My new blogging workflow works extremely well!
I swear, I didn't imagine to come this far with my current blogging setup with which I am extremely pleased! I will share with you what I have been able to do with my current setup
- Set up an obsidian vault with plugins like
- Use mkdocs/material as the SSG of choice, and configure it to my heart's content. Use plugins as per liking, and create custom layouts for the homepage (which IMHO looks pretty cool!)
- Create two repositories
- Private repo: For all the content, work in progress, config files, custom layouts etc so that in case I can maintain an all-in-one private vault with a single folder
docs/
which contains all my publishables. - Public repo: For pushing the built site and using
hgup.github.io
as its name to allow github pages to work seamlessly. It also houses all thegiscus
comments.
- Private repo: For all the content, work in progress, config files, custom layouts etc so that in case I can maintain an all-in-one private vault with a single folder
- Create a kickass CICD GitHub Actions file
The GitHub Actions is my favorite part. See I have two requirements (not really requirements, but nice-to-haves).
- I have private files in my vault that I don't want to be published or viewed by anyone and also when I push such files to my repository. I don't need the entire site to be built again with no real changes (since I hadn't updated any files within the
docs/
folder nor themkdocs.yml
file) and really its bad for the environment (using computing power for nothing) - Whenever I update a file in the
docs/
folder I want the CICD pipeline to run so that the changes can be LIVE on hgup.github.io
This ci.yml
actions file does it all!
- This condition runs the publishing sequence only if the commit message contains the following three strings.
docs/
,mkdocs.yml
andconfig
. I have set up Git on obsidian in such a way that it adds the file names to the description of the commit and thus whenever I update a file in thedocs/
folder, it registers and triggers a build. Pretty neat and satisfies the two nice-to-haves above. - The built files are then pushed to my public repository
hgup.github.io
. This ensures that I don't have to make my entire vault public and only the publishable stuff exists in the public repository. - I am using fine-grained tokens here and only allowed this bot to update the
content
of this particular repositoryhgup.github.io
. So, I don't need to worry about it being leaked really.
And that's it! Now that I have written this post. I will just commit-and-sync
using obsidian and you should be able to see it live on hgup.github.io.
-
I wanted to enjoy the process of writing and forget that I ever published anything online. I wanted to just open the site one day feel surprised "Wow! All this exists??" ↩
-
(with a keyboard shortcut
Alt+Q
) which I used to create this footnote too ↩ -
This also contains many snippets that allows me to utilize mkdocs's extra features without remember syntax too much. ↩