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

Rewrite internal links to include .html for static html (based on config) #950

Open
Tracked by #1270
agoose77 opened this issue Mar 4, 2024 · 3 comments
Open
Tracked by #1270
Labels
enhancement New feature or request

Comments

@agoose77
Copy link
Contributor

agoose77 commented Mar 4, 2024

Building a trivial site from the following Markdown (duplicated into test.md and test2.md), the generated navigation points to test2, not test2.html.

Content:

# Test!
Hello world

:::{note} A Note!
Some markdown
:::

Config:

# See docs at: https://mystmd.org/guide/frontmatter
version: 1
project:
  # title:
  # description:
  keywords: []
  authors: []
  github: https://github.com/executablebooks/mystmd
  # bibliography: []
site:
  template: book-theme
  # title:
  # options:
  #   logo: site_logo.png
  nav: []
  actions:
    - title: Learn More
      url: https://mystmd.org/guide
  domains: []

Build:

npx myst build --html

Is this intended?

@LecrisUT
Copy link
Contributor

Oh, I didn't check the issues before creating #984. This is probably part of the #188.

npx serve seems to do the redirection automatically. So this might also be something that the site hosting can fix/

Checking a local sphinx build, it seems that all of the links point to a .html suffixed page, so it might be better to use that approach as well.

@rowanc1
Copy link
Member

rowanc1 commented Jun 5, 2024

This is intended as this is usually handled by static web servers (e.g. github pages, npx serve, python webserver, etc.), but we may need to handle this for CircleCI and RTD.

@rowanc1 rowanc1 changed the title Static build of trivial site produces invalid nav links Rewrite internal links to include .html for static html (based on config) Jun 5, 2024
@rowanc1 rowanc1 added enhancement New feature or request and removed bug Something isn't working labels Jun 5, 2024
@nthiery
Copy link
Contributor

nthiery commented Aug 20, 2024

Just as a data point: python -m http.server with python 3.12.4 seems to be affected too: links such as https://0.0.0.0:8000/valeurs-types generated by myst fail, but adding manually a .html makes them work.

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

No branches or pull requests

4 participants