Navigation including '.md' when using GitHub Pages #6806
-
ContextNo response Bug descriptionI have using the nav element in the mkdocs.yaml and its bring me directing to the wrong URL with the '.md' in it link only when deploying to GItHub pages. If I run it locally it works fine. For example locally when clicking "onboarding a user" it links to http://127.0.0.1:8000/Getting-Started/onboarding-a-user/, which is great! If I remove '.md' from the URL it will show the page I what (https://defra.github.io/adp-documentation/Getting-Started/onboarding-a-user). This is a interesting bug to encounter please help in providing a fix or a work around. Related linksReproductionProvided source code link: link Steps to reproduceProvided source code link: link BrowserChrome Before submitting
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Anyone got any advice to sort this its a very weird issue to have? |
Beta Was this translation helpful? Give feedback.
For now try with POSIX paths, aka use
/
instead of\
to separate the directories and files. GitHub Actions run on Linux.Tough, I would assume that converting from Windows to POSIX paths should be handled via MkDocs, so perhaps I'm missing something 🤔
Apart of that in Linux (therefore also in browser URLs) paths are case-sensitive, so I recommend using only lowercase.
Tough be aware that it will break the current links Getting Started etc. in your browser's history, since they use mixed case.
EDIT: I don't mean only the
mkdocs.yml
but also the actual files/directory nameshttps://github.com/DEFRA/adp-documentation/blob/9abb6ca8400d72be73239b016adb8d667d58cb38/mkdocs.yml#L73-L88