Merge commit '3902f9a4767fe6e62ac5146728d8311b8cd227e0'

This commit is contained in:
Bjørn Erik Pedersen
2022-04-28 11:52:15 +02:00
33 changed files with 98 additions and 245 deletions

View File

@@ -54,6 +54,7 @@ Your 404.html file can be set to load automatically when a visitor enters a mist
* Caddy Server. Use the `handle_errors` directive to specify error pages for one or more status codes. [Details here](https://caddyserver.com/docs/caddyfile/directives/handle_errors)
* Netlify. Add `/* /404.html 404` to `content/_redirects`. [Details Here](https://www.netlify.com/docs/redirects/#custom-404)
* Azure Static website. You can specify the `Error document path` in the Static website configuration page of the Azure portal. [More details are available in the Static website documentation](https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-static-website).
* DigitalOcean App Platform. You can specify `error_document` in your app specification file or use control panel to set up error document. [Details here](https://docs.digitalocean.com/products/app-platform/references/app-specification-reference/).
{{% note %}}
`hugo server` will not automatically load your custom `404.html` file, but you

View File

@@ -421,6 +421,8 @@ In the above example, you may want `{{.Title}}` to point the `title` field you h
{{ end }}
{{< /code >}}
{{< new-in "0.97.0" >}} `GroupByDate` accepts the same time layouts as in [time.Format](/functions/dateformat/) and The `.Key` in the result will be localized for the current language.
### By Publish Date
{{< code file="layouts/partials/by-page-publish-date.html" >}}
@@ -438,6 +440,7 @@ In the above example, you may want `{{.Title}}` to point the `title` field you h
{{ end }}
{{< /code >}}
{{< new-in "0.97.0" >}} `GroupByDate` accepts the same time layouts as in [time.Format](/functions/dateformat/) and The `.Key` in the result will be localized for the current language.
### By Lastmod
@@ -456,6 +459,8 @@ In the above example, you may want `{{.Title}}` to point the `title` field you h
{{ end }}
{{< /code >}}
{{< new-in "0.97.0" >}} `GroupByDate` accepts the same time layouts as in [time.Format](/functions/dateformat/) and The `.Key` in the result will be localized for the current language.
### By Expiry Date
{{< code file="layouts/partials/by-page-expiry-date.html" >}}
@@ -473,6 +478,8 @@ In the above example, you may want `{{.Title}}` to point the `title` field you h
{{ end }}
{{< /code >}}
{{< new-in "0.97.0" >}} `GroupByDate` accepts the same time layouts as in [time.Format](/functions/dateformat/) and The `.Key` in the result will be localized for the current language.
### By Page Parameter
{{< code file="layouts/partials/by-page-param.html" >}}

View File

@@ -13,7 +13,7 @@ menu:
weight: 20
---
{{< new-in "0.62.0" >}} Note that this is only supported with the [Goldmark](#goldmark) renderer.
{{< 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`.

View File

@@ -83,7 +83,7 @@ To easily generate new instances of a content type (e.g., new `.md` files in a s
[dry]: https://en.wikipedia.org/wiki/Don%27t_repeat_yourself
[`.Format` function]: /functions/format/
[front matter]: /content-management/front-matter/
[pagetaxonomy]: /templates/taxonomy-templates/#displaying-a-single-piece-of-content-s-taxonomies
[pagetaxonomy]: /templates/taxonomy-templates/#display-a-single-piece-of-contents-taxonomies
[pagevars]: /variables/page/
[partials]: /templates/partials/
[section]: /content-management/sections/

View File

@@ -25,8 +25,8 @@ Hugo includes support for user-defined groupings of content called **taxonomies*
Hugo provides multiple ways to use taxonomies throughout your project templates:
* Order the way content associated with a taxonomy term is displayed in a [taxonomy list template](#taxonomy-list-template)
* Order the way the terms for a taxonomy are displayed in a [taxonomy terms template](#taxonomy-terms-template)
* Order the way content associated with a taxonomy term is displayed in a [taxonomy list template](#taxonomy-list-templates)
* Order the way the terms for a taxonomy are displayed in a [taxonomy terms template](#taxonomy-terms-templates)
* List a single content's taxonomy terms within a [single page template][]
## Taxonomy List Templates
@@ -37,7 +37,7 @@ Taxonomy list page templates are lists and therefore have all the variables and
See [Template Lookup](/templates/lookup-order/).
## Taxonomy Terms Template
## Taxonomy Terms Templates
### Taxonomy Terms Templates Lookup Order
@@ -103,7 +103,7 @@ type WeightedPages []WeightedPage
## Displaying custom metadata in Taxonomy Terms Templates
If you need to display custom metadata for each taxonomy term, you will need to create a page for that term at `/content/<TAXONOMY>/<TERM>/_index.md` and add your metadata in its front matter, [as explained in the taxonomies documentation](/content-management/taxonomies/#add-custom-meta-data-to-a-taxonomy-term). Based on the Actors taxonomy example shown there, within your taxonomy terms template, you may access your custom fields by iterating through the variable `.Pages` as such:
If you need to display custom metadata for each taxonomy term, you will need to create a page for that term at `/content/<TAXONOMY>/<TERM>/_index.md` and add your metadata in its front matter, [as explained in the taxonomies documentation](/content-management/taxonomies/#add-custom-metadata-to-a-taxonomy-or-term). Based on the Actors taxonomy example shown there, within your taxonomy terms template, you may access your custom fields by iterating through the variable `.Pages` as such:
```go-html-template
<ul>