mystmd
mystmd copied to clipboard
Rewrite internal links to include `.html` for static html (based on config)
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?
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.
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.
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.