.github/workflows | ||
archetypes | ||
assets | ||
bin | ||
content | ||
data | ||
layouts | ||
static | ||
.envrc | ||
.gitignore | ||
config.toml | ||
flake.lock | ||
flake.nix | ||
go.mod | ||
go.sum | ||
LICENSE | ||
Makefile | ||
README.adoc | ||
shell.nix |
My blog featuring a fairly customized version of my More Contentful Hugo theme.
Getting started
Though, it’s obvious but then again, you may not remember how to do well in a year.
Prerequisites
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!
You’re now a "content creator"!
The theme is a modified version of a modified version of a theme so that’s pretty cool.
To create a post, simply make with hugo new --kind post $PATH_REL_TO_CONTENT_DIR
and you’re 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 you’re set.
An additional benefit with this setup is you don’t 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 you’re 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).