1
0
mirror of https://github.com/gohugoio/hugo.git synced 2024-05-11 05:54:58 +00:00

Merge commit '50ec65fbe1a48475d3320775dab2c47389c02114'

This commit is contained in:
Bjørn Erik Pedersen
2017-07-31 09:21:24 +02:00
50 changed files with 390 additions and 1754 deletions

View File

@@ -38,10 +38,6 @@ Adding new content to the Hugo docs follows the same pattern, regardless of the
hugo new <DOCS-SECTION>/<new-content-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 examples provided in the Hugo docs. This is a known issue [(#452)](https://github.com/gohugoio/hugo/issues/452).
{{% /note %}}
### Add 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.
@@ -92,20 +88,6 @@ Here is a review of the front matter fields automatically generated for you usin
In the body of your function, expand the short description used in the front matter. Include as many examples as possible, and leverage the Hugo docs [`code` shortcode](#adding-code-blocks). If you are unable to add examples but would like to solicit help from the Hugo community, add `needsexample: true` to your front matter.
### Add a New Tutorial
Once you have cloned the Hugo repository, you can create a new tutorial via the following command. Name the markdown file accordingly:
```
hugo new tutorials/my-new-tutorial.md
```
The archetype for the `tutorials` content type is as follows:
{{< code file="archetypes/tutorials.md" >}}
{{< readfile file="/themes/gohugoioTheme/archetypes/tutorials.md">}}
{{< /code >}}
## Add Code Blocks
Code blocks are crucial for providing examples of Hugo's new features to end users of the Hugo docs. Whenever possible, create examples that you think Hugo users will be able to implement in their own projects.
@@ -223,12 +205,10 @@ The `output` shortcode is almost identical to the `code` shortcode but only take
The preceding `output` example will render as follows to the Hugo docs:
{{% output file="post/my-first-post/index.html" %}}
```
{{< output file="post/my-first-post/index.html" >}}
<h1>This is my First Hugo Blog Post</h1>
<p>I am excited to be using Hugo.</p>
```
{{% /output %}} -->
{{< /output >}} -->
## Blockquotes
@@ -278,13 +258,11 @@ Here is a piece of information I would like to draw your **attention** to.
#### Example `note` Output
{{% output file="note-with-heading.html" %}}
```
{{< output file="note-with-heading.html" >}}
{{% note %}}
Here is a piece of information I would like to draw your **attention** to.
{{% /note %}}
```
{{% /output %}}
{{< /output >}}
#### Example `note` Display
@@ -306,13 +284,11 @@ Here's a bit of advice to improve your productivity with Hugo.
#### Example `tip` Output
{{% output file="tip-output.html" %}}
```
{{< output file="tip-output.html" >}}
{{% tip %}}
Here's a bit of advice to improve your productivity with Hugo.
{{% /tip %}}
```
{{% /output %}}
{{< /output >}}
#### Example `tip` Display
@@ -334,13 +310,11 @@ This is a warning, which should be reserved for *important* information like bre
#### Example `warning` Output
{{% output file="warning-admonition-output.html" %}}
```
{{< output file="warning-admonition-output.html" >}}
{{% warning %}}
This is a warning, which should be reserved for *important* information like breaking changes.
{{% /warning %}}
```
{{% /output %}}
{{< /output >}}
#### Example `warning` Display