We welcome corrections and improvements to the documentation. The documentation lives in a separate repository from the main project. To contribute:
Follow Google’s developer documentation style guide.
Adhere to these Markdown conventions:
dt).Glossary terms are defined on individual pages, providing a central repository for definitions, though these pages are not directly linked from the site.
Definitions must be complete sentences, with the first sentence defining the term. Italicize the first occurrence of the term and any referenced glossary terms for consistency.
Link to glossary terms using this syntax: [term](g)
Term lookups are case-insensitive, ignore formatting, and support singular and plural forms. For example, all of these variations will link to the same glossary term:
[global resource](g)
[Global Resource](g)
[Global Resources](g)
[`Global Resources`](g)Use the glossary-term shortcode to insert a term definition:
{{% glossary-term "global resource" %}}Link to the glossary as needed and use terms consistently. Pay particular attention to:
When writing the page description use imperative present tense when possible. For example:
Use active voice and present tense wherever possible.
No → With Hugo you can build a static site.
Yes → Build a static site with Hugo.
No → This will cause Hugo to generate HTML files in the public directory.
Yes → Hugo generates HTML files in the public directory.
Use second person instead of third person.
No → Users should exercise caution when deleting files.
Better → You must be cautious when deleting files.
Best → Be cautious when deleting files.
Minimize adverbs.
No → Hugo is extremely fast.
Yes → Hugo is fast.
[!note] “It’s an adverb, Sam. It’s a lazy tool of a weak mind.” (Outbreak, 1995).
Start descriptions in the functions and methods sections with “Returns”, or for boolean values, “Reports whether”.
Enclose directory names, file names, and file paths in backticks, except when used in:
description field in front matterOther best practices:
dt) in backticks unless syntactically necessary.ref or relref shortcodes.This site uses the front matter fields listed in the table below.
Of the four required fields, only title and description require data.
title: The title
description: The description
categories: []
keywords: []This example demonstrates the minimum required front matter fields.
When available, the “See also” sidebar displays related pages using Hugo’s related content feature, based on front matter keywords. We ensure consistent keyword usage by validating them against data/keywords.yaml during the build process. If a keyword is not found, you’ll be alerted and must either modify the keyword or update the data file. This validation process helps to refine the related content for better results.
If the title in the “See also” sidebar is ambiguous or the same as another page, you can define an alternate title in the front matter:
Use of the alternate title is limited to the “See also” sidebar.
[!note] Think carefully before setting the
alt_title. Use it only when absolutely necessary.
With examples of template code:
img and a require whitespace removal on both sides.{{ if eq $foo $bar }}
{{ fmt.Printf "%s is %s" $foo $bar }}
{{ end }}Always specify the language.

When providing a Mardown example, set the code language to “text” to prevent erroneous lexing/highlighting of shortcode calls.
```go-html-template
{{ if eq $foo "bar" }}
{{ print "foo is bar" }}
{{ end }}
```To include a file name header and copy-to-clipboard button:
```go-html-template {file="layouts/_partials/foo.html" copy=true}
{{ if eq $foo "bar" }}
{{ print "foo is bar" }}
{{ end }}
```To wrap the code block within an initially-opened details element using a non-default summary:
```go-html-template {details=true open=true summary="layouts/_partials/foo.html" copy=true}
{{ if eq $foo "bar" }}
{{ print "foo is bar" }}
{{ end }}
```Use this syntax :
```text
{{</* foo */>}}
{{%/* foo */%}}
```Use the code-toggle shortcode to include site configuration examples:
{{< code-toggle file=hugo >}}
baseURL = 'https://example.org/'
languageCode = 'en-US'
title = 'My Site'
{{< /code-toggle >}}Use the code-toggle shortcode to include front matter examples:
{{< code-toggle file=content/posts/my-first-post.md fm=true >}}
title = 'My first post'
date = 2023-11-09T12:56:07-08:00
draft = false
{{< /code-toggle >}}To visually emphasize important information, use callouts (admonitions). Callout types are case-insensitive. Effective March 8, 2025, we utilize only three of the five available types.
Limiting the number of callout types helps us to use them consistently.
> [!note]
> Useful information that users should know, even when skimming content.[!note] Useful information that users should know, even when skimming content.
> [!warning]
> Urgent info that needs immediate user attention to avoid problems.[!warning] Urgent info that needs immediate user attention to avoid problems.
> [!caution]
> Advises about risks or negative outcomes of certain actions.[!caution] Advises about risks or negative outcomes of certain actions.
> [!tip]
> Helpful advice for doing things better or more easily.[!tip] Helpful advice for doing things better or more easily.
> [!important]
> Key information users need to know to achieve their goal.[!important] Key information users need to know to achieve their goal.
These shortcodes are commonly used throughout the documentation. Other shortcodes are available for specialized use.
Use the code-toggle shortcode to display examples of site configuration, front matter, or data files. This shortcode takes these arguments:
string) The section of site.Data.docs.config to render.bool) Whether to display a copy-to-clipboard button. Default is false.string) The section of site.Data.docs to render.string) The file name to display above the rendered code. Omit the file extension for site configuration examples.bool) Whether to render the code as front matter. Default is false.bool) Whether to omit top-level key(s) when rendering a section of site.Data.docs.config.{{< code-toggle file=hugo copy=true >}}
baseURL = 'https://example.org/'
languageCode = 'en-US'
title = 'My Site'
{{< /code-toggle >}}Use the deprecated-in shortcode to indicate that a feature is deprecated:
{{< deprecated-in 0.144.0 >}}
Use [`hugo.IsServer`] instead.
[`hugo.IsServer`]: /functions/hugo/isserver/
{{< /deprecated-in >}}Use the embedded template URL (eturl) shortcode to insert an absolute URL to the source code for an embedded template. The shortcode takes a single argument, the base file name of the template (omit the file extension).
This is a link to the [embedded alias template].
[embedded alias template]: {{% eturl alias %}}Use the glossary-term shortcode to insert the definition of the given glossary term.
{{% glossary-term scalar %}}Use the include shortcode to include content from another page.
{{% include "_common/glob-patterns.md" %}}Use the new-in shortcode to indicate a new feature:
{{< new-in 0.144.0 />}}You can also include details:
{{< new-in 0.144.0 >}}
This is a new feature.
{{< /new-in >}}Use the new-in shortcode to indicate a new feature:
{{< new-in 0.144.0 >}}The “new in” label will be hidden if the specified version is older than a predefined threshold, based on differences in major and minor versions. See details.
Use the deprecated-in shorcode shortcode to indicate that a feature is deprecated:
{{< deprecated-in 0.144.0 >}}
Use [`hugo.IsServer`] instead.
[`hugo.IsServer`]: /functions/hugo/isserver/
{{< /deprecated-in >}}When deprecating a function or method, add something like this to front matter:
Set the expiryDate to two years from the date of deprecation, and add a brief front matter comment to explain the setting.
[!note] This section assumes that you have a working knowledge of Git and GitHub, and are comfortable working on the command line.
Use this workflow to create and submit pull requests.
Fork the documentation repository.
Clone your fork.
Create a new branch with a descriptive name that includes the corresponding issue number, if any:
git checkout -b restructure-foo-page-99999Make changes.
Build the site locally to preview your changes.
Commit your changes with a descriptive commit message:
content, theme, config, all, or misc, followed by a colon, a space, and a brief description of the change beginning with a capital letterFor example:
git commit -m "content: Restructure the taxonomy page
This restructures the taxonomy page by splitting topics into logical
sections, each with one or more examples.
Fixes #9999
Closes #9998"Push the new branch to your fork of the documentation repository.
Visit the documentation repository and create a pull request (PR).
A project maintainer will review your PR and may request changes. You may delete your branch after the maintainer merges your PR.