diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/content/en/content-management/front-matter.md | 2 | ||||
-rw-r--r-- | docs/content/en/functions/md5.md | 2 | ||||
-rw-r--r-- | docs/content/en/functions/sha.md | 4 | ||||
-rw-r--r-- | docs/content/en/functions/where.md | 11 | ||||
-rw-r--r-- | docs/content/en/getting-started/configuration.md | 3 | ||||
-rw-r--r-- | docs/content/en/news/0.55.3-relnotes/index.md | 2 | ||||
-rw-r--r-- | docs/content/en/news/0.55.5-relnotes/index.md | 4 | ||||
-rw-r--r-- | docs/content/en/news/0.55.6-relnotes/index.md | 6 | ||||
-rw-r--r-- | docs/content/en/readfiles/sectionvars.md | 3 | ||||
-rw-r--r-- | docs/content/en/templates/404.md | 1 | ||||
-rw-r--r-- | docs/content/en/templates/introduction.md | 14 | ||||
-rw-r--r-- | docs/content/en/troubleshooting/build-performance.md | 10 | ||||
-rw-r--r-- | docs/content/en/troubleshooting/faq.md | 2 | ||||
-rw-r--r-- | docs/netlify.toml | 8 |
14 files changed, 42 insertions, 30 deletions
diff --git a/docs/content/en/content-management/front-matter.md b/docs/content/en/content-management/front-matter.md index 4a52b160c..4ff374000 100644 --- a/docs/content/en/content-management/front-matter.md +++ b/docs/content/en/content-management/front-matter.md @@ -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. diff --git a/docs/content/en/functions/md5.md b/docs/content/en/functions/md5.md index 31197f218..db5442166 100644 --- a/docs/content/en/functions/md5.md +++ b/docs/content/en/functions/md5.md @@ -14,7 +14,7 @@ keywords: [] signature: ["md5 INPUT"] workson: [] hugoversion: -relatedfuncs: [] +relatedfuncs: [sha] deprecated: false aliases: [] --- diff --git a/docs/content/en/functions/sha.md b/docs/content/en/functions/sha.md index 4e1243469..d10da3446 100644 --- a/docs/content/en/functions/sha.md +++ b/docs/content/en/functions/sha.md @@ -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. diff --git a/docs/content/en/functions/where.md b/docs/content/en/functions/where.md index 29623c908..ece4acb21 100644 --- a/docs/content/en/functions/where.md +++ b/docs/content/en/functions/where.md @@ -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 diff --git a/docs/content/en/getting-started/configuration.md b/docs/content/en/getting-started/configuration.md index 4f0a4c8c5..6fbfd3779 100644 --- a/docs/content/en/getting-started/configuration.md +++ b/docs/content/en/getting-started/configuration.md @@ -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). diff --git a/docs/content/en/news/0.55.3-relnotes/index.md b/docs/content/en/news/0.55.3-relnotes/index.md index ee6163a2f..d00c47d54 100644 --- a/docs/content/en/news/0.55.3-relnotes/index.md +++ b/docs/content/en/news/0.55.3-relnotes/index.md @@ -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 diff --git a/docs/content/en/news/0.55.5-relnotes/index.md b/docs/content/en/news/0.55.5-relnotes/index.md index eecfbe222..45a3eda54 100644 --- a/docs/content/en/news/0.55.5-relnotes/index.md +++ b/docs/content/en/news/0.55.5-relnotes/index.md @@ -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 diff --git a/docs/content/en/news/0.55.6-relnotes/index.md b/docs/content/en/news/0.55.6-relnotes/index.md index 4be66d556..c447aa061 100644 --- a/docs/content/en/news/0.55.6-relnotes/index.md +++ b/docs/content/en/news/0.55.6-relnotes/index.md @@ -1,13 +1,13 @@ --- 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 --- - This is a bug-fix release with one important fix. There have been reports about infrequent paginator crashes when running the Hugo server since 0.55.0. The reason have been narrowed down to that of parallel rebuilds. This isn't a new thing, but the changes in 0.55.0 made it extra important to serialize the page initialization. This release fixes that by protecting the `Build` method with a lock when running in server mode. [95ce2a40](https://github.com/gohugoio/hugo/commit/95ce2a40e734bb82b69f9a64270faf3ed69c92cc) [@bep](https://github.com/bep) [#5885](https://github.com/gohugoio/hugo/issues/5885)[#5968](https://github.com/gohugoio/hugo/issues/5968) +This is a bug-fix release with one important fix. There have been reports about infrequent paginator crashes when running the Hugo server since 0.55.0. The reason have been narrowed down to that of parallel rebuilds. This isn't a new thing, but the changes in 0.55.0 made it extra important to serialize the page initialization. This release fixes that by protecting the `Build` method with a lock when running in server mode. [95ce2a40](https://github.com/gohugoio/hugo/commit/95ce2a40e734bb82b69f9a64270faf3ed69c92cc) [@bep](https://github.com/bep) [#5885](https://github.com/gohugoio/hugo/issues/5885)[#5968](https://github.com/gohugoio/hugo/issues/5968) diff --git a/docs/content/en/readfiles/sectionvars.md b/docs/content/en/readfiles/sectionvars.md index 1b97a12d6..698955c02 100644 --- a/docs/content/en/readfiles/sectionvars.md +++ b/docs/content/en/readfiles/sectionvars.md @@ -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. diff --git a/docs/content/en/templates/404.md b/docs/content/en/templates/404.md index c6bea1912..bb1d5e424 100644 --- a/docs/content/en/templates/404.md +++ b/docs/content/en/templates/404.md @@ -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 diff --git a/docs/content/en/templates/introduction.md b/docs/content/en/templates/introduction.md index 1e1778eb0..02a580e79 100644 --- a/docs/content/en/templates/introduction.md +++ b/docs/content/en/templates/introduction.md @@ -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 }}`. diff --git a/docs/content/en/troubleshooting/build-performance.md b/docs/content/en/troubleshooting/build-performance.md index bc75ce262..e0700f381 100644 --- a/docs/content/en/troubleshooting/build-performance.md +++ b/docs/content/en/troubleshooting/build-performance.md @@ -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" >}} diff --git a/docs/content/en/troubleshooting/faq.md b/docs/content/en/troubleshooting/faq.md index 34d42958c..c68473a84 100644 --- a/docs/content/en/troubleshooting/faq.md +++ b/docs/content/en/troubleshooting/faq.md @@ -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`. diff --git a/docs/netlify.toml b/docs/netlify.toml index 73e13ac3e..667456275 100644 --- a/docs/netlify.toml +++ b/docs/netlify.toml @@ -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" |