Open spenserblack opened 3 months ago
I'll take a PR on this. It's most likely just figuring out the correct URL.
Unfortunately I can't seem to reproduce this locally. Both by running the dev server or by building and serving the production build. This could be caused by the deployment server's config.
Edit: nor could I reproduce by accessing a deployment on a Codespace. So it seems to only happen at https://peggyjs.org/, not on any other deployment I've been able to make.
it's a server issue, should respond with Content-Type: text/plain
instead of application/octet-stream
for peggy files
While you can't specify custom MIME types on a per-file or per-repository basis, you can add or modify MIME types for use on GitHub Pages. For more information, see the mime-db contributing guidelines.
Yuck. I wish they could get the MIME type from a .gitattributes entry. I guess we could ask them to add .peggy and .pegjs to their mime-db project as text/plain, but they don't have very many things in text/plain at the moment, so I bet they're going to be cautious about adding more.
I wonder if there are any other creative approaches?
nvm some type starting with application/
would be more appropriate
some workarounds: code block with copy button, change the extension to .txt, serve a html file
I could theoretically just assert that an application/x-peggy
media type exists, in the docs, then ask them to add it.
When I click on the link that points to
js/examples.peggy
, my browser triggers a download. Personally, I'd rather read the plain text in my browser, and then I'm free to download it if I want to. Perhaps there's a configuration option to allow this behavior, by recognizing.peggy
as plain text?