Merge commit 'be04ece8590f775a52ea167fbe4555753e8c5211'

This commit is contained in:
Bjørn Erik Pedersen 2019-05-25 10:41:51 +02:00
commit 4f61a926f6
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F
14 changed files with 42 additions and 30 deletions

View file

@ -61,7 +61,7 @@ audio
: an array of paths to audio files related to the page; used by the `opengraph` [internal template](/templates/internal) to populate `og:audio`.
date
: the datetime at which the content was created; note this value is auto-populated according to Hugo's built-in [archetype][].
: the datetime assigned to this page. This is usually fetched from the `date` field in front matter, but this behaviour is configurable.
description
: the description for the content.

View file

@ -14,7 +14,7 @@ keywords: []
signature: ["md5 INPUT"]
workson: []
hugoversion:
relatedfuncs: []
relatedfuncs: [sha]
deprecated: false
aliases: []
---

View file

@ -14,9 +14,9 @@ keywords: [sha,checksum]
signature: ["sha1 INPUT", "sha256 INPUT"]
workson: []
hugoversion:
relatedfuncs: []
relatedfuncs: [md5]
deprecated: false
aliases: []
aliases: [sha1, sha256]
---
`sha1` hashes the given input and returns its SHA1 checksum.

View file

@ -83,6 +83,15 @@ The following logical operators are available with `where`:
`intersect`
: `true` if a given field value that is a slice/array of strings or integers contains elements in common with the matching value; it follows the same rules as the [`intersect` function][intersect].
## Use `where` with `Booleans`
When using booleans you should not put quotation marks.
```go-html-template
{{range where .Pages ".Draft" true}}
<p>{{.Title}}</p>
{{end}}
```
## Use `where` with `intersect`
```go-html-template
@ -122,7 +131,7 @@ then ranges through only the first 5 posts in that list:
You can also nest `where` clauses to drill down on lists of content by more than one parameter. The following first grabs all pages in the "blog" section and then ranges through the result of the first `where` clause and finds all pages that are *not* featured:
```go-html-template
{{ range where (where .Pages "Section" "blog" ) ".Params.featured" "!=" "true" }}
{{ range where (where .Pages "Section" "blog" ) ".Params.featured" "!=" true }}
```
## Unset Fields

View file

@ -247,9 +247,6 @@ sitemap
staticDir ("static")
: A directory or a list of directories from where Hugo reads [static files][static-files].
stepAnalysis (false)
: Display memory and timing of different steps of the program.
summaryLength (70)
: The length of text in words to show in a [`.Summary`](/content-management/summaries/#hugo-defined-automatic-summary-splitting).

View file

@ -2,7 +2,7 @@
---
date: 2019-04-20
title: "Hugo 0.55.3: A Few More Bug Fixes!"
description: "To wrap up this Eeaster, here is one more patch release with some important fixes."
description: "To wrap up this Easter, here is one more patch release with some important fixes."
categories: ["Releases"]
images:
- images/blog/hugo-bug-poster.png

View file

@ -1,8 +1,8 @@
---
date: 2019-05-02
title: "0.55.5"
description: "0.55.5"
title: "Hugo 0.55.5: Take Five!"
description: "We round up this 0.55 release with a final batch of bug fixes!"
categories: ["Releases"]
images:
- images/blog/hugo-bug-poster.png

View file

@ -1,8 +1,8 @@
---
date: 2019-05-18
title: "0.55.6"
description: "0.55.6"
title: "Hugo 0.55.6: One Bug Fix!"
description: "Fixes some reported paginator crashes in server mode."
categories: ["Releases"]
images:
- images/blog/hugo-bug-poster.png

View file

@ -1,6 +1,9 @@
.CurrentSection
: The page's current section. The value can be the page itself if it is a section or the homepage.
.FirstSection
: The page's first section below root, e.g. `/docs`, `/blog` etc.
.InSection $anotherPage
: Whether the given page is in the current section. Note that this will always return false for pages that are not either regular, home or section pages.

View file

@ -52,6 +52,7 @@ Your 404.html file can be set to load automatically when a visitor enters a mist
* Amazon AWS S3. When setting a bucket up for static web serving, you can specify the error file from within the S3 GUI.
* Amazon CloudFont. You can specify the page in the Error Pages section in the CloudFont Console. [Details here](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html)
* Caddy Server. Using `errors { 404 /404.html }`. [Details here](https://caddyserver.com/docs/errors)
* Netlify. Add `/* /404.html 404` to `content/_redirects`. [Details Here](https://www.netlify.com/docs/redirects/#custom-404)
{{% note %}}
`hugo server` will not automatically load your custom `404.html` file, but you

View file

@ -20,7 +20,7 @@ toc: true
---
{{% note %}}
The following is only a primer on Go Templates. For an in-depth look into Go Templates, check the official [Go docs](http://golang.org/pkg/html/template/).
The following is only a primer on Go Templates. For an in-depth look into Go Templates, check the official [Go docs](https://golang.org/pkg/text/template/).
{{% /note %}}
Go Templates provide an extremely simple template language that adheres to the belief that only the most basic of logic belongs in the template or view layer.
@ -233,6 +233,18 @@ key.
{{ end }}
```
#### Example 5: Conditional on empty _map_, _array_, or _slice_.
If the _map_, _array_, or _slice_ passed into the range is zero-length then the else statment is evaluated.
```go-html-template
{{ range $array }}
{{ . }}
{{else}}
<!-- This is only evaluated if $array is empty -->
{{ end }}
```
### Conditionals
`if`, `else`, `with`, `or`, and `and` provide the framework for handling conditional logic in Go Templates. Like `range`, each statement is closed with an `{{ end }}`.

View file

@ -98,14 +98,4 @@ parameters to `partialCached` beyond the initial context. See the
{{% /tip %}}
## Step Analysis
Hugo provides a means of seeing metrics about each step in the site build
process. We call that *Step Analysis*. The *step analysis* output shows the
total time per step, the cumulative time after each step (in parentheses),
the memory usage per step, and the total memory allocations per step.
To enable *step analysis*, use the `--stepAnalysis` option when running Hugo.
[partialCached]:{{< ref "/functions/partialCached.md" >}}

View file

@ -51,6 +51,6 @@ If you process `SCSS` or `SASS` to `CSS` in your Hugo project, you need the Hugo
error: failed to transform resource: TOCSS: failed to transform "scss/main.scss" (text/x-scss): this feature is not available in your current Hugo version
```
We release two set of binaries for technical reasons. The extended is what you get by default, as an example, when you run `brew install hugo` on `macOS`. On the [release page](https://github.com/gohugoio/hugo/releases), look for archives with `extended` in the name.
We release two set of binaries for technical reasons. The extended is not what you get by default, as an example, when you run `brew install hugo` on `macOS`. On the [release page](https://github.com/gohugoio/hugo/releases), look for archives with `extended` in the name. To build `hugo-extended`, use `go install --tags extended`
To confirm, run `hugo version` and look for the word `extended`.

View file

@ -3,7 +3,7 @@ publish = "public"
command = "hugo --gc --minify"
[context.production.environment]
HUGO_VERSION = "0.55.4"
HUGO_VERSION = "0.55.6"
HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "true"
@ -11,20 +11,20 @@ HUGO_ENABLEGITINFO = "true"
command = "hugo --gc --minify --enableGitInfo"
[context.split1.environment]
HUGO_VERSION = "0.55.4"
HUGO_VERSION = "0.55.6"
HUGO_ENV = "production"
[context.deploy-preview]
command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL"
[context.deploy-preview.environment]
HUGO_VERSION = "0.55.4"
HUGO_VERSION = "0.55.6"
[context.branch-deploy]
command = "hugo --gc --minify -b $DEPLOY_PRIME_URL"
[context.branch-deploy.environment]
HUGO_VERSION = "0.55.4"
HUGO_VERSION = "0.55.6"
[context.next.environment]
HUGO_ENABLEGITINFO = "true"