Deployment on Netlify
We recommend using Netlify as a particularly simple way to serve your site from your Git provider (GitHub, GitLab, or BitBucket), with continuous deployment, previews of the generated site when you or your users create pull requests against the doc repo, and more. Netlify is free to use for Open Source projects, with premium tiers if you require greater support.
Before deploying with Netlify, make sure that you’ve pushed your site source to your chosen GitHub (or other provider) repo, following any setup instructions in Using the theme.
Then follow the instructions in Host on Netlify to set up a Netlify account (if you don’t have one already) and authorize access to your GitHub or other Git provider account. Once you’re logged in:
Click New site from Git.
Click your chosen Git provider, then choose your site repo from your list of repos.
In the Deploy settings page:
- Specify your Build command. The exact build command depends on how you
have chosen to use Docsy:
- If you are using Docsy as a Git submodule, specify
cd themes/docsy && git submodule update -f --init && cd ../.. && hugo. You need to specify this rather than justhugoso that Netlify can use the theme’s submodules. - If you are using Docsy as a Hugo module or NPM package, you can just
specify
hugo. Netlify installs dependencies automatically when your site’s base directory includes your Node dependency files (such aspackage.jsonand lock files).
- If you are using Docsy as a Git submodule, specify
- Click Show advanced.
- In the Advanced build settings section, click New variable.
- Specify
NODE_VERSIONas the Key for the new variable, and set its Value to the latest LTS version of Node.js. - In the Advanced build settings section, click New variable.
- Specify
HUGO_VERSIONas the Key for the new variable, and set its Value to the latest version of Hugo. - In the Advanced build settings section, click New variable again.
- Specify
GO_VERSIONas the Key for the new variable, and set its Value to the latest version of Go.
If you don’t want your site to be indexed by search engines, you can add an environment flag to your build command to specify a non-
productionenvironment, as described in Build environments and indexing.- Specify your Build command. The exact build command depends on how you
have chosen to use Docsy:
Click Deploy site.
You can also put the build command and environment variables in a
netlify.toml instead of the Deploy settings UI. See the
Docsy website’s netlify.toml for an example.
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.
Feedback
Cette page est-elle utile?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.