--- title: Documentation description: Help us to improve the documentation by identifying issues and suggesting changes. categories: [contribute] keywords: [documentation] menu: docs: parent: contribute weight: 30 weight: 30 toc: true aliases: [/contribute/docs/] --- ## Introduction We welcome corrections and improvements to the documentation. Please note that the documentation resides in its own repository, separate from the project repository. For corrections and improvements to the current documentation, please submit issues and pull requests to the [documentation repository]. For documentation related to a new feature, please include the documentation changes when you submit a pull request to the [project repository]. ## Guidelines ### Style Please adhere to Google's [developer documentation style guide]. [developer documentation style guide]: https://developers.google.com/style ### Markdown Please follow these guidelines: - Use [ATX] headings, not [setext] headings, levels 2 through 4 - Use [fenced code blocks], not [indented code blocks] - Use hyphens, not asterisks, with unordered [list items] - Use the [note shortcode] instead of blockquotes or bold text - Do not mix [raw HTML] within Markdown - Do not use bold text instead of a heading or description term (`dt`) - Remove consecutive blank lines (maximum of two) - Remove trailing spaces ### Glossary of terms Each term in the glossary has its own dedicated page located within the `content/en/getting-started/glossary` directory. While these individual glossary pages are not published as standalone web pages during the build process, their content is included in other pages as needed. To link to a term definition on the glossary page, use this custom link syntax: ```text [term](g) ``` Lookups are case-insensitive, ignore formatting, and support both singular and plural forms. For example, all of these variations will link to the same glossary entry: ```text [global resource](g) [Global Resource](g) [Global Resources](g) [`Global Resources`](g) ``` To insert a term definition, use the [`glossary-term`] shortcode: ```text {{%/* glossary-term "global resource" */%}} ``` [glossary of terms]: /getting-started/glossary/ [`glossary-term`]: #glossary-term ### Terminology Please link to the [glossary of terms] when necessary, and use the terms consistently throughout the documentation. Of special note: - The term "front matter" is two words unless you are referring to the configuration key - The term "home page" is two words - The term "website" is one word - The term "standalone" is one word, not hyphenated - Use the word "map" instead of "dictionary" - Use the word "flag" instead of "option" when referring to a command line flag - Capitalize the word "Markdown" - Hyphenate the term "open-source" when used an adjective. Use the [glossary link] (`gl`) shortcode to insert a link to the glossary entry for the given term, and use the [glossary term] (`gt`) shortcode to insert the definition of the given term. ### Page titles and headings Please follow these guidelines for page titles and headings: - Use sentence-style capitalization - Avoid formatted strings in headings and page titles - Shorter is better ### Use active voice with present tense In software documentation, passive voice is unavoidable in some cases. Please use active voice when 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. ### Avoid adverbs when possible 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). {{% /note %}} ### Level 6 headings Level 6 headings are styled as `dt` elements. This was implemented to support a [glossary] with linkable terms. [glossary]: /getting-started/glossary/ ### Function and method descriptions When adding a page to the [functions] or [methods] section, begin the description with the word "Returns". With functions and methods that return a boolean value, begin the description with the phrase "Reports whether". For example: - `Returns the URL aliases as defined in front matter.` - `Reports whether the given page is in the given section.` [functions]: /functions [methods]: /methods ### Directory names, file names, and file paths Enclose directory names, file names, and file paths within backticks, with the following exceptions: - Page titles - Section headings (h1-h6) - Definition list terms - The description field in front matter ### Miscellaneous Other guidelines to consider: - 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. ## 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 delimiters. ### Fenced code blocks Always include the language code when using a fenced code block: ````text ```go-html-template {{ if eq $foo "bar" }} {{ print "foo is bar" }} {{ end }} ``` ```` ```go-html-template {{ if eq $foo "bar" }} {{ print "foo is bar" }} {{ end }} ``` ### Shortcode calls Use this syntax to include shortcodes calls within your code examples: ```text {{*/* foo */*/>}} {{%/*/* foo */*/%}} ``` ```text {{* foo */>}} {{%/* foo */%}} ``` ### Site configuration Use the [code-toggle shortcode] to include site configuration examples: ```text {{* code-toggle file=hugo */>}} baseURL = 'https://example.org/' languageCode = 'en-US' title = 'My Site' {{* /code-toggle */>}} ``` {{< code-toggle file=hugo >}} baseURL = 'https://example.org/' languageCode = 'en-US' title = 'My Site' {{< /code-toggle >}} ### Front matter Use the [code-toggle shortcode] to include front matter examples: ```text {{* 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 */>}} ``` {{< 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 >}} ### Other code examples Use the [code shortcode] for other code examples that require a file name: ```text {{* code file=layouts/_default/single.html */>}} {{ range .Site.RegularPages }}