Ananke Documentation
  • Get started
    • Choose an installation method
    • Install as a Hugo Module (recommended)
    • Install as a Git submodule
    • Upgrade from theNewDynamic to gohugo-ananke
  • Configuration
    • General configuration
    • Homepage
    • Menus
    • Social media networks
    • SEO
    • robots.txt and environments
    • Analytics
    • Multilingual and i18n
    • Configuration reference
  • Content
    • Front matter
    • Authors and read more links
    • Content types and archetypes
    • Images
    • Summaries and reading time
    • Taxonomies
    • Shortcodes
  • Customisation
    • Colours
    • Styles
    • Custom CSS
    • Page headers
    • Header layout and hooks
    • Comments
    • Overriding partials
    • Layout map
    • Hooks & filters
  • Examples
    • Minimal blog
    • Multilingual site
    • No-blog static site
    • External links
    • Add a LinkedIn icon
  • Help
    • Troubleshooting
    • Contributing to the documentation
    • Contributors
    • Developing across the Ananke repositories
Mastodon

Shortcodes

Shortcodes are small snippets you place in your Markdown content to render something the theme provides. Ananke ships the following shortcodes. Each entry lists what it does, its parameters, and an example.

edit-page #

  • Purpose: render an “Improve this page on GitHub” link to edit the current page’s source file. Readers without write access are automatically offered GitHub’s fork-and-propose-changes flow.

  • Syntax: {{< edit-page >}} or, targeting a specific branch, {{< edit-page branch="development" >}}.

  • Parameters:

    • branch (optional) — passed as the first positional argument or as a named branch argument. Overrides the configured branch for this page only.
  • Output: an anchor styled as a badge linking to the GitHub editor for the page’s source file.

  • Example:

    go-html-template
    {{< edit-page >}}
  • Common mistakes: using it without setting params.ananke.shortcodes.edit_page.repo_url (a build-time warning is printed and nothing is rendered).

See the Edit page page for configuration and for showing the link automatically below every page.

form-contact #

  • Purpose: render a styled, accessible contact form.

  • Syntax: {{< form-contact action="URL" >}}

  • Parameters:

    • action (required) — the URL that receives the form POST.
  • Output: an HTML form with name, email, and message fields and a Send button.

  • Example:

    go-html-template
    {{< form-contact action="https://formspree.io/your@email.com" >}}
  • Common mistakes: omitting action (the form then has nowhere to submit); expecting Netlify Forms to work without overriding the shortcode.

See the Contact Form page for full details, backends, and spam-protection notes.

page-index #

  • Purpose: render an index of all regular pages of the site, grouped by top-level section. The homepage of this documentation uses it.

  • Syntax: {{< page-index >}}

  • Parameters: none.

  • Output: one heading for each top-level section, sorted by the section’s weight, followed by a list of links to the pages in that section.

  • Example:

    go-html-template
    {{< page-index >}}
  • Common mistakes: expecting it to list only the pages of the current section. It always lists the pages of the whole site.

since #

  • Purpose: render a small badge linking to the release where a feature was introduced (for example “since 2.17.0”).

  • Syntax: {{< since "2.17.0" >}} or, reading the version from front matter, {{< since >}}.

  • Parameters:

    • version (optional) — passed as the first positional argument or as a named version argument. If omitted, the page’s since front matter value is used.
  • Output: an anchor styled as a badge linking to the matching release tag.

  • Example:

    go-html-template
    {{< since "2.17.0" >}}
  • Common mistakes: calling it with no argument on a page that has no since front matter (a build-time warning is printed and nothing is rendered).

See the Since page for configuring the release URL and front-matter usage.


[!NOTE] This list reflects the shortcodes in the theme’s layouts/_shortcodes directory. If you add your own shortcodes in your project’s layouts/_shortcodes, they are available too but are not documented here.

In this section

  • Contact form

    Add a styled contact form to a page with the form-contact shortcode.

  • Edit page

    Add a link that opens the source file of the current page in the GitHub editor.

  • Since

    Show a badge with the theme release that introduced a feature.

Ananke Documentation © Ananke Documentation 2026
Mastodon