You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently had an issue with my docs, and although it's something I can and should fix in my docs, I think mkdocs error handling could be improved in this case. When having both a README.md and index.html in my source, and adding the README.md as one of the nav items, mkdocs correctly warns me that it won't clobber the index.html(yay!), but then proceeds to generate broken output in the TOC for that item(boo!), where the link label is None, and the link URL points to a README.md file in the output (which doesn't exist). The behaviour of generating broken output and succeeding is quite surprising.
I would expect any of the following:
mkdocs complaining that it can not generate correct output (error rather than warning, like if I had use the --strict option but defaulting to this in this case)
Not generating any output at all, to at least get a "clean" output
Ideally, creating a renamed "README.html" or similar file with the rendered output, rather than failing.
By the way, if we delete the whole demo subdirectory, it still produces a None nav entry. That's really the worse part of this for me. Other than this, it's actually hard to find what exactly is not intended behavior, it all started to seem like it is actually intended behavior.
Regarding your particular situation, it seems like you wanted to rely on the behavior of assuming that .html is the rendered file but still linking to the .md file and it kinda working and even picking up the page title from .md even though it's not the actual page used.
In such case, the correct way to configure it is as follows:
I recently had an issue with my docs, and although it's something I can and should fix in my docs, I think mkdocs error handling could be improved in this case. When having both a
README.md
andindex.html
in my source, and adding theREADME.md
as one of the nav items, mkdocs correctly warns me that it won't clobber theindex.html
(yay!), but then proceeds to generate broken output in the TOC for that item(boo!), where the link label isNone
, and the link URL points to aREADME.md
file in the output (which doesn't exist). The behaviour of generating broken output and succeeding is quite surprising.I would expect any of the following:
--strict
option but defaulting to this in this case)To reproduce
Use the following config:
Create the following tree of files. Put any valid content in the markdown/html files (or leave them empty):
Once you build this (I've used mkdocs 1.5.2) you'll get a navigation on the top with a link labeled "None", which points to an invalid URL (404).
The text was updated successfully, but these errors were encountered: