From 7c9653cbe00dcb232f75bcabf6c5e3f21f30f754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 2 May 2019 16:27:07 +0200 Subject: [PATCH 01/14] Hugo 0.55.5 --- content/en/news/0.55.5-relnotes/index.md | 4 ++-- netlify.toml | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/content/en/news/0.55.5-relnotes/index.md b/content/en/news/0.55.5-relnotes/index.md index eecfbe222..45a3eda54 100644 --- a/content/en/news/0.55.5-relnotes/index.md +++ b/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/netlify.toml b/netlify.toml index 73e13ac3e..d2da4a0a0 100644 --- a/netlify.toml +++ b/netlify.toml @@ -3,7 +3,7 @@ publish = "public" command = "hugo --gc --minify" [context.production.environment] -HUGO_VERSION = "0.55.4" +HUGO_VERSION = "0.55.5" 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.5" 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.5" [context.branch-deploy] command = "hugo --gc --minify -b $DEPLOY_PRIME_URL" [context.branch-deploy.environment] -HUGO_VERSION = "0.55.4" +HUGO_VERSION = "0.55.5" [context.next.environment] HUGO_ENABLEGITINFO = "true" From e08be4d81efd30542172ce0548f7b2139f7c23d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Fri, 3 May 2019 15:04:27 +0200 Subject: [PATCH 02/14] Update sectionvars.md --- content/en/readfiles/sectionvars.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/content/en/readfiles/sectionvars.md b/content/en/readfiles/sectionvars.md index 1b97a12d6..ca3a34164 100644 --- a/content/en/readfiles/sectionvars.md +++ b/content/en/readfiles/sectionvars.md @@ -1,6 +1,10 @@ .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. From e765084dd6e9973e5c498653e7a20f5e49e8a54e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Fri, 3 May 2019 15:04:50 +0200 Subject: [PATCH 03/14] Update sectionvars.md --- content/en/readfiles/sectionvars.md | 1 - 1 file changed, 1 deletion(-) diff --git a/content/en/readfiles/sectionvars.md b/content/en/readfiles/sectionvars.md index ca3a34164..698955c02 100644 --- a/content/en/readfiles/sectionvars.md +++ b/content/en/readfiles/sectionvars.md @@ -2,7 +2,6 @@ : 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 From 5e08b6930dd21a669668d23dfc5cc367c29bfeb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Fri, 3 May 2019 21:17:20 +0200 Subject: [PATCH 04/14] Fix date description --- content/en/content-management/front-matter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/content-management/front-matter.md b/content/en/content-management/front-matter.md index 4a52b160c..4ff374000 100644 --- a/content/en/content-management/front-matter.md +++ b/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. From 15f48966ad5168d3accbf6733500747c7a3decae Mon Sep 17 00:00:00 2001 From: Alexander Borsuk <170263+biodranik@users.noreply.github.com> Date: Tue, 7 May 2019 21:28:38 +0300 Subject: [PATCH 05/14] Added related sha function into the See Also --- content/en/functions/md5.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/functions/md5.md b/content/en/functions/md5.md index 31197f218..db5442166 100644 --- a/content/en/functions/md5.md +++ b/content/en/functions/md5.md @@ -14,7 +14,7 @@ keywords: [] signature: ["md5 INPUT"] workson: [] hugoversion: -relatedfuncs: [] +relatedfuncs: [sha] deprecated: false aliases: [] --- From 86ba9071cc20ef99251b5cb1a4ce1e4f7417ce52 Mon Sep 17 00:00:00 2001 From: Alexander Borsuk <170263+biodranik@users.noreply.github.com> Date: Tue, 7 May 2019 21:30:03 +0300 Subject: [PATCH 06/14] Related md5 and aliases for sha1/sha256 --- content/en/functions/sha.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/en/functions/sha.md b/content/en/functions/sha.md index 4e1243469..d10da3446 100644 --- a/content/en/functions/sha.md +++ b/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. From 9f684318fb6fb6e13904c2701aa77aa16fc8c34a Mon Sep 17 00:00:00 2001 From: Alexander Borsuk Date: Mon, 13 May 2019 21:41:04 +0300 Subject: [PATCH 07/14] Removed mentioning of removed --stepAnalysis command line option --- content/en/getting-started/configuration.md | 3 --- content/en/troubleshooting/build-performance.md | 10 ---------- 2 files changed, 13 deletions(-) diff --git a/content/en/getting-started/configuration.md b/content/en/getting-started/configuration.md index 4f0a4c8c5..6fbfd3779 100644 --- a/content/en/getting-started/configuration.md +++ b/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/content/en/troubleshooting/build-performance.md b/content/en/troubleshooting/build-performance.md index bc75ce262..e0700f381 100644 --- a/content/en/troubleshooting/build-performance.md +++ b/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" >}} From fc5e43db2fbb4e05fcbff610a487a3fdb8ac95f5 Mon Sep 17 00:00:00 2001 From: Dirk Kelly Date: Wed, 15 May 2019 11:48:10 +0800 Subject: [PATCH 08/14] Update 404.md with Netlify Instructions --- content/en/templates/404.md | 1 + 1 file changed, 1 insertion(+) diff --git a/content/en/templates/404.md b/content/en/templates/404.md index c6bea1912..bb1d5e424 100644 --- a/content/en/templates/404.md +++ b/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 From 25855690def3d7845641ef19fa75fa86f882a364 Mon Sep 17 00:00:00 2001 From: maiki Date: Wed, 15 May 2019 22:36:34 -0700 Subject: [PATCH 09/14] Fix misspelling --- content/en/news/0.55.3-relnotes/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/news/0.55.3-relnotes/index.md b/content/en/news/0.55.3-relnotes/index.md index ee6163a2f..d00c47d54 100644 --- a/content/en/news/0.55.3-relnotes/index.md +++ b/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 From e9b15c698000ea677043cc9e813b2a647d985b3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Sat, 18 May 2019 10:29:39 +0200 Subject: [PATCH 10/14] Update index.md --- content/en/news/0.55.6-relnotes/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/news/0.55.6-relnotes/index.md b/content/en/news/0.55.6-relnotes/index.md index 13d16122e..c447aa061 100644 --- a/content/en/news/0.55.6-relnotes/index.md +++ b/content/en/news/0.55.6-relnotes/index.md @@ -9,5 +9,5 @@ images: --- - 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) From 56d4cea3cb5988070acf1e1d820c54fc687fd1fb Mon Sep 17 00:00:00 2001 From: yarko Date: Sat, 11 May 2019 10:05:29 -0700 Subject: [PATCH 11/14] hugo-extended no longer the default It appears hugo-extended is no longer the default build. I'm on Linux / Ubuntu, so would appreciate if someone check that it is also no longer the default via `brew install` (I assumed the change was consistently throughout, based on github changes). --- content/en/troubleshooting/faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/troubleshooting/faq.md b/content/en/troubleshooting/faq.md index 34d42958c..c68473a84 100644 --- a/content/en/troubleshooting/faq.md +++ b/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`. From c3d83149af115cdcb6e3f2079436f00622ff8a63 Mon Sep 17 00:00:00 2001 From: Bradley Nelson Date: Wed, 22 May 2019 23:24:01 -0600 Subject: [PATCH 12/14] Boolean Values in the Where Function This caused me some trouble should seem oblivious but would have saved me some time. Maybe it will save some others. --- content/en/functions/where.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/content/en/functions/where.md b/content/en/functions/where.md index 29623c908..ece4acb21 100644 --- a/content/en/functions/where.md +++ b/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}} +

{{.Title}}

+{{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 From b14dd3505387d886c96c47783e2fc38d0b230f58 Mon Sep 17 00:00:00 2001 From: Bradley Nelson Date: Fri, 24 May 2019 16:51:10 -0600 Subject: [PATCH 13/14] Updated link to Go Docs to more helpful page The text/template page is a better resource for how Hugo templates work as is talks about the tags and what they do. --- content/en/templates/introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/templates/introduction.md b/content/en/templates/introduction.md index 1e1778eb0..e07957656 100644 --- a/content/en/templates/introduction.md +++ b/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. From 0c3c04fd63a7f140bdca0d3ca9b1e9dc794ebd77 Mon Sep 17 00:00:00 2001 From: Bradley Nelson Date: Sat, 25 May 2019 01:19:43 -0600 Subject: [PATCH 14/14] Merge pull request #827 from BCNelson/range-patch Range patch --- content/en/templates/introduction.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/content/en/templates/introduction.md b/content/en/templates/introduction.md index e07957656..02a580e79 100644 --- a/content/en/templates/introduction.md +++ b/content/en/templates/introduction.md @@ -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}} + +{{ 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 }}`.