Skip to content

Commit

Permalink
Merge pull request #412 from google/LisaFC-patch-4
Browse files Browse the repository at this point in the history
Clarify instructions for Netlify dependencies
  • Loading branch information
LisaFC committed Jan 12, 2021
2 parents 067b6c4 + 056c0da commit b7562e9
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion userguide/content/en/docs/Deployment/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,21 @@ Then follow the instructions in [Host on Netlify](https://gohugo.io/hosting-and-
1. (Optional) Click **New variable** again, and this time set `HUGO_ENV` to `production`. Do this if you want your site to be indexed by search engines. You must do this if you want to use a [Google Custom Search Engine](/docs/adding-content/navigation/#configure-search-with-a-google-custom-search-engine).
1. Click **Deploy site**.

Alternatively, you can follow the same instructions but specify your **Deploy settings** in a [`netlify.toml` file](https://docs.netlify.com/configure-builds/file-based-configuration/) in your repo rather than in the **Deploy settings** page. You can see an example of this in the [Docsy theme repo](https://github.com/google/docsy/blob/master/netlify.toml).
{{% alert title="Note" color="primary" %}}
Netlify uses your site repo's `package.json` file to install any JavaScript dependencies (like `postcss`) before building your site. If you haven't just copied our example site's version of this file, make sure that you've specified all our [prerequisites](/docs/getting-started/#install-postcss).

For example, if you want to use a version of `postcss-cli` later than version 8.0.0, you need to ensure that your `package.json` also specifies `postcss` separately:

```
"devDependencies": {
"autoprefixer": "^9.8.6",
"postcss-cli": "^8.0.0",
"postcss": "^8.0.0"
}
```
{{% /alert %}}

Alternatively, you can follow the same instructions but specify your **Deploy settings** in a [`netlify.toml` file](https://docs.netlify.com/configure-builds/file-based-configuration/) in your repo rather than in the **Deploy settings** page. You can see an example of this in the [Docsy theme repo](https://github.com/google/docsy/blob/master/netlify.toml) (though note that the build command here is a little unusual because the Docsy user guide is *inside* the theme repo).

If you have an existing deployment you can view and update the relevant information by selecting the site from your list of sites in Netlify, then clicking **Site settings** - **Build and deploy**. Ensure that **Ubuntu Xenial 16.04** is selected in the **Build image selection** section - if you're creating a new deployment this is used by default. You need to use this image to run the extended version of Hugo.

0 comments on commit b7562e9

Please sign in to comment.