Is it possible to use mkdocs without links related to filename

229 Views Asked by At

Here is the issue:

Mkdocs use filename to build links. However, users who update the doc often change the name of the files, as they use ordered titles (1 1 Introduction.md, 1 2 Main Content.md, ...)

Of course, they put links to other pages in their doc like this : (Introduction)[./1%201%20Introduction/#Paragraph2]

When they change the filename, the link ends up broken. Is there any way to link to another page#anchor without referring to filename and avoid broken link when changing file name? (Plugin, option in mkdocs, something I missed, ...)

Thanks in advance

1

There are 1 best solutions below

0
On BEST ANSWER

I found the answer, and it was really obvious. We don't use the nav property of the yml file to build the tree automatically and we could define it to avoid being dependent on file name for ordering.

Therefore, the filename could still not be modified but we can define the ordering in the nav property and rename the page title easily.

Obvious solution, but we missed it.