Remove delimiters in YAML and TOML config examples

The use of `---` and `...` delimiters in the YAML examples seem to
suggest that those delimiters are necessary in a .yaml/.yml file when in
fact they are optional. Also, it seems to be common practice to *not*
use `---` and `...` in .yaml/.yml files. Similarly, it's less common to
use `+++` in .toml files. The examples on TOML's Github repo don't use
it, and Hugo-generated .toml files don't use it either.  This commit
removes the delimiters mentioned above to conform with the more common
styles.

Additionally this modifies the example for shortcut to find
configuration option

- add `cd` to make it clear that user has to change to the hugo site's
  directory first
- separate the command and the output of the command
This commit is contained in:
i-give-up authored and digitalcraftsman committed 2017-10-04 16:36:03 +02:00
1 parent 62d7b269fb
commit ee81931a41
1 file changed
+9 -10
+9 -10
View File
@@ -34,10 +34,9 @@ In your `config` file, you can direct Hugo as to how you want your website rende
## YAML Configuration ## YAML Configuration
The following is a typical example of a YAML configuration file. Note the document opens with 3 hyphens and closes with 3 periods. The values nested under `params:` will populate the [`.Site.Params`][] variable for use in [templates][]: The following is a typical example of a YAML configuration file. The values nested under `params:` will populate the [`.Site.Params`][] variable for use in [templates][]:
{{< code file="config.yml">}} {{< code file="config.yml">}}
---
baseURL: "https://yoursite.example.com/" baseURL: "https://yoursite.example.com/"
title: "My Hugo Site" title: "My Hugo Site"
footnoteReturnLinkContents: "↩" footnoteReturnLinkContents: "↩"
@@ -51,7 +50,6 @@ params:
- "foo1" - "foo1"
- "foo2" - "foo2"
SidebarRecentLimit: 5 SidebarRecentLimit: 5
...
{{< /code >}} {{< /code >}}
### All Variables, YAML ### All Variables, YAML
@@ -59,7 +57,6 @@ params:
The following is the full list of Hugo-defined variables in an example YAML file. The values provided in this example represent the default values used by Hugo. The following is the full list of Hugo-defined variables in an example YAML file. The values provided in this example represent the default values used by Hugo.
{{< code file="config.yml" download="config.yml" >}} {{< code file="config.yml" download="config.yml" >}}
---
archetypeDir: "archetypes" archetypeDir: "archetypes"
# hostname (and path) to the root, e.g. http://spf13.com/ # hostname (and path) to the root, e.g. http://spf13.com/
baseURL: "" baseURL: ""
@@ -172,14 +169,13 @@ watch: true
taxonomies: taxonomies:
- category: "categories" - category: "categories"
- tag: "tags" - tag: "tags"
---
{{< /code >}} {{< /code >}}
## TOML Configuration ## TOML Configuration
The following is an example of a TOML configuration file. The values under `[params]` will populate the `.Site.Params` variable for use in [templates][]: The following is an example of a TOML configuration file. The values under `[params]` will populate the `.Site.Params` variable for use in [templates][]:
``` {{< code file="config.toml">}}
contentDir = "content" contentDir = "content"
layoutDir = "layouts" layoutDir = "layouts"
publishDir = "public" publishDir = "public"
@@ -195,14 +191,13 @@ title = "My Hugo Site"
[params] [params]
subtitle = "Hugo is Absurdly Fast!" subtitle = "Hugo is Absurdly Fast!"
author = "John Doe" author = "John Doe"
``` {{< /code >}}
### All Variables, TOML ### All Variables, TOML
The following is the full list of Hugo-defined variables in an example TOML file. The values provided in this example represent the default values used by Hugo. The following is the full list of Hugo-defined variables in an example TOML file. The values provided in this example represent the default values used by Hugo.
{{< code file="config.toml" download="config.toml">}} {{< code file="config.toml" download="config.toml">}}
+++
archetypeDir = "archetypes" archetypeDir = "archetypes"
# hostname (and path) to the root, e.g. http://spf13.com/ # hostname (and path) to the root, e.g. http://spf13.com/
baseURL = "" baseURL = ""
@@ -309,14 +304,18 @@ watch = true
[taxonomies] [taxonomies]
category = "categories" category = "categories"
tag = "tags" tag = "tags"
+++
{{< /code >}} {{< /code >}}
{{% note %}} {{% note %}}
If you are developing your site on a \*nix machine, here is a handy shortcut for finding a configuration option from the command line: If you are developing your site on a \*nix machine, here is a handy shortcut for finding a configuration option from the command line:
``` ```
~/sites/yourhugosite cd ~/sites/yourhugosite
hugo config | grep emoji hugo config | grep emoji
```
which shows output like
```
enableemoji: true enableemoji: true
``` ```
{{% /note %}} {{% /note %}}