Description
In the Python course, I use the following format for filenames: {sidebar_position}_{slug}.md
E.g. the file of the tenth lesson is 10_crawling.md
Would it be a good idea if we added inferring of sidebar_position
to Docusaurus? The algorithm would be:
- See if
sidebar_position
is set in the front matter. If yes, respect the value. - If not set, see if the filename starts with
r"\d\d_"
. If yes, take that as the value forsidebar_position
. - Otherwise leave
sidebar_position
unassigned.
Not sure if this is worth the engineering and the cognitive load necessary to understand that this happens (would need to be documented somewhere in contribution docs). But it would help me to keep the values synchronized both in the filename and the front matter.
If I wanted to reorder lessons or add new lesson in between existing ones, I could only change filenames. The way it is now it's easy to forget about the front matter and leave it in disarray by mistake.
At the same time, I find the {sidebar_position}_{slug}.md
format of filename highly practical for the purpose of the course. At least subjectively, my orientation in editor and file system is much better this way than with other parts of the Academy where the files are ordered alphabetically on disk, but according to sidebar_position
in the docs navigation.