From 9a998f4ac9d4c83d3202e15458c746066a997e73 Mon Sep 17 00:00:00 2001 From: Thanwer Date: Sat, 9 May 2026 23:09:44 +0200 Subject: [PATCH] Update AGENTS.md with new information --- .cspell.config.yaml | 1 + AGENTS.md | 56 +++++++++++++++++++++++++-------------------- 2 files changed, 32 insertions(+), 25 deletions(-) diff --git a/.cspell.config.yaml b/.cspell.config.yaml index df0c1b6..e579815 100644 --- a/.cspell.config.yaml +++ b/.cspell.config.yaml @@ -48,6 +48,7 @@ words: - linkinator - lychee - markdownlint + - markdownlintrc - maxretry - mathjax - mermaid diff --git a/AGENTS.md b/AGENTS.md index b6c95fa..938c653 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -7,50 +7,56 @@ Hugo blog (multilingual EN + PT-BR) using the **anubis2** theme as a git submodu ## Commands ```bash -hugo server # dev server at localhost:1313 -hugo # build to ./public/ -./deploy.sh # hugo --minify && rsync to server +hugo server # dev server at localhost:1313 +hugo # build to ./public/ (no minify) +./deploy.sh # pre-commit → hugo --minify → rsync +pre-commit run --all-files # quality check (lint, spell, links) ``` -No tests, linter, or typecheck. +## Quality toolchain + +- **pre-commit** — runs on `./deploy.sh` or manually via `pre-commit run --all-files`. Includes: YAML/TOML/JSON check, EOF fixer, trailing whitespace, large file check, markdownlint, cspell (EN + PT-BR), lychee (link checker). +- **markdownlint** — config: `.markdownlintrc`. MD013 (line-length) disabled. +- **cspell** — config: `.cspell.config.yaml`. Adds `@cspell/dict-pt-br` via `additional_dependencies`. Custom word list for technical terms. +- **lychee** — config: `.lychee.toml`. Run locally with `--root-dir static` to resolve `/images/...` links. Excludes social media domains and `sshaudit.com`. + +All quality tooling must pass before deploy. No separate test framework. ## Content conventions - **Posts**: `content/posts/.md` (EN), `content/posts/.pt.md` (PT-BR) - **Images**: `static/images/` — referenced as `/images/` in markdown -- **PT translations** set `canonical = "/posts/"` in frontmatter to point to the English original -- **`lastmod`** in frontmatter must use bare TOML datetime (no quotes): `lastmod = 2026-05-09T00:00:00Z`. With `enableGitInfo = true`, the template prefers `.Params.lastmod` over git dates — avoid `''` quoted format (Hugo stores it as string, not `time.Time`) -- **Archetype**: `hugo new posts/.md` uses `archetypes/default.md` -- **Tags** only (no categories used): `tags = ["GNU/Linux", "Tools"]` - -## Theme overrides (site `layouts/` shadows theme) - -- `layouts/partials/head.html` — overrides theme head: adds canonical from frontmatter (`Params.canonical`), production-only Umami analytics -- `layouts/partials/post-info.html` — overrides theme: prefers `.Params.lastmod` over `.Lastmod` (git override), shows "Last modified" when `lastmod ≠ date` -- `layouts/partials/footer-extra.html` — Ko-fi floating chat widget -- `layouts/robots.txt` — custom sitemap entries for both languages +- **PT translations** set `canonical = "/posts/"` in frontmatter +- **`lastmod`** must use bare TOML datetime (no quotes): `lastmod = 2026-05-09T00:00:00Z`. +- **Archetype**: `hugo new posts/.md` → `archetypes/default.md` +- **Tags** only (no categories): `tags = ["GNU/Linux", "Tools"]` ## Configuration quirks -- Theme expects **all lowercase keys** under `params.anubis2`: `colortheme`, `enablecolorthemeswitcher`, `readnextposts`, `socialicons`, etc. — see `themes/anubis2/PARAMS.md` -- `[params.anubis2.services.umami]` uses lowercase keys: `id`, `url` -- Analytics only inject in production (`hugo.IsProduction`). For testing analytics locally: `hugo server --environment production` -- Config uses modern Hugo keys: `locale` (not `languageCode`), `label` (not `languageName`) -- `enableGitInfo = true` — `.Lastmod` is derived from git; template falls back to frontmatter `lastmod` when set +- Theme requires **all lowercase keys** under `params.anubis2`: `colortheme`, `enablecolorthemeswitcher`, `readnextposts`, `socialicons`, etc. See `themes/anubis2/PARAMS.md`. +- `[params.anubis2.services.umami]` keys are lowercase: `id`, `url`. +- Analytics inject only in production (`hugo.IsProduction`). Test locally: `hugo server --environment production`. +- Config uses modern Hugo keys: `locale` (not `languageCode`), `label` (not `languageName`). +- `enableGitInfo = true` — `.Lastmod` derives from git; template prefers `.Params.lastmod` when set. ## Frontmatter reference ```toml date = 2024-10-26T16:59:23-03:00 -lastmod = 2026-05-09T00:00:00Z # bare datetime, no quotes +lastmod = 2026-05-09T00:00:00Z title = 'Post Title' description = "One-line summary for SEO and RSS" tags = ["tag1", "tag2"] canonical = "/posts/original-post" # PT translations only ``` -## Deprecated Hugo keys (avoid) +## Deprecated keys (avoid) -- `languageCode` → use `locale` -- `languageName` → use `label` -- `.Site.LanguageCode` → use `.Site.Language.Locale` +- `languageCode` → `locale`; `languageName` → `label`; `.Site.LanguageCode` → `.Site.Language.Locale` + +## Theme overrides (`layouts/` shadows theme) + +- `layouts/partials/head.html` — canonical from `Params.canonical`, Umami analytics (prod only) +- `layouts/partials/post-info.html` — prefers `.Params.lastmod`, shows "[Last modified]" when different from date +- `layouts/partials/footer-extra.html` — Ko-fi widget +- `layouts/robots.txt` — custom sitemap for both languages