Skip to content

move javascript.html to javascript/index.md #172

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

Closed
wants to merge 4 commits into from
Closed

Conversation

Fil
Copy link
Contributor

@Fil Fil commented Nov 14, 2023

closes #171

Copy link
Member

@mbostock mbostock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You’ll also have to fix relative links, e.g., ./markdown now should be ../markdown.

@Fil
Copy link
Contributor Author

Fil commented Nov 14, 2023

Right, but it's slightly more difficult than that, because now the dev server happily serves both /javascript and /javascript/ with the same contents, though the links should be different. I'll change the main reference link, but it's still a bit of a trap.

@mbostock
Copy link
Member

The dev server should redirect /javascript to /javascript/ to avoid serving under dual paths. Or perhaps better it should 404 for /javascript? I think that’s what GitHub Pages does and we should match.

Copy link
Member

@mbostock mbostock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks active link highlighting when you click the JavaScript link from the sidebar.

I think I’d rather have /javascript as the page, rather than /javascript/, so that it’s parallel to /markdown and /html etc. Are we only making this change to workaround an issue with http-server?

@mbostock
Copy link
Member

Closing since I would prefer to keep the existing structure but please comment if you disagree.

@mbostock mbostock closed this Nov 15, 2023
@Fil
Copy link
Contributor Author

Fil commented Nov 15, 2023

Are we only making this change to workaround an issue with http-server

yes. If http-server is going to be the recommended server, I think we ought to find a way to make the project itself work with it.

@Fil Fil deleted the fil/fix-js-page branch November 15, 2023 06:04
@Fil
Copy link
Contributor Author

Fil commented Nov 15, 2023

I just tested Github pages with the following file structure:

/directory.html
/directory/index.html
/directory2/index.html
/directory3.html
If you call pages tries to serve code result
/directory directory.html 200 directory.html
/directory/ directory/index.html 200 directory/index.html
/directory2 directory2.html 301 directory2/
/directory2/ directory2/index.html 200 directory2/index.html
/directory3 directory3.html 200 directory3.html
/directory3/ directory3/index.html 404 Not Found

I don't see settings for http-server that would result in the same behavior; it seems http-server always prioritizes f/ over f.html. A mitigation might be to build f/index.html as a redirect to f.html? (EDIT: see the similar but better suggestion in #174).

@mootari
Copy link
Member

mootari commented Nov 15, 2023

I don't see settings for http-server that would result in the same behavior

Does disabling the auto index via -i false help?

@Fil
Copy link
Contributor Author

Fil commented Nov 15, 2023

Does disabling the auto index via -i false help?

no

@Fil Fil mentioned this pull request Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The built site does not serve /javascript properly
3 participants