Go to file
2022-11-22 23:10:53 +08:00
.github/workflows Fix workflow yet again 2022-05-18 19:03:27 +08:00
archetypes Update blog components 2020-11-06 19:44:15 +08:00
assets Update logo 2022-11-22 23:09:33 +08:00
bin Use the latest version of the theme 2021-02-01 12:34:15 +08:00
content Add references to my GPG key 2021-02-03 01:33:36 +08:00
data Update themes 2022-11-22 23:09:33 +08:00
layouts Update layouts with the latest components 2022-11-22 23:09:33 +08:00
static Update logo 2022-11-22 23:09:33 +08:00
.envrc Use flake by default 2022-11-22 23:10:53 +08:00
.gitignore Update .gitignore 2022-11-22 22:37:51 +08:00
config.toml Update site configuration 2022-11-22 23:09:33 +08:00
flake.lock Set nixpkgs branch to nixpkgs-unstable 2022-11-22 22:37:51 +08:00
flake.nix Set nixpkgs branch to nixpkgs-unstable 2022-11-22 22:37:51 +08:00
go.mod Update Hugo modules 2022-11-22 22:37:51 +08:00
go.sum Update Hugo modules 2022-11-22 22:37:51 +08:00
LICENSE Cover the project under MIT license 2021-01-22 05:08:08 +08:00
Makefile Update dev environment 2022-03-01 18:00:18 +08:00
README.adoc Update docs and layouts 2020-11-15 04:26:02 +08:00
shell.nix Update dev environment 2022-03-01 18:00:18 +08:00

My blog featuring a fairly customized version of my More Contentful Hugo theme.

Getting started

Though, its obvious but then again, you may not remember how to do well in a year.

Prerequisites

  • Git

  • Hugo

  • Go runtime

  • Asciidoctor

  • jq

  • openring (you can easily compile one yourself with the Go toolchain)

  • GNU Make is optional but itll make your life easier.

  • Nix is also optional but itll make your life into an enlightened functional package management heaven.

Setting up

git clone $GIT_REPO
hugo mod get -u
hugo serve

Or you could simply get a server running with make serve and bada-bing, bada-boom! Youre now a "content creator"!

The theme is a modified version of a modified version of a theme so thats pretty cool.

To create a post, simply make with hugo new --kind post $PATH_REL_TO_CONTENT_DIR and youre on your merry way.

Setting up with Nix

If you have Nix installed, it is even easier by creating a local development environment for this project. And it already has one in shell.nix.

Just run nix-shell --pure shell.nix and youre set. An additional benefit with this setup is you dont have to manually compile openring since the config already sets it for you.

Even better, you can set up an automatic shell environment with direnv. To use it, just add .envrc!

echo "use nix" > .envrc && direnv allow

Deploying your blog

As of 2020-11-14, the blog is deployed into GitHub Pages with Travis CI for automation. Feel free to copy the .travis.yml for an idea.

Nonetheless, it is easy to migrate between hosts since Hugo is fast and simple. All you need to do is to run make build. Then, upload the build artefacts into your host provider of choice.

Project structure

blog
├── archetypes/
├── assets/
├── bin/
├── content/
├── data/
├── layouts/
├── public/
├── resources/
├── static/
├── config.toml
├── go.mod
├── go.sum
├── Makefile
├── README.adoc
└── shell.nix

Among all of the files laid above, here are the points of interest youre most likely to interact (aside from the content folder).

  • The ./bin directory contains custom scripts related for this project. An example of which is a script (i.e., ./bin/openring-create) that uses openring to create a webring from my public list of blogs I follow.

  • ./shell.nix is used for quickly creating a local project environment. It can be only used when Nix is installed.

  • The data folder contains some of the theme configuration as well as relevant data for my customizations.

  • The layout folder contains theme overrides as well as additional components for custom content types (e.g., making appropriate templates for my gallery section, modifying the post section to be more readable).