Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally emit page links with “.html” for static file servers that don’t support implicit extensions when routing #92

Closed
pettiross opened this issue Nov 3, 2023 · 6 comments · Fixed by #1037
Assignees
Labels
enhancement New feature or request

Comments

@pettiross
Copy link
Contributor

pettiross commented Nov 3, 2023

I copied my dist folder to a basic web server. The index file loaded, but the links to pages like Observable GitHub fail to load because the URL specified was just to /github instead of /github.html.

@pettiross pettiross added the bug Something isn’t working label Nov 3, 2023
@mbostock mbostock added enhancement New feature or request and removed bug Something isn’t working labels Nov 4, 2023
@mbostock
Copy link
Member

mbostock commented Nov 4, 2023

This is intentional behavior to produce “clean URLs”, and is what we want by default. This means that you need to use a static file server that supports clean URLs, such as http-server, GitHub Pages, Netlify, etc. Most hosting sites so this automatically. If we want to generate “non-clean” URLs, it should be opt-in through a configuration option.

@mbostock mbostock changed the title Broken links - Nav bar in built project omits .html from hrefs Optionally emit page links with “.html” for static file servers that don’t support implicit extensions when routing Nov 4, 2023
@pettiross
Copy link
Contributor Author

Ah, that's how long it's been since I've been habitually running my own dev web server. I switched from httpd to http-server and works for me now; thanks for the pointer. (I tried adding the appropriate option to httpd.conf and I still wasn't getting it to work, but I'm chalking that up to user error.)

@mbostock mbostock added this to the Future milestone Nov 13, 2023
@mbostock
Copy link
Member

There should definitely be an option for emitting .html, and I think perhaps even this should be the default behavior because it works universally. Even http-server doesn’t handle serving /javascript correctly, for example. #171

@mbostock mbostock modified the milestones: Future, General availability Dec 22, 2023
@cinxmo cinxmo self-assigned this Jan 19, 2024
@Fil
Copy link
Contributor

Fil commented Jan 22, 2024

related #69

@Fil
Copy link
Contributor

Fil commented Feb 13, 2024

interesting read https://unterwaditzer.net/2023/cool-uris.html

@nelreina
Copy link

nelreina commented Feb 19, 2024

There should definitely be an option for emitting .html, and I think perhaps even this should be the default behavior because it works universally. Even http-server doesn’t handle serving /javascript correctly, for example. #171

This will be handy spacially when want to run in docker with minimal storage footprint. E.g. busybox httpd server is < 10mb (This is what I want :) ) . Nginx static is like 40mb / if I use node then it will be 260+ MB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants