Merge commit '766085c2dc6fc95ac30fda2a9ebde2355fc12554'
|
@ -53,12 +53,13 @@ toc: true
|
||||||
* Integrated [Google Analytics][] support
|
* Integrated [Google Analytics][] support
|
||||||
* Automatic [RSS][] creation
|
* Automatic [RSS][] creation
|
||||||
* Support for [Go][], [Amber], and [Ace][] HTML templates
|
* Support for [Go][], [Amber], and [Ace][] HTML templates
|
||||||
* [Syntax highlighting][] powered by [Pygments][]
|
* [Syntax highlighting][] powered by [Chroma][] (partly compatible with Pygments)
|
||||||
|
|
||||||
|
|
||||||
[Ace]: /templates/alternatives/
|
[Ace]: /templates/alternatives/
|
||||||
[aliases]: /content-management/urls/#aliases
|
[aliases]: /content-management/urls/#aliases
|
||||||
[Amber]: https://github.com/eknkc/amber
|
[Amber]: https://github.com/eknkc/amber
|
||||||
|
[Chroma]: https://github.com/alecthomas/chroma
|
||||||
[content summaries]: /content-management/summaries/
|
[content summaries]: /content-management/summaries/
|
||||||
[content types]: /content-management/types/
|
[content types]: /content-management/types/
|
||||||
[Disqus]: https://disqus.com/
|
[Disqus]: https://disqus.com/
|
||||||
|
@ -77,7 +78,6 @@ toc: true
|
||||||
[Permalink]: /content-management/urls/#permalinks
|
[Permalink]: /content-management/urls/#permalinks
|
||||||
[Powerful theming]: /themes/
|
[Powerful theming]: /themes/
|
||||||
[Pretty URLs]: /content-management/urls/
|
[Pretty URLs]: /content-management/urls/
|
||||||
[Pygments]: http://pygments.org/
|
|
||||||
[RSS]: /templates/rss/
|
[RSS]: /templates/rss/
|
||||||
[Shortcodes]: /content-management/shortcodes/
|
[Shortcodes]: /content-management/shortcodes/
|
||||||
[sort content]: /templates/
|
[sort content]: /templates/
|
||||||
|
|
|
@ -44,7 +44,7 @@ Hugo is for people building a blog, a company site, a portfolio site, documentat
|
||||||
[@spf13]: https://twitter.com/@spf13
|
[@spf13]: https://twitter.com/@spf13
|
||||||
[Aerobatic]: https://www.aerobatic.com/
|
[Aerobatic]: https://www.aerobatic.com/
|
||||||
[Amazon S3]: https://aws.amazon.com/s3/
|
[Amazon S3]: https://aws.amazon.com/s3/
|
||||||
[Azure]: https://blogs.msdn.microsoft.com/acoat/2016/01/28/publish-a-static-web-site-using-azure-web-apps/
|
[Azure]: https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-static-website
|
||||||
[CloudFront]: https://aws.amazon.com/cloudfront/ "Amazon CloudFront"
|
[CloudFront]: https://aws.amazon.com/cloudfront/ "Amazon CloudFront"
|
||||||
[DreamHost]: https://www.dreamhost.com/
|
[DreamHost]: https://www.dreamhost.com/
|
||||||
[Firebase]: https://firebase.google.com/docs/hosting/ "Firebase static hosting"
|
[Firebase]: https://firebase.google.com/docs/hosting/ "Firebase static hosting"
|
||||||
|
|
|
@ -41,7 +41,11 @@ For many websites, this is enough configuration. However, you also have the opti
|
||||||
|
|
||||||
### Render Hugo's Built-in Disqus Partial Template
|
### Render Hugo's Built-in Disqus Partial Template
|
||||||
|
|
||||||
See [Partial Templates][partials] to learn how to add the Disqus partial to your Hugo website's templates.
|
Disqus has its own [internal template](https://gohugo.io/templates/internal/#disqus) available, to render it add the following code where you want comments to appear:
|
||||||
|
|
||||||
|
```
|
||||||
|
{{ template "_internal/disqus.html" . }}
|
||||||
|
```
|
||||||
|
|
||||||
## Comments Alternatives
|
## Comments Alternatives
|
||||||
|
|
||||||
|
|
|
@ -17,10 +17,10 @@ menu:
|
||||||
|
|
||||||
## The Image Page Resource
|
## The Image Page Resource
|
||||||
|
|
||||||
The `image` is a [Page Resource]({{< relref "content-management/page-resources" >}}), and the processing methods listed below does not work on images inside your `/static` folder.
|
The `image` is a [Page Resource]({{< relref "/content-management/page-resources" >}}), and the processing methods listed below does not work on images inside your `/static` folder.
|
||||||
|
|
||||||
|
|
||||||
To get all images in a [Page Bundle]({{< relref "content-management/organization#page-bundles" >}}):
|
To get all images in a [Page Bundle]({{< relref "/content-management/organization#page-bundles" >}}):
|
||||||
|
|
||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
|
|
|
@ -231,7 +231,7 @@ By setting the `translationKey` front matter param to `about` in all three pages
|
||||||
|
|
||||||
Because paths and filenames are used to handle linking, all translated pages, except for the language part, will be sharing the same url.
|
Because paths and filenames are used to handle linking, all translated pages, except for the language part, will be sharing the same url.
|
||||||
|
|
||||||
To localize the URLs, the [`slug`]({{< ref "content-management/organization/index.md#slug" >}}) or [`url`]({{< ref "content-management/organization/index.md#url" >}}) front matter param can be set in any of the non-default language file.
|
To localize the URLs, the [`slug`]({{< ref "/content-management/organization/index.md#slug" >}}) or [`url`]({{< ref "/content-management/organization/index.md#url" >}}) front matter param can be set in any of the non-default language file.
|
||||||
|
|
||||||
For example, a french translation (`content/about.fr.md`) can have its own localized slug.
|
For example, a french translation (`content/about.fr.md`) can have its own localized slug.
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ toc: true
|
||||||
|
|
||||||
Hugo `0.32` announced page-relative images and other resources packaged into `Page Bundles`.
|
Hugo `0.32` announced page-relative images and other resources packaged into `Page Bundles`.
|
||||||
|
|
||||||
These terms are connected, and you also need to read about [Page Resources]({{< relref "content-management/page-resources" >}}) and [Image Processing]({{< relref "content-management/image-processing" >}}) to get the full picture.
|
These terms are connected, and you also need to read about [Page Resources]({{< relref "/content-management/page-resources" >}}) and [Image Processing]({{< relref "/content-management/image-processing" >}}) to get the full picture.
|
||||||
|
|
||||||
{{% imgproc 1-featured Resize "300x" %}}
|
{{% imgproc 1-featured Resize "300x" %}}
|
||||||
The illustration shows 3 bundles. Note that the home page bundle cannot contain other content pages, but other files (images etc.) are fine.
|
The illustration shows 3 bundles. Note that the home page bundle cannot contain other content pages, but other files (images etc.) are fine.
|
||||||
|
|
|
@ -42,7 +42,7 @@ $scratch := newScratch
|
||||||
$scratch.Set "greeting" "Hello"
|
$scratch.Set "greeting" "Hello"
|
||||||
```
|
```
|
||||||
|
|
||||||
A `Scratch` is also added to both `Page` and `Shortcode`. `Sratch` have the following methods:
|
A `Scratch` is also added to both `Page` and `Shortcode`. `Scratch` has the following methods:
|
||||||
|
|
||||||
#### .Set
|
#### .Set
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ Hugo currently provides pre-built binaries for the following:
|
||||||
* OpenBSD
|
* OpenBSD
|
||||||
* FreeBSD
|
* FreeBSD
|
||||||
|
|
||||||
Hugo may also be compiled from source wherever the Go compiler tool chain can run; e.g., on other operating systems such as DragonFly BSD, OpenBSD, Plan 9, Solaris, and others. See <https://golang.org/doc/install/source> for the full set of supported combinations of target operating systems and compilation architectures.
|
Hugo may also be compiled from source wherever the Go toolchain can run; e.g., on other operating systems such as DragonFly BSD, OpenBSD, Plan 9, Solaris, and others. See <https://golang.org/doc/install/source> for the full set of supported combinations of target operating systems and compilation architectures.
|
||||||
|
|
||||||
## Quick Install
|
## Quick Install
|
||||||
|
|
||||||
|
@ -82,9 +82,11 @@ go get github.com/magefile/mage
|
||||||
go get -d github.com/gohugoio/hugo
|
go get -d github.com/gohugoio/hugo
|
||||||
cd ${GOPATH:-$HOME/go}/src/github.com/gohugoio/hugo
|
cd ${GOPATH:-$HOME/go}/src/github.com/gohugoio/hugo
|
||||||
mage vendor
|
mage vendor
|
||||||
mage install
|
HUGO_BUILD_TAGS=extended mage install
|
||||||
{{< /code >}}
|
{{< /code >}}
|
||||||
|
|
||||||
|
Remove `HUGO_BUILD_TAGS=extended` if you do not want Sass/SCSS support.
|
||||||
|
|
||||||
{{% note %}}
|
{{% note %}}
|
||||||
If you are a Windows user, substitute the `$HOME` environment variable above with `%USERPROFILE%`.
|
If you are a Windows user, substitute the `$HOME` environment variable above with `%USERPROFILE%`.
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
@ -420,50 +422,43 @@ Directory of C:\hugo\sites\example.com
|
||||||
|
|
||||||
### Snap Package
|
### Snap Package
|
||||||
|
|
||||||
In any of the [Linux distributions that support snaps][snaps]:
|
In any of the [Linux distributions that support snaps][snaps], you may install install the "extended" Sass/SCSS version with this command:
|
||||||
|
|
||||||
```
|
snap install hugo --channel=extended
|
||||||
snap install hugo
|
|
||||||
```
|
|
||||||
|
|
||||||
### Debian and Ubuntu
|
To install the non-extended version without Sass/SCSS support:
|
||||||
|
|
||||||
Debian and Ubuntu provide a `hugo` version via `apt-get`:
|
snap install hugo
|
||||||
|
|
||||||
```
|
To switch between the two, use either `snap refresh hugo --channel=extended` or `snap refresh hugo --channel=stable`.
|
||||||
sudo apt-get install hugo
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Pros
|
|
||||||
|
|
||||||
* Native Debian/Ubuntu package maintained by Debian Developers
|
|
||||||
* Pre-installed bash completion script and `man` pages
|
|
||||||
|
|
||||||
#### Cons
|
|
||||||
|
|
||||||
* Might not be the latest version, especially if you are using an older, stable version (e.g., Ubuntu 16.04 LTS). Until backports and PPA are available, you may consider installing the Hugo snap package to get the latest version of Hugo.
|
|
||||||
|
|
||||||
{{% note %}}
|
{{% note %}}
|
||||||
Hugo-as-a-snap can write only inside the user’s `$HOME` directory---and gvfs-mounted directories owned by the user---because of Snaps’ confinement and security model. More information is also available [in this related GitHub issue](https://github.com/gohugoio/hugo/issues/3143). Use ```sudo snap install hugo --classic``` to disable the default security model if you want hugo to be able to have write access in other paths besides the user’s `$HOME` directory.
|
Hugo-as-a-snap can write only inside the user’s `$HOME` directory---and gvfs-mounted directories owned by the user---because of Snaps’ confinement and security model. More information is also available [in this related GitHub issue](https://github.com/gohugoio/hugo/issues/3143). Use ```sudo snap install hugo --classic``` to disable the default security model if you want hugo to be able to have write access in other paths besides the user’s `$HOME` directory.
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
|
### Debian and Ubuntu
|
||||||
|
|
||||||
|
[@anthonyfok](https://github.com/anthonyfok) and friends in the [Debian Go Packaging Team](https://go-team.pages.debian.net/) maintains an official hugo [Debian package](https://packages.debian.org/hugo) which is shared with [Ubuntu](https://packages.ubuntu.com/hugo) and is installable via `apt-get`:
|
||||||
|
|
||||||
|
sudo apt-get install hugo
|
||||||
|
|
||||||
|
This installs the "extended" Sass/SCSS version.
|
||||||
|
|
||||||
### Arch Linux
|
### Arch Linux
|
||||||
|
|
||||||
You can also install Hugo from the Arch Linux [community](https://www.archlinux.org/packages/community/x86_64/hugo/) repository. Applies also for derivatives such as Manjaro.
|
You can also install Hugo from the Arch Linux [community](https://www.archlinux.org/packages/community/x86_64/hugo/) repository. Applies also to derivatives such as Manjaro.
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo pacman -Syu hugo
|
sudo pacman -Syu hugo
|
||||||
```
|
```
|
||||||
|
|
||||||
### Fedora
|
### Fedora, Red Hat and CentOS
|
||||||
|
|
||||||
Fedora provides a package for Hugo. The installation is done with the command :
|
Fedora maintains an [official package for Hugo](https://apps.fedoraproject.org/packages/hugo) which may be installed with:
|
||||||
|
|
||||||
```
|
sudo dnf install hugo
|
||||||
sudo dnf install hugo
|
|
||||||
```
|
|
||||||
|
|
||||||
### CentOS, and Red Hat
|
For the latest version, the Hugo package maintained by [@daftaupe](https://github.com/daftaupe) at Fedora Copr is recommended:
|
||||||
|
|
||||||
* <https://copr.fedorainfracloud.org/coprs/daftaupe/hugo/>
|
* <https://copr.fedorainfracloud.org/coprs/daftaupe/hugo/>
|
||||||
|
|
||||||
|
@ -473,9 +468,8 @@ See the [related discussion in the Hugo forums][redhatforum].
|
||||||
|
|
||||||
OpenBSD provides a package for Hugo via `pkg_add`:
|
OpenBSD provides a package for Hugo via `pkg_add`:
|
||||||
|
|
||||||
```
|
doas pkg_add hugo
|
||||||
doas pkg_add hugo
|
|
||||||
```
|
|
||||||
|
|
||||||
## Upgrade Hugo
|
## Upgrade Hugo
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ For improved readability, the Hugo Pipes examples of this documentation will be
|
||||||
### Method aliases
|
### Method aliases
|
||||||
|
|
||||||
Each Hugo Pipes `resources` transformation method uses a __camelCased__ alias (`toCSS` for `resources.ToCSS`).
|
Each Hugo Pipes `resources` transformation method uses a __camelCased__ alias (`toCSS` for `resources.ToCSS`).
|
||||||
Non-transformation methods deprived of such aliases are `resources.Get`, `resources.FromString` and `resources.ExecuteAsTemplate`.
|
Non-transformation methods deprived of such aliases are `resources.Get`, `resources.FromString`, `resources.ExecuteAsTemplate` and `resources.Concat`.
|
||||||
|
|
||||||
The example above can therefore also be written as follows:
|
The example above can therefore also be written as follows:
|
||||||
```go-html-template
|
```go-html-template
|
||||||
|
|
|
@ -36,7 +36,10 @@ precision [int]
|
||||||
enableSourceMap [bool]
|
enableSourceMap [bool]
|
||||||
: When enabled, a source map will be generated.
|
: When enabled, a source map will be generated.
|
||||||
|
|
||||||
|
includePaths [string slice]
|
||||||
|
: Additional SCSS/SASS include paths. Paths must be relative to the project directory.
|
||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
{{ $options := (dict "targetPath" "style.css" "outputStyle" "compressed" "enableSourceMap" true) }}
|
{{ $options := (dict "targetPath" "style.css" "outputStyle" "compressed" "enableSourceMap" true "includePaths" (slice "node_modules/myscss")) }}
|
||||||
{{ $style := resources.Get "sass/main.scss" | resources.ToCSS $options }}
|
{{ $style := resources.Get "sass/main.scss" | resources.ToCSS $options }}
|
||||||
```
|
```
|
BIN
docs/content/en/news/0.45-relnotes/featured-hugo-45-poster.png
Normal file
After Width: | Height: | Size: 65 KiB |
|
@ -1,8 +1,8 @@
|
||||||
|
|
||||||
---
|
---
|
||||||
date: 2018-07-22
|
date: 2018-07-22
|
||||||
title: "0.45"
|
title: "Hugo 0.45: Revival of ref, relref and GetPage"
|
||||||
description: "0.45"
|
description: "Hugo 0.45 adds relative page lookups, language support in ref/relref and several Hugo Pipes improvements."
|
||||||
categories: ["Releases"]
|
categories: ["Releases"]
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ Now you can simply do:
|
||||||
{{ with .Site.GetPage "/blog/my-post.md" }}{{ .Title }}{{ end }}
|
{{ with .Site.GetPage "/blog/my-post.md" }}{{ .Title }}{{ end }}
|
||||||
```
|
```
|
||||||
|
|
||||||
Or two get a section page:
|
Or to get a section page:
|
||||||
|
|
||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
|
|
||||||
---
|
---
|
||||||
date: 2018-07-25
|
date: 2018-07-25
|
||||||
title: "0.45.1"
|
title: "Hugo 0.45.1: Two Bug Fixes"
|
||||||
description: "0.45.1"
|
description: "Hugo 0.45.1 comes with two bug fixes ... and one enhancement."
|
||||||
categories: ["Releases"]
|
categories: ["Releases"]
|
||||||
images:
|
images:
|
||||||
- images/blog/hugo-bug-poster.png
|
- images/blog/hugo-bug-poster.png
|
||||||
|
|
9
docs/content/en/readfiles/pages-vs-site-pages.md
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
| Variable | Current context | Pages included |
|
||||||
|
|----------------------|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| `.Site.Pages` | **any** page | ALL pages of the site: content, sections, taxonomies, etc. -- Superset of everything! |
|
||||||
|
| `.Site.RegularPages` | **any** page | Only regular (content) pages -- Subset of `.Site.Pages` |
|
||||||
|
| `.Pages` | _List_ page | Regular pages under that _list_ page representing the homepage, section, taxonomy term (`/tags`) or taxonomy (`/tags/foo`) page -- Subset of `.Site.Pages` or `.Site.RegularPages`, depending on context. |
|
||||||
|
| `.Pages` | _Single_ page | empty slice |
|
||||||
|
|
||||||
|
Note
|
||||||
|
: In the **home** context (`index.html`), `.Pages` is the same as `.Site.RegularPages`.
|
|
@ -35,18 +35,35 @@ A sitemap is a `Page` and therefore has all the [page variables][pagevars] avail
|
||||||
|
|
||||||
If provided, Hugo will use `/layouts/sitemap.xml` instead of the internal `sitemap.xml` template that ships with Hugo.
|
If provided, Hugo will use `/layouts/sitemap.xml` instead of the internal `sitemap.xml` template that ships with Hugo.
|
||||||
|
|
||||||
|
## Sitemap Templates
|
||||||
|
|
||||||
|
Hugo has built-on Sitemap templates, but you can provide your own if needed, in either `layouts/sitemap.xml` or `layouts/_default/sitemap.xml`.
|
||||||
|
|
||||||
|
For multilingual sites, we also create a Sitemap index. You can provide a custom layout for that in either `layouts/sitemapindex.xml` or `layouts/_default/sitemapindex.xml`.
|
||||||
|
|
||||||
## Hugo’s sitemap.xml
|
## Hugo’s sitemap.xml
|
||||||
|
|
||||||
This template respects the version 0.9 of the [Sitemap Protocol](http://www.sitemaps.org/protocol.html).
|
This template respects the version 0.9 of the [Sitemap Protocol](http://www.sitemaps.org/protocol.html).
|
||||||
|
|
||||||
```
|
```xml
|
||||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
|
||||||
{{ range .Pages }}
|
xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
||||||
|
{{ range .Data.Pages }}
|
||||||
<url>
|
<url>
|
||||||
<loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
|
<loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
|
||||||
<lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
|
<lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
|
||||||
<changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
|
<changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
|
||||||
<priority>{{ .Sitemap.Priority }}</priority>{{ end }}
|
<priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ if .IsTranslated }}{{ range .Translations }}
|
||||||
|
<xhtml:link
|
||||||
|
rel="alternate"
|
||||||
|
hreflang="{{ .Lang }}"
|
||||||
|
href="{{ .Permalink }}"
|
||||||
|
/>{{ end }}
|
||||||
|
<xhtml:link
|
||||||
|
rel="alternate"
|
||||||
|
hreflang="{{ .Lang }}"
|
||||||
|
href="{{ .Permalink }}"
|
||||||
|
/>{{ end }}
|
||||||
</url>
|
</url>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</urlset>
|
</urlset>
|
||||||
|
@ -59,6 +76,23 @@ on render. Please don't include this in the template as it's not valid HTML.
|
||||||
`<?xml version="1.0" encoding="utf-8" standalone="yes" ?>`
|
`<?xml version="1.0" encoding="utf-8" standalone="yes" ?>`
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
|
## Hugo's sitemapindex.xml
|
||||||
|
|
||||||
|
This is used to create a Sitemap index in multilingual mode:
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||||
|
{{ range . }}
|
||||||
|
<sitemap>
|
||||||
|
<loc>{{ .SitemapAbsURL }}</loc>
|
||||||
|
{{ if not .LastChange.IsZero }}
|
||||||
|
<lastmod>{{ .LastChange.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</lastmod>
|
||||||
|
{{ end }}
|
||||||
|
</sitemap>
|
||||||
|
{{ end }}
|
||||||
|
</sitemapindex>
|
||||||
|
```
|
||||||
|
|
||||||
## Configure `sitemap.xml`
|
## Configure `sitemap.xml`
|
||||||
|
|
||||||
Defaults for `<changefreq>`, `<priority>` and `filename` values can be set in the site's config file, e.g.:
|
Defaults for `<changefreq>`, `<priority>` and `filename` values can be set in the site's config file, e.g.:
|
||||||
|
@ -72,4 +106,6 @@ Defaults for `<changefreq>`, `<priority>` and `filename` values can be set in th
|
||||||
|
|
||||||
The same fields can be specified in an individual content file's front matter in order to override the value assigned to that piece of content at render time.
|
The same fields can be specified in an individual content file's front matter in order to override the value assigned to that piece of content at render time.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[pagevars]: /variables/page/
|
[pagevars]: /variables/page/
|
||||||
|
|
|
@ -108,4 +108,4 @@ the memory usage per step, and the total memory allocations per step.
|
||||||
To enable *step analysis*, use the `--stepAnalysis` option when running Hugo.
|
To enable *step analysis*, use the `--stepAnalysis` option when running Hugo.
|
||||||
|
|
||||||
|
|
||||||
[partialCached]:{{< ref "functions/partialCached.md" >}}
|
[partialCached]:{{< ref "/functions/partialCached.md" >}}
|
||||||
|
|
|
@ -106,9 +106,8 @@ See also `.ExpiryDate`, `.Date`, `.PublishDate`, and [`.GitInfo`][gitinfo].
|
||||||
: contains all formats, including the current format, for a given page. Can be combined the with [`.Get` function](/functions/get/) to grab a specific format. (See [Output Formats](/templates/output-formats/).)
|
: contains all formats, including the current format, for a given page. Can be combined the with [`.Get` function](/functions/get/) to grab a specific format. (See [Output Formats](/templates/output-formats/).)
|
||||||
|
|
||||||
.Pages
|
.Pages
|
||||||
: a collection of associated pages. `.Pages` is an alias for
|
: a collection of associated pages. This value will be `nil` within
|
||||||
`.Data.Pages`. This value will be `nil` within the context of
|
the context of regular content pages. See [`.Pages`](#pages).
|
||||||
regular content pages.
|
|
||||||
|
|
||||||
.Permalink
|
.Permalink
|
||||||
: the Permanent link for this page; see [Permalinks](/content-management/urls/)
|
: the Permanent link for this page; see [Permalinks](/content-management/urls/)
|
||||||
|
@ -187,6 +186,15 @@ Also see [Sections](/content-management/sections/).
|
||||||
|
|
||||||
{{< readfile file="/content/en/readfiles/sectionvars.md" markdown="true" >}}
|
{{< readfile file="/content/en/readfiles/sectionvars.md" markdown="true" >}}
|
||||||
|
|
||||||
|
## The `.Pages` Variable {#pages}
|
||||||
|
|
||||||
|
`.Pages` is an alias to `.Data.Pages`. It is conventional to use the
|
||||||
|
aliased form `.Pages`.
|
||||||
|
|
||||||
|
### `.Pages` compared to `.Site.Pages`
|
||||||
|
|
||||||
|
{{< readfile file="/content/en/readfiles/pages-vs-site-pages.md" markdown="true" >}}
|
||||||
|
|
||||||
## Page-level Params
|
## Page-level Params
|
||||||
|
|
||||||
Any other value defined in the front matter in a content file, including taxonomies, will be made available as part of the `.Params` variable.
|
Any other value defined in the front matter in a content file, including taxonomies, will be made available as part of the `.Params` variable.
|
||||||
|
|
|
@ -49,6 +49,9 @@ The following is a list of site-level (aka "global") variables. Many of these va
|
||||||
.Site.GoogleAnalytics
|
.Site.GoogleAnalytics
|
||||||
: a string representing your tracking code for Google Analytics as defined in the site configuration.
|
: a string representing your tracking code for Google Analytics as defined in the site configuration.
|
||||||
|
|
||||||
|
.Site.Home
|
||||||
|
: reference to the homepage's [page object](https://gohugo.io/variables/page/)
|
||||||
|
|
||||||
.Site.IsMultiLingual
|
.Site.IsMultiLingual
|
||||||
: whether there are more than one language in this site. See [Multilingual](/content-management/multilingual/) for more information.
|
: whether there are more than one language in this site. See [Multilingual](/content-management/multilingual/) for more information.
|
||||||
|
|
||||||
|
@ -83,13 +86,13 @@ The following is a list of site-level (aka "global") variables. Many of these va
|
||||||
: all of the menus in the site.
|
: all of the menus in the site.
|
||||||
|
|
||||||
.Site.Pages
|
.Site.Pages
|
||||||
: array of all content ordered by Date with the newest first. This array contains only the pages in the current language.
|
: array of all content ordered by Date with the newest first. This array contains only the pages in the current language. See [`.Site.Pages`](#site-pages).
|
||||||
|
|
||||||
.Site.Permalinks
|
.Site.Permalinks
|
||||||
: a string to override the default [permalink](/content-management/urls/) format as defined in the site configuration.
|
: a string to override the default [permalink](/content-management/urls/) format as defined in the site configuration.
|
||||||
|
|
||||||
.Site.RegularPages
|
.Site.RegularPages
|
||||||
: a shortcut to the *regular* page collection. `.Site.RegularPages` is equivalent to `where .Site.Pages "Kind" "page"`.
|
: a shortcut to the *regular* page collection. `.Site.RegularPages` is equivalent to `where .Site.Pages "Kind" "page"`. See [`.Site.Pages`](#site-pages).
|
||||||
|
|
||||||
.Site.RSSLink
|
.Site.RSSLink
|
||||||
: the URL for the site RSS.
|
: the URL for the site RSS.
|
||||||
|
@ -125,4 +128,13 @@ You can use `.Site.Params` in a [partial template](/templates/partials/) to call
|
||||||
<meta name="description" content="{{if .IsHome}}{{ $.Site.Params.description }}{{else}}{{.Description}}{{end}}" />
|
<meta name="description" content="{{if .IsHome}}{{ $.Site.Params.description }}{{else}}{{.Description}}{{end}}" />
|
||||||
{{< /code >}}
|
{{< /code >}}
|
||||||
|
|
||||||
|
## The `.Site.Pages` Variable {#site-pages}
|
||||||
|
|
||||||
|
### `.Site.Pages` compared to `.Pages`
|
||||||
|
|
||||||
|
{{< readfile file="/content/en/readfiles/pages-vs-site-pages.md" markdown="true" >}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[config]: /getting-started/configuration/
|
[config]: /getting-started/configuration/
|
||||||
|
|
|
@ -3,7 +3,7 @@ publish = "public"
|
||||||
command = "hugo"
|
command = "hugo"
|
||||||
|
|
||||||
[context.production.environment]
|
[context.production.environment]
|
||||||
HUGO_VERSION = "0.44"
|
HUGO_VERSION = "0.45.1"
|
||||||
HUGO_ENV = "production"
|
HUGO_ENV = "production"
|
||||||
HUGO_ENABLEGITINFO = "true"
|
HUGO_ENABLEGITINFO = "true"
|
||||||
|
|
||||||
|
@ -11,20 +11,20 @@ HUGO_ENABLEGITINFO = "true"
|
||||||
command = "hugo --enableGitInfo"
|
command = "hugo --enableGitInfo"
|
||||||
|
|
||||||
[context.split1.environment]
|
[context.split1.environment]
|
||||||
HUGO_VERSION = "0.44"
|
HUGO_VERSION = "0.45.1"
|
||||||
HUGO_ENV = "production"
|
HUGO_ENV = "production"
|
||||||
|
|
||||||
[context.deploy-preview]
|
[context.deploy-preview]
|
||||||
command = "hugo --buildFuture -b $DEPLOY_PRIME_URL"
|
command = "hugo --buildFuture -b $DEPLOY_PRIME_URL"
|
||||||
|
|
||||||
[context.deploy-preview.environment]
|
[context.deploy-preview.environment]
|
||||||
HUGO_VERSION = "0.44"
|
HUGO_VERSION = "0.45.1"
|
||||||
|
|
||||||
[context.branch-deploy]
|
[context.branch-deploy]
|
||||||
command = "hugo -b $DEPLOY_PRIME_URL"
|
command = "hugo -b $DEPLOY_PRIME_URL"
|
||||||
|
|
||||||
[context.branch-deploy.environment]
|
[context.branch-deploy.environment]
|
||||||
HUGO_VERSION = "0.44"
|
HUGO_VERSION = "0.45.1"
|
||||||
|
|
||||||
[context.next.environment]
|
[context.next.environment]
|
||||||
HUGO_ENABLEGITINFO = "true"
|
HUGO_ENABLEGITINFO = "true"
|
||||||
|
|
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 5 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 5 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 65 KiB |
Before Width: | Height: | Size: 77 KiB |
Before Width: | Height: | Size: 88 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 47 KiB |