dirtree: dealing with ambiguous "index" zettels
srid opened this issue · 3 comments
Consider the following layout:
./index.md
./work/index.md
./home/index.md
"work" and "home" are sub-zettelkastens (they may have their own neuron.dhall
) published on different domains, and so they have their own index.md which is served in the root as index.html. However when working on the "master" zettelkasten, these index zettels will be ignored due to zettel name conflict.
We do require zettel names to be unique even if they are positioned in different folders, but this limitation is annoying for "index" zettels, which the dirtree
plugin can perhaps treat differently.
Specifically,
- Use
FOO-BAR-index
(notindex
) as the zettel ID for files of the form./FOO/BAR/index.md
This automatically uses index
as zettel ID for top-level index zettel (current bebavhiour), but renames the sub index zettels automatically to avoid conflict. It also means if ./FOO/BAR/some.md
links to [[index]]
, that link would be to ./index.md
(not ./FOO/index.md
) when working on the master zettelkasten; but of course, when working on the sub zettelkasten, nothing changes (i.e., cd ./FOO && neuron gen
), and the public site for FOO wouldn't be affected.
An alternate solution would be to support "alternative zettel IDs" that includes the full relative path. So ./FOO/BAR/index.md
would have [[index]]
as primary ID, but [[BAR/index]]
and [[FOO/BAR/index]]
as second IDs. When there is a conflict in primary ID, a secondary ID is automatically choosen. However linking to [[index]]
should still resolve automatically to the closest parent folder.
@srid, did you come up with a definitive idea on how to implement this feature? Any progress on this will be greatly appreciated!
@fdaguin Yes, first see https://neuron.zettel.page/next for some context, then checkout how Emanote handles directories ... and finally for this issue specifically, see a proposal here: srid/emanote#107
The way I deal with it currently in Emanote is to create "foo/bar.md" for every "foo/bar/" directory (which is great because you can then link to a folder as [[foo/bar]]
). The proposal allows use of index.md as well.
Closing per https://neuron.zettel.page/next ... to further discuss this idea, add a comment in srid/emanote#107