Skip to content

danohn/danohn.com

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

danohn.com

Source for danohn.com, a personal engineering blog built with Hugo and deployed to GitHub Pages.

Requirements

  • Hugo Extended 0.162.1 or newer
  • Git

Run Locally

hugo server

Open http://localhost:1313. Hugo watches the source files and refreshes the site as they change.

Analytics is disabled during local development.

Create A Post

Generate a new post from the included archetype:

hugo new content/posts/my-new-post/index.md

This 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: ""
---
  • title is the post title.
  • description is used for page metadata, social previews, lists, and search.
  • summary optionally provides a different internal search excerpt.
  • date is the original publication date.
  • lastmod is the most recent meaningful update date.
  • authors assigns the post to one or more author pages.
  • topics creates browsable topic pages.
  • canonical optionally points search engines to an original version elsewhere.
  • cover.image optionally displays a cover and supplies the background for the generated Open Graph and Twitter preview image.
  • cover.alt describes 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:

![A useful description of the diagram.](diagram.png)

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

Build the production site locally with:

HUGO_ENVIRONMENT=production hugo --gc --minify

The generated site is written to public/, which is intentionally ignored by Git.

Deployment

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.

Site Features

  • 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.

Project Structure

  • content/: Markdown pages and post leaf bundles containing their images
  • content/posts/_index.md: section defaults inherited by every post
  • archetypes/posts.md: default front matter for new posts
  • hugo.toml: site settings, navigation, topics, and output formats
  • layouts/index.html: home page
  • layouts/_default/: shared list and article templates
  • layouts/partials/: header, footer, metadata, analytics, and search UI
  • layouts/index.json: client-side search index template
  • layouts/robots.txt: generated robots file
  • assets/css/main.css: visual system and responsive styles
  • assets/js/site.js: theme and search behavior, minified and fingerprinted by Hugo
  • assets/images/: source images processed by Hugo for avatars and social previews
  • static/CNAME: GitHub Pages custom domain
  • static/favicon*, static/apple-touch-icon.png, and static/site.webmanifest: browser and device icons
  • .github/workflows/pages.yml: production build and deployment workflow

Configuration

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].

About

Personal engineering notes built with Hugo

Resources

Stars

Watchers

Forks

Contributors