mirror of https://github.com/theNewDynamic/gohugo-theme-ananke.git

Patrick Kollitsch
17 hours ago fb71d100fe069244d1fcbe3f48c976ab7a0558e2
refs
author Patrick Kollitsch <83281+davidsneighbour@users.noreply.github.com>
Sunday, June 7, 2026 05:24 +0200
committer Patrick Kollitsch <davidsneighbourdev+gh@gmail.com>
Sunday, June 7, 2026 05:47 +0200
commitfb71d100fe069244d1fcbe3f48c976ab7a0558e2
tree b7243569b155793c76188499189265cf4b0c9813 tree | zip | gz
parent 1d9673468505eaad912ebb7b9b6d601ac2b5bf60 view | diff
feat: add since shortcode for release badges (#1018)

## Summary

Migrates the `since` shortcode from the documentation site into the
theme itself, so every Ananke site can use it. It renders a small badge
marking the release a feature was introduced in (e.g. "since 2.17.0").

## Changes

- **`layouts/_shortcodes/since.html`** — new theme shortcode. The
version is resolved, in order of precedence, from:
- the first positional argument: `{{< since "2.17.0" >}}`
- a named `version` argument: `{{< since version="2.17.0" >}}`
- the page's `since` front matter

When no version can be resolved it renders nothing and prints a
build-time `warnf` naming the page.
- **`i18n/en.toml`** — new translatable `since` label.

## Behaviour

- **No link by default.** With no configuration the badge is plain text
(`<span>`). Linking is opt-in.
- **`params.ananke.shortcodes.since.repo_url`** — a printf format string
(`%s` = version). Setting it turns the badge into an `<a>` linking to
that release. Not shipped in the theme's default config (documented
only).
- **`params.ananke.shortcodes.since.target`** — link target, defaults to
`_blank` (with `rel="noopener"`). Set a custom value (e.g. `"_top"`) or
`false` to open in the same window.

## Notes

The accompanying documentation lives in the separate `documentation`
repo (a `shortcodes/since` page plus removal of the docs site's local
copy, which now resolves from the theme module).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 files modified
1 files added
55 ■■■■■ changed files
i18n/en.toml 3 ●●●●● diff | view | raw | blame | history
layouts/_shortcodes/since.html 52 ●●●●● diff | view | raw | blame | history