teesloane / firn

Org Mode Static Site Generator
Eclipse Public License 1.0
324 stars 24 forks source link

[FR] Use the filesystem hierarchy as `#+FIRN_UNDER` #99

Closed NightMachinery closed 3 years ago

NightMachinery commented 3 years ago

I organize my notes using the filesystem directory (which makes it really easy to integrate with a lot of unspecialized tools). I wonder if it's possible to use this hierarchy instead of #+FIRN_UNDER?

E.g., I have:

~cel/notes/bookmarks/watch
❯ fd                 

_firn
_firn/config.edn
_firn/layouts
_firn/layouts/default.clj
_firn/pages
_firn/pages/tags.clj
_firn/partials
_firn/partials/head.clj
_firn/static
_firn/static/css
_firn/static/css/firn_base.css
actors
actors/Rowan Atkinson, mr bean.org
adaptations
adaptations/a little princess.org
adaptations/pinocchio.org
animated series
animated series/chinese, eastern.org
animated series/gen.org
animated series/nostalgia.md
animated series/rationalish.org
animations
animations/disney.org
animations/log.org
animations/nostalgia.md
anime
anime/chinese.org
anime/comedy.org
anime/deconstruction.org
anime/family, slice of life.org
anime/isekai.org
anime/nostalgia.md
anime/parody.org
anime/people, creators, authors, directors.org
anime/rationalish.org
anime/recs.org
anime/reverse isekai.org
anime/scifi.org
anime/seen log.org
anime/tvtropes anime rec flowchart.jpg
anime/western adaptations.org
anime/wish fulfillment.org
documentaries
documentaries/log.org
documentaries/nature
documentaries/nature/free streaming sites.md
documentaries/racing
documentaries/racing/cars
documentaries/racing/cars/f1.org
game streaming
game streaming/civilization.org
index.org
lectures
lectures/@towatch.org
lectures/CS
lectures/CS/PL, programming languages.org
lectures/CS/blockchain.org
lectures/CS/databases.org
lectures/CS/ml.org
lectures/CS/practical
lectures/CS/practical/by lang
lectures/CS/practical/by lang/clojure.md
lectures/CS/practical/by lang/cpp.md
lectures/CS/practical/by lang/crystal.org
lectures/CS/practical/by lang/dart, flutter.org
lectures/CS/practical/by lang/golang.org
lectures/CS/practical/by lang/haskell.org
lectures/CS/practical/by lang/java, jvm.org
lectures/CS/practical/by lang/julia.md
lectures/CS/practical/by lang/kotlin.md
lectures/CS/practical/by lang/lisp.org
lectures/CS/practical/by lang/python.md
lectures/CS/practical/by lang/webassembly.org
lectures/CS/practical/code streamers.org
lectures/CS/practical/graphics.org
lectures/CS/practical/security.md
lectures/CS/practical/video games.org
lectures/CS/practical/web
lectures/CS/practical/web/CSS.org
lectures/CS/practical/web/javascript.org
lectures/CS/speakers.org
lectures/CS/theoretical cs.md
lectures/archaeology.md
lectures/biology.org
lectures/economics.org
lectures/effective altruism (EA).md
lectures/engineering.md
lectures/entertainment.md
lectures/entrepreneurship.md
lectures/futurism.md
lectures/gen, channels, aggregators.md
lectures/iran.org
lectures/law.md
lectures/linguistics.md
lectures/math.md
lectures/philosophy.md
lectures/politics.md
lectures/science.md
lectures/space.md
lectures/tech.md
movies
movies/Iranian
movies/Iranian/European
movies/Iranian/European/German
movies/Iranian/European/German/crime.org
movies/Iranian/Middle-eastern
movies/Iranian/Middle-eastern/lists.org
movies/Iranian/children.org
movies/Iranian/comedy.org
movies/Iranian/lists.org
movies/Iranian/log.org
movies/Iranian/nostalgia.org
movies/Iranian/random.org
movies/Iranian/romance.org
movies/Iranian/sad.org
movies/Iranian/social commentary.org
movies/adventure.md
movies/children
movies/children/log.org
movies/comedy
movies/comedy/log.org
movies/crime mystery.md
movies/drama
movies/drama/crime
movies/drama/crime/log.org
movies/drama/log.org
movies/drama/war
movies/drama/war/log.org
movies/fantasy
movies/fantasy/alice.org
movies/fantasy/log.org
movies/fantasy/superheroes
movies/fantasy/superheroes/DC.org
movies/fantasy/time
movies/fantasy/time/log.org
movies/fantasy/time/timeloop.org
movies/fantasy/time/timetravel.org
movies/fantasy/zombies
movies/fantasy/zombies/log.org
movies/horror
movies/horror/korean.org
movies/horror/log.org
movies/musical
movies/musical/log.org
movies/non-Western
movies/non-Western/lists.org
movies/rationalish.org
movies/scifi
movies/scifi/lists.org
movies/scifi/log.org
musicals.org
playground.md
rationalish
rationalish/anime.org
rationalish/anime.org_archive
rationalish/youtube.org
series
series/Iranian
series/Iranian/comedy.org
series/Iranian/romance.org
series/Iranian/supernatural.org
series/anthology.org
series/chinese.org
series/gen.org
series/japanese.org
series/rational-adjacent.org
web-series.md

I like to see these as a tree-like sitemap on my index page. Ideally, each file also contains a tree-like sitemap of its parent directory.

teesloane commented 3 years ago

I think I see what you mean. #+FIRN_UNDER is intended for flat-file structures and thus arbitrary decisions of what "goes under" what. This will continue to be Firn's method for organizing information. However, I think a file-system index/site-map makes sense. However, unfortunately, as this is not my use case for Firn, I have no intention to build this functionality. I would however accept a PR on this. In case anyone is interested in submitting a PR the following would need to be done:

In firn/build.clj

In firn/markup.clj

And of course, write tests.

Thanks for the suggestion!

NightMachinery commented 3 years ago

Thanks! Publishing my notes is not currently a priority for me, but when I find the time for it, I'll send a PR. I'll have to find a way to fix the ID links as well, since without those all my links will break.

If anyone knows a site generator that supports a workflow of nested directories, please let me know.