Add OS env to faq

This commit is contained in:
Bjørn Erik Pedersen 2018-02-27 11:08:23 +01:00
parent 414f0dbc65
commit e07eda273b
No known key found for this signature in database
GPG Key ID: 330E6E2BD4859D8F
2 changed files with 11 additions and 2 deletions

View File

@ -309,7 +309,7 @@ enableemoji: true
```
{{% /note %}}
## Environmental Variables
## Configure with Environment Variables
In addition to the 3 config options already mentioned, configuration key-values can be defined through operating system environment variables.
@ -319,10 +319,16 @@ For example, the following command will effectively set a website's title on Uni
$ env HUGO_TITLE="Some Title" hugo
```
This is really useful if you use a service such as Netlify to deploy your site. Look at the Hugo docs [Netlify configuration file](https://github.com/gohugoio/hugoDocs/blob/master/netlify.toml) for an example.
{{% note "Setting Environment Variables" %}}
Names must be prefixed with `HUGO_` and the configuration key must be set in uppercase when setting operating system environment variables.
{{% /note %}}
{{< todo >}}
Test and document setting params via JSON env var.
{{< /todo >}}
## Ignore Files When Rendering
The following statement inside `./config.toml` will cause Hugo to ignore files ending with `.foo` and `.boo` when rendering:

View File

@ -17,6 +17,10 @@ aliases: [/faq/]
**Note:** The answers/solutions presented below are short, and may not be note be enough to solve your problem. Visit [Hugo Discourse](https://discourse.gohugo.io/) and use the search. It that does not help, start a new topic and ask your questions.
{{% /note %}}
## Can I set configuration variables via OS environment?
Yes you can! See [Configure with Environment Variables](/getting-started/configuration/#configure-with-environment-variables).
## How do I schedule posts?
1. Set `publishDate` in the page [Front Matter](/content-management/front-matter/) to a date in the future.
@ -34,4 +38,3 @@ Also see this Twitter thread:
## Can I use the latest Hugo version on Netlify?
Yes you can! Read [this](/hosting-and-deployment/hosting-on-netlify/#configure-hugo-version-in-netlify).