Files
poweronoff.click/AGENTS.md
T
morpheus 9a02ee8111 Add agent tooling and restore the legal footer links
The footer override at layouts/partials/footer.html stopped being applied when
PaperMod moved its partials to layouts/_partials/: the Datenschutz and Impressum
links had silently vanished from the live site, and the copied theme JS was
stale. Drop the 135-line fork and get the links from params.footer.text, which
the theme renders itself.

Agentic setup:
- AGENTS.md: repo map, writing rules, guardrails, definition of done, backlog
- Makefile: dockerised build/serve/check/new/clean, pinned Hugo 0.169.0
- scripts/new-post.sh: creates a correct draft page bundle
- scripts/check-links.py: fails on unresolved internal links
- .editorconfig for consistent whitespace

CI/build:
- pin ghcr.io/gohugoio/hugo to v0.169.0 instead of :latest
- serialise runs per ref so deploys cannot race
- only send the Telegram notification for pushes

Also: trailing slash on the howto menu URL, ignore .hugo_build.lock, document the
dead Universal Analytics ID, and remove two unused duplicate images (304 KB).
2026-11-06 10:06:13 +01:00

91 lines
4.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# AGENTS.md
Instructions for coding agents working on this repository. Keep them in sync
with the tooling; if a command below stops working, fix the command here first.
## What this is
The Hugo source of https://poweronoff.click, a German-language blog about agile
leadership and engineering management by Stan Nowogrudski. Theme: PaperMod
(git submodule). Deployed by Gitea Actions via `scp` on every push to `master`.
## Commands
Hugo is **not** installed on the host. Everything runs through the pinned
official Docker image (`HUGO_VERSION` in the `Makefile`, mirrored in
`.gitea/workflows/build.yml`).
```sh
make build # production build into public/ (minified)
make serve # http://localhost:1313 with drafts, live reload
make check # build + generated-site assertions + internal link check
make new slug=my-post title="Mein Titel" # new draft page bundle
make clean # remove public/ and resources/
make theme-update # bump the PaperMod submodule, then review + `make check`
```
`make check` is the definition of done for any change. It fails on placeholder
text, a leaked `localhost:1313` base URL, or broken internal links.
## Layout
| Path | Meaning |
| --- | --- |
| `config.yml` | All site config: params, menus, social icons, footer text |
| `content/posts/<slug>/index.md` | Page bundle per post; cover image may live next to it |
| `content/*.md` | Standalone pages (about, impressum, data protection) |
| `layouts/shortcodes/obfuscate.html` | Base64 email obfuscation shortcode |
| `static/` | Files served at the site root (images, icons) |
| `themes/PaperMod` | Git submodule. **Never edit it.** Override from `layouts/` instead |
| `.gitea/workflows/build.yml` | Build, deploy, Telegram notification |
Do not recreate `layouts/partials/footer.html`. It used to be a copy of the
theme footer, which silently stopped working when PaperMod moved to
`layouts/_partials/` (the legal links disappeared from the site). The
Datenschutz/Impressum links now come from `params.footer.text` in `config.yml`.
## Writing rules
- Posts are written in **German**; `howto-work-with-stan.md` is the English
exception. Do not translate existing content unless asked.
- Voice: first person, opinionated, practical. Do not add marketing filler.
- New posts start as `draft: true`. `buildDrafts` is off, so drafts never deploy.
- The paragraph before `<!--more-->` becomes the summary; make it meaningful.
- Front matter fields used by the theme: `title`, `date`, `draft`, `tags`,
`categories`, `ShowToc`, `ShowBreadCrumbs`, `cover.{image,alt,caption,relative}`.
- Cover images go in `static/` and are referenced by absolute path
(`/name.jpg`), even with `relative: true`. Use the unsplash/free license
credit in `caption` when the photo is not ours.
- Keep images out of `static/` unless they must be shared; prefer page bundles
with `resources.Get` for new artwork. Flag images larger than ~300 KB.
- Email addresses in content must use the `obfuscate` shortcode:
`{{< obfuscate >}}name@example.com{{< /obfuscate >}}`.
- Do not commit `public/`, `resources/`, `.hugo_build.lock`, or editor droppings.
## Guardrails
- **Never push to `master`** unless the user explicitly asks for a deploy.
A push to `master` builds and overwrites the live site.
- Do not touch `config.yml` secrets/analytics IDs, and never commit credentials.
CI secrets (`SSH_USERNAME`, `SSH_PASSWORD`, `SSH_PORT`, `TELEGRAM_TO`,
`TELEGRAM_TOKEN`) live in Gitea repository settings only.
- Deploy uses password `scp` and `rm: false`, so removed files are **not**
deleted on the server. If you delete a post or image, say so explicitly in
the PR/commit message so it can be cleaned up by hand.
- Theme deprecation warnings are upstream PaperMod noise
(`.Language.LanguageDirection`, `.Language.LanguageCode`). Do not try to fix
them in the submodule; wait for `make theme-update`. There are no other
acceptable Hugo warnings.
## Known issues / backlog
- `googleAnalytics` in `config.yml` is a dead Universal Analytics ID; a GA4
`G-…` property is needed before analytics works again.
- `params.images` (Open Graph / Twitter cards) points at 32–60 px icons. Use a
1200×630 image so shared links render properly.
- Two posts (`a-letter-to-my-younger-self`, `appreciation`) are drafts whose
bodies are still placeholders. They are not published, but do not "clean
them up" without asking — they are the author's unfinished work.
- Deploy would be safer with `rsync --delete` and SSH keys instead of a
password; out of scope unless asked.