From 3a20aa0bae1a4204ec423057e9cdf6a36c91869c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Wed, 14 Sep 2022 09:20:15 +0200 Subject: [PATCH 001/108] Update theme --- .../gohugoio/gohugoioTheme/data/sponsors.toml | 30 +++++---- .../partials/home-page-sections/sponsors.html | 65 ++++++++++--------- .../static/images/sponsors/brave-logo.svg | 1 - .../static/images/sponsors/butter-dark.svg | 1 + .../static/images/sponsors/butter-light.svg | 1 + .../images/sponsors/forestry-logotype.svg | 1 - _vendor/modules.txt | 2 +- go.mod | 2 +- go.sum | 2 + 9 files changed, 57 insertions(+), 48 deletions(-) delete mode 100644 _vendor/github.com/gohugoio/gohugoioTheme/static/images/sponsors/brave-logo.svg create mode 100644 _vendor/github.com/gohugoio/gohugoioTheme/static/images/sponsors/butter-dark.svg create mode 100644 _vendor/github.com/gohugoio/gohugoioTheme/static/images/sponsors/butter-light.svg delete mode 100644 _vendor/github.com/gohugoio/gohugoioTheme/static/images/sponsors/forestry-logotype.svg diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/data/sponsors.toml b/_vendor/github.com/gohugoio/gohugoioTheme/data/sponsors.toml index 0d276b374..1e46fc07c 100644 --- a/_vendor/github.com/gohugoio/gohugoioTheme/data/sponsors.toml +++ b/_vendor/github.com/gohugoio/gohugoioTheme/data/sponsors.toml @@ -1,18 +1,22 @@ [[banners]] - name = "Linode" - link = "https://www.linode.com/" - logo = "/images/sponsors/linode-logo_standard_light_medium.png" - copy = "" + name = "Linode" + link = "https://www.linode.com/" + logo = "/images/sponsors/linode-logo_standard_light_medium.png" + utm_campaign = "hugosponsor" [[banners]] - name = "eSolia" - link = "https://esolia.com/post/why-did-esolia-choose-hugo/" - logo = "/images/sponsors/esolia-logo.svg" - copy = "" + name = "eSolia" + link = "https://esolia.com/post/why-did-esolia-choose-hugo/" + logo = "/images/sponsors/esolia-logo.svg" + utm_campaign = "hugosponsor" [[banners]] - name = "BEP Consulting" - link = "https://bep.consulting" - logo = "/images/sponsors/bep-consulting.svg" - bgcolor = "#004887" - copy = "" + name = "ButterCMS" + link = "https://buttercms.com/hugo-cms/" + logo = "/images/sponsors/butter-light.svg" + utm_campaign = "sponsorship" + bgcolor = "#131A3E" + + #hugohome + #hugofooter + #hugogithub diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/home-page-sections/sponsors.html b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/home-page-sections/sponsors.html index a808655a6..e0f6670be 100644 --- a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/home-page-sections/sponsors.html +++ b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/home-page-sections/sponsors.html @@ -1,38 +1,41 @@ -{{$classes_box := "ba b--dark-gray bg-light-gray br3 flex flex-column flex-wrap items-center justify-center ph3 pv4 mb4 w-100 w-30-l "}} -{{$gtag := .gtag | default "unknown" }} +{{ $classes_box := "ba b--dark-gray bg-light-gray br3 flex flex-column flex-wrap items-center justify-center ph3 pv4 mb4 w-100 w-30-l " }} +{{ $gtag := .gtag | default "unknown" }} +{{ $classes_box := "ba b--dark-gray bg-light-gray br3 flex flex-column flex-wrap items-center justify-center ph3 pv4 mb4 w-100 w-30-l " }} +{{ $gtag := .gtag | default "unknown" }} +{{ $utmSource := cond (eq $gtag "footer") "hugofooter" "hugohome" }} {{ with .cx.Site.Data.sponsors }} -
-
  +
+

Hugo Sponsors

{{ range .banners }} - {{ $banner := . }} - {{if .logo}} -
- {{with .link -}} - {{ $url := printf "%s?%s" . (querify "utm_source" "homepage" "utm_medium" "banner" "utm_campaign" "hugosponsor") | safeURL }} - {{ if eq (getenv "HUGO_ENV") "production" | or (eq $.cx.Site.Params.env "production") }} - {{ $gtagID := printf "Sponsor %s %s" $banner.name $gtag | title }} - - {{ else }} - - {{ end }} - {{- end}} - Logo for {{ .name }} - {{with .link}}{{end}} - {{with .copy}} -

- {{- . -}} -

- {{end}} -
- {{else}} -
-

Your Logo Here

-
- {{end}} - {{end}} +
+ {{ $url := printf "%s?%s" .link (querify "utm_source" $utmSource "utm_medium" "banner" "utm_campaign" (.utm_campaign | default "hugosponsor")) | safeURL }} + {{ if eq (getenv "HUGO_ENV") "production" | or (eq $.cx.Site.Params.env "production") }} + {{ $gtagID := printf "Sponsor %s %s" .name $gtag | title }} + + Logo for {{ .name }} + + {{ else }} + + Logo for {{ .name }} + {{ end }} +
+ {{ end }}
-{{end}} +{{ end }} diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/static/images/sponsors/brave-logo.svg b/_vendor/github.com/gohugoio/gohugoioTheme/static/images/sponsors/brave-logo.svg deleted file mode 100644 index 27cdd974d..000000000 --- a/_vendor/github.com/gohugoio/gohugoioTheme/static/images/sponsors/brave-logo.svg +++ /dev/null @@ -1 +0,0 @@ -brave_logo_2color_reversed \ No newline at end of file diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/static/images/sponsors/butter-dark.svg b/_vendor/github.com/gohugoio/gohugoioTheme/static/images/sponsors/butter-dark.svg new file mode 100644 index 000000000..657b75c50 --- /dev/null +++ b/_vendor/github.com/gohugoio/gohugoioTheme/static/images/sponsors/butter-dark.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/static/images/sponsors/butter-light.svg b/_vendor/github.com/gohugoio/gohugoioTheme/static/images/sponsors/butter-light.svg new file mode 100644 index 000000000..a0697df08 --- /dev/null +++ b/_vendor/github.com/gohugoio/gohugoioTheme/static/images/sponsors/butter-light.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/static/images/sponsors/forestry-logotype.svg b/_vendor/github.com/gohugoio/gohugoioTheme/static/images/sponsors/forestry-logotype.svg deleted file mode 100644 index ac95cd444..000000000 --- a/_vendor/github.com/gohugoio/gohugoioTheme/static/images/sponsors/forestry-logotype.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/_vendor/modules.txt b/_vendor/modules.txt index 2147e7a1c..39c33113f 100644 --- a/_vendor/modules.txt +++ b/_vendor/modules.txt @@ -1 +1 @@ -# github.com/gohugoio/gohugoioTheme v0.0.0-20220912070954-88dcaf003b4d +# github.com/gohugoio/gohugoioTheme v0.0.0-20220914071648-0ef1c51685bf diff --git a/go.mod b/go.mod index f80bd4941..4550abaf6 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module github.com/gohugoio/hugoDocs go 1.16 -require github.com/gohugoio/gohugoioTheme v0.0.0-20220912070954-88dcaf003b4d // indirect +require github.com/gohugoio/gohugoioTheme v0.0.0-20220914071648-0ef1c51685bf // indirect diff --git a/go.sum b/go.sum index 91fe56887..36f0a13cb 100644 --- a/go.sum +++ b/go.sum @@ -37,3 +37,5 @@ github.com/gohugoio/gohugoioTheme v0.0.0-20220905093719-cb8b64046950 h1:Ovlh3nuy github.com/gohugoio/gohugoioTheme v0.0.0-20220905093719-cb8b64046950/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs= github.com/gohugoio/gohugoioTheme v0.0.0-20220912070954-88dcaf003b4d h1:UYJL6RmEepprvlgHvDnFCWtPOvjmqzFCQ90cRDRBO7U= github.com/gohugoio/gohugoioTheme v0.0.0-20220912070954-88dcaf003b4d/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs= +github.com/gohugoio/gohugoioTheme v0.0.0-20220914071648-0ef1c51685bf h1:A8Ksnvp8reNt2Ap0mUK7gFkJkCjt9R60yopGsezcOBA= +github.com/gohugoio/gohugoioTheme v0.0.0-20220914071648-0ef1c51685bf/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs= From 6beb443c58f1cc216b7f6ec7f423f9423e4528dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 15 Sep 2022 18:50:21 +0200 Subject: [PATCH 002/108] netlify: Hugo 0.103.0 --- netlify.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/netlify.toml b/netlify.toml index 6b6276364..bfc098a8c 100644 --- a/netlify.toml +++ b/netlify.toml @@ -3,7 +3,7 @@ publish = "public" command = "hugo --gc --minify" [context.production.environment] -HUGO_VERSION = "0.102.3" +HUGO_VERSION = "0.103.0" HUGO_ENV = "production" HUGO_ENABLEGITINFO = "true" @@ -11,20 +11,20 @@ HUGO_ENABLEGITINFO = "true" command = "hugo --gc --minify --enableGitInfo" [context.split1.environment] -HUGO_VERSION = "0.102.3" +HUGO_VERSION = "0.103.0" HUGO_ENV = "production" [context.deploy-preview] command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL" [context.deploy-preview.environment] -HUGO_VERSION = "0.102.3" +HUGO_VERSION = "0.103.0" [context.branch-deploy] command = "hugo --gc --minify -b $DEPLOY_PRIME_URL" [context.branch-deploy.environment] -HUGO_VERSION = "0.102.3" +HUGO_VERSION = "0.103.0" [context.next.environment] HUGO_ENABLEGITINFO = "true" From 50f5d4776f647899a3c1d863e84d44ff72972cbe Mon Sep 17 00:00:00 2001 From: Salim B Date: Thu, 15 Sep 2022 19:41:07 +0200 Subject: [PATCH 003/108] Fix internal link (#1817) --- content/en/getting-started/configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/getting-started/configuration.md b/content/en/getting-started/configuration.md index 4f1efefb3..5b27832bb 100644 --- a/content/en/getting-started/configuration.md +++ b/content/en/getting-started/configuration.md @@ -554,7 +554,7 @@ force = false {{< new-in "0.103.0" >}} -Hugo will, by default, render all 404 errors when running `hugo server` with the `404.html` template. Note that if you have already added one or more redirects to your [Server Config](#server-config), you need to add the 404 redirect explicitly, e.g: +Hugo will, by default, render all 404 errors when running `hugo server` with the `404.html` template. Note that if you have already added one or more redirects to your [Server Config](#configure-server), you need to add the 404 redirect explicitly, e.g: ```toml [[redirects]] From 0b0e890d1f1b70538591dc88f45dce0c2e28bb19 Mon Sep 17 00:00:00 2001 From: Tanya Bouman Date: Fri, 16 Sep 2022 10:53:11 -0400 Subject: [PATCH 004/108] Update markdownify and RenderString documentation (#1818) These updates are from https://github.com/gohugoio/hugo/issues/9538 --- content/en/functions/RenderString.md | 3 +-- content/en/functions/markdownify.md | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/content/en/functions/RenderString.md b/content/en/functions/RenderString.md index e414b11ca..014e32599 100644 --- a/content/en/functions/RenderString.md +++ b/content/en/functions/RenderString.md @@ -32,5 +32,4 @@ Some examples: {{ "/italic org mode/" | $p.RenderString $optOrg }} ``` - -**Note** that this method is more powerful than the similar [markdownify](/functions/markdownify/) function as it also supports [Render Hooks](/getting-started/configuration-markup/#markdown-render-hooks) and it has options to render other markup formats. +{{< new-in "0.93.0" >}} **Note**: [markdownify](/functions/markdownify/) uses this function in order to support [Render Hooks](/getting-started/configuration-markup/#markdown-render-hooks). diff --git a/content/en/functions/markdownify.md b/content/en/functions/markdownify.md index 171c3bf10..b108ccb94 100644 --- a/content/en/functions/markdownify.md +++ b/content/en/functions/markdownify.md @@ -23,7 +23,6 @@ aliases: [] {{ .Title | markdownify }} ``` -*Note*: if you need [Render Hooks][], which `markdownify` doesn't currently -support, use [.RenderString](/functions/renderstring/) instead. +{{< new-in "0.93.0" >}} **Note**: `markdownify` now supports [Render Hooks][] just like [.RenderString](/functions/renderstring/). -[Render Hooks]: /getting-started/configuration-markup/#markdown-render-hooks +[Render Hooks]: /templates/render-hooks/ From 9218ab9937ec342a6fa599791d63f18c9079620f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Sun, 18 Sep 2022 16:52:45 +0200 Subject: [PATCH 005/108] netlify: Hugo 0.103.1 --- netlify.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/netlify.toml b/netlify.toml index bfc098a8c..9259e7b39 100644 --- a/netlify.toml +++ b/netlify.toml @@ -3,7 +3,7 @@ publish = "public" command = "hugo --gc --minify" [context.production.environment] -HUGO_VERSION = "0.103.0" +HUGO_VERSION = "0.103.1" HUGO_ENV = "production" HUGO_ENABLEGITINFO = "true" @@ -11,20 +11,20 @@ HUGO_ENABLEGITINFO = "true" command = "hugo --gc --minify --enableGitInfo" [context.split1.environment] -HUGO_VERSION = "0.103.0" +HUGO_VERSION = "0.103.1" HUGO_ENV = "production" [context.deploy-preview] command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL" [context.deploy-preview.environment] -HUGO_VERSION = "0.103.0" +HUGO_VERSION = "0.103.1" [context.branch-deploy] command = "hugo --gc --minify -b $DEPLOY_PRIME_URL" [context.branch-deploy.environment] -HUGO_VERSION = "0.103.0" +HUGO_VERSION = "0.103.1" [context.next.environment] HUGO_ENABLEGITINFO = "true" From 1cc265d99fab08585a41093147c86bf3e87a82a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 20 Sep 2022 10:22:53 +0200 Subject: [PATCH 006/108] Update the GA template usage section Mostly to remove the async example (not relevant for GA4 which people should be using by now). See https://github.com/gohugoio/hugo/issues/9987 --- content/en/templates/internal.md | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/content/en/templates/internal.md b/content/en/templates/internal.md index ace21f548..15f90b102 100644 --- a/content/en/templates/internal.md +++ b/content/en/templates/internal.md @@ -45,20 +45,13 @@ googleAnalytics = "G-MEASUREMENT_ID" ### Use the Google Analytics Template -You can then include the Google Analytics internal template: +You can then include the Google Analytics internal template in the `` section of your template: -``` -{{ template "_internal/google_analytics.html" . }} -``` - - -``` -{{ template "_internal/google_analytics_async.html" . }} -``` - -When using Google Analytics v4 use `_internal/google_analytics.html`. - -A `.Site.GoogleAnalytics` variable is also exposed from the config. +```go-html-template +{{ if hugo.IsProduction }} + {{ template "_internal/google_analytics.html" . }} +{{ end }} + ``` ## Disqus From 26329723614fbcbb62e469871676b05c59f90910 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 20 Sep 2022 10:31:09 +0200 Subject: [PATCH 007/108] Adjust GA template instructions Vs. what Google says in their instructions. See https://github.com/gohugoio/hugo/issues/9987 --- content/en/templates/internal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/templates/internal.md b/content/en/templates/internal.md index 15f90b102..776fc924c 100644 --- a/content/en/templates/internal.md +++ b/content/en/templates/internal.md @@ -193,7 +193,7 @@ Hugo uses the page title and description for the card's title and description fi ### Use the Twitter Cards Template -To add Twitter card metadata, include the following line between the `` tags in your templates: +To add Twitter card metadata, include the following line immediately after the `` element in your templates: ``` {{ template "_internal/twitter_cards.html" . }} From 17aefc515ae5b593e176853e3b95dbe430e3fa46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 20 Sep 2022 10:37:15 +0200 Subject: [PATCH 008/108] Remove the recommendation about where to put the GA tempalte Thinking about it, I'm not sure where it's best to put it myself, so I don't think we should recommend anything so fast. See gohugoio/hugo#9987 --- content/en/templates/internal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/templates/internal.md b/content/en/templates/internal.md index 776fc924c..552c4470c 100644 --- a/content/en/templates/internal.md +++ b/content/en/templates/internal.md @@ -45,7 +45,7 @@ googleAnalytics = "G-MEASUREMENT_ID" ### Use the Google Analytics Template -You can then include the Google Analytics internal template in the `` section of your template: +You can then include the Google Analytics internal template your template: ```go-html-template {{ if hugo.IsProduction }} From c0c7339e0aa9e896c60862dd842fd9da45489067 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 20 Sep 2022 11:34:50 +0200 Subject: [PATCH 009/108] Update internal.md --- content/en/templates/internal.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/content/en/templates/internal.md b/content/en/templates/internal.md index 552c4470c..00e8ef084 100644 --- a/content/en/templates/internal.md +++ b/content/en/templates/internal.md @@ -53,6 +53,8 @@ You can then include the Google Analytics internal template your template: {{ end }} ``` +If you want to create your own template, you can access the configured ID with `{{ site.Config.Services.GoogleAnalytics.ID }}`. + ## Disqus Hugo also ships with an internal template for [Disqus comments][disqus], a popular commenting system for both static and dynamic websites. In order to effectively use Disqus, you will need to secure a Disqus "shortname" by [signing up for the free service][disqussignup]. From d1a84701bda91d696abbd59c3798dcca1c276505 Mon Sep 17 00:00:00 2001 From: bearomorphism Date: Tue, 20 Sep 2022 20:15:45 +0800 Subject: [PATCH 010/108] fix typo in template introduction (#1820) --- content/en/templates/introduction.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/content/en/templates/introduction.md b/content/en/templates/introduction.md index ba66afa86..6d8a49fbb 100644 --- a/content/en/templates/introduction.md +++ b/content/en/templates/introduction.md @@ -4,7 +4,7 @@ linktitle: Templating description: Hugo uses Go's `html/template` and `text/template` libraries as the basis for the templating. date: 2017-02-01 publishdate: 2017-02-01 -lastmod: 2017-02-25 +lastmod: 2022-09-20 categories: [templates,fundamentals] keywords: [go] menu: @@ -70,8 +70,8 @@ Accessing the Page Parameter `bar` defined in a piece of content's [front matter #### A Single Statement Can be Split over Multiple Lines ```go-html-template -{{ if or - (isset .Params "alt") +{{ if or + (isset .Params "alt") (isset .Params "caption") }} ``` @@ -139,7 +139,7 @@ Go Templates only ship with a few basic functions but also provide a mechanism f ``` -Note that both examples make use of Go Template's [math]][] functions. +Note that both examples make use of Go Template's [math][math] functions. {{% note "Additional Boolean Operators" %}} There are more boolean operators than those listed in the Hugo docs in the [Go Template documentation](https://golang.org/pkg/text/template/#hdr-Functions). @@ -293,7 +293,7 @@ See the [`.Param` function][param]. #### Example 3: `if` An alternative (and a more verbose) way of writing `with` is using -`if`. Here, the `.` does not get rebinded. +`if`. Here, the `.` does not get rebound. Below example is "Example 1" rewritten using `if`: @@ -405,7 +405,7 @@ that `{{ . }}` always refers to the **current context**. - In the top level of your template, this will be the data set made available to it. -- Inside of an iteration, however, it will have the value of the +- Inside an iteration, however, it will have the value of the current item in the loop; i.e., `{{ . }}` will no longer refer to the data available to the entire page. @@ -430,7 +430,7 @@ The following shows how to define a variable independent of the context. {{< /code >}} {{% note %}} -Notice how once we have entered the loop (i.e. `range`), the value of `{{ . }}` has changed. We have defined a variable outside of the loop (`{{$title}}`) that we've assigned a value so that we have access to the value from within the loop as well. +Notice how once we have entered the loop (i.e. `range`), the value of `{{ . }}` has changed. We have defined a variable outside the loop (`{{$title}}`) that we've assigned a value so that we have access to the value from within the loop as well. {{% /note %}} ### 2. Use `$.` to Access the Global Context From 8e3f9ca64b48caffe39eba9469e9fc0daa57ca9e Mon Sep 17 00:00:00 2001 From: Christian Oliff Date: Thu, 22 Sep 2022 18:22:21 +0900 Subject: [PATCH 011/108] Remove outdated IE conditional comments example (#1821) This only applied to IE9 and lower which hasn't been supported for a long time and has 0.0% browser marketshare. --- content/en/templates/introduction.md | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/content/en/templates/introduction.md b/content/en/templates/introduction.md index 6d8a49fbb..970327b41 100644 --- a/content/en/templates/introduction.md +++ b/content/en/templates/introduction.md @@ -382,22 +382,6 @@ Stuff Here {{ end }} ``` -### Example 4: Internet Explorer Conditional Comments {#ie-conditional-comments} - -By default, Go Templates remove HTML comments from output. This has the unfortunate side effect of removing Internet Explorer conditional comments. As a workaround, use something like this: - -```go-html-template -{{ "" | safeHTML }} -``` - -Alternatively, you can use the backtick (`` ` ``) to quote the IE conditional comments, avoiding the tedious task of escaping every double quotes (`"`) inside, as demonstrated in the [examples](https://golang.org/pkg/text/template/#hdr-Examples) in the Go text/template documentation: - -```go-html-template -{{ `` | safeHTML }} -``` - ## Context (aka "the dot") {#the-dot} The most easily overlooked concept to understand about Go Templates is From 3c43a8bbe8fd333b3f82f3f2e66dbfcc43bca86b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Fri, 23 Sep 2022 16:59:08 +0200 Subject: [PATCH 012/108] netlify: Hugo 0.104.0 --- netlify.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/netlify.toml b/netlify.toml index 9259e7b39..44bddce62 100644 --- a/netlify.toml +++ b/netlify.toml @@ -3,7 +3,7 @@ publish = "public" command = "hugo --gc --minify" [context.production.environment] -HUGO_VERSION = "0.103.1" +HUGO_VERSION = "0.104.0" HUGO_ENV = "production" HUGO_ENABLEGITINFO = "true" @@ -11,20 +11,20 @@ HUGO_ENABLEGITINFO = "true" command = "hugo --gc --minify --enableGitInfo" [context.split1.environment] -HUGO_VERSION = "0.103.1" +HUGO_VERSION = "0.104.0" HUGO_ENV = "production" [context.deploy-preview] command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL" [context.deploy-preview.environment] -HUGO_VERSION = "0.103.1" +HUGO_VERSION = "0.104.0" [context.branch-deploy] command = "hugo --gc --minify -b $DEPLOY_PRIME_URL" [context.branch-deploy.environment] -HUGO_VERSION = "0.103.1" +HUGO_VERSION = "0.104.0" [context.next.environment] HUGO_ENABLEGITINFO = "true" From 05d1192cdef14481ce2050fbae7a888322200322 Mon Sep 17 00:00:00 2001 From: Ivan Duka <39438519+ivanduka@users.noreply.github.com> Date: Mon, 26 Sep 2022 01:46:34 -0600 Subject: [PATCH 013/108] Update diagrams.md (#1823) Make it a bit more explicit that the variable won't be set until `.Content` that contains the render hook is processed. --- content/en/content-management/diagrams.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/content-management/diagrams.md b/content/en/content-management/diagrams.md index 243a70fd4..7c12d7fff 100644 --- a/content/en/content-management/diagrams.md +++ b/content/en/content-management/diagrams.md @@ -61,7 +61,7 @@ Hugo currently does not provide default templates for Mermaid diagrams. But you {{ .Page.Store.Set "hasMermaid" true }} ``` -And then include this snippet at the bottom of the content template (below `.Content`): +And then include this snippet at the bottom of the content template (**Note**: below `.Content` as the render hook is not processed until `.Content` is executed): ```go-html-template {{ if .Page.Store.Get "hasMermaid" }} From c2baf71553e368d6dfe08f103c9fa2b772e4fd1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Mon, 26 Sep 2022 19:27:00 +0200 Subject: [PATCH 014/108] netlify: Hugo 0.104.1 --- netlify.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/netlify.toml b/netlify.toml index 44bddce62..cdb8e6099 100644 --- a/netlify.toml +++ b/netlify.toml @@ -3,7 +3,7 @@ publish = "public" command = "hugo --gc --minify" [context.production.environment] -HUGO_VERSION = "0.104.0" +HUGO_VERSION = "0.104.1" HUGO_ENV = "production" HUGO_ENABLEGITINFO = "true" @@ -11,20 +11,20 @@ HUGO_ENABLEGITINFO = "true" command = "hugo --gc --minify --enableGitInfo" [context.split1.environment] -HUGO_VERSION = "0.104.0" +HUGO_VERSION = "0.104.1" HUGO_ENV = "production" [context.deploy-preview] command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL" [context.deploy-preview.environment] -HUGO_VERSION = "0.104.0" +HUGO_VERSION = "0.104.1" [context.branch-deploy] command = "hugo --gc --minify -b $DEPLOY_PRIME_URL" [context.branch-deploy.environment] -HUGO_VERSION = "0.104.0" +HUGO_VERSION = "0.104.1" [context.next.environment] HUGO_ENABLEGITINFO = "true" From f8c721162e78c0b1af1f1ad1045a698ec7982175 Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Mon, 26 Sep 2022 11:25:20 -0700 Subject: [PATCH 015/108] Update postcss.md --- content/en/hugo-pipes/postcss.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/content/en/hugo-pipes/postcss.md b/content/en/hugo-pipes/postcss.md index 46833e0a4..a411068b0 100755 --- a/content/en/hugo-pipes/postcss.md +++ b/content/en/hugo-pipes/postcss.md @@ -45,8 +45,7 @@ Note that this import routine does not care about the CSS spec, so you can have Hugo will look for imports relative to the module mount and will respect theme overrides. skipInlineImportsNotFound [bool] {{< new-in "0.99.0" >}} - -Before Hugo 0.99.0 when `inlineImports` was enabled and we failed to resolve an import, we logged it as a warning. We now fail the build. If you have regular CSS imports in your CSS that you want to preserve, you can either use imports with URL or media queries (Hugo does not try to resolve those) or set `skipInlineImportsNotFound` to true. +: Default is `false`. Before Hugo 0.99.0 when `inlineImports` was enabled and we failed to resolve an import, we logged it as a warning. We now fail the build. If you have regular CSS imports in your CSS that you want to preserve, you can either use imports with URL or media queries (Hugo does not try to resolve those) or set `skipInlineImportsNotFound` to true. _If no configuration file is used:_ From 347434cca16f3b0dda928581751e39c448c1de70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 29 Sep 2022 12:57:34 +0200 Subject: [PATCH 016/108] netlify: Hugo 0.104.2 --- netlify.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/netlify.toml b/netlify.toml index cdb8e6099..43f9948a3 100644 --- a/netlify.toml +++ b/netlify.toml @@ -3,7 +3,7 @@ publish = "public" command = "hugo --gc --minify" [context.production.environment] -HUGO_VERSION = "0.104.1" +HUGO_VERSION = "0.104.2" HUGO_ENV = "production" HUGO_ENABLEGITINFO = "true" @@ -11,20 +11,20 @@ HUGO_ENABLEGITINFO = "true" command = "hugo --gc --minify --enableGitInfo" [context.split1.environment] -HUGO_VERSION = "0.104.1" +HUGO_VERSION = "0.104.2" HUGO_ENV = "production" [context.deploy-preview] command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL" [context.deploy-preview.environment] -HUGO_VERSION = "0.104.1" +HUGO_VERSION = "0.104.2" [context.branch-deploy] command = "hugo --gc --minify -b $DEPLOY_PRIME_URL" [context.branch-deploy.environment] -HUGO_VERSION = "0.104.1" +HUGO_VERSION = "0.104.2" [context.next.environment] HUGO_ENABLEGITINFO = "true" From 09a7a46ae5fd3b83cd3f0abb90e5b2217e3c5d28 Mon Sep 17 00:00:00 2001 From: "Daniel F. Dickinson" Date: Sat, 1 Oct 2022 11:53:37 -0400 Subject: [PATCH 017/108] Remove my defunct and little used migrator (#1824) wpxr-to-static is not much used, and I have had recent reports that it does not work with current wordpress.com exports. As I have not needed to update the project myself and it is little used, I remove it from the Hugo documentation as I will be marking it archived and unmaintained. Signed-off-by: Daniel F. Dickinson Signed-off-by: Daniel F. Dickinson --- content/en/tools/migrations.md | 1 - 1 file changed, 1 deletion(-) diff --git a/content/en/tools/migrations.md b/content/en/tools/migrations.md index 7009164eb..22f55d450 100644 --- a/content/en/tools/migrations.md +++ b/content/en/tools/migrations.md @@ -49,7 +49,6 @@ Alternatively, you can use the new [Jekyll import command](/commands/hugo_import - [wordpress-to-hugo-exporter](https://github.com/SchumacherFM/wordpress-to-hugo-exporter) - A one-click WordPress plugin that converts all posts, pages, taxonomies, metadata, and settings to Markdown and YAML which can be dropped into Hugo. (Note: If you have trouble using this plugin, you can [export your site for Jekyll](https://wordpress.org/plugins/jekyll-exporter/) and use Hugo's built in Jekyll converter listed above.) - [blog2md](https://github.com/palaniraja/blog2md) - Works with [exported xml](https://en.support.wordpress.com/export/) file of your free YOUR-TLD.wordpress.com website. It also saves approved comments to `YOUR-POST-NAME-comments.md` file along with posts. - [wordhugopress](https://github.com/nantipov/wordhugopress) - A small utility written in Java, exports the entire WordPress site from the database and resource (e.g. images) files stored locally or remotely. Therefore, migration from the backup files is possible. Supports merging of the multiple WordPress sites into a single Hugo one. -- [wpxr-to-static](https://github.com/danielfdickinson/wpxr-to-static) - WordPress eXtended RSS to Static Generator Conversion, Python3 program to convert WordPress XML Export (WPXR) format files to Hugo Markdown files (with YAML metadata) and a `config.toml` for the site. Inspired by [exitwp-for-hugo](https://github.com/wooni005/exitwp-for-hugo) (a Python 2 \[EOL] script which works with the xml export from WordPress and converts WordPress pages and posts to Markdown and YAML for hugo). ## Medium From 892360f61955d41700a3a7db7dc026298adec252 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Mon, 3 Oct 2022 14:42:17 +0200 Subject: [PATCH 018/108] Update output-formats.md --- content/en/templates/output-formats.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/content/en/templates/output-formats.md b/content/en/templates/output-formats.md index df48d55dc..9add49dec 100644 --- a/content/en/templates/output-formats.md +++ b/content/en/templates/output-formats.md @@ -117,6 +117,9 @@ The following is the full list of configuration options for output formats and t `noUgly` : used to turn off ugly URLs If `uglyURLs` is set to `true` in your site. **Default:** `false`. +`ugly` +: Enable to override the global uglyURLs setting. + `notAlternative` : enable if it doesn't make sense to include this format in an `AlternativeOutputFormats` format listing on `Page` (e.g., with `CSS`). Note that we use the term *alternative* and not *alternate* here, as it does not necessarily replace the other format. **Default:** `false`. From 6cffff87a229361299c72ef3c7fa9e6a62f0c35d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 4 Oct 2022 16:50:14 +0200 Subject: [PATCH 019/108] netlify: Hugo 0.104.3 --- netlify.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/netlify.toml b/netlify.toml index 43f9948a3..8ba4fdfaa 100644 --- a/netlify.toml +++ b/netlify.toml @@ -3,7 +3,7 @@ publish = "public" command = "hugo --gc --minify" [context.production.environment] -HUGO_VERSION = "0.104.2" +HUGO_VERSION = "0.104.3" HUGO_ENV = "production" HUGO_ENABLEGITINFO = "true" @@ -11,20 +11,20 @@ HUGO_ENABLEGITINFO = "true" command = "hugo --gc --minify --enableGitInfo" [context.split1.environment] -HUGO_VERSION = "0.104.2" +HUGO_VERSION = "0.104.3" HUGO_ENV = "production" [context.deploy-preview] command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL" [context.deploy-preview.environment] -HUGO_VERSION = "0.104.2" +HUGO_VERSION = "0.104.3" [context.branch-deploy] command = "hugo --gc --minify -b $DEPLOY_PRIME_URL" [context.branch-deploy.environment] -HUGO_VERSION = "0.104.2" +HUGO_VERSION = "0.104.3" [context.next.environment] HUGO_ENABLEGITINFO = "true" From e9d72bcdab3dfd018d15b4b1ea0295574183c114 Mon Sep 17 00:00:00 2001 From: JB Date: Wed, 5 Oct 2022 03:20:44 +0200 Subject: [PATCH 020/108] Breadcrumb example: add basic accessibility (#1832) Add `aria-current="page"` for screen readers for the bredcrumb example. --- content/en/content-management/sections.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/content-management/sections.md b/content/en/content-management/sections.md index 6806e342c..17fcb0817 100644 --- a/content/en/content-management/sections.md +++ b/content/en/content-management/sections.md @@ -73,7 +73,7 @@ With the available [section variables and methods](#section-page-variables-and-m {{ else if not .p1.IsHome }} {{ template "breadcrumbnav" (dict "p1" .p1.Site.Home "p2" .p2 ) }} {{ end }} - + {{ .p1.Title }} {{ end }} From de5fa7b304a33302fa1214ce8cf5ee468c9caa9c Mon Sep 17 00:00:00 2001 From: Bryce Wray Date: Tue, 4 Oct 2022 20:22:14 -0500 Subject: [PATCH 021/108] Update search.md to include Pagefind (#1826) --- content/en/tools/search.md | 1 + 1 file changed, 1 insertion(+) diff --git a/content/en/tools/search.md b/content/en/tools/search.md index e28e144c1..528718bc4 100644 --- a/content/en/tools/search.md +++ b/content/en/tools/search.md @@ -27,6 +27,7 @@ A static website with a dynamic search function? Yes, Hugo provides an alternati * [Github Gist for Fuse.js integration](https://gist.github.com/eddiewebb/735feb48f50f0ddd65ae5606a1cb41ae). This gist demonstrates how to leverage Hugo's existing build time processing to generate a searchable JSON index used by [Fuse.js](https://fusejs.io/) on the client side. Although this gist uses Fuse.js for fuzzy matching, any client side search tool capable of reading JSON indexes will work. Does not require npm, grunt or other build-time tools except Hugo! * [hugo-search-index](https://www.npmjs.com/package/hugo-search-index). A library containing Gulp tasks and a prebuilt browser script that implements search. Gulp generates a search index from project markdown files. * [hugofastsearch](https://gist.github.com/cmod/5410eae147e4318164258742dd053993). A usability and speed update to "GitHub Gist for Fuse.js integration" — global, keyboard-optimized search. +* [Pagefind](https://github.com/cloudcannon/pagefind). A fully static search library that aims to perform well on large sites, while using as little of your users' bandwidth as possible. ## Commercial Search Services From 301379fc33b640dde0286ff723a52a43ed84f436 Mon Sep 17 00:00:00 2001 From: Christian Oliff Date: Fri, 7 Oct 2022 17:54:05 +0900 Subject: [PATCH 022/108] fix: use shorter image URL to make it easier to read (#1835) --- content/en/templates/render-hooks.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/content/en/templates/render-hooks.md b/content/en/templates/render-hooks.md index 6987819ca..3d114dc96 100644 --- a/content/en/templates/render-hooks.md +++ b/content/en/templates/render-hooks.md @@ -15,7 +15,6 @@ menu: {{< new-in "0.62.0" >}} Note that this is only supported with the [Goldmark](/getting-started/configuration-markup#goldmark) renderer. - You can override certain parts of the default Markdown rendering to HTML by creating templates with base names `render-{kind}` in `layouts/_default/_markup`. You can also create type/section specific hooks in `layouts/[type/section]/_markup`, e.g.: `layouts/blog/_markup`.{{< new-in "0.71.0" >}} @@ -101,7 +100,7 @@ Here is a code example for how the render-link.html template could look: ### Image Markdown example: ```md -![Text](https://d33wubrfki0l68.cloudfront.net/c38c7334cc3f23585738e40334284fddcaf03d5e/2e17c/images/hugo-logo-wide.svg "Title") +![Text](https://gohugo.io/images/hugo-logo-wide.svg "Title") ``` Here is a code example for how the render-image.html template could look: From 3f2e26f77fe2432192627a41ad7302a4a0cfc96f Mon Sep 17 00:00:00 2001 From: yakirk Date: Fri, 7 Oct 2022 11:55:24 +0300 Subject: [PATCH 023/108] Change link of repojacking vulnerable link - JekyllToHugo (#1834) --- content/en/tools/migrations.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/tools/migrations.md b/content/en/tools/migrations.md index 22f55d450..c3cef20a7 100644 --- a/content/en/tools/migrations.md +++ b/content/en/tools/migrations.md @@ -29,7 +29,7 @@ Take a look at this list of migration tools if you currently use other blogging Alternatively, you can use the new [Jekyll import command](/commands/hugo_import_jekyll/). -- [JekyllToHugo](https://github.com/SenjinDarashiva/JekyllToHugo) - A Small script for converting Jekyll blog posts to a Hugo site. +- [JekyllToHugo](https://github.com/fredrikloch/JekyllToHugo) - A Small script for converting Jekyll blog posts to a Hugo site. - [ConvertToHugo](https://github.com/coderzh/ConvertToHugo) - Convert your blog from Jekyll to Hugo. ## Ghost From 5636c208bd015646d63fe8b8dd85e89f8aebaaa2 Mon Sep 17 00:00:00 2001 From: Christian Oliff Date: Fri, 7 Oct 2022 19:57:44 +0900 Subject: [PATCH 024/108] Grammar and spelling fixes (#1836) --- .cspell.json | 14 +++++++++++++- content/en/about/hugo-and-gdpr.md | 2 +- content/en/content-management/diagrams.md | 3 --- content/en/content-management/front-matter.md | 2 +- content/en/content-management/multilingual.md | 4 ++-- content/en/content-management/related.md | 2 -- content/en/content-management/shortcodes.md | 4 ++-- .../en/content-management/syntax-highlighting.md | 2 +- content/en/contribute/development.md | 4 ++-- content/en/getting-started/configuration.md | 4 ++-- .../hosting-and-deployment/hosting-on-21yunbox.md | 1 - .../en/hosting-and-deployment/hosting-on-github.md | 4 ++-- .../hosting-and-deployment/hosting-on-netlify.md | 2 +- content/en/hugo-modules/configuration.md | 2 +- content/en/hugo-pipes/babel.md | 2 +- content/en/hugo-pipes/scss-sass.md | 4 ++-- content/en/templates/render-hooks.md | 2 +- content/en/variables/git.md | 2 +- 18 files changed, 33 insertions(+), 27 deletions(-) diff --git a/.cspell.json b/.cspell.json index 1a197ea7b..484259330 100644 --- a/.cspell.json +++ b/.cspell.json @@ -34,6 +34,7 @@ "brlink", "Brotli", "Browsersync", + "canonicalization", "canonify", "Catmull", "Catwoman", @@ -61,6 +62,7 @@ "datatable", "DATOCMS", "debugconfig", + "defang", "DELIM", "dhersam", "digitalcraftsman", @@ -79,10 +81,12 @@ "errorf", "erroridf", "Evernote", + "Exif", "exitwp", "expirydate", "Feminella", "firstpost", + "Flickr", "Formspree", "fpath", "Francia", @@ -95,6 +99,7 @@ "Getenv", "getjson", "getpage", + "Gitee", "Gmfc", "Goel", "Gohugo", @@ -188,6 +193,7 @@ "newparam", "Nichlas", "Nikhil", + "Nikola", "Njjy", "nlist", "nobr", @@ -257,6 +263,7 @@ "Sindre", "sitemapindex", "sitemapxml", + "slugorfilename", "Smartcrop", "Sprintf", "Startseite", @@ -278,6 +285,7 @@ "Tknx", "TLDR", "TMPDIR", + "toclevels", "TOCSS", "todos", "tojson", @@ -288,6 +296,8 @@ "toyaml", "twitteruser", "Unmarshal", + "unpublishdate", + "Unsharp", "urlize", "urlset", "utimestamp", @@ -301,15 +311,17 @@ "wibble", "wordcount", "workson", + "Wowchemy", "wpxr", "Xbaabbab", "xvzf", "yoyoyo", + "yunbox", "Zgotmpl", "zzbbaabb", "مدونتي" ], - "language": "en,en-GB,en-US,de,fr", + "language": "en,en-US,de,fr", "allowCompoundWords": true, "files": [ "**/*.md" diff --git a/content/en/about/hugo-and-gdpr.md b/content/en/about/hugo-and-gdpr.md index 269c5d432..81cc5782a 100644 --- a/content/en/about/hugo-and-gdpr.md +++ b/content/en/about/hugo-and-gdpr.md @@ -117,7 +117,7 @@ simple : If simple mode is enabled, a static and no-JS version of a tweet will be built. -**Note:** If you use the _simple mode_ for Twitter, you may want to disable the inlines styles provided by Hugo: +**Note:** If you use the _simple mode_ for Twitter, you may want to disable the inline styles provided by Hugo: {{< code-toggle file="config">}} [services] diff --git a/content/en/content-management/diagrams.md b/content/en/content-management/diagrams.md index 7c12d7fff..cc2a68cb4 100644 --- a/content/en/content-management/diagrams.md +++ b/content/en/content-management/diagrams.md @@ -272,6 +272,3 @@ https://arthursonzogni.com/Diagon/#Table │LITERAL = """" character { character } """" .│ └────────────────────────────────────────────────┘ ``` - - - diff --git a/content/en/content-management/front-matter.md b/content/en/content-management/front-matter.md index 0d8c2e3a6..20862074a 100644 --- a/content/en/content-management/front-matter.md +++ b/content/en/content-management/front-matter.md @@ -68,7 +68,7 @@ cascade : a map of Front Matter keys whose values are passed down to the page's descendants unless overwritten by self or a closer ancestor's cascade. See [Front Matter Cascade](#front-matter-cascade) for details. date -: the datetime assigned to this page. This is usually fetched from the `date` field in front matter, but this behaviour is configurable. +: the datetime assigned to this page. This is usually fetched from the `date` field in front matter, but this behavior is configurable. description : the description for the content. diff --git a/content/en/content-management/multilingual.md b/content/en/content-management/multilingual.md index e2450bb29..3e75e22c4 100644 --- a/content/en/content-management/multilingual.md +++ b/content/en/content-management/multilingual.md @@ -229,7 +229,7 @@ If using `url`, remember to include the language part as well: `/fr/compagnie/a- ### Page Bundles -To avoid the burden of having to duplicate files, each Page Bundle inherits the resources of its linked translated pages' bundles except for the content files (markdown files, html files etc...). +To avoid the burden of having to duplicate files, each Page Bundle inherits the resources of its linked translated pages' bundles except for the content files (Markdown files, HTML files etc...). Therefore, from within a template, the page will have access to the files from all linked pages' bundles. @@ -570,7 +570,7 @@ If there is more than one language defined, the `LanguagePrefix` variable will e ## Generate multilingual content with `hugo new` -Currently, `hugo new` is not ready to support generating multilingual content. But there is a [proposal topic](https://github.com/gohugoio/hugo/issues/7732) about this in Github issue to discuss how it should work. +Currently, `hugo new` is not ready to support generating multilingual content. But there is a [proposal topic](https://github.com/gohugoio/hugo/issues/7732) about this in GitHub issue to discuss how it should work. diff --git a/content/en/content-management/related.md b/content/en/content-management/related.md index 9ede15252..c7262b42d 100644 --- a/content/en/content-management/related.md +++ b/content/en/content-management/related.md @@ -14,12 +14,10 @@ aliases: [/content/related/,/related/] toc: true --- - Hugo uses a set of factors to identify a page's related content based on Front Matter parameters. This can be tuned to the desired set of indices and parameters or left to Hugo's default [Related Content configuration](#configure-related-content). ## List Related Content - To list up to 5 related pages (which share the same _date_ or _keyword_ parameters) is as simple as including something similar to this partial in your single page template: {{< code file="layouts/partials/related.html" >}} diff --git a/content/en/content-management/shortcodes.md b/content/en/content-management/shortcodes.md index 017267ec7..c5a126ab1 100644 --- a/content/en/content-management/shortcodes.md +++ b/content/en/content-management/shortcodes.md @@ -249,7 +249,7 @@ By adding the preceding `hidecaption` example, the following HTML will be added #### Example `instagram` Display -Using the preceding `instagram` with `hidecaption` example above, the following simulates the displayed experience for visitors to your website. Naturally, the final display will be contingent on your stylesheets and surrounding markup. +Using the preceding `instagram` with `hidecaption` example above, the following simulates the displayed experience for visitors to your website. Naturally, the final display will be contingent on your style sheets and surrounding markup. {{< instagram BWNjjyYFxVx hidecaption >}} @@ -414,7 +414,7 @@ Using the preceding `youtube` example, the following HTML will be added to your #### Example `youtube` Display -Using the preceding `youtube` example (without `autoplay="true"`), the following simulates the displayed experience for visitors to your website. Naturally, the final display will be contingent on your stylesheets and surrounding markup. The video is also include in the [Quick Start of the Hugo documentation][quickstart]. +Using the preceding `youtube` example (without `autoplay="true"`), the following simulates the displayed experience for visitors to your website. Naturally, the final display will be contingent on your style sheets and surrounding markup. The video is also include in the [Quick Start of the Hugo documentation][quickstart]. {{< youtube w7Ft2ymGmfc >}} diff --git a/content/en/content-management/syntax-highlighting.md b/content/en/content-management/syntax-highlighting.md index 5195b8211..1c5de035d 100644 --- a/content/en/content-management/syntax-highlighting.md +++ b/content/en/content-management/syntax-highlighting.md @@ -36,7 +36,7 @@ Run `hugo gen chromastyles -h` for more options. See https://xyproto.github.io/s ## Highlight Shortcode -Highlighting is carried out via the built-in [`highlight` shortcode](https://gohugo.io/content-management/shortcodes/#highlight). It takes exactly one required parameter for the programming language to be highlighted and requires a closing shortcode. Note that `highlight` is *not* used for client-side javascript highlighting. +Highlighting is carried out via the built-in [`highlight` shortcode](https://gohugo.io/content-management/shortcodes/#highlight). It takes exactly one required parameter for the programming language to be highlighted and requires a closing shortcode. Note that `highlight` is *not* used for client-side JavaScript highlighting. Options: diff --git a/content/en/contribute/development.md b/content/en/contribute/development.md index 16489772e..41747f35e 100644 --- a/content/en/contribute/development.md +++ b/content/en/contribute/development.md @@ -65,7 +65,7 @@ You can print the `GOPATH` with `echo $GOPATH`. You should see a non-empty strin ### Install Go with Homebrew -If you are a MacOS user and have [Homebrew](https://brew.sh/) installed on your machine, installing Go is as simple as the following command: +If you are a macOS user and have [Homebrew](https://brew.sh/) installed on your machine, installing Go is as simple as the following command: {{< code file="install-go.sh" >}} brew install go @@ -374,7 +374,7 @@ Check the commit log if everything looks as expected. Should an error occur you ### Push commits -To push our commits to the fork on GitHub we need to specify a destination. A destination is defined by the remote and a branch name. Earlier, the defined that the remote url of our fork is the same as our GitHub handle, in my case `digitalcraftsman`. The branch should have the same as our local one. This makes it easy to identify corresponding branches. +To push our commits to the fork on GitHub we need to specify a destination. A destination is defined by the remote and a branch name. Earlier, the defined that the remote URL of our fork is the same as our GitHub handle, in my case `digitalcraftsman`. The branch should have the same as our local one. This makes it easy to identify corresponding branches. ``` git push --set-upstream diff --git a/content/en/getting-started/configuration.md b/content/en/getting-started/configuration.md index 5b27832bb..dae323d87 100644 --- a/content/en/getting-started/configuration.md +++ b/content/en/getting-started/configuration.md @@ -23,7 +23,7 @@ Hugo uses the `config.toml`, `config.yaml`, or `config.json` (if found in the site root) as the default site config file. The user can choose to override that default with one or more site config files -using the command line `--config` switch. +using the command-line `--config` switch. Examples: @@ -548,7 +548,7 @@ status = 200 force = false {{< /code-toggle >}} -{{< new-in "0.76.0" >}} Setting `force=true` will make a redirect even if there is existing content in the path. Note that before Hugo 0.76 `force` was the default behaviour, but this is inline with how Netlify does it. +{{< new-in "0.76.0" >}} Setting `force=true` will make a redirect even if there is existing content in the path. Note that before Hugo 0.76 `force` was the default behavior, but this is inline with how Netlify does it. ## 404 Server Error Page diff --git a/content/en/hosting-and-deployment/hosting-on-21yunbox.md b/content/en/hosting-and-deployment/hosting-on-21yunbox.md index b0ea7a7cf..1d8120283 100644 --- a/content/en/hosting-and-deployment/hosting-on-21yunbox.md +++ b/content/en/hosting-and-deployment/hosting-on-21yunbox.md @@ -4,7 +4,6 @@ linktitle: Host on 21YunBox description: Host your Hugo site with 21YunBox's blazing fast Chinese CDN, fully-managed SSL and auto deploys from Gitee. date: 2021-01-06 publishdate: 2021-01-06 -lastmod: 2021-01-06 categories: [hosting and deployment] keywords: [21yunbox,hosting,deployment] authors: [Toby Glei] diff --git a/content/en/hosting-and-deployment/hosting-on-github.md b/content/en/hosting-and-deployment/hosting-on-github.md index 22acca568..431ad73fd 100644 --- a/content/en/hosting-and-deployment/hosting-on-github.md +++ b/content/en/hosting-and-deployment/hosting-on-github.md @@ -43,11 +43,11 @@ The GitHub Actions used in these instructions pull source content from the `main As mentioned in the [GitHub Pages documentation][ghorgs], you can host a user/organization page in addition to project pages. Here are the key differences in GitHub Pages websites for Users and Organizations: 1. You must create a repository named `.github.io` or `.github.io` to host your pages -2. By default, content from the `main` branch is used to publish GitHub Pages - rather than the `gh-pages` branch which is the default for project sites. However, the GitHub Actions in these instructions publish to the `gh-pages` branch. Therefore, if you are publishing Github pages for a user or organization, you will need to change the publishing branch to `gh-pages`. See the instructions later in this document. +2. By default, content from the `main` branch is used to publish GitHub Pages - rather than the `gh-pages` branch which is the default for project sites. However, the GitHub Actions in these instructions publish to the `gh-pages` branch. Therefore, if you are publishing GitHub pages for a user or organization, you will need to change the publishing branch to `gh-pages`. See the instructions later in this document. ## Build Hugo With GitHub Action -GitHub executes your software development workflows. Everytime you push your code on the GitHub repository, Github Actions will build the site automatically. +GitHub executes your software development workflows. Every time you push your code on the GitHub repository, GitHub Actions will build the site automatically. Create a file in `.github/workflows/gh-pages.yml` containing the following content (based on [actions-hugo](https://github.com/marketplace/actions/hugo-setup)): diff --git a/content/en/hosting-and-deployment/hosting-on-netlify.md b/content/en/hosting-and-deployment/hosting-on-netlify.md index 1e2da8466..9fc1b6a62 100644 --- a/content/en/hosting-and-deployment/hosting-on-netlify.md +++ b/content/en/hosting-and-deployment/hosting-on-netlify.md @@ -136,7 +136,7 @@ git submodule update --rebase --remote ## Next Steps -You now have a live website served over https, distributed through CDN, and configured for continuous deployment. Dig deeper into the Netlify documentation: +You now have a live website served over HTTPS, distributed through CDN, and configured for continuous deployment. Dig deeper into the Netlify documentation: 1. [Using a Custom Domain][] 2. [Setting up HTTPS on Custom Domains][httpscustom] diff --git a/content/en/hugo-modules/configuration.md b/content/en/hugo-modules/configuration.md index 70de492ab..a91c47baa 100644 --- a/content/en/hugo-modules/configuration.md +++ b/content/en/hugo-modules/configuration.md @@ -31,7 +31,7 @@ noVendor {{< new-in "0.75.0" >}} : A optional Glob pattern matching module paths to skip when vendoring, e.g. "github.com/**" vendorClosest {{< new-in "0.81.0" >}} -: When enabled, we will pick the vendored module closest to the module using it. The default behaviour is to pick the first. Note that there can still be only one dependency of a given module path, so once it is in use it cannot be redefined. +: When enabled, we will pick the vendored module closest to the module using it. The default behavior is to pick the first. Note that there can still be only one dependency of a given module path, so once it is in use it cannot be redefined. proxy : Defines the proxy server to use to download remote modules. Default is `direct`, which means "git clone" and similar. diff --git a/content/en/hugo-pipes/babel.md b/content/en/hugo-pipes/babel.md index 7cf931f65..b39556ccf 100755 --- a/content/en/hugo-pipes/babel.md +++ b/content/en/hugo-pipes/babel.md @@ -66,7 +66,7 @@ verbose [bool] : Log everything sourceMap [string] -: Output `inline` or `external` sourcemap from the babel compile. External sourcemaps will be written to the target with the output file name + ".map". Input sourcemaps can be read from js.Build and node modules and combined into the output sourcemaps. +: Output `inline` or `external` sourcemap from the babel compile. External sourcemaps will be written to the target with the output filename + ".map". Input sourcemaps can be read from js.Build and node modules and combined into the output sourcemaps. ### Examples diff --git a/content/en/hugo-pipes/scss-sass.md b/content/en/hugo-pipes/scss-sass.md index c4a0a5520..25d3707dc 100755 --- a/content/en/hugo-pipes/scss-sass.md +++ b/content/en/hugo-pipes/scss-sass.md @@ -16,7 +16,7 @@ draft: false --- -Any SASS or SCSS file can be transformed into a CSS file using `resources.ToCSS` which takes two arguments, the resource object and a map of options listed below. +Any Sass or SCSS file can be transformed into a CSS file using `resources.ToCSS` which takes two arguments, the resource object and a map of options listed below. ```go-html-template {{ $sass := resources.Get "sass/main.scss" }} @@ -42,7 +42,7 @@ enableSourceMap [bool] : When enabled, a source map will be generated. includePaths [string slice] -: Additional SCSS/SASS include paths. Paths must be relative to the project directory. +: Additional SCSS/Sass include paths. Paths must be relative to the project directory. ```go-html-template {{ $options := (dict "targetPath" "style.css" "outputStyle" "compressed" "enableSourceMap" (not hugo.IsProduction) "includePaths" (slice "node_modules/myscss")) }} diff --git a/content/en/templates/render-hooks.md b/content/en/templates/render-hooks.md index 3d114dc96..5f56680d9 100644 --- a/content/en/templates/render-hooks.md +++ b/content/en/templates/render-hooks.md @@ -145,7 +145,7 @@ layouts └── render-codeblock-bash.html ``` -The default behaviour for these code blocks is to do [Code Highlighting](/content-management/syntax-highlighting/#highlighting-in-code-fences), but since you can pass attributes to these code blocks, they can be used for almost anything. One example would be the built-in [GoAT Diagrams](/content-management/diagrams/#goat-diagrams-ascii) or this [Mermaid Diagram Code Block Hook](/content-management/diagrams/#mermaid-diagrams) example. +The default behavior for these code blocks is to do [Code Highlighting](/content-management/syntax-highlighting/#highlighting-in-code-fences), but since you can pass attributes to these code blocks, they can be used for almost anything. One example would be the built-in [GoAT Diagrams](/content-management/diagrams/#goat-diagrams-ascii) or this [Mermaid Diagram Code Block Hook](/content-management/diagrams/#mermaid-diagrams) example. The context (the ".") you receive in a code block template contains: diff --git a/content/en/variables/git.md b/content/en/variables/git.md index 58a285fd9..24878e350 100644 --- a/content/en/variables/git.md +++ b/content/en/variables/git.md @@ -53,6 +53,6 @@ The `GitInfo` object contains the following fields: ## `.Lastmod` -If the `.GitInfo` feature is enabled, `.Lastmod` (on `Page`) is fetched from Git i.e. `.GitInfo.AuthorDate`. This behaviour can be changed by adding your own [front matter configuration for dates](/getting-started/configuration/#configure-front-matter). +If the `.GitInfo` feature is enabled, `.Lastmod` (on `Page`) is fetched from Git i.e. `.GitInfo.AuthorDate`. This behavior can be changed by adding your own [front matter configuration for dates](/getting-started/configuration/#configure-front-matter). [configuration]: /getting-started/configuration/ From 018f83bbe17b8a8322fba3028e701c6b4ce4f86a Mon Sep 17 00:00:00 2001 From: Tom Hopcraft Date: Fri, 7 Oct 2022 11:58:57 +0100 Subject: [PATCH 025/108] [comment platform] - add new alternative (#1751) --- content/en/content-management/comments.md | 1 + 1 file changed, 1 insertion(+) diff --git a/content/en/content-management/comments.md b/content/en/content-management/comments.md index 5c604fdeb..46d30b140 100644 --- a/content/en/content-management/comments.md +++ b/content/en/content-management/comments.md @@ -58,6 +58,7 @@ These are some alternatives to Disqus: * [Isso](https://posativ.org/isso/) (Self-hosted, Python) ([tutorial][issotutorial]) * [Muut](https://muut.com/) * [Remark42](https://remark42.com/) (Open source, Golang, Easy to run docker) +* [ReplyBox](https://getreplybox.com/) * [Staticman](https://staticman.net/) * [Talkyard](https://blog-comments.talkyard.io/) (Open source, & serverless hosting) * [Utterances](https://utteranc.es/) (Open source, GitHub comments widget built on GitHub issues) From ef73712ff8a24fb9a9ae5ab8c4a129fd280d1754 Mon Sep 17 00:00:00 2001 From: Andreas Deininger Date: Tue, 11 Oct 2022 15:17:46 +0200 Subject: [PATCH 026/108] Image processing. available methods: add method 'Colors' (#1837) Fixing typo. --- .../image-processing/index.md | 35 ++++++++++++------- content/en/contribute/development.md | 2 +- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/content/en/content-management/image-processing/index.md b/content/en/content-management/image-processing/index.md index d99ea7846..84e55989b 100644 --- a/content/en/content-management/image-processing/index.md +++ b/content/en/content-management/image-processing/index.md @@ -94,10 +94,10 @@ Example 3: A more concise way to skip image rendering if the resource is not fou ## Image Processing Methods -The `image` resource implements the `Resize`, `Fit`, `Fill`, `Crop`, `Filter`, and `Exif` methods. +The `image` resource implements the [`Resize`], [`Fit`], [`Fill`], [`Crop`], [`Filter`], [`Colors`] and [`Exif`] methods. {{% note %}} -Metadata (Exif, IPTC, XMP, etc.) is not preserved during image transformation. Use the`Exif` method with the _original_ image to extract Exif metadata from JPEG or TIFF images. +Metadata (Exif, IPTC, XMP, etc.) is not preserved during image transformation. Use the [`Exif`] method with the _original_ image to extract Exif metadata from JPEG or TIFF images. {{% /note %}} ### Resize @@ -167,7 +167,7 @@ Sometimes it can be useful to create the filter chain once and then reuse it. {{< new-in "0.104.0" >}} -`.Colors` returns a slice of hex string with the dominant colors in the image using a simple histogram method. +`.Colors` returns a slice of hex strings with the dominant colors in the image using a simple histogram method. ```go-html-template {{ $colors := $image.Colors }} @@ -180,7 +180,7 @@ This method is fast, but if you also scale down your images, it would be good fo Provides an [Exif] object containing image metadata. -You may access Exif data in JPEG and TIFF images. To prevent errors when processing images without Exif data, wrap the access in a `with` statement. +You may access Exif data in JPEG and TIFF images. To prevent errors when processing images without Exif data, wrap the access in a [`with`] statement. ```go-html-template {{ with $image.Exif }} @@ -226,11 +226,11 @@ You may also access Exif fields individually, using the [`lang.FormatNumber`] fu ## Image Processing Options -The `Resize`, `Fit`, `Fill`, and `Crop` methods accept a space-separated, case-insensitive list of options. The order of the options within the list is irrelevant. +The [`Resize`], [`Fit`], [`Fill`], and [`Crop`] methods accept a space-separated, case-insensitive list of options. The order of the options within the list is irrelevant. ### Dimensions -With the `Resize` method you must specify width, height, or both. The `Fit`, `Fill`, and `Crop` methods require both width and height. All dimensions are in pixels. +With the [`Resize`] method you must specify width, height, or both. The [`Fit`], [`Fill`], and [`Crop`] methods require both width and height. All dimensions are in pixels. ```go-html-template {{ $image := $image.Resize "600x" }} @@ -265,9 +265,9 @@ In the example above, on the second line, we have reversed width and height to r ### Anchor -When using the `Crop` or `Fill` method, the _anchor_ determines the placement of the crop box. You may specify `TopLeft`, `Top`, `TopRight`, `Left`, `Center`,`Right`, `BottomLeft`, `Bottom`, `BottomRight`, or `Smart`. +When using the [`Crop`] or [`Fill`] method, the _anchor_ determines the placement of the crop box. You may specify `TopLeft`, `Top`, `TopRight`, `Left`, `Center`,`Right`, `BottomLeft`, `Bottom`, `BottomRight`, or `Smart`. -The default value is `Smart`, which uses [Smartcrop] image analysis to determine the optimal placement of the crop box. You may override the default value in the [site configuration](#processing-options). +The default value is `Smart`, which uses [Smartcrop] image analysis to determine the optimal placement of the crop box. You may override the default value in the [site configuration]. For example, if you have a 400x200 image with a bird in the upper left quadrant, you can create a 200x100 thumbnail containing the bird: @@ -275,7 +275,7 @@ For example, if you have a 400x200 image with a bird in the upper left quadrant, {{ $image.Crop "200x100 TopLeft" }} ``` -If you apply rotation when using the `Crop` or `Fill` method, specify the anchor relative to the rotated image. +If you apply [rotation](#rotation) when using the [`Crop`] or [`Fill`] method, specify the anchor relative to the rotated image. ### Target Format @@ -299,7 +299,7 @@ To convert an image without scaling, use the dimensions of the original image: Applicable to JPEG and WebP images, the `q` value determines the quality of the converted image. Higher values produce better quality images, while lower values produce smaller files. Set this value to a whole number between 1 and 100, inclusive. -The default value is 75. You may override the default value in the [site configuration](#processing-options). +The default value is 75. You may override the default value in the [site configuration]. ```go-html-template {{ $image.Resize "600x webp q50" }} @@ -319,7 +319,7 @@ Value|Example `picture`|Indoor photograph such as a portrait `text`|Image that is primarily text -The default value is `photo`. You may override the default value in the [site configuration](#processing-options). +The default value is `photo`. You may override the default value in the [site configuration]. ```go-html-template {{ $image.Resize "600x webp picture" }} @@ -331,7 +331,7 @@ When converting an image from a format that supports transparency (e.g., PNG) to Use either a 3-digit or a 6-digit hexadecimal color code (e.g., `#00f` or `#0000ff`). -The default value is `#ffffff` (white). You may override the default value in the [site configuration](#processing-options). +The default value is `#ffffff` (white). You may override the default value in the [site configuration]. ```go-html-template {{ $image.Resize "600x jpg #b31280" }} @@ -350,7 +350,7 @@ Filter|Description `Linear`|Bilinear resampling filter, produces smooth output, faster than cubic filters `NearestNeighbor`|Fastest resampling filter, no antialiasing -The default value is `Box`. You may override the default value in the [site configuration](#processing-options). +The default value is `Box`. You may override the default value in the [site configuration]. ```go-html-template {{ $image.Resize "600x400 Lanczos" }} @@ -477,3 +477,12 @@ hugo --gc [page bundle]: {{< relref "content-management/page-bundles" >}} [Smartcrop]: [time.Format]: {{< relref "functions/dateformat" >}} +[`Colors`]: #colors +[`Crop`]: #crop +[`Exif`]: #exif +[`Fill`]: #fill +[`Filter`]: #filter +[`Fit`]: #fit +[`Resize`]: #resize +[site configuration]: #processing-options +[`with`]: /functions/with/ diff --git a/content/en/contribute/development.md b/content/en/contribute/development.md index 41747f35e..8e3c97edb 100644 --- a/content/en/contribute/development.md +++ b/content/en/contribute/development.md @@ -402,7 +402,7 @@ Last but not least you should accept the contributor license agreement (CLA). A ### Automatic builds -We use a GitHub Actions workflow to build and test. This is a matrix build across combinations of operating system (masOS, Windows, and Ubuntu) and Go versions. The workflow is triggered by the submission of a pull request. If you are a first-time contributor, the workflow requires approval from a project maintainer. +We use a GitHub Actions workflow to build and test. This is a matrix build across combinations of operating system (macOS, Windows, and Ubuntu) and Go versions. The workflow is triggered by the submission of a pull request. If you are a first-time contributor, the workflow requires approval from a project maintainer. ## Where to start? From 2446ad3497dbb6e276bad68e9f1ee1c1f4ade3e0 Mon Sep 17 00:00:00 2001 From: Mike Neumegen Date: Mon, 17 Oct 2022 20:14:16 -0700 Subject: [PATCH 027/108] Added Introduction to Hugo tutorial/video series (#1736) --- .../en/getting-started/external-learning-resources/index.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/content/en/getting-started/external-learning-resources/index.md b/content/en/getting-started/external-learning-resources/index.md index feb7cbb50..208a33930 100644 --- a/content/en/getting-started/external-learning-resources/index.md +++ b/content/en/getting-started/external-learning-resources/index.md @@ -38,6 +38,7 @@ Hugo in Action is a step-by-step guide to using Hugo to create static websites. ## Video tutorials -### Video Playlist by Mike Dane +* Mike Dane explains the various features of Hugo via dedicated tutorials on [YouTube](https://www.youtube.com/watch?list=PLLAZ4kZ9dFpOnyRlyS-liKL5ReHDcj4G3&v=qtIqKaDlqXo). -Mike Dane explains the various features of Hugo via dedicated tutorials on [YouTube](https://www.youtube.com/watch?list=PLLAZ4kZ9dFpOnyRlyS-liKL5ReHDcj4G3&v=qtIqKaDlqXo). +* [Introduction to building your first Hugo site](https://cloudcannon.com/community/learn/hugo-beginner-tutorial/ +) by Mike Neumegen. From 5e336bd26a1599c848439728c5596251be3e7c8e Mon Sep 17 00:00:00 2001 From: Bryce Wray Date: Mon, 17 Oct 2022 22:15:32 -0500 Subject: [PATCH 028/108] Replace awkward wording (ESL?) (#1842) --- content/en/content-management/taxonomies.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/content-management/taxonomies.md b/content/en/content-management/taxonomies.md index 32227d52c..8188c57ee 100644 --- a/content/en/content-management/taxonomies.md +++ b/content/en/content-management/taxonomies.md @@ -98,7 +98,7 @@ If you do not want Hugo to create any taxonomies, set `disableKinds` in your [si disableKinds = ["taxonomy","term"] {{}} -{{< new-in "0.73.0" >}} We have fixed the before confusing page kinds used for taxonomies (see the listing below) to be in line with the terms used when we talk about taxonomies. We have been careful to avoid site breakage, and you should get an ERROR in the console if you need to adjust your `disableKinds` section. +{{< new-in "0.73.0" >}} We have fixed the previously confusing page kinds used for taxonomies (see the listing below) to be in line with the terms used when we talk about taxonomies. We have been careful to avoid site breakage, and you should get an ERROR in the console if you need to adjust your `disableKinds` section. {{% page-kinds %}} From 385fa77c604528451c8602c776342d8d3c612c67 Mon Sep 17 00:00:00 2001 From: Rohit Yandigeri <91059418+RohitYandigeri@users.noreply.github.com> Date: Tue, 18 Oct 2022 08:49:02 +0530 Subject: [PATCH 029/108] Update articles.toml (#1840) --- data/articles.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/data/articles.toml b/data/articles.toml index eac45d20a..37b66928f 100644 --- a/data/articles.toml +++ b/data/articles.toml @@ -143,7 +143,7 @@ date = "2016-02-23" [[article]] - title = "Hugo: A Modern WebSite Engine That Just Works" + title = "Hugo: A Modern Website Engine That Just Works" url = "https://github.com/shekhargulati/52-technologies-in-2016/blob/master/07-hugo/README.md" author = "Shekhar Gulati" date = "2016-02-14" @@ -491,7 +491,7 @@ date = "2014-08-19" [[article]] - title = "Going with hugo" + title = "Going with Hugo" url = "http://www.markuseliasson.se/article/going-with-hugo/" author = "Markus Eliasson" date = "2014-08-18" @@ -509,7 +509,7 @@ date = "2014-08-11" [[article]] - title = "Beautiful sites for Open Source projects" + title = "Beautiful sites for Open Source Projects" url = "http://beautifulopen.com/2014/08/09/hugo/" author = "Beautiful Open" date = "2014-08-09" @@ -545,7 +545,7 @@ date = "2014-08-03" [[article]] - title = "Hugo Is Friggin' Awesome" + title = "Hugo Is Freakin' Awesome" url = "http://npf.io/2014/08/hugo-is-awesome/" author = "Nate Finch" date = "2014-08-01" From 54c253ab03fbb4424cd28c716640b2babfe758d3 Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Mon, 17 Oct 2022 23:36:06 -0400 Subject: [PATCH 030/108] Note that Google Universal Analytics are deprecated (#1770) Co-authored-by: Christian Oliff --- content/en/templates/internal.md | 37 ++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/content/en/templates/internal.md b/content/en/templates/internal.md index 00e8ef084..88d71baae 100644 --- a/content/en/templates/internal.md +++ b/content/en/templates/internal.md @@ -27,31 +27,40 @@ While the following internal templates are called similar to partials, they do * ## Google Analytics -Hugo ships with internal templates for Google Analytics tracking, including both synchronous and asynchronous tracking codes. As well as support for both v3 and v4 of Google Analytics. +Hugo ships with internal templates supporting Google Analytics, both [Google Analytics 4][GA4] (GA4) and Universal Analytics. + +**Note:** Universal Analytics are deprecated. For details, see [Universal Analytics will be going away][]. + +[GA4]: https://support.google.com/analytics/answer/10089681 +[Universal Analytics will be going away]: https://support.google.com/analytics/answer/11583528 ### Configure Google Analytics -Provide your tracking id in your configuration file: +Provide your tracking ID in your configuration file: -**Google Analytics v3 (analytics.js)** -{{< code-toggle file="config" >}} -googleAnalytics = "UA-PROPERTY_ID" -{{}} - -**Google Analytics v4 (gtag.js)** +**Google Analytics 4 (gtag.js)** {{< code-toggle file="config" >}} googleAnalytics = "G-MEASUREMENT_ID" {{}} +**Google Universal Analytics (analytics.js)** +{{< code-toggle file="config" >}} +googleAnalytics = "UA-PROPERTY_ID" +{{}} + ### Use the Google Analytics Template -You can then include the Google Analytics internal template your template: +You can then include the Google Analytics internal template: -```go-html-template -{{ if hugo.IsProduction }} - {{ template "_internal/google_analytics.html" . }} -{{ end }} - ``` +``` +{{ template "_internal/google_analytics_async.html" . }} +``` + +**Note:** The async template is _not_ suitable for Google Analytics 4. + +``` +{{ template "_internal/google_analytics.html" . }} +``` If you want to create your own template, you can access the configured ID with `{{ site.Config.Services.GoogleAnalytics.ID }}`. From 63b3e082e283ba08aee05974839e8bd2b9e4bffe Mon Sep 17 00:00:00 2001 From: Edd Turtle Date: Tue, 18 Oct 2022 04:42:50 +0100 Subject: [PATCH 031/108] Add tutorial on using fusejs to search examples (#1756) Co-authored-by: Christian Oliff --- content/en/tools/search.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/content/en/tools/search.md b/content/en/tools/search.md index 528718bc4..ec9a0965c 100644 --- a/content/en/tools/search.md +++ b/content/en/tools/search.md @@ -4,7 +4,6 @@ linktitle: Search description: See some of the open-source and commercial search options for your newly created Hugo website. date: 2017-02-01 publishdate: 2017-02-01 -lastmod: 2017-02-26 categories: [developer tools] keywords: [search,tools] menu: @@ -13,7 +12,6 @@ menu: weight: 60 weight: 60 sections_weight: 60 -draft: false aliases: [] toc: true --- @@ -24,9 +22,10 @@ A static website with a dynamic search function? Yes, Hugo provides an alternati * [hugo-lunr](https://www.npmjs.com/package/hugo-lunr). A simple way to add site search to your static Hugo site using [lunr.js](https://lunrjs.com/). Hugo-lunr will create an index file of any html and markdown documents in your Hugo project. * [hugo-lunr-zh](https://www.npmjs.com/package/hugo-lunr-zh). A bit like Hugo-lunr, but Hugo-lunr-zh can help you separate the Chinese keywords. -* [Github Gist for Fuse.js integration](https://gist.github.com/eddiewebb/735feb48f50f0ddd65ae5606a1cb41ae). This gist demonstrates how to leverage Hugo's existing build time processing to generate a searchable JSON index used by [Fuse.js](https://fusejs.io/) on the client side. Although this gist uses Fuse.js for fuzzy matching, any client side search tool capable of reading JSON indexes will work. Does not require npm, grunt or other build-time tools except Hugo! +* [GitHub Gist for Fuse.js integration](https://gist.github.com/eddiewebb/735feb48f50f0ddd65ae5606a1cb41ae). This gist demonstrates how to leverage Hugo's existing build time processing to generate a searchable JSON index used by [Fuse.js](https://fusejs.io/) on the client side. Although this gist uses Fuse.js for fuzzy matching, any client side search tool capable of reading JSON indexes will work. Does not require npm, grunt or other build-time tools except Hugo! * [hugo-search-index](https://www.npmjs.com/package/hugo-search-index). A library containing Gulp tasks and a prebuilt browser script that implements search. Gulp generates a search index from project markdown files. * [hugofastsearch](https://gist.github.com/cmod/5410eae147e4318164258742dd053993). A usability and speed update to "GitHub Gist for Fuse.js integration" — global, keyboard-optimized search. +* [JS & Fuse.js tutorial](https://makewithhugo.com/add-search-to-a-hugo-site/) A simple client-side search solution, using FuseJS (does not require jQuery). * [Pagefind](https://github.com/cloudcannon/pagefind). A fully static search library that aims to perform well on large sites, while using as little of your users' bandwidth as possible. ## Commercial Search Services From ab5a49c49d85374582515727dad3f68ce639325d Mon Sep 17 00:00:00 2001 From: Christian Oliff Date: Tue, 18 Oct 2022 22:25:06 +0900 Subject: [PATCH 032/108] Create codeql-analysis GitHub Action (#1812) --- .github/workflows/codeql-analysis.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 000000000..841383c96 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,26 @@ +name: "CodeQL" + +on: + schedule: + - cron: "0 0 1 * *" + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: 'javascript' + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 From fd91bfe1acaaf50c7a89f3e59ddf5baef58107b8 Mon Sep 17 00:00:00 2001 From: Christian Oliff Date: Wed, 19 Oct 2022 01:02:02 +0900 Subject: [PATCH 033/108] Formatting and grammar fixes (#1844) --- .cspell.json | 6 +++++ .github/workflows/spellcheck.yml | 3 ++- .textlintignore | 3 +++ README.md | 6 ++--- content/en/content-management/multilingual.md | 3 +-- content/en/contribute/documentation.md | 5 ++-- content/en/getting-started/_index.md | 2 -- .../getting-started/configuration-markup.md | 3 --- content/en/getting-started/configuration.md | 23 ++++++++++++------- .../en/getting-started/directory-structure.md | 7 +++--- .../external-learning-resources/index.md | 5 ++-- content/en/getting-started/installing.md | 8 +++---- .../deployment-with-rsync.md | 2 +- .../hosting-on-aws-amplify.md | 1 - content/en/hugo-modules/theme-components.md | 5 ---- content/en/hugo-modules/use-modules.md | 7 ++---- content/en/hugo-pipes/babel.md | 4 ---- content/en/hugo-pipes/fingerprint.md | 3 --- content/en/hugo-pipes/js.md | 23 ++++++++----------- content/en/hugo-pipes/postcss.md | 4 +--- content/en/hugo-pipes/scss-sass.md | 9 +++----- content/en/showcase/digitalgov/index.md | 2 +- content/en/showcase/fireship/index.md | 2 +- content/en/showcase/forestry/bio.md | 3 +-- content/en/showcase/godot-tutorials/bio.md | 4 +--- content/en/showcase/godot-tutorials/index.md | 4 ++-- .../en/showcase/hartwell-insurance/index.md | 2 +- content/en/showcase/small-multiples/index.md | 6 ++--- content/en/templates/data-templates.md | 2 +- content/en/templates/menu-templates.md | 2 +- content/en/tools/editors.md | 3 +-- content/en/tools/migrations.md | 7 +++--- content/en/tools/search.md | 4 ++-- .../en/troubleshooting/build-performance.md | 22 ++++++++---------- content/en/troubleshooting/faq.md | 6 ++--- content/en/variables/page.md | 1 - content/en/variables/pages.md | 4 ++-- content/en/variables/shortcodes.md | 5 ---- 38 files changed, 90 insertions(+), 121 deletions(-) create mode 100644 .textlintignore diff --git a/.cspell.json b/.cspell.json index 484259330..51dddc8d3 100644 --- a/.cspell.json +++ b/.cspell.json @@ -63,6 +63,7 @@ "DATOCMS", "debugconfig", "defang", + "Deindent", "DELIM", "dhersam", "digitalcraftsman", @@ -74,6 +75,7 @@ "DRING", "Eiqc", "Eliott", + "embeddable", "Emojify", "Enwrite", "eopkg", @@ -150,6 +152,7 @@ "keycdn", "KEYVALS", "kubernetes", + "Kubuntu", "Lanczos", "langformatnumber", "lastmod", @@ -157,6 +160,7 @@ "linktitle", "Lipi", "lrwxr", + "Lubuntu", "maingo", "markdownified", "markdownify", @@ -265,6 +269,7 @@ "sitemapxml", "slugorfilename", "Smartcrop", + "Sobre", "Sprintf", "Startseite", "strconv", @@ -314,6 +319,7 @@ "Wowchemy", "wpxr", "Xbaabbab", + "Xubuntu", "xvzf", "yoyoyo", "yunbox", diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml index 6f68fee18..b90689862 100644 --- a/.github/workflows/spellcheck.yml +++ b/.github/workflows/spellcheck.yml @@ -15,6 +15,7 @@ jobs: - uses: actions/checkout@v3 - uses: streetsidesoftware/cspell-action@v2 with: + check_dot_files: false + incremental_files_only: true inline: warning strict: false - incremental_files_only: true diff --git a/.textlintignore b/.textlintignore new file mode 100644 index 000000000..97a18e37c --- /dev/null +++ b/.textlintignore @@ -0,0 +1,3 @@ +**/news/** +**/showcase/** +**/zh/** \ No newline at end of file diff --git a/README.md b/README.md index a2c767b7b..072714a02 100644 --- a/README.md +++ b/README.md @@ -7,11 +7,11 @@ Documentation site for [Hugo](https://github.com/gohugoio/hugo), the very fast a ## Contributing -We welcome contributions to Hugo of any kind including documentation, suggestions, bug reports, pull requests etc. Also check out our [contribution guide](https://gohugo.io/contribute/documentation/). We would love to hear from you. +We welcome contributions to Hugo of any kind including documentation, suggestions, bug reports, pull requests etc. Also check out our [contribution guide](https://gohugo.io/contribute/documentation/). We would love to hear from you. -Note that this repository contains solely the documentation for Hugo. For contributions that aren't documentation-related please refer to the [hugo](https://github.com/gohugoio/hugo) repository. +Note that this repository contains solely the documentation for Hugo. For contributions that aren't documentation-related please refer to the [hugo](https://github.com/gohugoio/hugo) repository. -*Pull requests shall **only** contain changes to the actual documentation. However, changes on the code base of Hugo **and** the documentation shall be a single, atomic pull request in the [hugo](https://github.com/gohugoio/hugo) repository.* +*Pull requests shall **only** contain changes to the actual documentation. However, changes on the codebase of Hugo **and** the documentation shall be a single, atomic pull request in the [hugo](https://github.com/gohugoio/hugo) repository.* Spelling fixes are most welcomed, and if you want to contribute longer sections to the documentation, it would be great if you had the following criteria in mind when writing: diff --git a/content/en/content-management/multilingual.md b/content/en/content-management/multilingual.md index 3e75e22c4..abab72a60 100644 --- a/content/en/content-management/multilingual.md +++ b/content/en/content-management/multilingual.md @@ -59,7 +59,7 @@ weight = 3 Anything not defined in a `languages` block will fall back to the global value for that key (e.g., `copyright` for the English `en` language). This also works for `params`, as demonstrated with `help` above: You will get the value `Aide` in French and `Help` in all the languages without this parameter set. -With the configuration above, all content, sitemap, RSS feeds, paginations, +With the configuration above, all content, sitemap, RSS feeds, pagination, and taxonomy pages will be rendered below `/` in English (your default content language) and then below `/fr` in French. When working with front matter `Params` in [single page templates], omit the `params` in the key for the translation. @@ -538,7 +538,6 @@ And do the appropriate changes in the menu code to use the `i18n` tag with the ` {{- end }} {{< /code >}} - ## Missing Translations diff --git a/content/en/contribute/documentation.md b/content/en/contribute/documentation.md index df937f1e1..f4fce5d20 100644 --- a/content/en/contribute/documentation.md +++ b/content/en/contribute/documentation.md @@ -40,7 +40,7 @@ hugo new /.md ### Add a New Function -Once you have cloned the Hugo repository, you can create a new function via the following command. Keep the file name lowercase. +Once you have cloned the Hugo repository, you can create a new function via the following command. Keep the filename lowercase. ``` hugo new functions/newfunction.md @@ -94,7 +94,7 @@ Code blocks are crucial for providing examples of Hugo's new features to end use ### Standard Syntax -Across many pages on the Hugo docs, the typical triple-back-tick markdown syntax (```` ``` ````) is used. If you do not want to take the extra time to implement the following code block shortcodes, please use standard GitHub-flavored markdown. The Hugo docs use a version of [highlight.js](https://highlightjs.org/) with a specific set of languages. +Across many pages on the Hugo docs, the typical triple-back-tick Markdown syntax (```` ``` ````) is used. If you do not want to take the extra time to implement the following code block shortcodes, please use standard GitHub-flavored Markdown. The Hugo docs use a version of [highlight.js](https://highlightjs.org/) with a specific set of languages. Your options for languages are `xml`/`html`, `go`/`golang`, `md`/`markdown`/`mkd`, `handlebars`, `apache`, `toml`, `yaml`, `json`, `css`, `asciidoc`, `ruby`, `powershell`/`ps`, `scss`, `sh`/`zsh`/`bash`/`git`, `http`/`https`, and `javascript`/`js`. @@ -125,7 +125,6 @@ A whole bunch of coding going on up in here! The following are the arguments passed into `code`: - ***`file`*** : the only *required* argument. `file` is needed for styling but also plays an important role in helping users create a mental model around Hugo's directory structure. Visually, this will be displayed as text in the top left of the code block. diff --git a/content/en/getting-started/_index.md b/content/en/getting-started/_index.md index 1615bdd91..ef641daa5 100644 --- a/content/en/getting-started/_index.md +++ b/content/en/getting-started/_index.md @@ -4,7 +4,6 @@ linktitle: Get Started Overview description: Quick start and guides for installing Hugo on your preferred operating system. date: 2017-02-01 publishdate: 2017-02-01 -lastmod: 2017-02-01 categories: [getting started] keywords: [usage,docs] menu: @@ -12,7 +11,6 @@ menu: parent: "getting-started" weight: 1 weight: 0001 #rem -draft: false aliases: [/overview/introduction/] toc: false --- diff --git a/content/en/getting-started/configuration-markup.md b/content/en/getting-started/configuration-markup.md index 2a38c0ce4..335cb6cab 100644 --- a/content/en/getting-started/configuration-markup.md +++ b/content/en/getting-started/configuration-markup.md @@ -79,7 +79,6 @@ Note that attributes in [code fences](/content-management/syntax-highlighting/#h autoHeadingIDType ("github") {{< new-in "0.62.2" >}} : The strategy used for creating auto IDs (anchor names). Available types are `github`, `github-ascii` and `blackfriday`. `github` produces GitHub-compatible IDs, `github-ascii` will drop any non-Ascii characters after accent normalization, and `blackfriday` will make the IDs compatible with [Blackfriday](#blackfriday), the default Markdown engine before Hugo 0.60. Note that if Goldmark is your default Markdown engine, this is also the strategy used in the [anchorize](/functions/anchorize/) template func. - ### Highlight This is the default `highlight` configuration. Note that some of these settings can be set per code block, see [Syntax Highlighting](/content-management/syntax-highlighting/). @@ -108,8 +107,6 @@ endLevel ordered : Whether or not to generate an ordered list instead of an unordered list. - ## Markdown Render Hooks See [Markdown Render Hooks](/templates/render-hooks/). - diff --git a/content/en/getting-started/configuration.md b/content/en/getting-started/configuration.md index dae323d87..569bd6f65 100644 --- a/content/en/getting-started/configuration.md +++ b/content/en/getting-started/configuration.md @@ -12,7 +12,6 @@ menu: weight: 60 weight: 60 sections_weight: 60 -draft: false aliases: [/overview/source-directory/,/overview/configuration/] toc: true --- @@ -92,9 +91,8 @@ This is how you need to configure your `config.toml` files considering the above 3. Similarly in `staging/config.toml` you just need to have one line: ```googleAnalytics = "G-SSSSSSSS"``` - - Now you need to tell Hugo that you are using the staging environment. So your build command should be `hugo --environment staging` which will load the `G-SSSSSSSS` analytics code in your staging website + Now you need to tell Hugo that you are using the staging environment. So your build command should be `hugo --environment staging` which will load the `G-SSSSSSSS` analytics code in your staging website {{% note %}} Default environments are __development__ with `hugo server` and __production__ with `hugo`. @@ -125,7 +123,7 @@ The following is the full list of Hugo-defined variables with their default value in parentheses. Users may choose to override those values in their site config file(s). -### archetypeDir +### archetypeDir **Default value:** "archetypes" @@ -304,18 +302,23 @@ See [Configure Languages](/content-management/multilingual/#configure-languages) See [Disable a Language](/content-management/multilingual/#disable-a-language) ### markup + See [Configure Markup](/getting-started/configuration-markup).{{< new-in "0.60.0" >}} ### mediaTypes + See [Configure Media Types](/templates/output-formats/#media-types). ### menus + See [Add Non-content Entries to a Menu](/content-management/menus/#add-non-content-entries-to-a-menu). ### minify + See [Configure Minify](#configure-minify) ### module + Module config see [Module Config](/hugo-modules/configuration/).{{< new-in "0.56.0" >}} ### newContentEditor @@ -382,6 +385,7 @@ Enable this to make all relative URLs relative to content root. Note that this d When using `ref` or `relref` to resolve page links and a link cannot resolved, it will be logged with this log level. Valid values are `ERROR` (default) or `WARNING`. Any `ERROR` will fail the build (`exit -1`). ### refLinksNotFoundURL + URL to be used as a placeholder when a page reference cannot be found in `ref` or `relref`. Is used as-is. ### removePathAccents @@ -394,7 +398,6 @@ Removes [non-spacing marks](https://www.compart.com/en/unicode/category/Mn) from content/post/hügó.md --> https://example.org/post/hugo/ ``` - ### rssLimit **Default value:** -1 (unlimited) @@ -402,6 +405,7 @@ content/post/hügó.md --> https://example.org/post/hugo/ Maximum number of items in the RSS feed. ### sectionPagesMenu + See ["Section Menu for Lazy Bloggers"](/templates/menu-templates/#section-menu-for-lazy-bloggers). ### security @@ -409,6 +413,7 @@ See ["Section Menu for Lazy Bloggers"](/templates/menu-templates/#section-menu-f See [Security Policy](/about/security-model/#security-policy) ### sitemap + Default [sitemap configuration](/templates/sitemap-template/#configuration). ### summaryLength @@ -418,9 +423,11 @@ Default [sitemap configuration](/templates/sitemap-template/#configuration). The length of text in words to show in a [`.Summary`](/content-management/summaries/#automatic-summary-splitting). ### taxonomies + See [Configure Taxonomies](/content-management/taxonomies#configure-taxonomies). ### theme + : See [Module Config](/hugo-modules/configuration/#module-config-imports) for how to import a theme. ### themesDir @@ -429,19 +436,20 @@ See [Configure Taxonomies](/content-management/taxonomies#configure-taxonomies). The directory where Hugo reads the themes from. -### timeout +### timeout **Default value:** "30s" Timeout for generating page contents, specified as a [duration](https://pkg.go.dev/time#Duration) or in milliseconds. *Note:* this is used to bail out of recursive content generation. You might need to raise this limit if your pages are slow to generate (e.g., because they require large image processing or depend on remote contents). -### timeZone +### timeZone {{< new-in "0.87.0" >}} The time zone (or location), e.g. `Europe/Oslo`, used to parse front matter dates without such information and in the [`time` function](/functions/time/). The list of valid values may be system dependent, but should include `UTC`, `Local`, and any location in the [IANA Time Zone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). ### title + Site title. ### titleCaseStyle @@ -648,7 +656,6 @@ ignoreFiles = ['^/home/user/project/content/test\.md$'] Dates are important in Hugo, and you can configure how Hugo assigns dates to your content pages. You do this by adding a `frontmatter` section to your `config.toml`. - The default configuration is: {{< code-toggle file="config" >}} diff --git a/content/en/getting-started/directory-structure.md b/content/en/getting-started/directory-structure.md index c523219c2..5d52a84fe 100644 --- a/content/en/getting-started/directory-structure.md +++ b/content/en/getting-started/directory-structure.md @@ -22,7 +22,7 @@ toc: true {{< youtube sB0HLHjgQ7E >}} -Running the `hugo new site` generator from the command line will create a directory structure with the following elements: +Running the `hugo new site` generator from the command-line will create a directory structure with the following elements: ``` . @@ -36,14 +36,13 @@ Running the `hugo new site` generator from the command line will create a direct └── themes ``` - ## Directory Structure Explained The following is a high-level overview of each of the directories with links to each of their respective sections within the Hugo docs. [`archetypes`](/content-management/archetypes/) : You can create new content files in Hugo using the `hugo new` command. -By default, Hugo will create new content files with at least `date`, `title` (inferred from the file name), and `draft = true`. This saves time and promotes consistency for sites using multiple content types. You can create your own [archetypes][] with custom preconfigured front matter fields as well. +By default, Hugo will create new content files with at least `date`, `title` (inferred from the filename), and `draft = true`. This saves time and promotes consistency for sites using multiple content types. You can create your own [archetypes][] with custom preconfigured front matter fields as well. [`assets`][] : Stores all the files which need be processed by [Hugo Pipes](/hugo-pipes/). Only the files whose `.Permalink` or `.RelPermalink` are used will be published to the `public` directory. Note: assets directory is not created by default. @@ -73,7 +72,7 @@ From **Hugo 0.31** you can have multiple static directories. {{% /note %}} [`resources`][] -: Caches some files to speed up generation. Can be also used by template authors to distribute built SASS files, so you don't have to have the preprocessor installed. Note: resources directory is not created by default. +: Caches some files to speed up generation. Can be also used by template authors to distribute built Sass files, so you don't have to have the preprocessor installed. Note: resources directory is not created by default. [archetypes]: /content-management/archetypes/ [`assets`]: /hugo-pipes/introduction#asset-directory/ diff --git a/content/en/getting-started/external-learning-resources/index.md b/content/en/getting-started/external-learning-resources/index.md index 208a33930..7102e0831 100644 --- a/content/en/getting-started/external-learning-resources/index.md +++ b/content/en/getting-started/external-learning-resources/index.md @@ -34,11 +34,10 @@ Hugo in Action is a step-by-step guide to using Hugo to create static websites. ### Hugo tutorial by CloudCannon -[Step-by-step written tutorial](https://cloudcannon.com/community/learn/hugo-101/) to teach you the basics of creating a Hugo site. +[Step-by-step written tutorial](https://cloudcannon.com/community/learn/hugo-101/) to teach you the basics of creating a Hugo site. ## Video tutorials * Mike Dane explains the various features of Hugo via dedicated tutorials on [YouTube](https://www.youtube.com/watch?list=PLLAZ4kZ9dFpOnyRlyS-liKL5ReHDcj4G3&v=qtIqKaDlqXo). -* [Introduction to building your first Hugo site](https://cloudcannon.com/community/learn/hugo-beginner-tutorial/ -) by Mike Neumegen. +* [Introduction to building your first Hugo site](https://cloudcannon.com/community/learn/hugo-beginner-tutorial/) by Mike Neumegen. diff --git a/content/en/getting-started/installing.md b/content/en/getting-started/installing.md index 3fd8d0a57..beecf32e3 100644 --- a/content/en/getting-started/installing.md +++ b/content/en/getting-started/installing.md @@ -143,7 +143,7 @@ Remove `--tags extended` if you do not want/need Sass/SCSS support. 1. You know how to open the macOS terminal. 2. You're running a modern 64-bit Mac. -3. You will use `~/Sites` as the starting point for your site. (`~/Sites` is used for example purposes. If you are familiar enough with the command line and file system, you should have no issues following along with the instructions.) +3. You will use `~/Sites` as the starting point for your site. (`~/Sites` is used for example purposes. If you are familiar enough with the command-line and file system, you should have no issues following along with the instructions.) ### Pick Your Method @@ -161,12 +161,12 @@ There are pros and cons to each of the aforementioned methods: 1. **Package Manager.** Using a package manager is the simplest method and will require the least amount of work to maintain. The drawbacks aren't severe. The default package will be for the most recent release, so it will not have bug fixes until the next release (i.e., unless you install it with the `--HEAD` option in Homebrew). Releases may lag a few days behind because it has to be coordinated with another team. Nevertheless, this is the recommended installation method if you want to work from a stable, widely used source. Package managers work well and they are easy to update. -2. **Tarball.** Downloading and installing from the tarball is also easy, although it requires a few more command line skills than does Homebrew. Updates are easy as well: you just repeat the process with the new binary. This gives you the flexibility to have multiple versions on your computer. If you don't want to use `brew`, then the tarball/binary is a good choice. +2. **Tarball.** Downloading and installing from the tarball is also easy, although it requires a few more command-line skills than does Homebrew. Updates are easy as well: you just repeat the process with the new binary. This gives you the flexibility to have multiple versions on your computer. If you don't want to use `brew`, then the tarball/binary is a good choice. 3. **Building from Source.** Building from source is the most work. The advantage of building from source is that you don't have to wait for a release to add features or bug fixes. The disadvantage is that you need to spend more time managing the setup, which is manageable but requires more time than the preceding two options. {{% note %}} -Since building from source is appealing to more seasoned command line users, this guide will focus more on installing Hugo via Homebrew and Tarball. +Since building from source is appealing to more seasoned command-line users, this guide will focus more on installing Hugo via Homebrew and Tarball. {{% /note %}} ### Install Hugo with Brew @@ -384,7 +384,7 @@ You'll need a place to store the Hugo executable, your [content][], and the gene 1. Download the latest zipped Hugo executable from [Hugo Releases][releases]. 2. Extract all contents to your `..\Hugo\bin` folder. -3. Open Windows Command Line (cmd, "DOS") to add the `hugo.exe` executable to your PATH +3. Open Windows command-line (cmd, "DOS") to add the `hugo.exe` executable to your PATH * do `set PATH=%PATH%;C:\Hugo\bin` to have hugo in PATH for the currently opened cmd box * do `setx PATH "%PATH%;C:\Hugo\bin"` to have hugo in PATH for every newly opened cmd box * note: "setx", not "set", plus syntax 'key "val"', not 'key=val' diff --git a/content/en/hosting-and-deployment/deployment-with-rsync.md b/content/en/hosting-and-deployment/deployment-with-rsync.md index ad59b71f1..516426d08 100644 --- a/content/en/hosting-and-deployment/deployment-with-rsync.md +++ b/content/en/hosting-and-deployment/deployment-with-rsync.md @@ -105,7 +105,7 @@ hugo && rsync -avz --delete public/ ${USER}@${HOST}:~/${DIR} exit 0 ``` -Note that `DIR` is the relative path from the remote user's home. If you have to specify a full path (for instance `/var/www/mysite/`) you must change `~/${DIR}` to `${DIR}` inside the command line. For most cases you should not have to. +Note that `DIR` is the relative path from the remote user's home. If you have to specify a full path (for instance `/var/www/mysite/`) you must change `~/${DIR}` to `${DIR}` inside the command-line. For most cases you should not have to. Save and close, and make the `deploy` file executable: diff --git a/content/en/hosting-and-deployment/hosting-on-aws-amplify.md b/content/en/hosting-and-deployment/hosting-on-aws-amplify.md index 34a21e9e9..e4fda8904 100644 --- a/content/en/hosting-and-deployment/hosting-on-aws-amplify.md +++ b/content/en/hosting-and-deployment/hosting-on-aws-amplify.md @@ -53,5 +53,4 @@ If you need to use a different, perhaps newer, version of Hugo than the version 1. From the selection, click **Hugo** and ensure the version field says `latest` 1. Click **Save** to save the changes. - [Quick Start]: /getting-started/quick-start/ diff --git a/content/en/hugo-modules/theme-components.md b/content/en/hugo-modules/theme-components.md index f1feb636a..314bb1fc4 100644 --- a/content/en/hugo-modules/theme-components.md +++ b/content/en/hugo-modules/theme-components.md @@ -25,7 +25,6 @@ Since Hugo `0.42` a project can configure a theme as a composite of as many them theme = ["my-shortcodes", "base-theme", "hyde"] {{< /code-toggle >}} - You can even nest this, and have the theme component itself include theme components in its own `config.toml` (theme inheritance).[^1] The theme definition example above in `config.toml` creates a theme with 3 theme components with precedence from left to right. @@ -47,8 +46,4 @@ Also note that a component that is part of a theme can have its own configuratio The same rules apply here: The left-most param/menu etc. with the same ID will win. There are some hidden and experimental namespace support in the above, which we will work to improve in the future, but theme authors are encouraged to create their own namespaces to avoid naming conflicts. - [^1]: For themes hosted on the [Hugo Themes Showcase](https://themes.gohugo.io/) components need to be added as git submodules that point to the directory `exampleSite/themes` - - - diff --git a/content/en/hugo-modules/use-modules.md b/content/en/hugo-modules/use-modules.md index 038e0bf89..bcd5d7a18 100644 --- a/content/en/hugo-modules/use-modules.md +++ b/content/en/hugo-modules/use-modules.md @@ -20,8 +20,6 @@ toc: true {{< gomodules-info >}} - - ## Initialize a New Module Use `hugo mod init` to initialize a new Hugo Module. If it fails to guess the module path, you must provide it as an argument, e.g.: @@ -33,6 +31,7 @@ hugo mod init github.com/gohugoio/myShortcodes Also see the [CLI Doc](/commands/hugo_mod_init/). ## Use a Module for a Theme + The easiest way to use a Module for a theme is to import it in the config. 1. Initialize the hugo module system: `hugo mod init github.com//` @@ -71,6 +70,7 @@ hugo mod get -u ./... ```bash hugo mod get -u github.com/gohugoio/myShortcodes ``` + ### Get a Specific Version ```bash @@ -125,7 +125,6 @@ Note that: Also see the [CLI Doc](/commands/hugo_mod_vendor/). - ## Tidy go.mod, go.sum Run `hugo mod tidy` to remove unused entries in `go.mod` and `go.sum`. @@ -138,6 +137,4 @@ Run `hugo mod clean` to delete the entire modules cache. Note that you can also configure the `modules` cache with a `maxAge`, see [File Caches](/getting-started/configuration/#configure-file-caches). - - Also see the [CLI Doc](/commands/hugo_mod_clean/). diff --git a/content/en/hugo-pipes/babel.md b/content/en/hugo-pipes/babel.md index b39556ccf..e60c1cbea 100755 --- a/content/en/hugo-pipes/babel.md +++ b/content/en/hugo-pipes/babel.md @@ -3,7 +3,6 @@ title: Babel description: Hugo Pipes can process JS files with Babel. date: 2019-03-21 publishdate: 2019-03-21 -lastmod: 2019-03-21 categories: [asset management] keywords: [] menu: @@ -12,7 +11,6 @@ menu: weight: 48 weight: 48 sections_weight: 48 -draft: false --- Any JavaScript resource file can be transpiled to another JavaScript version using `resources.Babel` which takes for argument the resource object and an optional dict of options listed below. Babel uses the [babel cli](https://babeljs.io/docs/en/babel-cli). @@ -46,8 +44,6 @@ module.exports = { }; ``` - - ### Options config [string] diff --git a/content/en/hugo-pipes/fingerprint.md b/content/en/hugo-pipes/fingerprint.md index b58b577db..9916f9c4d 100755 --- a/content/en/hugo-pipes/fingerprint.md +++ b/content/en/hugo-pipes/fingerprint.md @@ -3,7 +3,6 @@ title: Fingerprinting and SRI description: Hugo Pipes allows Fingerprinting and Subresource Integrity. date: 2018-07-14 publishdate: 2018-07-14 -lastmod: 2018-07-14 categories: [asset management] keywords: [] menu: @@ -12,10 +11,8 @@ menu: weight: 70 weight: 70 sections_weight: 70 -draft: false --- - Fingerprinting and [SRI](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) can be applied to any asset file using `resources.Fingerprint` which takes two arguments, the resource object and a [hash function](https://en.wikipedia.org/wiki/Cryptographic_hash_function). The default hash function is `sha256`. Other available functions are `sha384` (from Hugo `0.55`), `sha512` and `md5`. diff --git a/content/en/hugo-pipes/js.md b/content/en/hugo-pipes/js.md index ff29ca958..6ae801ade 100644 --- a/content/en/hugo-pipes/js.md +++ b/content/en/hugo-pipes/js.md @@ -3,7 +3,6 @@ title: JavaScript Building description: Hugo Pipes can process JavaScript files with [ESBuild](https://github.com/evanw/esbuild). date: 2020-07-20 publishdate: 2020-07-20 -lastmod: 2020-07-20 categories: [asset management] keywords: [] menu: @@ -20,7 +19,7 @@ Any JavaScript resource file can be transpiled and "tree shaken" using `js.Build ### Options targetPath [string] -: If not set, the source path will be used as the base target path. +: If not set, the source path will be used as the base target path. Note that the target path's extension may change if the target MIME type is different, e.g. when the source is TypeScript. params [map or slice] {{< new-in "0.78.0" >}} @@ -29,11 +28,11 @@ params [map or slice] {{< new-in "0.78.0" >}} ```go-html-template {{ $js := resources.Get "js/main.js" | js.Build (dict "params" (dict "api" "https://example.org/api")) }} ``` -And then in your JS file: +And then in your JS file: ```js import * as params from '@params'; -``` +``` Note that this is meant for small data sets, e.g. config settings. For larger data, please put/mount the files into `/assets` and import them directly. @@ -63,7 +62,6 @@ module.exports = window.React; module.exports = window.ReactDOM; ``` - With the above, these imports should work in both scenarios: ```js @@ -97,7 +95,7 @@ format [string] {{< new-in "0.74.3" >}} Default is `iife`, a self-executing function, suitable for inclusion as a ``` - - diff --git a/content/en/hugo-pipes/postcss.md b/content/en/hugo-pipes/postcss.md index a411068b0..a1c166efd 100755 --- a/content/en/hugo-pipes/postcss.md +++ b/content/en/hugo-pipes/postcss.md @@ -3,7 +3,6 @@ title: PostCSS description: Hugo Pipes can process CSS files with PostCSS. date: 2018-07-14 publishdate: 2018-07-14 -lastmod: 2018-07-14 categories: [asset management] keywords: [] menu: @@ -12,10 +11,9 @@ menu: weight: 40 weight: 40 sections_weight: 40 -draft: false --- -Any asset file can be processed using `resources.PostCSS` which takes for argument the resource object and a slice of options listed below. +Any asset file can be processed using `resources.PostCSS` which takes for argument the resource object and a slice of options listed below. The resource will be processed using the project's or theme's own `postcss.config.js` or any file set with the `config` option. diff --git a/content/en/hugo-pipes/scss-sass.md b/content/en/hugo-pipes/scss-sass.md index 25d3707dc..91a4164de 100755 --- a/content/en/hugo-pipes/scss-sass.md +++ b/content/en/hugo-pipes/scss-sass.md @@ -1,9 +1,8 @@ --- -title: SASS / SCSS -description: Hugo Pipes allows the processing of SASS and SCSS files. +title: Sass / SCSS +description: Hugo Pipes allows the processing of Sass and SCSS files. date: 2018-07-14 publishdate: 2018-07-14 -lastmod: 2018-07-14 categories: [asset management] keywords: [] menu: @@ -12,10 +11,8 @@ menu: weight: 30 weight: 02 sections_weight: 02 -draft: false --- - Any Sass or SCSS file can be transformed into a CSS file using `resources.ToCSS` which takes two arguments, the resource object and a map of options listed below. ```go-html-template @@ -50,5 +47,5 @@ includePaths [string slice] ``` {{% note %}} -Setting `outputStyle` to `compressed` will handle SASS/SCSS files minification better than the more generic [`resources.Minify`]({{< ref "minification">}}). +Setting `outputStyle` to `compressed` will handle Sass/SCSS files minification better than the more generic [`resources.Minify`]({{< ref "minification">}}). {{% /note %}} diff --git a/content/en/showcase/digitalgov/index.md b/content/en/showcase/digitalgov/index.md index 63f44b645..b06eb355b 100644 --- a/content/en/showcase/digitalgov/index.md +++ b/content/en/showcase/digitalgov/index.md @@ -13,7 +13,7 @@ Through collaboration in our communities of practice, Digital.gov is a window in Digital.gov is built using the [U.S. Web Design System](https://designsystem.digital.gov/) (USWDS) and have followed the [design principles](https://designsystem.digital.gov/maturity-model/) in building out our new site: - **Start with real user needs** — We used human-centered design methods to inform our product decisions (like qualitative user research), and gathered feedback from real users. We also continually test our assumptions with small experiments. -- **Earn trust** —We recognize that trust has to be earned every time. We are including all [required links and content](https://digital.gov/resources/required-web-content-and-links/) on our site, clearly identifying as a government site, building with modern best practices, and using https. +- **Earn trust** —We recognize that trust has to be earned every time. We are including all [required links and content](https://digital.gov/resources/required-web-content-and-links/) on our site, clearly identifying as a government site, building with modern best practices, and using HTTPS. - **Embrace accessibility** — [Accessibility](https://digital.gov/resources/intro-accessibility/) affects everybody, and we built it into every decision. We’re continually working to conform to Section 508 requirements, use user experience best practices, and support a wide range of devices. - **Promote continuity** — We started from shared solutions like USWDS and [Federalist](https://federalist.18f.gov/). We designed our site to clearly identify as a government site by including USWDS’s .gov banner, common colors and patterns, and built with modern best practices. - **Listen** — We actively collect user feedback and web metrics. We use the [Digital Analytics Program](https://digital.gov/services/dap/) (DAP) and analyze the data to discover actionable insights. We make small, incremental changes to continuously improve our website by listening to readers and learning from what we hear. diff --git a/content/en/showcase/fireship/index.md b/content/en/showcase/fireship/index.md index e9338a625..a229e4f6a 100644 --- a/content/en/showcase/fireship/index.md +++ b/content/en/showcase/fireship/index.md @@ -14,4 +14,4 @@ After careful consideration of JavaScript/JSX-based static site generators, it b - **Composability.** Hugo's partial and shortcode systems empower us to write DRY and maintainable templates. - **Simplicity.** Hugo is easy to learn (even without Go experience) and doesn't burden us with brittle dependencies. -The site is able to achieve Lighthouse performance scores of 95+, despite the fact that it is a fully interactive PWA that ships Angular and Firebase in the JS bundle. This is made possible by (1) prerendering content with Hugo and (2) lazily embedding native web components directly in the HTML and markdown. We provide a [detailed explanation](https://youtu.be/gun8OiGtlNc) of the architecture on YouTube and can't imagine development without Hugo. +The site is able to achieve Lighthouse performance scores of 95+, despite the fact that it is a fully interactive PWA that ships Angular and Firebase in the JS bundle. This is made possible by (1) prerendering content with Hugo and (2) lazily embedding native web components directly in the HTML and Markdown. We provide a [detailed explanation](https://youtu.be/gun8OiGtlNc) of the architecture on YouTube and can't imagine development without Hugo. diff --git a/content/en/showcase/forestry/bio.md b/content/en/showcase/forestry/bio.md index 767365cc0..0b8f28743 100644 --- a/content/en/showcase/forestry/bio.md +++ b/content/en/showcase/forestry/bio.md @@ -1,5 +1,4 @@ -Forestry.io is a Git-backed CMS (content management system) for websites and web products built using static site generators such as Hugo. +Forestry.io is a Git-backed CMS (content management system) for websites and web products built using static site generators such as Hugo. Forestry bridges the gap between developers and their teams, by making development fun and easy, while providing powerful content management for their teams. - diff --git a/content/en/showcase/godot-tutorials/bio.md b/content/en/showcase/godot-tutorials/bio.md index 92fccadf6..fd849f844 100644 --- a/content/en/showcase/godot-tutorials/bio.md +++ b/content/en/showcase/godot-tutorials/bio.md @@ -1,9 +1,7 @@ - [Godot Tutorials](https://godottutorials.com) aims to teach beginners how to get up and running with basic game programming and game development skills. The website is built with the **Hugo Framework** alongside aws+cloudfront+lambda. The site is built by: -* [Godot Tutorials](https://godottutorials.com) - +- [Godot Tutorials](https://godottutorials.com) diff --git a/content/en/showcase/godot-tutorials/index.md b/content/en/showcase/godot-tutorials/index.md index e33e413e1..56a8dfc4d 100644 --- a/content/en/showcase/godot-tutorials/index.md +++ b/content/en/showcase/godot-tutorials/index.md @@ -15,11 +15,11 @@ byline: "[Godot Tutorials](https://godottutorials.com), Web Developer & Game Pro [Godot Tutorials](https://godottutorials.com) started as a way to teach beginners game programming and game development. -As I created videos, I ran into a problem; if I made a mistake with a Youtube video, it was difficult to correct errors. +As I created videos, I ran into a problem; if I made a mistake with a YouTube video, it was difficult to correct errors. I discovered that blogging episodes and having articles that teach on top of my videos is a fantastic solution to my problem. -As I researched blogging platforms, I came across two solutions; however, I chose [Hugo](https://gohugo.io) because it's built with markdown in mind and simplified my workflow. +As I researched blogging platforms, I came across two solutions; however, I chose [Hugo](https://gohugo.io) because it's built with Markdown in mind and simplified my workflow. In a sense, with [Hugo](https://gohugo.io) programmed the right way, I can focus **more time on planning, creating, and editing** my videos and **less time maintaining and fixing** my website. \ No newline at end of file diff --git a/content/en/showcase/hartwell-insurance/index.md b/content/en/showcase/hartwell-insurance/index.md index 925497949..66fc46f44 100644 --- a/content/en/showcase/hartwell-insurance/index.md +++ b/content/en/showcase/hartwell-insurance/index.md @@ -20,7 +20,7 @@ It’s a multi-page, single-page (!) website written in Hugo, a static site gene There’s no Apache or Node backend that does compilation at runtime, it’s all done at the build step. This means the server; Netlify in this case, only has to do one thing – serve files. Unsurprisingly, serving simple files is VERY quick. -The starter point was the [Victor Hugo](https://github.com/netlify/victor-hugo) repository that Netlify have created. It let me dive in with Hugo, PostCSS, BrowserSync and ES6 without setting up any tooling myself – always a win! +The starter point was the [Victor Hugo](https://github.com/netlify/victor-hugo) repository that Netlify have created. It let me dive in with Hugo, PostCSS, Browsersync and ES6 without setting up any tooling myself – always a win! I then took all the content from the design file and moved it into Markdown, putting shortcodes in where necessary. This site did need a number of custom shortcodes for the presentational elements like the expanding circles and full width backgrounds. But mostly it was just clean, semantic HTML with some CSS and JS enhancement thrown in. diff --git a/content/en/showcase/small-multiples/index.md b/content/en/showcase/small-multiples/index.md index e2b80ea9a..15c39d6a0 100644 --- a/content/en/showcase/small-multiples/index.md +++ b/content/en/showcase/small-multiples/index.md @@ -18,13 +18,13 @@ Application development has become increasingly complex and there is a strong mo Libraries like React make this easy, but we also wanted something that was server rendered. This led us to look at React based tools for static site generation such as GatsbyJS. We liked GatsbyJS, but in the end, we didn’t choose it due to the lack of availability of a simple CMS driven data source. -For this, we considered Contentful. Contentful is a beautifully designed application. It’s basically a headless CMS, but it’s not specifically designed for websites and it becomes quite expensive at a commercial level. Their free tier is possibly a good option for personal sites especially with Gatsby. We also evaluated prose.io. This is a free service for editing markdown files in a GitHub repository. It works well, but it’s quite basic and didn’t provide the editing experience we were looking for. +For this, we considered Contentful. Contentful is a beautifully designed application. It’s basically a headless CMS, but it’s not specifically designed for websites and it becomes quite expensive at a commercial level. Their free tier is possibly a good option for personal sites especially with Gatsby. We also evaluated prose.io. This is a free service for editing Markdown files in a GitHub repository. It works well, but it’s quite basic and didn’t provide the editing experience we were looking for. At the same time, we started exploring Hugo. Hugo is a static site generator similar to Jekyll, but it’s written in Go. It has excellent support and integration with Netlify and we were immediately blown away by how fast it was. We had been closely following the redevelopment of the Smashing Magazine website. We knew this was being powered by Hugo and Netlify and this showed us that Hugo could work for a large scale sites. -The deciding factor, however, was the availability of CMS options that integrate well with Hugo. Netlify has an open source project called NetlifyCMS and there are also hosted services like Forestry.io. These both provide a CMS with an editing interface for markdown files and images. There is no database, instead, changes are committed directly back into the GitHub repository. +The deciding factor, however, was the availability of CMS options that integrate well with Hugo. Netlify has an open source project called NetlifyCMS and there are also hosted services like Forestry.io. These both provide a CMS with an editing interface for Markdown files and images. There is no database, instead, changes are committed directly back into the GitHub repository. In the end, we chose Hugo on Netlify, with Forestry as our CMS. The site is built and redeployed immediately with Netlify watching for changes to the GitHub repository. @@ -40,7 +40,7 @@ NetlifyCMS was also very new when we first looked at it and this is partly why w Fortunately, the site is more portable now than it was, or would have been with a dynamic CMS like WordPress, or a fully hosted service like SquareSpace. It should be comparatively easy to swap the publishing functions from Forestry to NetlifyCMS or to change the templates. No part of the pipe-line is tightly coupled, the hosting, the CMS and the templates and the build process can all be updated independently, without changing anything else. -We have complete control over the design and mark-up produced. This means we can implement a better responsive design and have a stronger focus on accessibility and performance. +We have complete control over the design and markup produced. This means we can implement a better responsive design and have a stronger focus on accessibility and performance. These technology choices gave us a good performance baseline. It was important to implement a site that took advantage of this. As a data visualisation agency, it can be difficult to optimise for performance with a small bundle size, while also aiming for high-quality visuals and working with large datasets. This meant we spent a lot of time optimising assets making sure there was little blocking the critical path for faster rendering and lazy-load images and videos. diff --git a/content/en/templates/data-templates.md b/content/en/templates/data-templates.md index bd1ed6d76..3bfdaa056 100644 --- a/content/en/templates/data-templates.md +++ b/content/en/templates/data-templates.md @@ -197,7 +197,7 @@ With the command-line flag `--cacheDir`, you can specify any folder on your syst You can also set `cacheDir` in the [main configuration file][config]. -If you don't like caching at all, you can fully disable caching with the command line flag `--ignoreCache`. +If you don't like caching at all, you can fully disable caching with the command-line flag `--ignoreCache`. ### Authentication When Using REST URLs diff --git a/content/en/templates/menu-templates.md b/content/en/templates/menu-templates.md index dd7ab380f..cfd9c0038 100644 --- a/content/en/templates/menu-templates.md +++ b/content/en/templates/menu-templates.md @@ -76,7 +76,7 @@ To enable this menu, configure `sectionPagesMenu` in your site `config`: sectionPagesMenu = "main" ``` -The menu name can be anything, but take a note of what it is. +The menu name can be anything, but take a note of what it is. This will create a menu with all the sections as menu items and all the sections' pages as "shadow-members". Ensure that all first level directories that you would like to show up on this menu are [Branch Bundles](https://gohugo.io/content-management/sections/). Leaf Bundles do not form sections. diff --git a/content/en/tools/editors.md b/content/en/tools/editors.md index 8da5fc2d7..06c959b3f 100644 --- a/content/en/tools/editors.md +++ b/content/en/tools/editors.md @@ -4,7 +4,6 @@ linktitle: Editor Plug-ins description: The Hugo community uses a wide range of preferred tools and has developed plug-ins for some of the most popular text editors to help automate parts of your workflow. date: 2017-02-01 publishdate: 2017-02-01 -lastmod: 2017-02-01 categories: [developer tools] keywords: [editor, plug-ins] menu: @@ -36,7 +35,7 @@ The Hugo community uses a wide range of preferred tools and has developed plug-i ## Emacs * [emacs-easy-hugo](https://github.com/masasam/emacs-easy-hugo). Emacs major mode for managing hugo blogs. Note that Hugo also supports [Org-mode][formats]. -* [ox-hugo.el](https://ox-hugo.scripter.co). Native Org-mode exporter that exports to Blackfriday Markdown with Hugo front-matter. `ox-hugo` supports two common Org blogging flows --- exporting multiple Org sub-trees in a single file to multiple Hugo posts, and exporting a single Org file to a single Hugo post. It also leverages the Org tag and property inheritance features. See [*Why ox-hugo?*](https://ox-hugo.scripter.co/doc/why-ox-hugo/) for more. +* [ox-hugo.el](https://ox-hugo.scripter.co). Native Org-mode exporter that exports to Blackfriday Markdown with Hugo front-matter. `ox-hugo` supports two common Org blogging flows --- exporting multiple Org subtrees in a single file to multiple Hugo posts, and exporting a single Org file to a single Hugo post. It also leverages the Org tag and property inheritance features. See [*Why ox-hugo?*](https://ox-hugo.scripter.co/doc/why-ox-hugo/) for more. ## Vim diff --git a/content/en/tools/migrations.md b/content/en/tools/migrations.md index c3cef20a7..d6ca14ab5 100644 --- a/content/en/tools/migrations.md +++ b/content/en/tools/migrations.md @@ -5,7 +5,7 @@ description: A list of community-developed tools for migrating from your existin date: 2017-02-01 publishdate: 2017-02-01 lastmod: 2022-03-26 -keywords: [migrations,jekyll,wordpress,drupal,ghost,contentful] +keywords: [migrations, jekyll, wordpress, drupal, ghost, contentful] menu: docs: parent: "tools" @@ -13,7 +13,7 @@ menu: weight: 10 sections_weight: 10 draft: false -aliases: [/developer-tools/migrations/,/developer-tools/migrated/] +aliases: [/developer-tools/migrations/, /developer-tools/migrated/] toc: true --- @@ -80,7 +80,6 @@ Alternatively, you can use the new [Jekyll import command](/commands/hugo_import - [contentful2hugo](https://github.com/ArnoNuyts/contentful2hugo) - A tool to create content-files for Hugo from content on [Contentful](https://www.contentful.com/). - ## BlogML -- [BlogML2Hugo](https://github.com/jijiechen/BlogML2Hugo) - A tool that helps you convert BlogML xml file to Hugo markdown files. Users need to take care of links to attachments and images by themselves. This helps the blogs that export BlogML files (e.g. BlogEngine.NET) transform to hugo sites easily. +- [BlogML2Hugo](https://github.com/jijiechen/BlogML2Hugo) - A tool that helps you convert BlogML xml file to Hugo Markdown files. Users need to take care of links to attachments and images by themselves. This helps the blogs that export BlogML files (e.g. BlogEngine.NET) transform to hugo sites easily. diff --git a/content/en/tools/search.md b/content/en/tools/search.md index ec9a0965c..97ddeaf01 100644 --- a/content/en/tools/search.md +++ b/content/en/tools/search.md @@ -20,9 +20,9 @@ A static website with a dynamic search function? Yes, Hugo provides an alternati * [GitHub Gist for Hugo Workflow](https://gist.github.com/sebz/efddfc8fdcb6b480f567). This gist contains a simple workflow to create a search index for your static website. It uses a simple Grunt script to index all your content files and [lunr.js](https://lunrjs.com/) to serve the search results. -* [hugo-lunr](https://www.npmjs.com/package/hugo-lunr). A simple way to add site search to your static Hugo site using [lunr.js](https://lunrjs.com/). Hugo-lunr will create an index file of any html and markdown documents in your Hugo project. +* [hugo-lunr](https://www.npmjs.com/package/hugo-lunr). A simple way to add site search to your static Hugo site using [lunr.js](https://lunrjs.com/). Hugo-lunr will create an index file of any HTML and Markdown documents in your Hugo project. * [hugo-lunr-zh](https://www.npmjs.com/package/hugo-lunr-zh). A bit like Hugo-lunr, but Hugo-lunr-zh can help you separate the Chinese keywords. -* [GitHub Gist for Fuse.js integration](https://gist.github.com/eddiewebb/735feb48f50f0ddd65ae5606a1cb41ae). This gist demonstrates how to leverage Hugo's existing build time processing to generate a searchable JSON index used by [Fuse.js](https://fusejs.io/) on the client side. Although this gist uses Fuse.js for fuzzy matching, any client side search tool capable of reading JSON indexes will work. Does not require npm, grunt or other build-time tools except Hugo! +* [GitHub Gist for Fuse.js integration](https://gist.github.com/eddiewebb/735feb48f50f0ddd65ae5606a1cb41ae). This gist demonstrates how to leverage Hugo's existing build time processing to generate a searchable JSON index used by [Fuse.js](https://fusejs.io/) on the client-side. Although this gist uses Fuse.js for fuzzy matching, any client-side search tool capable of reading JSON indexes will work. Does not require npm, grunt or other build-time tools except Hugo! * [hugo-search-index](https://www.npmjs.com/package/hugo-search-index). A library containing Gulp tasks and a prebuilt browser script that implements search. Gulp generates a search index from project markdown files. * [hugofastsearch](https://gist.github.com/cmod/5410eae147e4318164258742dd053993). A usability and speed update to "GitHub Gist for Fuse.js integration" — global, keyboard-optimized search. * [JS & Fuse.js tutorial](https://makewithhugo.com/add-search-to-a-hugo-site/) A simple client-side search solution, using FuseJS (does not require jQuery). diff --git a/content/en/troubleshooting/build-performance.md b/content/en/troubleshooting/build-performance.md index 1ec564757..543c71247 100644 --- a/content/en/troubleshooting/build-performance.md +++ b/content/en/troubleshooting/build-performance.md @@ -18,17 +18,17 @@ toc: true ## Template Metrics Hugo is a very fast static site generator, but it is possible to write -inefficient templates. Hugo's *template metrics* feature is extremely helpful +inefficient templates. Hugo's _template metrics_ feature is extremely helpful in pinpointing which templates are executed most often and how long those executions take **in terms of CPU time**. -| Metric Name | Description | -|---------------------|-------------| -| cumulative duration | The cumulative time spent executing a given template. | -| average duration | The average time spent executing a given template. | +| Metric Name | Description | +| ------------------- | -------------------------------------------------------------- | +| cumulative duration | The cumulative time spent executing a given template. | +| average duration | The average time spent executing a given template. | | maximum duration | The maximum time a single execution took for a given template. | -| count | The number of times a template was executed. | -| template | The template name. | +| count | The number of times a template was executed. | +| template | The template name. | ``` ▶ hugo --templateMetrics @@ -77,20 +77,18 @@ simultaneously. Because of this parallelism, the sum of "cumulative duration" values is usually greater than the actual time it takes to build a site. {{% /note %}} - ## Cached Partials Some `partial` templates such as sidebars or menus are executed many times -during a site build. Depending on the content within the `partial` template and +during a site build. Depending on the content within the `partial` template and the desired output, the template may benefit from caching to reduce the number -of executions. The [`partialCached`][partialCached] template function provides +of executions. The [`partialCached`][partialcached] template function provides caching capabilities for `partial` templates. {{% tip %}} Note that you can create cached variants of each `partial` by passing additional -parameters to `partialCached` beyond the initial context. See the +parameters to `partialCached` beyond the initial context. See the `partialCached` documentation for more details. {{% /tip %}} - [partialCached]:{{< ref "/functions/partialCached.md" >}} diff --git a/content/en/troubleshooting/faq.md b/content/en/troubleshooting/faq.md index c4246caf1..4b9dfca46 100644 --- a/content/en/troubleshooting/faq.md +++ b/content/en/troubleshooting/faq.md @@ -19,9 +19,9 @@ aliases: [/faq/] ## I can't see my content! -Is your markdown file [in draft mode](https://gohugo.io/content-management/front-matter/#front-matter-variables)? When testing, run `hugo server` with the `-D` or `--buildDrafts` [switch](https://gohugo.io/getting-started/usage/#draft-future-and-expired-content). +Is your Markdown file [in draft mode](https://gohugo.io/content-management/front-matter/#front-matter-variables)? When testing, run `hugo server` with the `-D` or `--buildDrafts` [switch](https://gohugo.io/getting-started/usage/#draft-future-and-expired-content). -Is your markdown file part of a [leaf bundle](/content-management/page-bundles/)? If there is an `index.md` file in the same or any parent directory then other markdown files will not be rendered as individual pages. +Is your Markdown file part of a [leaf bundle](/content-management/page-bundles/)? If there is an `index.md` file in the same or any parent directory then other Markdown files will not be rendered as individual pages. ## Can I set configuration variables via OS environment? @@ -49,7 +49,7 @@ Yes you can! Read [this](/hosting-and-deployment/hosting-on-netlify/#configure-h ## I get "... this feature is not available in your current Hugo version" -If you process `SCSS` or `SASS` to `CSS` in your Hugo project with `libsass` as the transpiler or if you convert images to the `webp` format, you need the Hugo `extended` version, or else you may see an error message similar to the below: +If you process `SCSS` or `Sass` to `CSS` in your Hugo project with `libsass` as the transpiler or if you convert images to the `webp` format, you need the Hugo `extended` version, or else you may see an error message similar to the below: ```bash 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 diff --git a/content/en/variables/page.md b/content/en/variables/page.md index df7e3cb71..46bab0cf0 100644 --- a/content/en/variables/page.md +++ b/content/en/variables/page.md @@ -4,7 +4,6 @@ linktitle: description: Page-level variables are defined in a content file's front matter, derived from the content's file location, or extracted from the content body itself. date: 2017-02-01 publishdate: 2017-02-01 -lastmod: 2017-02-01 categories: [variables and params] keywords: [pages] draft: false diff --git a/content/en/variables/pages.md b/content/en/variables/pages.md index 79d39a158..61036dd74 100644 --- a/content/en/variables/pages.md +++ b/content/en/variables/pages.md @@ -23,8 +23,8 @@ Also see [List templates](/templates/lists) for an overview of sort methods. `.Next` and `.Prev` on `Pages` work similar to the methods with the same names on `.Page`, but are more flexible (and slightly slower) as they can be used on any page collection. -`.Next` points **up** to the next page relative to the page sent in as the argument. Example: `{{with .Site.RegularPages.Next . }}{{.RelPermalink}}{{end}}`. Calling `.Next` with the first page in the collection returns `nil`. +`.Next` points **up** to the next page relative to the page sent in as the argument. Example: `{{with .Site.RegularPages.Next . }}{{.RelPermalink}}{{end}}`. Calling `.Next` with the first page in the collection returns `nil`. ## .Prev PAGE -`.Prev` points **down** to the previous page relative to the page sent in as the argument. Example: `{{with .Site.RegularPages.Prev . }}{{.RelPermalink}}{{end}}`. Calling `.Prev` with the last page in the collection returns `nil`. \ No newline at end of file +`.Prev` points **down** to the previous page relative to the page sent in as the argument. Example: `{{with .Site.RegularPages.Prev . }}{{.RelPermalink}}{{end}}`. Calling `.Prev` with the last page in the collection returns `nil`. diff --git a/content/en/variables/shortcodes.md b/content/en/variables/shortcodes.md index 37ae30629..a7c9e475b 100644 --- a/content/en/variables/shortcodes.md +++ b/content/en/variables/shortcodes.md @@ -4,10 +4,8 @@ linktitle: Shortcode Variables description: Shortcodes can access page variables and also have their own specific built-in variables. date: 2017-03-12 publishdate: 2017-03-12 -lastmod: 2017-03-12 categories: [variables and params] keywords: [shortcodes] -draft: false menu: docs: parent: "variables" @@ -47,6 +45,3 @@ toc: false .InnerDeindent {{< new-in "0.100.0" >}} : Gets the `.Inner` with any indentation removed. This is what's used in the built-in `{{}}` shortcode. - - - From 4193f4445bcaefd1df65094629be71132db1c40a Mon Sep 17 00:00:00 2001 From: Christian Oliff Date: Wed, 19 Oct 2022 11:56:34 +0900 Subject: [PATCH 034/108] Add Super Linter GitHub Action (#1845) --- .github/workflows/super-linter.yml | 39 ++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/super-linter.yml diff --git a/.github/workflows/super-linter.yml b/.github/workflows/super-linter.yml new file mode 100644 index 000000000..062336a94 --- /dev/null +++ b/.github/workflows/super-linter.yml @@ -0,0 +1,39 @@ +name: Super Linter + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + build: + name: Lint Code Base + runs-on: ubuntu-latest + if: ${{ github.actor != 'dependabot[bot]' }} + + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Lint Code Base + uses: github/super-linter/slim@v4 + env: + DEFAULT_BRANCH: master + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + IGNORE_GITIGNORED_FILES: true + LINTER_RULES_PATH: / + LOG_LEVEL: NOTICE + MARKDOWN_CONFIG_FILE: .markdownlint.yaml + SUPPRESS_POSSUM: true + VALIDATE_ALL_CODEBASE: false + VALIDATE_CSS: false + VALIDATE_EDITORCONFIG: false + VALIDATE_GITLEAKS: false + VALIDATE_HTML: false + VALIDATE_JAVASCRIPT_STANDARD: false + VALIDATE_JSCPD: false + VALIDATE_MARKDOWN: false + VALIDATE_NATURAL_LANGUAGE: false + VALIDATE_SHELL_SHFMT: false + VALIDATE_XML: false From 83e8f2168483a2459eefe5404e078ef5326ed961 Mon Sep 17 00:00:00 2001 From: "Daniel F. Dickinson" Date: Wed, 19 Oct 2022 03:08:41 -0400 Subject: [PATCH 035/108] Clarify that a shortcode with .Inner must be closed (#1785) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Clarify that a shortcode with .Inner must be closed Closes #1784 which provides the details. Signed-off-by: Daniel F. Dickinson * Apply suggestions from code review Co-authored-by: Joe Mooring Signed-off-by: Daniel F. Dickinson Co-authored-by: Bjørn Erik Pedersen Co-authored-by: Joe Mooring --- content/en/templates/shortcode-templates.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/content/en/templates/shortcode-templates.md b/content/en/templates/shortcode-templates.md index 839032800..d1a7ceb84 100644 --- a/content/en/templates/shortcode-templates.md +++ b/content/en/templates/shortcode-templates.md @@ -110,6 +110,11 @@ by using the self-closing syntax: {{}} ``` +{{% warning %}} +Any shortcode that refers to `.Inner` must be closed or self-closed. + +{{% /warning %}} + #### `.Params` The `.Params` variable in shortcodes contains the list parameters passed to shortcode for more complicated use cases. You can also access higher-scoped parameters with the following logic: From 527ec5941694f8977ab158382131e5cee845b14e Mon Sep 17 00:00:00 2001 From: Tampere Date: Wed, 19 Oct 2022 18:48:55 +0300 Subject: [PATCH 036/108] Update hugo.md (#1742) Co-authored-by: Tampere <103528272+carerragt@users.noreply.github.com> Co-authored-by: Christian Oliff --- content/en/functions/hugo.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/en/functions/hugo.md b/content/en/functions/hugo.md index 1792f5a8d..c7d3c076b 100644 --- a/content/en/functions/hugo.md +++ b/content/en/functions/hugo.md @@ -22,10 +22,10 @@ aliases: [] `hugo` returns an instance that contains the following functions: hugo.Generator -: `` tag for the version of Hugo that generated the site. `hugo.Generator` outputs a *complete* HTML tag; e.g. `` +: `` tag for the version of Hugo that generated the site. `hugo.Generator` outputs a *complete* HTML tag; e.g. `` hugo.Version -: the current version of the Hugo binary you are using e.g. `0.63.2` +: the current version of the Hugo binary you are using e.g. `0.99.1` hugo.GoVersion : returns the version of Go that the Hugo binary was built with. {{< new-in "0.101.0" >}} From b6cb5ae4830e12b1bd554934c52c1071c3b536c7 Mon Sep 17 00:00:00 2001 From: Christian Oliff Date: Thu, 20 Oct 2022 01:06:32 +0900 Subject: [PATCH 037/108] Markdown linting fixes (#1846) --- .cspell.json | 3 +++ .github/workflows/super-linter.yml | 1 - .markdownlint.yaml | 27 +++++++++++++++++-- .markdownlintignore | 5 ++++ content/en/about/benefits.md | 1 - content/en/about/features.md | 1 - content/en/about/hugo-and-gdpr.md | 4 +-- content/en/about/security-model/index.md | 3 +-- content/en/content-management/archetypes.md | 4 --- .../en/content-management/build-options.md | 4 ++- .../en/content-management/cross-references.md | 2 +- content/en/content-management/diagrams.md | 17 ++++-------- content/en/content-management/formats.md | 8 +++--- content/en/content-management/front-matter.md | 14 +++++----- content/en/content-management/multilingual.md | 4 +-- content/en/content-management/page-bundles.md | 19 +++++++------ .../en/content-management/page-resources.md | 5 ++-- content/en/content-management/related.md | 10 ++++--- content/en/content-management/shortcodes.md | 14 ++++------ content/en/content-management/static-files.md | 1 - content/en/content-management/summaries.md | 4 +-- content/en/content-management/types.md | 10 +++---- content/en/content-management/urls.md | 4 +-- content/en/contribute/development.md | 18 ++++++------- content/en/contribute/documentation.md | 2 -- content/en/functions/RenderString.md | 2 +- content/en/functions/complement.md | 5 ---- content/en/functions/dict.md | 10 +++---- content/en/functions/format.md | 2 +- content/en/functions/highlight.md | 4 +-- content/en/functions/int.md | 2 +- content/en/functions/ref.md | 2 +- content/en/functions/relref.md | 2 +- content/en/functions/scratch.md | 2 +- content/en/functions/symdiff.md | 5 ---- content/en/functions/urlize.md | 2 -- content/en/functions/where.md | 2 +- .../getting-started/configuration-markup.md | 2 +- content/en/getting-started/configuration.md | 17 ++++++++---- content/en/getting-started/installing.md | 8 +++--- content/en/getting-started/usage.md | 2 +- .../hosting-on-21yunbox.md | 1 + .../hosting-on-aws-amplify.md | 2 +- .../hosting-on-firebase.md | 5 ++-- .../hosting-on-netlify.md | 1 - .../hosting-on-render.md | 6 ++--- content/en/hugo-modules/configuration.md | 5 +--- content/en/hugo-modules/theme-components.md | 2 +- content/en/hugo-modules/use-modules.md | 1 - content/en/hugo-pipes/babel.md | 1 - content/en/hugo-pipes/introduction.md | 5 +--- content/en/hugo-pipes/minification.md | 3 --- content/en/hugo-pipes/resource-from-string.md | 2 -- .../en/hugo-pipes/resource-from-template.md | 7 ++--- content/en/news/0.89.4-relnotes/index.md | 7 ----- content/en/readfiles/dateformatting.md | 2 +- content/en/templates/alternatives.md | 2 -- content/en/templates/base.md | 1 - content/en/templates/files.md | 4 +-- content/en/templates/internal.md | 1 + content/en/templates/introduction.md | 9 ++++--- content/en/templates/lookup-order.md | 2 +- content/en/templates/menu-templates.md | 1 - content/en/templates/ordering-and-grouping.md | 6 +---- content/en/templates/output-formats.md | 3 ++- content/en/templates/pagination.md | 1 - content/en/templates/partials.md | 2 +- content/en/templates/render-hooks.md | 4 +-- content/en/templates/rss.md | 2 +- content/en/templates/section-templates.md | 1 - content/en/templates/shortcode-templates.md | 9 ++----- content/en/tools/frontends.md | 18 ++++++------- content/en/tools/other.md | 18 ++++++------- content/en/variables/menus.md | 7 +++-- content/en/variables/site.md | 3 --- content/en/variables/sitemap.md | 3 +-- 76 files changed, 178 insertions(+), 223 deletions(-) create mode 100644 .markdownlintignore diff --git a/.cspell.json b/.cspell.json index 51dddc8d3..1fcd48fa0 100644 --- a/.cspell.json +++ b/.cspell.json @@ -82,6 +82,7 @@ "eparis", "errorf", "erroridf", + "esbuild", "Evernote", "Exif", "exitwp", @@ -231,6 +232,7 @@ "Poupin", "prerender", "println", + "Pritchard", "publishdate", "Pygments", "qref", @@ -259,6 +261,7 @@ "safejs", "Samsa", "schemaorg", + "setx", "Shekhar", "Shortcode", "Shortcodes", diff --git a/.github/workflows/super-linter.yml b/.github/workflows/super-linter.yml index 062336a94..80658ebd9 100644 --- a/.github/workflows/super-linter.yml +++ b/.github/workflows/super-linter.yml @@ -33,7 +33,6 @@ jobs: VALIDATE_HTML: false VALIDATE_JAVASCRIPT_STANDARD: false VALIDATE_JSCPD: false - VALIDATE_MARKDOWN: false VALIDATE_NATURAL_LANGUAGE: false VALIDATE_SHELL_SHFMT: false VALIDATE_XML: false diff --git a/.markdownlint.yaml b/.markdownlint.yaml index 1b76d280e..545846ce5 100644 --- a/.markdownlint.yaml +++ b/.markdownlint.yaml @@ -1,4 +1,27 @@ # https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md -MD013: false # Line length -MD033: false # Inline HTML +MD002: false +MD003: false +MD004: false +MD007: false +MD012: + maximum: 2 +MD013: false +MD014: false +MD022: false +MD024: false +MD026: false +MD031: false +MD032: false +MD033: false +MD034: false +MD036: false +MD037: false +MD038: false +MD040: false +MD041: false +MD046: false +MD049: false +MD050: false +MD051: false +MD053: false diff --git a/.markdownlintignore b/.markdownlintignore new file mode 100644 index 000000000..43e5b1b1b --- /dev/null +++ b/.markdownlintignore @@ -0,0 +1,5 @@ +**/commands/** +**/news/** +**/showcase/** +**/zh/** +**/license.md diff --git a/content/en/about/benefits.md b/content/en/about/benefits.md index d5c13a9c3..e4fec5bb2 100644 --- a/content/en/about/benefits.md +++ b/content/en/about/benefits.md @@ -34,7 +34,6 @@ This has many benefits. The most noticeable is performance. HTTP servers are *ve * ["Top 10 Static Website Generators", Netlify blog][] * ["The Resurgence of Static", dotCMS][dotcms] - ["An Introduction to Static Site Generators", David Walsh]: https://davidwalsh.name/introduction-static-site-generators ["Static Site Generators", O'Reilly]: https://github.com/gohugoio/hugoDocs/files/1242701/static-site-generators.pdf ["Top 10 Static Website Generators", Netlify blog]: https://www.netlify.com/blog/2016/05/02/top-ten-static-website-generators/ diff --git a/content/en/about/features.md b/content/en/about/features.md index ed8c25821..28a5099a9 100644 --- a/content/en/about/features.md +++ b/content/en/about/features.md @@ -54,7 +54,6 @@ toc: true * Support for [Go][] HTML templates * [Syntax highlighting][] powered by [Chroma][] - [aliases]: /content-management/urls/#aliases [Chroma]: https://github.com/alecthomas/chroma [content summaries]: /content-management/summaries/ diff --git a/content/en/about/hugo-and-gdpr.md b/content/en/about/hugo-and-gdpr.md index 81cc5782a..2d4fba872 100644 --- a/content/en/about/hugo-and-gdpr.md +++ b/content/en/about/hugo-and-gdpr.md @@ -16,7 +16,6 @@ aliases: [/privacy/,/gdpr/] toc: true --- - General Data Protection Regulation ([GDPR](https://en.wikipedia.org/wiki/General_Data_Protection_Regulation)) is a regulation in EU law on data protection and privacy for all individuals within the European Union and the European Economic Area. It became enforceable on 25 May 2018. **Hugo is a static site generator. By using Hugo you are already standing on very solid ground. Static HTML files on disk are much easier to reason about compared to server and database driven web sites.** @@ -95,6 +94,7 @@ useSessionStorage {{% warning %}} `useSessionStorage` is not supported when using Google Analytics v4 (gtag.js). {{% /warning %}} + ### Instagram simple @@ -116,7 +116,6 @@ enableDNT simple : If simple mode is enabled, a static and no-JS version of a tweet will be built. - **Note:** If you use the _simple mode_ for Twitter, you may want to disable the inline styles provided by Hugo: {{< code-toggle file="config">}} @@ -137,4 +136,3 @@ enableDNT simple : If simple mode is enabled, the video thumbnail is fetched from Vimeo's servers and it is overlayed with a play button. If the user clicks to play the video, it will open in a new tab directly on Vimeo's website. - diff --git a/content/en/about/security-model/index.md b/content/en/about/security-model/index.md index 461c7fe77..497685cb4 100644 --- a/content/en/about/security-model/index.md +++ b/content/en/about/security-model/index.md @@ -28,7 +28,6 @@ But when developing and building your site, the runtime is the `hugo` executable * User-defined components have read-only access to the filesystem. * We shell out to some external binaries to support [Asciidoctor](/content-management/formats/#list-of-content-formats) and similar, but those binaries and their flags are predefined and disabled by default (see [Security Policy](#security-policy)). General functions to run arbitrary external OS commands have been [discussed](https://github.com/gohugoio/hugo/issues/796), but not implemented because of security concerns. - ## Security Policy {{< new-in "0.91.0" >}} @@ -57,7 +56,7 @@ These are the security threats as defined by [OWASP](https://en.wikipedia.org/wi For HTML output, this is the core security model: -https://golang.org/pkg/html/template/#hdr-Security_Model + In short: diff --git a/content/en/content-management/archetypes.md b/content/en/content-management/archetypes.md index 354ef0fef..cb55fb24d 100644 --- a/content/en/content-management/archetypes.md +++ b/content/en/content-management/archetypes.md @@ -12,7 +12,6 @@ menu: weight: 70 quicklinks: weight: 70 #rem -draft: false aliases: [/content/archetypes/] toc: true --- @@ -69,7 +68,6 @@ It will create a new newsletter type of content file based on the archetype temp The above _newsletter type archetype_ illustrates the possibilities: The full Hugo `.Site` and all of Hugo's template funcs can be used in the archetype file. - ## Directory based archetypes Since Hugo `0.49` you can use complete directories as archetype templates. Given this archetype directory: @@ -90,8 +88,6 @@ hugo new --kind post-bundle posts/my-post Will create a new folder in `/content/posts/my-post` with the same set of files as in the `post-bundle` archetypes folder. All content files (`index.md` etc.) can contain template logic, and will receive the correct `.Site` for the content's language. - - [archetypes directory]: /getting-started/directory-structure/ [content types]: /content-management/types/ [front matter]: /content-management/front-matter/ diff --git a/content/en/content-management/build-options.md b/content/en/content-management/build-options.md index 7bbb772df..16954eae2 100644 --- a/content/en/content-management/build-options.md +++ b/content/en/content-management/build-options.md @@ -26,6 +26,7 @@ _build: {{< /code-toggle >}} #### render + If `always`, the page will be treated as a published page, holding its dedicated output files (`index.html`, etc...) and permalink. {{< new-in "0.76.0" >}} We extended this property from a boolean to an enum in Hugo 0.76.0. Valid values are: @@ -58,7 +59,7 @@ If true, the page will be treated as part of the project's collections and, when #### publishResources -If set to true the [Bundle's Resources]({{< relref "content-management/page-bundles" >}}) will be published. +If set to true the [Bundle's Resources]({{< relref "content-management/page-bundles" >}}) will be published. Setting this to false will still publish Resources on demand (when a resource's `.Permalink` or `.RelPermalink` is invoked from the templates) but will skip the others. {{% note %}} @@ -70,6 +71,7 @@ Any page, regardless of their build options, will always be available using the ### Illustrative use cases #### Not publishing a page + Project needs a "Who We Are" content file for Front Matter and body to be used by the homepage but nowhere else. ```yaml diff --git a/content/en/content-management/cross-references.md b/content/en/content-management/cross-references.md index b5dd8a4c3..5ec7dc545 100644 --- a/content/en/content-management/cross-references.md +++ b/content/en/content-management/cross-references.md @@ -116,7 +116,7 @@ produces this HTML: The behavior can, since Hugo 0.45, be configured in `config.toml`: -refLinksErrorLevel ("ERROR") +refLinksErrorLevel ("ERROR") : When using `ref` or `relref` to resolve page links and a link cannot resolved, it will be logged with this log level. Valid values are `ERROR` (default) or `WARNING`. Any `ERROR` will fail the build (`exit -1`). refLinksNotFoundURL diff --git a/content/en/content-management/diagrams.md b/content/en/content-management/diagrams.md index cc2a68cb4..5c247e569 100644 --- a/content/en/content-management/diagrams.md +++ b/content/en/content-management/diagrams.md @@ -45,14 +45,9 @@ Will be rendered as: 1 2 3 4 1 2 3 4 1 2 3 4 '--- 4 '-- 4 \ 4 ``` - - - - ## Mermaid Diagrams -Hugo currently does not provide default templates for Mermaid diagrams. But you can easily add your own. One way to do it would be to create ` layouts/_default/_markup/render-codeblock-mermaid.html`: - +Hugo currently does not provide default templates for Mermaid diagrams. But you can easily add your own. One way to do it would be to create `layouts/_default/_markup/render-codeblock-mermaid.html`: ```go-html-template
@@ -88,8 +83,6 @@ sequenceDiagram Bob-->>John: Jolly good! ``` - - ## Goat Ascii Diagram Examples ### Graphics @@ -160,7 +153,7 @@ sequenceDiagram ### File tree -Created from https://arthursonzogni.com/Diagon/#Tree +Created from ```goat { width=300 color="orange" } ───Linux─┬─Android @@ -176,7 +169,7 @@ Created from https://arthursonzogni.com/Diagon/#Tree ### Sequence Diagram -https://arthursonzogni.com/Diagon/#Sequence + ```goat { class="w-40" } ┌─────┐ ┌───┐ @@ -197,7 +190,7 @@ https://arthursonzogni.com/Diagon/#Sequence ### Flowchart -https://arthursonzogni.com/Diagon/#Flowchart + ```goat _________________ @@ -243,7 +236,7 @@ https://arthursonzogni.com/Diagon/#Flowchart ### Table -https://arthursonzogni.com/Diagon/#Table + ```goat { class="w-80 dark-blue" } ┌────────────────────────────────────────────────┐ diff --git a/content/en/content-management/formats.md b/content/en/content-management/formats.md index 303bb4596..89c209a61 100644 --- a/content/en/content-management/formats.md +++ b/content/en/content-management/formats.md @@ -55,13 +55,13 @@ Because additional formats are external commands, generation performance will re ### External Helper AsciiDoc -[AsciiDoc](https://github.com/asciidoc/asciidoc) implementation EOLs in Jan 2020 and is no longer supported. -AsciiDoc development is being continued under [Asciidoctor](https://github.com/asciidoctor). The format AsciiDoc +[AsciiDoc](https://github.com/asciidoc/asciidoc) implementation EOLs in Jan 2020 and is no longer supported. +AsciiDoc development is being continued under [Asciidoctor](https://github.com/asciidoctor). The format AsciiDoc remains of course. Please continue with the implementation Asciidoctor. ### External Helper Asciidoctor -The Asciidoctor community offers a wide set of tools for the AsciiDoc format that can be installed additionally to Hugo. +The Asciidoctor community offers a wide set of tools for the AsciiDoc format that can be installed additionally to Hugo. [See the Asciidoctor docs for installation instructions](https://asciidoctor.org/docs/install-toolchain/). Make sure that also all optional extensions like `asciidoctor-diagram` or `asciidoctor-html5s` are installed if required. @@ -109,7 +109,7 @@ Example of how to set extensions and attributes: my-attribute-name = "my value" ``` -In a complex Asciidoctor environment it is sometimes helpful to debug the exact call to your external helper with all +In a complex Asciidoctor environment it is sometimes helpful to debug the exact call to your external helper with all parameters. Run Hugo with `-v`. You will get an output like ``` diff --git a/content/en/content-management/front-matter.md b/content/en/content-management/front-matter.md index 20862074a..c4246d1d0 100644 --- a/content/en/content-management/front-matter.md +++ b/content/en/content-management/front-matter.md @@ -137,7 +137,7 @@ weight : used for [ordering your content in lists][ordering]. Lower weight gets higher precedence. So content with lower weight will come first. If set, weights should be non-zero, as 0 is interpreted as an *unset* weight. \ -: field name of the *plural* form of the index. See `tags` and `categories` in the above front matter examples. _Note that the plural form of user-defined taxonomies cannot be the same as any of the predefined front matter variables._ +: field name of the *plural* form of the index. See `tags` and `categories` in the above front matter examples. *Note that the plural form of user-defined taxonomies cannot be the same as any of the predefined front matter variables.* {{% note "Hugo's Default URL Destinations" %}} If neither `slug` nor `url` is present and [permalinks are not configured otherwise in your site `config` file](/content-management/urls/#permalinks), Hugo will use the filename of your content to create the output URL. See [Content Organization](/content-management/organization) for an explanation of paths in Hugo and [URL Management](/content-management/urls/) for ways to customize Hugo's default behaviors. @@ -192,7 +192,7 @@ lang environment : A Glob pattern matching the build environment, e.g. "{production,development}" -Any of the above can be omitted. +Any of the above can be omitted. ### Example @@ -206,11 +206,9 @@ cascade: With the above example the Blog section page and its descendants will return `images/typewriter.jpg` when `.Params.banner` is invoked unless: -- Said descendant has its own `banner` value set +- Said descendant has its own `banner` value set - Or a closer ancestor node has its own `cascade.banner` value set. - - ## Order Content Through Front Matter You can assign content-specific `weight` in the front matter of your content. These values are especially useful for [ordering][ordering] in list views. You can use `weight` for ordering of content and the convention of [`_weight`][taxweight] for ordering content within a taxonomy. See [Ordering and Grouping Hugo Lists][lists] to see how `weight` can be used to organize your content in list views. @@ -221,9 +219,9 @@ It's possible to set some options for Markdown rendering in a content's front ma ## Front Matter Format Specs -* [TOML Spec][toml] -* [YAML Spec][yaml] -* [JSON Spec][json] +- [TOML Spec][toml] +- [YAML Spec][yaml] +- [JSON Spec][json] [variables]: /variables/ [aliases]: /content-management/urls/#aliases diff --git a/content/en/content-management/multilingual.md b/content/en/content-management/multilingual.md index abab72a60..b401cc924 100644 --- a/content/en/content-management/multilingual.md +++ b/content/en/content-management/multilingual.md @@ -507,6 +507,7 @@ The rendering of the main navigation works as usual. `.Site.Menus` will just con ``` ### Dynamically localizing menus with i18n + While customizing menus per language is useful, your config file can become hard to maintain if you have a lot of languages If your menus are the same in all languages (ie. if the only thing that changes is the translated name) you can use the `.Identifier` as a translation key for the menu name: @@ -569,10 +570,9 @@ If there is more than one language defined, the `LanguagePrefix` variable will e ## Generate multilingual content with `hugo new` + Currently, `hugo new` is not ready to support generating multilingual content. But there is a [proposal topic](https://github.com/gohugoio/hugo/issues/7732) about this in GitHub issue to discuss how it should work. - - [abslangurl]: /functions/abslangurl [config]: /getting-started/configuration/ [contenttemplate]: /templates/single-page-templates/ diff --git a/content/en/content-management/page-bundles.md b/content/en/content-management/page-bundles.md index 924efccd2..bb5516729 100644 --- a/content/en/content-management/page-bundles.md +++ b/content/en/content-management/page-bundles.md @@ -72,13 +72,13 @@ bundles: : This leaf bundle has the `index.md`, two other content Markdown files and two image files. -- image1, image2: +- image1, image2: These images are page resources of `my-post` and only available in `my-post/index.md` resources. -- content1, content2: +- content1, content2: These content files are page resources of `my-post` - and only available in `my-post/index.md` resources. + and only available in `my-post/index.md` resources. They will **not** be rendered as individual pages. `my-other-post` @@ -99,8 +99,8 @@ as long as it is not inside another **leaf** bundle. A headless bundle is a bundle that is configured to not get published anywhere: -- It will have no `Permalink` and no rendered HTML in `public/`. -- It will not be part of `.Site.RegularPages`, etc. +- It will have no `Permalink` and no rendered HTML in `public/`. +- It will not be part of `.Site.RegularPages`, etc. But you can get it by `.Site.GetPage`. Here is an example: @@ -121,9 +121,9 @@ _In this example, we are assuming the `some-headless-bundle` to be a headless Explanation of the above example: 1. Get the `some-headless-bundle` Page "object". -2. Collect a *slice* of resources in this *Page Bundle* that matches +2. Collect a _slice_ of resources in this _Page Bundle_ that matches `"author*"` using `.Resources.Match`. -3. Loop through that *slice* of nested pages, and output their `.Title` and +3. Loop through that _slice_ of nested pages, and output their `.Title` and `.Content`. --- @@ -137,9 +137,8 @@ headless = true There are many use cases of such headless page bundles: -- Shared media galleries -- Reusable page content "snippets" - +- Shared media galleries +- Reusable page content "snippets" ## Branch Bundles {#branch-bundles} diff --git a/content/en/content-management/page-resources.md b/content/en/content-management/page-resources.md index 24b1d03ed..c694fc409 100644 --- a/content/en/content-management/page-resources.md +++ b/content/en/content-management/page-resources.md @@ -90,6 +90,7 @@ MediaType.Suffixes : A slice of possible suffixes for the resource's MIME type. ## Methods + ByType : Returns the page resources of the given type. @@ -107,6 +108,7 @@ GetMatch : Same as `Match` but will return the first match. ### Pattern Matching + ```go // Using Match/GetMatch to find this images/sunset.jpg ? .Resources.Match "images/sun*" ✅ @@ -140,8 +142,7 @@ title params : A map of custom key/values. - -### Resources metadata example +### Resources metadata example {{< code-toggle copy="false">}} title: Application diff --git a/content/en/content-management/related.md b/content/en/content-management/related.md index c7262b42d..10dc50336 100644 --- a/content/en/content-management/related.md +++ b/content/en/content-management/related.md @@ -25,9 +25,9 @@ To list up to 5 related pages (which share the same _date_ or _keyword_ paramete {{ with $related }}

See Also

{{ end }} {{< /code >}} @@ -37,6 +37,7 @@ To list up to 5 related pages (which share the same _date_ or _keyword_ paramete Here is the list of "Related" methods available on a page collection such `.RegularPages`. #### .Related PAGE + Returns a collection of pages related the given one. ``` @@ -44,6 +45,7 @@ Returns a collection of pages related the given one. ``` #### .RelatedIndices PAGE INDICE1 [INDICE2 ...] + Returns a collection of pages related to a given one restricted to a list of indices. ``` @@ -51,6 +53,7 @@ Returns a collection of pages related to a given one restricted to a list of ind ``` #### .RelatedTo KEYVALS [KEYVALS2 ...] + Returns a collection of pages related together by a set of indices and their match. In order to build those set and pass them as argument, one must use the `keyVals` function where the first argument would be the `indice` and the consecutive ones its potential `matches`. @@ -64,6 +67,7 @@ Read [this blog article](https://regisphilibert.com/blog/2018/04/hugo-optmized-r {{% /note %}} ## Configure Related Content + Hugo provides a sensible default configuration of Related Content, but you can fine-tune this in your configuration, on the global or language level if needed. ### Default configuration diff --git a/content/en/content-management/shortcodes.md b/content/en/content-management/shortcodes.md index c5a126ab1..b2862f701 100644 --- a/content/en/content-management/shortcodes.md +++ b/content/en/content-management/shortcodes.md @@ -71,10 +71,9 @@ If you want the old behavior, you can put the following line in the start of you {{ $_hugo_config := `{ "version": 1 }` }} ``` - ### Shortcodes Without Markdown -The `<` character indicates that the shortcode's inner content does *not* need further rendering. Often shortcodes without markdown include internal HTML: +The `<` character indicates that the shortcode's inner content does *not* need further rendering. Often shortcodes without Markdown include internal HTML: ``` {{}}

Hello World!

{{}} @@ -86,11 +85,11 @@ You can call shortcodes within other shortcodes by creating your own templates t ## Use Hugo's Built-in Shortcodes -Hugo ships with a set of predefined shortcodes that represent very common usage. These shortcodes are provided for author convenience and to keep your markdown content clean. +Hugo ships with a set of predefined shortcodes that represent very common usage. These shortcodes are provided for author convenience and to keep your Markdown content clean. ### `figure` -`figure` is an extension of the image syntax in markdown, which does not provide a shorthand for the more semantic [HTML5 `
` element][figureelement]. +`figure` is an extension of the image syntax in Markdown, which does not provide a shorthand for the more semantic [HTML5 `
` element][figureelement]. The `figure` shortcode can use the following named parameters: @@ -254,7 +253,6 @@ Using the preceding `instagram` with `hidecaption` example above, the following {{< instagram BWNjjyYFxVx hidecaption >}} - {{% note %}} The `instagram`-shortcode refers an endpoint of Instagram's API, that's deprecated since October 24th, 2020. Thus, no images can be fetched from this API endpoint, resulting in an error when the `instagram`-shortcode is used. For more information please have a look at GitHub issue [#7879](https://github.com/gohugoio/hugo/issues/7879). {{% /note %}} @@ -360,7 +358,7 @@ Using the preceding `vimeo` example, the following HTML will be added to your re {{< /output >}} {{% tip %}} -If you want to further customize the visual styling of the YouTube or Vimeo output, add a `class` named parameter when calling the shortcode. The new `class` will be added to the `
` that wraps the `