mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-15 02:17:05 +00:00
Improve the Netlify versioning docs
This commit is contained in:
4 files changed
+19
-6
No files matched your search
@@ -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.
|
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.
|
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]
|
[context.production.environment]
|
||||||
HUGO_VERSION = "0.26"
|
HUGO_VERSION = "0.36"
|
||||||
```
|
```
|
||||||
|
|
||||||
For testing:
|
For testing:
|
||||||
|
|
||||||
```
|
```
|
||||||
[context.deploy-preview.environment]
|
[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:.
|
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:
|
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 */}}
|
{{/* 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}}
|
{{end}}
|
||||||
<div class="code-copy-content nt3" {{with .Get "download"}}id="{{.}}"{{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>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
{{$file := .Get "file"}}
|
{{$file := .Get "file"}}
|
||||||
{{- if eq (.Get "markdown") "true" -}}
|
{{- if eq (.Get "markdown") "true" -}}
|
||||||
{{- $file | readFile | markdownify -}}
|
{{- $file | readFile | markdownify -}}
|
||||||
|
{{- else if (.Get "highlight") -}}
|
||||||
|
{{- highlight ($file | readFile) (.Get "highlight") "" -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{ $file | readFile | safeHTML }}
|
{{ $file | readFile | safeHTML }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
Reference in new issue
Block a user