website/README.adoc

105 lines
3.5 KiB
Plaintext
Raw Normal View History

2019-08-15 11:28:39 +00:00
= blog
2020-11-06 22:16:12 +00:00
My blog featuring a fairly customized version of https://github.com/foo-dogsquared/hugo-theme-more-contentful/[my More Contentful Hugo theme].
2019-08-15 11:28:39 +00:00
2020-11-05 04:34:37 +00:00
== Getting started
2019-08-15 11:28:39 +00:00
2020-11-06 22:16:12 +00:00
Though, it's obvious but then again, you may not remember how to do well in a year.
2019-08-15 11:28:39 +00:00
2020-11-05 04:34:37 +00:00
=== Prerequisites
2019-08-15 11:28:39 +00:00
2020-11-05 04:34:37 +00:00
* Git
* Hugo
* https://golang.org/[Go] runtime
* https://asciidoctor.org/[Asciidoctor]
2020-11-14 20:26:02 +00:00
* https://stedolan.github.io/jq/[jq]
2020-11-06 22:16:12 +00:00
* https://git.sr.ht/~sircmpwn/openring/[openring] (you can easily compile one yourself with the Go toolchain)
2020-11-14 20:26:02 +00:00
* https://www.gnu.org/software/make/[GNU Make] is optional but it'll make your life easier.
* https://nixos.org/[Nix] is also optional but it'll make your life into an enlightened functional package management heaven.
2020-11-05 04:34:37 +00:00
=== Setting up
[source, shell]
----
git clone $GIT_REPO
hugo mod get -u
hugo serve
----
2020-11-14 20:26:02 +00:00
Or you could simply get a server running with `make serve` and bada-bing, bada-boom!
You're now a "content creator"!
2020-11-05 04:34:37 +00:00
The theme is a modified version of a https://github.com/foo-dogsquared/hugo-theme-more-contentful[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.
2019-08-15 11:28:39 +00:00
2020-11-14 20:26:02 +00:00
=== Setting up with Nix
If you have Nix installed, it is even easier by creating a https://nix.dev/tutorials/ad-hoc-developer-environments.html[local development environment] for this project.
And it already has one in link:shell.nix[`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 https://git.sr.ht/~sircmpwn/openring/[openring] since the config already sets it for you.
Even better, you can set up an automatic shell environment with https://direnv.net/[direnv].
To use it, just add `.envrc`!
[source, bash]
----
echo "use nix" > .envrc && direnv allow
----
=== Deploying your blog
As of 2020-11-14, the blog is deployed into GitHub Pages with http://travis-ci.com/[Travis CI] for automation.
Feel free to copy the link:.travis.yml[`.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
[source, tree]
----
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 link:./bin[`./bin`] directory contains custom scripts related for this project.
An example of which is a script (i.e., link:./bin/openring-create[`./bin/openring-create`]) that uses https://git.sr.ht/~sircmpwn/openring/[openring] to create a webring from my link:./data/blogs.json[public list of blogs I follow].
* link:./shell.nix[`./shell.nix`] is used for quickly creating a local project environment.
It can be only used when Nix is installed.
* The link:./data/[data folder] contains some of the https://github.com/foo-dogsquared/hugo-theme-more-contentful/[theme] configuration as well as relevant data for my customizations.
* The link:./layouts/[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).