How this Site was Made
This file documents exactly how I made the repository/website that is the purpose of this repository/project.
For the impatient if you already know how this works (yes, I am talking to future-me here), you can just edit the following and execute it. You should end up with a new GitHub Project/repository for static website and a development environment that is configured with software to develop a website for root of the domain specified.
This assumes you have:
- a github.com account and your shell’s ssh-agent has the private key for the public key that you will use to access that account
- the github cli installed and configured (i.e. such that
gh auth statusgives a useful response)
Create the Repository
| |
Create the website
There are several options to create basic scaffolding for a Hugo website, such as cloning or otherwise copy from a Hugo Theme repository, such as the template repository of the Hextra Theme or using the Hugo CLI.
Hugo CLI
| |
Add a theme
- For Beautiful Hugo: use
halogenica/beautifulhugoas the repository - For Hextra: use
imfing/hextraas the repository
hugo mod get github.com/imfing/hextra | |
Writing New Posts
To create a new blog post:
- Create a new file in the
blogdirectory - Name it using the format:
YYYY-MM-DD-title.md - Add front matter at the top:
---
# type:
title: "Your Post Title"
date: YYYY-MM-DD
type: blog
draft: false
---Writing Pages
For non-blog content, create a new file in the articles directory:
---
title: "About"
type: docs
# prev:
# next:
sidebar:
open: true
---Markdown Tips
This site supports CommonMark as a “standard” Markdown:
- Bold text uses
**asterisks** - Italic text uses
*asterisks* - Links use
[text](url) - Images use
 - See some markdown docs for more help
- Footnotes
Here is some text with a footnote.[^1] [^1]: And here's the footnote text.
Deeper details
By default, and for this site, Hugo uses Goldmark to render Markdown. This means:
- I can use anything in the CommonMark Spec.
- Various built-in extensions are available by default. As you can see across this site, I use the extensions ‘Definition Lists’ and ‘Footnotes’ extensively.
- Various optional extensions can easily be made available.
Hugo Tips
- Learn more about draft, future, and expired content
Build/Serve locally
hugo server --buildDrafts --disableFastRender --bind 0.0.0.0 --port 8088Publish/Deploy
Given that Hugo is a Static Site Generator, it outputs plain text files (HTML, CSS, JavaScript) that can be served by any webserver. So there are many simple publishing/deployment options.
- GitLab Pages
- GitHub Pages
- Cloudflare Pages
- or your own tiny server such as a Raspberry Pi, smartphone or other low power computing device.
Next: Wouldn’t it be nice if …?
- Additional Goldmark extensions
- Web Analytics via Plausible Analytics, a simple, open-source, lightweight and privacy-friendly web analytics, using the plausible-hugo integration
- Fediverse/etc. publication?
- Comments? Perhaps via giscus?
Testing
Pre-commit
Linting
(Code) syntax checker, grammar/style checker (vale et al.), etc.
Link checking
- Check for broken (internal) links with hyperlink.
- Consider
--check-anchorsand--sources. - dump a list of external hyperlinks.