Files
hugo/content/contribute/documentation.md
T
2017-02-26 19:27:05 -06:00

15 KiB

title, linktitle, description, date, publishdate, lastmod, categories, tags, weight, draft, aliases, toc, needsreview
title linktitle description date publishdate lastmod categories tags weight draft aliases toc needsreview
Contribute to the Hugo Docs Contribute to the Hugo Docs Documentation is an integral part of any open source project. The Hugo docs are as much a work in progress as the source it attempts to teach its users. 2017-02-01 2017-02-01 2017-02-01
contribute to hugo
docs
documentation
community
contribute
20 false
/contribute/docs/
true true

Documentation is a critical component of any open-source project. The Hugo docs were completely reworked for the release of v0.19, but there is always room for improvement.

Create Your Fork

It's best to make changes to the Hugo docs on your local machine to check for consistent visual styling. Make sure you've created a fork of Hugo on GitHub and cloned the repository locally on your computer. For more information, you can use the GitHub docs for "forking" or see Hugo's extensive development contribution guide.

You can then create a separate branch for your additions. Note that you can choose a different descriptive branch name that best fits the type of content. The following is an example of a branch name you might use for adding a new website to the showcase:

git checkout -b jon-doe-showcase-addition

Adding New Content

The Hugo docs are built using Hugo and therefore make heavy use of Hugo's archetypes feature to easily scaffold new instances of content types. All content sections in Hugo documentation have an assigned archetype (see the Hugo docs archetype source).

Adding new content follows the same pattern, regardless of the content section:

hugo new <docssection>/<newcontent-all-lowercase.md>

{{% note "title:, date:, and Field Order" %}} title and date fields are added automatically when using archetypes via hugo new. Do not be worried if the order of the new file's front matter fields on your local machine is different than that of the following examples. This is a known issue (#452). {{% /note %}}

Adding a New Function

Once you have cloned the Hugo repository, you can create a new function via the following command. Keep the file name lowercase.

hugo new functions/newfunction.md

The archetype for the functions content type is as follows:

{{% code file="archetypes/functions.md" %}}

{{< readfile file="archetypes/functions.md">}}

{{% /code %}}

Function Required Fields

Adding to the Showcase

Once you have cloned the Hugo repository, you can add your Hugo website as a new showcase content file via the following command. Name the markdown file accordingly:

hugo new tutorials/my-hugo-showcase-website.md

The archetype for the showcase content type is as follows:

{{% code file="archetypes/showcase.md" %}}

{{< readfile file="archetypes/showcase.md">}}

{{% /code %}}

Showcase Required Fields

sitelink
the full URL to your website
title
the `