## mt. solitary stack #

This note explains how Mt. Solitary is built, in case someone would like to base their own site off how I’ve cobbled it together.

### Writing #

I write my notes, like everything else, in emacs. My emacs configuration is available on this site or on Github as a literate org babel document. All the notes that comprise this site are written as org-mode files using org roam, an open source Roam Research clone written for emacs. I use this for all my notes, including personal notes and my daily journal, and tag notes that I specifically want to be published on the site with the tag public.

If you don’t know anything about emacs then most of this will be very hard to follow. If you’re interested in learning a very interesting and unique text editor that you can tailor exactly to your needs and use to automate a whole bunch of workflows (assuming you are comfortable with some sort of scripting language, or better, Lisp), then I think it’s a fun and interesting way to set things up. If you aren’t into that sort of thing, there are plenty of other ways to manage text files, and you can always write everything in Markdown and skip straight to the “publishing” section below.

#### Resources #

• To get started with emacs, you should probably watch David Wilson’s emacs from scratch video series on YouTube. He also covers the basics of org mode.
• You can get the idea of org roam by watching any Roam Research propaganda on YouTube.
• Here is the original blog post introducing org roam.
• You can find more about roam tags in the fairly extensive org roam docs.

### Organising #

The idea behind a Zettelkasten-style system is that notes are not organised according to any sort of hierarchy, but rather according to their relationships to each other. So all notes are stored in a single directory, and a sort of “graph” or “network” is built between notes by a two-step process.

• Making sure to insert links to important concepts or repeating ideas when you are writing notes, and that if they have not been referred to before, create a new “stub” note for that idea.
• Each of these ideas contains a list of “backlinks”: notes which link to it. The note itself can now be elaborated on, and can take inspiration from the list of concepts which link to it.

With time and a “critical mass” of notes, this method really does begin to reveal new and interesting connections between ideas.

### Publishing #

Publishing my notes essentially means converting them from org mode markup into Markdown files to be served with Hugo. This is a fairly involved process as the syntax for the two markup languages is quite different, particularly how links work, and Hugo needs quite a lot of boilerplate on its Markdown files which correspond to tags and so forth.

Taking inspiration from Jethro Kuan, who created the org roam package, I wrote a series of Lisp and Python scripts which

• look for all org files in my ~/roam directory which are tagged as public
• create a Ninja build command to convert each one into Markdown files (the build command runs emacs -l with a custom init file that only contains the specific packages I need to load to run the conversion script)

Ninja, which is a great little build tool, then knows how to only build the files which have been updated since last time it was run.

You can see all the code I use to publish the site in my emacs.d configuration files on Github.

### Serving #

The final step is to serve the Markdown files using Hugo. Installing Hugo and getting a simple site running is very straightforward and there are plenty of tutorials on the web. I downloaded the hugo-book theme and made my own fork with a few changes, specifically:

• I removed the list of articles on the side bar and kept the search bar.
• I changed the background colour and the font colour (my own dark mode).
• I added Goatcounter support so I can have basic analytics on the site without invading people’s privacy.
• I added backlinks as part of the HTML templating (this way backlinks are already up-to-date and don’t need to be generated as part of the export, as it’s a little complicated to know which pages have had their backlinks updated, since it’s not stored in the org file but rather in a SQLite database that org roam uses).
• I added four pages which are dynamically generated using Hugo templating:
• the index, an alphabetical list with links to all posts, with their word counts and last updated date
• the recent updates page, a list of links to the twenty most recently updated posts on the site
• the stubs page, a list of links to pages with no content (without considering backlinks), which can serve as ideas for notes to flesh out in the garden
• the summary, which contains a few dynamically updating statistics about the site.

I then use Vercel and their fantastic free “hobby” plan to serve the site, which was so simple to do with Hugo and Github that I was able to do it in about five minutes. The very final step is adding a custom domain, which is just a matter of setting up the DNS configuration properly with your domain provider according to the instructions on Vercel.

I think it would be a nice idea to turn this fork into a “digital garden” theme for Hugo, and include some scripts to easily publish your org roam files to it.

• Org roam discourse thread discussing various solutions for publishing to a digital garden from org roam.