An MVP SSG for Obsidian

2022-11-21 20:39

(This post gets the award for obnoxious TLA's in the title).

What would it take to turn this little obsidian vault of mine into a site? Since I will not be paying for obsidian to turn my vault into a blog, I will at some point write some kind of script that turns this vault into a site to replace my old one, which uses Firn.

From a cursory glance, here's what I would need to do to make the most simple ssg:

  • loop over all the markdown files
  • write a function that parse front matter
  • check in the frontmatter if the file is public
  • if the file is public, read the entire front matter into a map, and store the file contents into a map as well, I guess
  • Now, I have a list of every file that's to be published
  • iterate over the above list and for each one, do the following:
    • determine the output path for each link
    • replace all links in the file with their expected html link
    • run the markdown through a markdown to html converter
    • write the files to a directory structure to mirror url routing.

That's about the bare minimum I can think of. Of course, the real fun would be in the following:

  • recreating the backlink / outlinking graph and displaying that in the UI
  • making files browsable by tags
  • capturing backlinks
  • building a template system
  • building a graph for displaying networked notes.
  • making it fast.