mirror of
https://github.com/gohugoio/hugo.git
synced 2026-09-01 11:12:37 +00:00
Improve the Netlify versioning docs
This commit is contained in:
@@ -59,7 +59,7 @@ Select the repo you want to use for continuous deployment. If you have a large n
|
||||
|
||||
Once selected, you'll be brought to a screen for basic setup. Here you can select the branch you wanted published, your [build command][], and your publish (i.e. deploy) directory. The publish directory should mirror that of what you've set in your [site configuration][config], the default of which is `public`. The following steps assume you are publishing from the `master` branch.
|
||||
|
||||
### Build with a Specific Hugo Version
|
||||
## Build with a Specific Hugo Version
|
||||
|
||||
Setting the build command to `hugo` will build your site according to the current default Hugo version used by Netlify.
|
||||
|
||||
@@ -79,15 +79,21 @@ For production:
|
||||
|
||||
```
|
||||
[context.production.environment]
|
||||
HUGO_VERSION = "0.26"
|
||||
HUGO_VERSION = "0.36"
|
||||
```
|
||||
|
||||
For testing:
|
||||
|
||||
```
|
||||
[context.deploy-preview.environment]
|
||||
HUGO_VERSION = "0.26"
|
||||
```
|
||||
HUGO_VERSION = "0.36"
|
||||
```
|
||||
|
||||
The Netlify configuration file can be a little hard to understand and get right for the different, and you may get some inspiration and tips from this site's `netlify.toml`:
|
||||
|
||||
{{< code file="netlify.toml" nocode="true" >}}
|
||||
{{< readfile file="netlify.toml" highlight="toml" >}}
|
||||
{{< /code >}}
|
||||
|
||||
Selecting "Deploy site" will immediately take you to a terminal for your build:.
|
||||
|
||||
|
||||
@@ -29,4 +29,9 @@ How automate the "publish at intervals" part depends on your situation:
|
||||
|
||||
Also see this Twitter thread:
|
||||
|
||||
{{< tweet 962380712027590657 >}}
|
||||
{{< tweet 962380712027590657 >}}
|
||||
|
||||
## Can I use the latest Hugo version on Netlify?
|
||||
|
||||
Yes you can! Read [this](/hosting-and-deployment/hosting-on-netlify/#build-with-a-specific-hugo-version).
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
{{/* Functionality located within filesaver.js The copy here is located in the css with .copy class so it can be replaced with JS on success */}}
|
||||
{{end}}
|
||||
<div class="code-copy-content nt3" {{with .Get "download"}}id="{{.}}"{{end}}>
|
||||
{{ if $isHTML }}{{- highlight .Inner "html" "" | -}}{{ else }}<pre><code>{{- .Inner | string -}}</code></pre>{{ end }}
|
||||
{{ if .Get "nocode" }}{{ .Inner }}{{ else }}{{ if $isHTML }}{{- highlight .Inner "html" "" | -}}{{ else }}<pre><code>{{- .Inner | string -}}</code></pre>{{ end }}{{ end }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{{$file := .Get "file"}}
|
||||
{{- if eq (.Get "markdown") "true" -}}
|
||||
{{- $file | readFile | markdownify -}}
|
||||
{{- else if (.Get "highlight") -}}
|
||||
{{- highlight ($file | readFile) (.Get "highlight") "" -}}
|
||||
{{- else -}}
|
||||
{{ $file | readFile | safeHTML }}
|
||||
{{- end -}}
|
||||
Reference in New Issue
Block a user