Skip to content

Commit a497d30

Browse files
committed
feat: add agents.md and clean up homepage
1 parent 7d8afc9 commit a497d30

File tree

5 files changed

+300
-70
lines changed

5 files changed

+300
-70
lines changed

AGENTS.md

Lines changed: 235 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
1+
# AGENTS.md — Tales
2+
3+
Guidance for agentic coding assistants working in this repository.
4+
5+
---
6+
7+
## Project Overview
8+
9+
A personal static blog by Dewald Viljoen, built with **Hugo** and deployed to **GitHub Pages**. The theme (`themes/tales/`) is a custom local theme derived from `smol`. No npm, no bundler, no CSS framework — deliberately minimal.
10+
11+
---
12+
13+
## Build & Dev Commands
14+
15+
There is no Makefile or npm scripts. All commands use the Hugo CLI directly.
16+
17+
| Purpose | Command |
18+
|---|---|
19+
| Dev server (published posts only) | `hugo server` |
20+
| Dev server (including drafts) | `hugo server -D` |
21+
| Production build | `hugo --gc --minify` |
22+
| Create a new post | `hugo new content/posts/YYYY-MM-DD-slug.md` |
23+
24+
There are **no lint, format, or test commands**. Hugo itself validates templates at build/serve time — errors are printed to the terminal.
25+
26+
**The dev server is the primary feedback loop.** Always verify changes by checking the running server at `http://localhost:1313`.
27+
28+
### Nix Dev Environment
29+
30+
The repo uses Nix flakes + direnv. If the Nix shell is active (via `direnv allow` or `nix develop`), `hugo` and `go` are available automatically.
31+
32+
### CI/CD
33+
34+
GitHub Actions (`.github/workflows/hugo.yaml`) builds with:
35+
```bash
36+
hugo --gc --minify --baseURL "${{ steps.pages.outputs.base_url }}/"
37+
```
38+
Pinned to **Hugo 0.155.3 extended**. Sets `HUGO_ENVIRONMENT=production`.
39+
40+
---
41+
42+
## Project Structure
43+
44+
```
45+
content/
46+
_index.md # Homepage (YAML front matter, no body content)
47+
about/_index.md # About page (YAML, layout: about)
48+
posts/
49+
00-post-ideas.md # Draft scratchpad — never publish
50+
YYYY-MM-DD-slug.md # Blog posts
51+
themes/tales/
52+
layouts/
53+
_default/ # Base templates (baseof, single, list, summary, about)
54+
about/ # About-specific layout overrides
55+
index.html # Homepage layout
56+
partials/ # header, footer, pagination, contact
57+
_default/_markup/ # render-image.html (wraps images in <figure>)
58+
static/css/style.css # All styles — single file, no build step
59+
static/images/ # Site-level static assets
60+
hugo.toml # Site config, params, menus
61+
```
62+
63+
---
64+
65+
## Content Conventions
66+
67+
### Post Files
68+
69+
- **Location:** `content/posts/`
70+
- **Filename format:** `YYYY-MM-DD-kebab-case-slug.md` — date prefix is mandatory, keeps posts sorted naturally in the filesystem.
71+
- **Example:** `2025-02-10-nixos-setup.md`
72+
73+
### Front Matter
74+
75+
Posts use **TOML** delimiters (`+++`):
76+
77+
```toml
78+
+++
79+
title = 'Post Title Here'
80+
date = 2025-02-10T10:00:00Z
81+
draft = false
82+
tags = ['nixos', 'linux']
83+
+++
84+
```
85+
86+
Section index files (`_index.md`) use **YAML** delimiters (`---`):
87+
88+
```yaml
89+
---
90+
title: "Page Title"
91+
description: "Short description"
92+
---
93+
```
94+
95+
Rules:
96+
- `title` and `date` are always required on posts.
97+
- `draft = true` hides a post from the live site (`hugo server -D` still shows it locally).
98+
- `tags` are optional, lowercase, kebab-case strings.
99+
- Dates use ISO 8601 with time and UTC offset: `2025-02-10T10:00:00Z`.
100+
- Do **not** set `draft = false` on `00-post-ideas.md` — it is a scratchpad, not a post.
101+
102+
### The `hugo new` Archetype
103+
104+
Running `hugo new content/posts/YYYY-MM-DD-slug.md` scaffolds a TOML front matter file from `archetypes/default.md`. The title is auto-derived from the filename.
105+
106+
---
107+
108+
## Hugo Templates
109+
110+
### Layout Hierarchy
111+
112+
- All page templates define a `{{ define "main" }}` block injected into `baseof.html`.
113+
- `baseof.html` owns `<html>`, `<head>`, header/footer partials, and the inline JS for the theme toggle.
114+
- Never add `<html>`, `<head>`, or `<body>` tags to layout files other than `baseof.html`.
115+
116+
### Indentation
117+
118+
Hard **tabs** throughout all `.html` template files. Do not use spaces.
119+
120+
### Partials
121+
122+
Call partials with the `.html` suffix for consistency:
123+
```html
124+
{{ partial "contact.html" . }}
125+
{{ partial "pagination.html" . }}
126+
```
127+
128+
Pass `.` (current context) unless a specific context is needed.
129+
130+
### Site Params
131+
132+
Social/contact links and section config live in `hugo.toml` under `[params]`. Access them in templates with `{{ .Site.Params.github }}` etc. Always wrap optional params in `{{ with }}`:
133+
134+
```html
135+
{{ with .Site.Params.github }}<a href="{{ . }}">GitHub</a>{{ end }}
136+
```
137+
138+
### Hugo Template Patterns
139+
140+
- Use `{{ $var := value }}` for local variables.
141+
- Use `{{ range }}...{{ end }}` for iteration.
142+
- Use `{{ with }}...{{ end }}` for nil-safe access (preferred over `{{ if }}`).
143+
- Date formatting uses Go reference time: `"2006-01-02"` for date-only, `"2006-01-02 15:04:05"` for datetime.
144+
- Use `| relURL` or `| relLangURL` for internal links; `| urlize` for slugifying tag names.
145+
146+
---
147+
148+
## CSS Conventions
149+
150+
Single file: `themes/tales/static/css/style.css`. No preprocessor, no build step.
151+
152+
### Custom Properties
153+
154+
All colours are defined as CSS custom properties on `:root`. The full set:
155+
156+
```css
157+
--bgcolor, --fontcolor, --linkcolor, --visitedcolor,
158+
--precolor, --prebgcolor, --hrcolor, --mutedcolor
159+
```
160+
161+
Always use these variables — never hardcode colour values.
162+
163+
### Theme System
164+
165+
- Default: light (`:root`)
166+
- OS dark preference: `@media (prefers-color-scheme: dark)`
167+
- Manual override: `[data-theme="dark"]` / `[data-theme="light"]` on `<html>`
168+
169+
When adding new components, define colours using the existing variables so dark/light mode works automatically.
170+
171+
### Naming
172+
173+
- Kebab-case class names: `.site-header`, `.latest-post`, `.latest-post-label`
174+
- No component prefix or BEM syntax — flat, descriptive names
175+
- Semantic HTML elements styled directly where appropriate (`article`, `footer`, `figure`, etc.)
176+
177+
### File Organisation
178+
179+
Add new styles under a clearly commented section header:
180+
```css
181+
/* New component name */
182+
.new-component { ... }
183+
```
184+
185+
The existing section order is: variables → base → links → headings → code → specific components → headerfooter → theme toggle → responsive.
186+
187+
### Typography & Layout
188+
189+
- Body: `14px/1.6 monospace` — the monospace aesthetic is intentional, do not change.
190+
- Max-width: `800px`, centred with `margin: auto`.
191+
- Single responsive breakpoint at `max-width: 600px`.
192+
193+
---
194+
195+
## Hugo Config (`hugo.toml`)
196+
197+
- Format: TOML throughout.
198+
- `baseURL`: `https://dewaldv.com/`
199+
- `languageCode`: `en-GB` — use British English in all UI strings.
200+
- Site title: `DEWALD VILJOEN` (all caps) — do not change casing.
201+
- `params.mainSections = ["posts"]` — required for the homepage post list and latest-post callout.
202+
- Social params (`github`, `linkedin`, `email`) are the single source of truth for contact details. Update them here, not in templates or content.
203+
204+
---
205+
206+
## Git Conventions
207+
208+
Commit messages follow **Conventional Commits** with one custom type:
209+
210+
```
211+
feat: new site feature or template change
212+
fix: bug fix
213+
chore: deps, config, formatting, maintenance
214+
post: adding or updating a blog post or content file
215+
```
216+
217+
Format: `<type>: <short imperative description>` (no capital, no period).
218+
219+
Examples:
220+
```
221+
feat: add latest post callout to homepage
222+
fix: use list layout for about page
223+
chore: update flake dependencies
224+
post: start nixos setup post
225+
```
226+
227+
---
228+
229+
## Common Pitfalls
230+
231+
- **`_index.md` uses the list layout**, not single — section index files are branch bundles. Use `layout:` front matter or a section-specific layout file in `layouts/<section>/` to override.
232+
- **`mainSections` must be set** in `hugo.toml` — without it, the homepage and latest-post callout will be empty.
233+
- **Drafts require `-D` flag** — `hugo server` without `-D` will not show draft posts.
234+
- **Post filename must have a date prefix** — `YYYY-MM-DD-slug.md` is the established convention; do not create posts without it.
235+
- **Do not publish `00-post-ideas.md`** — it is a scratchpad and must remain `draft = true`.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# tales from the deep
1+
# Tales
22

33
Static blog site build with [Hugo](https://github.com/gohugoio/hugo).
44

content/_index.md

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,4 @@
11
---
22
title: "DewaldV"
33
description: "A blog, probably."
4-
theme_version: '2.9.1'
5-
featured_image: '/images/veld_sunset.jpg'
64
---
7-
8-
Starting out with some basics, let's get a bit of structure.
9-
10-
1. A Landing page with a list of articles and a hero image
11-
2. An initial post with something about something
12-
3. Published to my domain
13-
14-
Let's list out some ideas for future posts:
15-
16-
- Zoom on Sway
17-
- Something on NixOS, maybe combined with the Framework?
18-
- Nix for Rust Development, a Guide?
19-
- Bevy and Rust
20-
- Writing a blog with Hugo (so meta)
21-
- Choosing to make time for the things you want to do in life
22-
- Something about books I've read recently?
23-
- Helldivers 2, tweaking performance on 7900XT on Linux
24-
- Linux Gaming stuff in general
25-
- Something on repair, maybe along with re-fixing the PSU for the rice cooker?
26-
- Setting up Kolide on NixOS
27-
- Gaming on Linux, retrospective from the last two years on the platform (PopOS, NixOS)
28-
- Framework laptop retrospective, 6 months in.
29-
- Something about infrastructure on Kube maybe. Aligned with the big project this year (CP).
30-
- De-googling with Proton (Series)
31-
- Mail management with Proton
32-
- Drive management with Proton
33-
- Wireguard VPNs with Proton
34-
- Setting up Steam with Gamemode and Mangohud
35-
36-
37-
# A southern summer with the Framework 13
38-
- The best laptop keyboard in a 13" on the market
39-
- Gaming, Work, Endurance
40-
- It's no MacBook and that's a good thing
41-
- Linux makes the magic
42-
43-
# Taking back control: A blog series about de-cloudifying
44-
45-
## Motivations: Why even bother?
46-
47-
## Getting Started with acceptable Cloud services: Proton, Tailscale
48-
- Tailscale foundation for securing and exposing services
49-
-
50-
51-
## The most important cloud functions: Email, Docs/Notes, Photos, Storage
52-
- Proton Mail, personal domain
53-
- Proton Drive, an acceptable compromise for now
54-
- Syncthing + WebDAV, note sync with no cloud
55-
- Syncthing Android app discussion (mention iOS app quality)
56-
57-
# Taking back control: Branching out into the physical with Home Automation
58-
59-
## A tirade on privacy, choosing your suppliers
60-
- Reolink
61-
- Reputable, open, integratable
62-
63-
## Uk-specific, energy providers and boilers
64-
- Opentherm
65-
- Octopus
66-
67-
# Taking back control: Financial integrations
68-
69-
## UK-specific, banks, pensions, oh my!
70-
- Monzo API
71-
- Starling API
72-

content/posts/00-post-ideas.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
+++
2+
title = 'Post Ideas'
3+
date = 2024-01-01T00:00:00Z
4+
draft = true
5+
+++
6+
7+
Let's list out some ideas for future posts:
8+
9+
- Zoom on Sway
10+
- Something on NixOS, maybe combined with the Framework?
11+
- Nix for Rust Development, a Guide?
12+
- Bevy and Rust
13+
- Writing a blog with Hugo (so meta)
14+
- Choosing to make time for the things you want to do in life
15+
- Something about books I've read recently?
16+
- Helldivers 2, tweaking performance on 7900XT on Linux
17+
- Linux Gaming stuff in general
18+
- Something on repair, maybe along with re-fixing the PSU for the rice cooker?
19+
- Setting up Kolide on NixOS
20+
- Gaming on Linux, retrospective from the last two years on the platform (PopOS, NixOS)
21+
- Framework laptop retrospective, 6 months in.
22+
- Something about infrastructure on Kube maybe. Aligned with the big project this year (CP).
23+
- De-googling with Proton (Series)
24+
- Mail management with Proton
25+
- Drive management with Proton
26+
- Wireguard VPNs with Proton
27+
- Setting up Steam with Gamemode and Mangohud
28+
29+
30+
# A southern summer with the Framework 13
31+
- The best laptop keyboard in a 13" on the market
32+
- Gaming, Work, Endurance
33+
- It's no MacBook and that's a good thing
34+
- Linux makes the magic
35+
36+
# Taking back control: A blog series about de-cloudifying
37+
38+
## Motivations: Why even bother?
39+
40+
## Getting Started with acceptable Cloud services: Proton, Tailscale
41+
- Tailscale foundation for securing and exposing services
42+
43+
## The most important cloud functions: Email, Docs/Notes, Photos, Storage
44+
- Proton Mail, personal domain
45+
- Proton Drive, an acceptable compromise for now
46+
- Syncthing + WebDAV, note sync with no cloud
47+
- Syncthing Android app discussion (mention iOS app quality)
48+
49+
# Taking back control: Branching out into the physical with Home Automation
50+
51+
## A tirade on privacy, choosing your suppliers
52+
- Reolink
53+
- Reputable, open, integratable
54+
55+
## Uk-specific, energy providers and boilers
56+
- Opentherm
57+
- Octopus
58+
59+
# Taking back control: Financial integrations
60+
61+
## UK-specific, banks, pensions, oh my!
62+
- Monzo API
63+
- Starling API

content/posts/2024-05-12-wine-sway-cursor-positioning.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
+++
2-
title = ''
2+
title = 'A sway misclick'
33
date = 2024-05-12T12:48:00Z
44
draft = true
55
+++

0 commit comments

Comments
 (0)