Build and deploy the poweronoff.click hugo / build (push) Successful in 42s
Hugo 0.158+ deprecated .Language.LanguageDirection and .Language.LanguageCode. Both were used only by the theme (baseof.html, rss.xml, opengraph.html) and are already fixed upstream, so bump PaperMod v8.0-139 -> v8.0-152 instead of patching the submodule. Other changes in that range are theme improvements (focus handling for in-page anchors, throttled scroll handlers, ISO date titles); no site behaviour regressions in the generated HTML. Universal Analytics (UA-179789773-1) stopped collecting data in 2023 and made Hugo warn on every build. Analytics is now disabled with a comment showing how to enable GA4; the dead gtag.js snippet is no longer shipped to visitors. make check: 0 warnings, 0 errors.
104 lines
5.3 KiB
Markdown
104 lines
5.3 KiB
Markdown
# 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 official
|
||
Docker image `ghcr.io/gohugoio/hugo:latest`, in the `Makefile` and in
|
||
`.gitea/workflows/build.yml`. Builds track the newest Hugo; if a new release
|
||
breaks the site, pin for the debugging session instead of committing a tag:
|
||
|
||
```sh
|
||
make check HUGO_IMAGE=ghcr.io/gohugoio/hugo:v0.169.0
|
||
```
|
||
|
||
```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**. Do not translate existing content unless asked.
|
||
The English "How to work with me" page was removed in 2026; `content/howto-work-with-stan.md`
|
||
is only recoverable from git history.
|
||
- 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 mirrors `public/` to the server with
|
||
`rsync -rltz --delete --delay-updates`, so deleting a post or image also
|
||
removes it from the live site on the next `master` push. Never place
|
||
hand-made files under `/var/www/poweronoff.click` — they will be deleted;
|
||
`.well-known/` is excluded for ACME challenges.
|
||
- Deploy still authenticates with a password via `sshpass`. Moving to an SSH
|
||
key is a known follow-up.
|
||
- The build must be warning-free. Deprecations coming from the theme are fixed
|
||
by `make theme-update`, never by editing the submodule; deprecations coming
|
||
from `config.yml` (e.g. a retired analytics ID) are fixed in the config.
|
||
|
||
## Known issues / backlog
|
||
|
||
- Analytics is deliberately disabled: the Universal Analytics property is dead
|
||
and no GA4 measurement ID exists yet. Add `googleAnalytics: G-XXXXXXXXXX` in
|
||
`config.yml` if tracking is wanted (cookieless consent implications aside).
|
||
- `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.
|
||
- Builds are intentionally unpinned (`hugo:latest`). A Hugo release can change
|
||
output or deprecate theme code between two commits; when that happens, pin via
|
||
`HUGO_IMAGE` locally, then bump PaperMod with `make theme-update`.
|
||
- Deploy still uses password auth; switch to an SSH key and keep the rsync
|
||
`--delete` semantics.
|