Setting Up An Obsidian-based Digital Garden Website
It’s been a backlog priority of mine for a while now to start writing online. As someone who has been working with a second brain/PKM system for a while now (Notion & Obsidian), I figured a solution that can leverage that personal written content for the purpose would be ideal:
- Note-taking is part of my natural way of working - this means I passively generate content, and perhaps through integration, writing online could also feel as frictionless.
- Both apps are written in native markdown content, making translation to web pages easy.
- The value of each resource is substantial, but integrated, the resulting personal ecosystem could be way greater.
I decided instead to stand on the shoulders of jackyzha0 ’s incredible Quartz repo as the touchstone, and adapt my solution from there.
In the event it’s useful for others, here are the steps I took to get it all going. It involves:
- The Quartz Repository, by Jacky Zhao
- An existing
Obsidian Vault
- A particularly useful related plugin is Waypoint, for generating MOC pages.
- GitHub Pages for hosting
- And a little scripting for quality of life changes.
# Linux (ubuntu) installation:
Firstly, fork and clone the following repo locally:
|
|
# 1. Install Hugo:
Quartz runs on top of Hugo, so we’ll need to independently install it. For me, this was on linux, but hugo has documentation for installation on other OS’s too.
|
|
# 2. Install Hugo-obsidian
+ Go dependencies, if required:
Install go if not already installed on system.
- Make sure go version is (>= 1.16).
- Go installation page
Initialise a new go module for project, using github repo URL. e.g
|
|
If you experience path issues, indicated by command not found
errors:
a. Confirm where GO installed itself (normally in `~/[user]` folder).
b. Edit or create `.bash_profile` file in user directory.
c. Add the following line to the file, e.g:
|
|
Run the following to load the edited config to current shell (you might need to restart your app if operating terminal in something like vscode for same effect):
source ~/.bash_profile
Install
hugo-obsidian
to enable backlink conversion, for local site live previewing:a. Get the modules required:
1
go get github.com/jackyzha0/hugo-obsidian
b. Install from repo:
1
go get go install github.com/jackyzha0/hugo-obsidian
c. Test with:
1
hugo-obsidian version
To run, navigate to the folder where quartz was cloned and run:
1
make serve
# 3. Copy obsidian/markdown files to quartz
Navigate to the desired obsidian folder to upload.
- I set up my vault to have a
public
and aprivate
folder. - My workflow for now will involve working in obsidian, and logically considering the
public
folder the space where I move notes I want to share. - All notes/posts will be edited and created through the obsidian -> export process, with the only elements needing editing within an IDE being the index file, CSS, html etc.
- I set up my vault to have a
Copy the folder into the
content
folder in your quartz directory.That’s it! Run
make serve
to view your website locally, and push to your github repo to host it on Github pages.
# Automating export:
Here’s a quick and dirty bash script to clears the repo’s copy of the vault and index files, to copy in the current ones from the obsidian vault location.
Automating this process means the creation process of posts is simple:
- Write/edit posts and index file as notes in obsidian
- Run
make serve
to host local render of website. - Run script in terminal to update the browser render live.
- To post, push on git!
Feel free to adapt if the idea is useful.
|
|
# References:
Resources: