Go to file
2023-02-25 15:24:16 +08:00
.github/workflows Add weekly schedule for building 2022-12-18 13:39:52 +08:00
archetypes Update Hugo archetypes with current email address 2023-02-20 12:46:31 +08:00
assets Update site style 2023-02-25 08:02:05 +08:00
bin Create script for managing code-specific content 2023-02-21 01:04:38 +08:00
content Add contact page 2023-02-25 08:20:18 +08:00
data Update light color scheme 2023-02-21 01:05:23 +08:00
gems Add custom Asciidoctor extensions to load path 2023-02-25 12:11:54 +08:00
i18n Create QoL improvements for code listings 2023-02-21 01:06:05 +08:00
layouts Update site layouts 2023-02-25 08:06:18 +08:00
static Update site favicon 2023-02-25 08:18:52 +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 Add custom Asciidoctor extensions to load path 2023-02-25 12:11:54 +08:00
flake.lock Add custom Asciidoctor extensions to load path 2023-02-25 12:11:54 +08:00
flake.nix Add custom Asciidoctor extensions to load path 2023-02-25 12:11:54 +08:00
Gemfile Add custom Asciidoctor extensions to load path 2023-02-25 12:11:54 +08:00
Gemfile.lock Add custom Asciidoctor extensions to load path 2023-02-25 12:11:54 +08:00
gemset.nix Add custom Asciidoctor extensions to load path 2023-02-25 12:11:54 +08:00
go.mod Update Hugo modules 2023-02-24 21:58:54 +08:00
go.sum Update Hugo modules 2023-02-24 21:58:54 +08:00
LICENSE Update license year 2023-02-25 15:24:16 +08:00
Makefile Update development tasks 2023-02-25 15:24:08 +08:00
netlify.toml Revert Netlify build to GitHub Actions 2022-11-28 11:17:59 +08:00
README.adoc Update docs and layouts 2020-11-15 04:26:02 +08:00
shell.nix Add custom Asciidoctor extensions to load path 2023-02-25 12:11:54 +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).