Epoch
By Devanandan N B • 4 minutes read •
I had always wanted a blog site for myself. This need grew even more as I started playing CTFs and looked for a space to jot down my thought process of solving challenges. That’s the epoch of this site. Here’s the steps I took to set it up.
Tech Stack
There are many ways to set up a blog. You can manually code up the entire site yourselves in plain HTML, CSS and if needed JavaScript and then copy the template to create new blogs; this is what I initially did, however this takes up way too much time and effort. So then comes Static Site Generators(SSGs) like Jekyll, Hugo, Eleventy, Zola etc. which turn your markdown content into webpages which share a similar structure and theme. It usually also comes with many other features like automatic syntax highlighting for your code, automatic image compression etc. SSGs largely automates your workflow and make pushing blogs faster.
I chose to host with Github Pages and go with Zola Static Site Generator, as it was
- relatively new
- single binary (no dependency packages to install on your system, no compilation)
- fast (bonus: written in rust)
The other components I used in this site is as follows:
- Duckquill - A theme for zola with a lot of features including syntax highlighting, latex support etc.
- Zola Deploy to Pages - GitHub action for deploying zola to GitHub-Pages.
Step By Step Setup
Step 1 - Setting Up Your Repository
Create your repository for the blog on GitHub. Your repository must be named
<USERNAME>.github.ioas is convention with GitHub Pages (or you can name your repository, say,blogwhich would appear at<USERNAME>.github.io/blog. This is usefull when you already have a main site).Clone this repository to your local device and intialise your site with:
This will create a sub-directory
<BASE_DIR>which is the source folder for your site.Install Duckquill theme within the repository by creating a submodule. Visit Duckquill theme’s documentation for detailed steps.
Edit your
config.tomlwithin<BASE_DIR>and add this line at the top:= "duckquill"Optionally, add
README.md,.gitignoreandLICENSEfiles to your repository. I chose theCC BY-NC-SA 4.0license as it seemed fit for my content; mostly writeups and technical blogs.Next step is to edit/extend the duckquill defaults to personalise your website. In my case, I extended the default footer to include the Creative-Commons license clause as well as modified the top nav-bar.
The theme’s footer template is located at
<BASE_DIR>/themes/duckquill/templates/partial footer.html. To override this, we copy the file onto<BASE_DIR>/templates/partial/footer.html. Checkout my GitHub to see the changes I made tofooter.htmlto make it display the license clause.The website’s appearance and link content on both top and bottom nav-bars are defined in the
config.tomlfile. You can refer to the theme’s copy in<BASE_DIR>/themes/duckquill/config.tomlto replicate it’s color scheme and edit the links/add new icons. It also contains plenty of other customisation options which you probably want to look at.
Now is the time to push a blog or two. To do that simply create a new folder with the blog title in the
<BASE_DIR>/contentdirectory and write the contents within sREADME.mdfile inside.Finally to set up automatic deployment to github-pages, I used the Zola Deploy to Pages GitHub Action from GitHub Marketplace.Under your repository settings:
Settings > Actions > General, in Workflow permissions, make sure that GITHUB_TOKEN has Read and Write permissions. Also underSettings > PagesselectSourceas ‘Deploy from a branch’ and select branch asgh-pages.