lyz-code/mkdocs-newsletter

how to refer a file whose name is not unique

m0wer opened this issue · 1 comments

m0wer commented

Question

With the given file structure:

.
├── python
│   └── basics.md
└── flutter
    └── basics.md

How can we refer a change in one of those files so that it is labeled correctly in the newsletter? feat(basics): something would be ambiguous.

Thanks!

Hi @m0wer thanks for taking the time to open an issue. Sadly as we use the autolinks plugin you need to have unique file names, the advantages of it is that you don't need to remind the whole path structure to make links between articles so if you have:

.
├── flutter
│   └── flutter.md
└── python
    ├── pdm.md
    ├── pytest.md
    └── python.md

If you're writing the flutter.md article and want to reference to pytest.md you don't need to use ../python/pytest.md, you just use pytest.md.

Furthermore, if suddenly you decide to change the structure of your articles, which happens a lot as your site starts to grow, you don't need to correct all the links that will get broken.

After trying many file structures, I ended up storing all the markdown files in the same directory, and assume that the logical hierarchy is defined in the mkdocs.yaml, something like:

.
├── flutter.md
├── pytest.md
├── python.md
└── python_snippets.md

I hope that this behaviour is not too uncomfortable for you :S.

If you don't feel answered, please do not hesitate on commenting further and I'll reopen the issue