Source for danohn.com, a personal engineering blog built with Hugo and deployed to GitHub Pages.
- Hugo Extended
0.162.1or newer - Git
hugo serverOpen http://localhost:1313. Hugo watches the source files and refreshes the site as they change.
Analytics is disabled during local development.
Generate a new post from the included archetype:
hugo new content/posts/my-new-post/index.mdThis creates a leaf bundle. Keep the post and all of its images together:
content/posts/my-new-post/
├── index.md
├── cover.png
└── diagram.png
The generated index.md includes the supported front matter:
---
title: "My New Post"
description: ""
summary: ""
date: "2026-06-05T00:00:00+10:00"
lastmod: "2026-06-05T00:00:00+10:00"
authors: ["Daniel Ohnesorge"]
topics: []
canonical: ""
cover:
image: ""
alt: ""
---titleis the post title.descriptionis used for page metadata, social previews, lists, and search.summaryoptionally provides a different internal search excerpt.dateis the original publication date.lastmodis the most recent meaningful update date.authorsassigns the post to one or more author pages.topicscreates browsable topic pages.canonicaloptionally points search engines to an original version elsewhere.cover.imageoptionally displays a cover and supplies the background for the generated Open Graph and Twitter preview image.cover.altdescribes the cover for screen readers.
Write the post below the closing ---, then commit and push it to publish.
Reference bundled images using paths relative to index.md:
Hugo generates responsive WebP variants for bundled covers and Markdown images.
The original source images remain in Git but are excluded from the published
site. Posts without a cover receive a generated typographic social preview.
Posts inherit the default author from content/posts/_index.md. The site-wide
author name and avatar are configured in hugo.toml.
Fenced code blocks include syntax highlighting and a copy button. Add an optional filename and Hugo highlighting options in the info string:
```yaml {filename="deployment.yaml" lineNos=inline hl_lines="6-7"}
apiVersion: apps/v1
kind: Deployment
```Build the production site locally with:
HUGO_ENVIRONMENT=production hugo --gc --minifyThe generated site is written to public/, which is intentionally ignored by
Git.
Pushing to main triggers
the GitHub Pages workflow. The workflow builds
the site with Hugo Extended 0.162.1 and deploys the generated public/
directory to GitHub Pages.
The custom domain is declared in static/CNAME. GitHub Pages handles HTTPS.
- Responsive light and dark themes that default to the visitor's system preference
- Latest-post homepage preview with a compact post archive
- Client-side search across post titles, descriptions, content, and topics
- Topic archive pages generated from post front matter
- Author archive pages with linked post bylines
- Native, X, LinkedIn, and copy-link sharing on posts
- GitHub Discussions comments powered by Giscus
- Privacy policy covering analytics, comments, preferences, and hosting
- Custom 404 page
- RSS feed and sitemap generated by Hugo
- Canonical, Open Graph, Twitter, and JSON-LD metadata
- Production-only self-hosted Plausible analytics
Search data is generated as /index.json and loaded only when someone opens
search. Queries must contain at least three characters.
content/: Markdown pages and post leaf bundles containing their imagescontent/posts/_index.md: section defaults inherited by every postarchetypes/posts.md: default front matter for new postshugo.toml: site settings, navigation, topics, and output formatslayouts/index.html: home pagelayouts/_default/: shared list and article templateslayouts/partials/: header, footer, metadata, analytics, and search UIlayouts/index.json: client-side search index templatelayouts/robots.txt: generated robots fileassets/css/main.css: visual system and responsive stylesassets/js/site.js: theme and search behavior, minified and fingerprinted by Hugoassets/images/: source images processed by Hugo for avatars and social previewsstatic/CNAME: GitHub Pages custom domainstatic/favicon*,static/apple-touch-icon.png, andstatic/site.webmanifest: browser and device icons.github/workflows/pages.yml: production build and deployment workflow
Social profile links, site metadata, and Plausible settings live in
hugo.toml.
Production builds load the Plausible CE tracking script from
https://analytics.danohn.com. Its instance-specific script URL is configured
under [params.analytics].
Giscus repository and discussion category identifiers are configured under
[params.giscus].