We welcome corrections and improvements to the documentation. Please note that the documentation resides in its own repository, separate from the project repository.
Although we do not strictly adhere to the [Microsoft Writing Style Guide], it is an excellent resource for questions related to style, grammar, and voice.
- Do not place list items directly under a heading; include an introductory sentence or phrase before the list.
- Avoid use of **bold** text. Use the [note shortcode] to draw attention to important content.
- Do not place description terms (`dt`) within backticks unless required for syntactic clarity.
- Do not use Hugo's `ref` or `relref` shortcodes. We use a link render hook to resolve and validate link destinations, including fragments.
- Shorter is better. If there is more than one way to do something, describe the current best practice. For example, avoid phrases such as "you can also do..." and "in older versions you had to..."
- When including code samples, use short snippets that demonstrate the concept.
- The Hugo user community is global; use [basic english](https://simple.wikipedia.org/wiki/Basic_English) when possible.
#### Level 6 markdown headings
Level 6 markdown headings are styled as `dt` elements. This was implemented to support a [glossary] with linkable terms.
[glossary]: /getting-started/glossary
## Code examples
Indent code by two spaces. With examples of template code, include a space after opening action delimiters, and include a space before closing action delimeters.
These shortcodes are commonly used throughout the documentation. Other shortcodes are available for specialized use.
### deprecated-in
Use the “deprecated-in” shortcode to indicate that a feature is deprecated:
```text
{{%/* deprecated-in 0.120.0 */%}}
Use [`hugo.IsServer`] instead.
[`hugo.IsServer`]: /functions/hugo/isserver
{{%/* /deprecated-in */%}}
```
Rendered:
{{% deprecated-in 0.120.0 %}}
Use [`hugo.IsServer`] instead.
[`hugo.IsServer`]: /functions/hugo/isserver
{{% /deprecated-in %}}
### code
Use the "code" shortcode for other code examples that require a file name. See the [code examples] above. This shortcode takes these arguments:
copy
: (`bool`) Whether to display a copy-to-clipboard button. Default is `false`.
file
: (`string`) The file name to display.
lang
: (`string`) The code language. If you do not provide a `lang` argument, the code language is determined by the file extension. If the file extension is "html", sets the code language to `go-html-template`. Default is `text`.
Use the "code-toggle" shortcode to display examples of site configuration, front matter, or data files. See the [code examples] above. This shortcode takes these arguments:
Use the "new-in" shortcode to indicate a new feature:
{{<codefile=content/something/foo.mdlang=text>}}
{{</* new-in 0.120.0 */>}}
{{</code>}}
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](https://github.com/gohugoio/hugoDocs/blob/master/layouts/shortcodes/new-in.html).
## Deprecated features
Use the "deprecated-in" shortcode to indicate that a feature is deprecated:
{{<codefile=content/something/foo.md>}}
{{%/* deprecated-in 0.120.0 */%}}
Use [`hugo.IsServer`] instead.
[`hugo.IsServer`]: /functions/hugo/isserver
{{%/* /deprecated-in */%}}
{{</code>}}
When deprecating a function or method, add this to front matter:
Use this workflow to create and submit pull requests.
Step 1
: Fork the [documentation repository].
Step 2
: Clone your fork.
Step 3
: Create a new branch with a descriptive name.
```sh
git checkout -b fix/typos-shortcode-templates
```
Step 4
: Make changes.
Step 5
: Commit your changes with a descriptive commit message, typically 50 characters or less. Add the "Closes" keyword if your change addresses one or more open [issues].
```sh
git commit -m "Fix typos on the shortcode templates page
Closes #1234
Closes #5678"
```
Step 5
: Push the new branch to your fork of the documentation repository.
Step 6
: Visit the [documentation repository] and create a pull request (PR).
Step 7
: A project maintainer will review your PR and may request changes. You may delete your branch after the maintainer merges your PR.