Skip to content

Commit

Permalink
Remove delimiters in YAML and TOML config examples
Browse files Browse the repository at this point in the history
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
  • Loading branch information
i-give-up authored and digitalcraftsman committed Oct 4, 2017
1 parent 62d7b26 commit ee81931
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions content/getting-started/configuration.md
Expand Up @@ -34,10 +34,9 @@ In your `config` file, you can direct Hugo as to how you want your website rende

## 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">}}
---
baseURL: "https://yoursite.example.com/"
title: "My Hugo Site"
footnoteReturnLinkContents: "↩"
Expand All @@ -51,15 +50,13 @@ params:
- "foo1"
- "foo2"
SidebarRecentLimit: 5
...
{{< /code >}}

### All Variables, YAML

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" >}}
---
archetypeDir: "archetypes"
# hostname (and path) to the root, e.g. http://spf13.com/
baseURL: ""
Expand Down Expand Up @@ -172,14 +169,13 @@ watch: true
taxonomies:
- category: "categories"
- tag: "tags"
---
{{< /code >}}

## 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][]:

```
{{< code file="config.toml">}}
contentDir = "content"
layoutDir = "layouts"
publishDir = "public"
Expand All @@ -195,14 +191,13 @@ title = "My Hugo Site"
[params]
subtitle = "Hugo is Absurdly Fast!"
author = "John Doe"
```
{{< /code >}}

### 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.

{{< code file="config.toml" download="config.toml">}}
+++
archetypeDir = "archetypes"
# hostname (and path) to the root, e.g. http://spf13.com/
baseURL = ""
Expand Down Expand Up @@ -309,14 +304,18 @@ watch = true
[taxonomies]
category = "categories"
tag = "tags"
+++
{{< /code >}}

{{% 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:
```
~/sites/yourhugosite
cd ~/sites/yourhugosite
hugo config | grep emoji
```

which shows output like

```
enableemoji: true
```
{{% /note %}}
Expand Down

0 comments on commit ee81931

Please sign in to comment.