blog/AGENTS.md

2.6 KiB

AGENTS.md — Thanwer's Blog

Project

Hugo blog (multilingual EN + PT-BR) using the anubis2 theme as a git submodule (themes/anubis2, v1.6.0). Deployed via rsync to a VPS.

Commands

hugo server           # dev server at localhost:1313
hugo                  # build to ./public/
./deploy.sh           # hugo --minify && rsync to server

No tests, linter, or typecheck.

Content conventions

  • Posts: content/posts/<slug>.md (EN), content/posts/<slug>.pt.md (PT-BR)
  • Images: static/images/<filename> — referenced as /images/<filename> in markdown
  • PT translations set canonical = "/posts/<en-slug>" 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 '<string>' quoted format (Hugo stores it as string, not time.Time)
  • Archetype: hugo new posts/<slug>.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

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

Frontmatter reference

date = 2024-10-26T16:59:23-03:00
lastmod = 2026-05-09T00:00:00Z      # bare datetime, no quotes
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)

  • languageCode → use locale
  • languageName → use label
  • .Site.LanguageCode → use .Site.Language.Locale