Skip to content

Commit

Permalink
Restructure templates section
Browse files Browse the repository at this point in the history
  • Loading branch information
jmooring committed Jun 25, 2024
1 parent fafbf65 commit 748bf06
Show file tree
Hide file tree
Showing 90 changed files with 1,045 additions and 909 deletions.
2 changes: 1 addition & 1 deletion content/en/about/privacy.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ aliases: [/gdpr/,/about/hugo-and-gdpr/]

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.**
**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 websites.**

But even static websites can integrate with external services, so from version `0.41`, Hugo provides a **privacy configuration** that covers the relevant built-in templates.

Expand Down
2 changes: 1 addition & 1 deletion content/en/content-management/comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@ Open-source commenting systems:
[front matter]: /content-management/front-matter/
[kaijuissue]: https://github.com/spf13/kaiju/issues/new
[issotutorial]: https://stiobhart.net/2017-02-24-isso-comments/
[partials]: /templates/partials/
[partials]: /templates/partial/
[MongoDB]: https://www.mongodb.com/
2 changes: 1 addition & 1 deletion content/en/content-management/content-adapters.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ Step 3
{{< /code >}}

Step 4
: Create a single page template to render each book review.
: Create a single template to render each book review.

{{< code file=layouts/books/single.html copy=true >}}
{{ define "main" }}
Expand Down
20 changes: 8 additions & 12 deletions content/en/content-management/cross-references.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ The `ref` and `relref` shortcodes require a single argument: the path to a conte
The pages can be referenced as follows:

```text
{{</* ref "document2" */>}} // <- From pages/document1.md, relative path
{{</* ref "document2" */>}} <-- From pages/document1.md, relative path
{{</* ref "document2#anchor" */>}}
{{</* ref "document2.md" */>}}
{{</* ref "document2.md#anchor" */>}}
{{</* ref "#anchor" */>}} // <- From pages/document2.md
{{</* ref "/blog/my-post" */>}} // <- From anywhere, absolute path
{{</* ref "#anchor" */>}} <-- From pages/document2.md
{{</* ref "/blog/my-post" */>}} <-- From anywhere, absolute path
{{</* ref "/blog/my-post.md" */>}}
{{</* relref "document" */>}}
{{</* relref "document.md" */>}}
Expand All @@ -52,12 +52,12 @@ The pages can be referenced as follows:
index.md can be reference either by its path or by its containing folder without the ending `/`. \_index.md can be referenced only by its containing folder:

```text
{{</* ref "/about" */>}} // <- References /about/_index.md
{{</* ref "/about/_index" */>}} // Raises REF_NOT_FOUND error
{{</* ref "/about/credits.md" */>}} // <- References /about/credits.md
{{</* ref "/about" */>}} <-- References /about/_index.md
{{</* ref "/about/_index" */>}} <-- Raises REF_NOT_FOUND error
{{</* ref "/about/credits.md" */>}} <-- References /about/credits.md
{{</* ref "/products" */>}} // <- References /products/index.md
{{</* ref "/products/index" */>}} // <- References /products/index.md
{{</* ref "/products" */>}} <-- References /products/index.md
{{</* ref "/products/index" */>}} <-- References /products/index.md
```

To generate a hyperlink using `ref` or `relref` in Markdown:
Expand Down Expand Up @@ -146,7 +146,3 @@ refLinksErrorLevel ("ERROR")

refLinksNotFoundURL
: URL to be used as a placeholder when a page reference cannot be found in `ref` or `relref`. Is used as-is.

[lists]: /templates/lists/
[output formats]: /templates/output-formats/
[shortcode]: /content-management/shortcodes/
2 changes: 1 addition & 1 deletion content/en/content-management/front-matter.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ path

(`map`) A map of sitemap options. See the [sitemap templates] page for details. Access these values from a template using the [`Sitemap`] method on a `Page` object.

[sitemap templates]: /templates/sitemap-template/
[sitemap templates]: /templates/sitemap/
[`sitemap`]: /methods/page/sitemap/

###### slug
Expand Down
2 changes: 1 addition & 1 deletion content/en/content-management/image-processing/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ A remote resource is a file on a remote server, accessible via HTTP or HTTPS. To

## Image rendering

Once you have accessed an image as either a page resource or a global resource, render it in your templates using the `Permalink`, `RelPermalink`, `Width`, and `Height` properties.
Once you have accessed an image as a resource, render it in your templates using the `Permalink`, `RelPermalink`, `Width`, and `Height` properties.

Example 1: Throws an error if the resource is not found.

Expand Down
4 changes: 2 additions & 2 deletions content/en/content-management/menus.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ Hugo provides two methods to localize your menu entries. See [multilingual].
See [menu templates].

[localize]: /content-management/multilingual/#menus
[menu templates]: /templates/menu-templates/
[menu templates]: /templates/menu/
[multilingual]: /content-management/multilingual/#menus
[section]: /getting-started/glossary/#section
[template]: /templates/menu-templates/
[template]: /templates/menu/
7 changes: 2 additions & 5 deletions content/en/content-management/multilingual.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ To create a list of links to translated content, use a template similar to the f
{{ end }}
{{< /code >}}

The above can be put in a `partial` (i.e., inside `layouts/partials/`) and included in any template, whether a [single content page][contenttemplate] or the [homepage]. It will not print anything if there are no translations for a given page.
The above can be put in a `partial` (i.e., inside `layouts/partials/`) and included in any template. It will not print anything if there are no translations for a given page.

The above also uses the [`i18n` function][i18func] described in the next section.

Expand Down Expand Up @@ -564,7 +564,7 @@ products = 'Produkte'
services = 'Leistungen'
{{< / code-toggle >}}

[example menu template]: /templates/menu-templates/#example
[example menu template]: /templates/menu/#example
[automatically]: /content-management/menus/#define-automatically
[in front matter]: /content-management/menus/#define-in-front-matter
[in site configuration]: /content-management/menus/#define-in-site-configuration
Expand Down Expand Up @@ -615,10 +615,8 @@ hugo new content content/de/post/test.md

[`abslangurl`]: /functions/urls/abslangurl/
[config]: /getting-started/configuration/
[contenttemplate]: /templates/single-page-templates/
[go-i18n-source]: https://github.com/nicksnyder/go-i18n
[go-i18n]: https://github.com/nicksnyder/go-i18n
[homepage]: /templates/homepage/
[Hugo Multilingual Part 1: Content translation]: https://regisphilibert.com/blog/2018/08/hugo-multilingual-part-1-managing-content-translation/
[i18func]: /functions/lang/translate/
[lang.FormatAccounting]: /functions/lang/formataccounting/
Expand All @@ -630,5 +628,4 @@ hugo new content content/de/post/test.md
[menus]: /content-management/menus/
[OS environment]: /getting-started/configuration/#configure-with-environment-variables
[`rellangurl`]: /functions/urls/rellangurl/
[single page templates]: /templates/single-page-templates/
[`time.Format`]: /functions/time/format/
15 changes: 4 additions & 11 deletions content/en/content-management/organization/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ The following demonstrates the relationships between your content organization a

### Index pages: `_index.md`

`_index.md` has a special role in Hugo. It allows you to add front matter and content to your [list templates][lists]. These templates include those for [section templates], [taxonomy templates], [taxonomy terms templates], and your [homepage template].
`_index.md` has a special role in Hugo. It allows you to add front matter and content to `home`, `section`, `taxonomy`, and `term` pages.

{{% note %}}
**Tip:** You can get a reference to the content and metadata in `_index.md` using the [`.Site.GetPage` function](/methods/page/getpage).
{{% /note %}}

You can create one `_index.md` for your homepage and one in each of your content sections, taxonomies, and taxonomy terms. The following shows typical placement of an `_index.md` that would contain content and front matter for a `posts` section list page on a Hugo website:
You can create one `_index.md` for your home page and one in each of your content sections, taxonomies, and terms. The following shows typical placement of an `_index.md` that would contain content and front matter for a `posts` section list page on a Hugo website:

```txt
. url
Expand Down Expand Up @@ -106,7 +106,7 @@ The [sections] can be nested as deeply as you want. The important thing to under

### Single pages in sections

Single content files in each of your sections will be rendered as [single page templates][singles]. Here is an example of a single `post` within `posts`:
Single content files in each of your sections will be rendered by a [single template]. Here is an example of a single `post` within `posts`:

```txt
path ("posts/my-first-hugo-post.md")
Expand Down Expand Up @@ -156,14 +156,7 @@ The `url` is the entire URL path, defined by the file path and optionally overri
[formats]: /content-management/formats/
[front matter]: /content-management/front-matter/
[getpage]: /methods/page/getpage/
[homepage template]: /templates/homepage/
[homepage]: /templates/homepage/
[lists]: /templates/lists/
[pretty]: /content-management/urls/#appearance
[section templates]: /templates/section-templates/
[sections]: /content-management/sections/
[singles]: /templates/single-page-templates/
[taxonomy templates]: /templates/taxonomy-templates/
[taxonomy terms templates]: /templates/taxonomy-templates/
[types]: /content-management/types/
[single template]: /templates/types/#single
[urls]: /content-management/urls/
10 changes: 7 additions & 3 deletions content/en/content-management/page-bundles.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,17 @@ Page bundle characteristics vary by bundle type.
| Index file | index.md | _index.md |
| Example | content/about/index.md | content/posts/_index.md |
| [Page kinds] | `page` | `home`, `section`, `taxonomy`, or `term` |
| Layout type | [single] | [list] |
| Template types | [single] | [home], [section], [taxonomy], or [term] |
| Descendant pages | None | Zero or more |
| Resource location | Adjacent to the index file or in a nested subdirectory | Same as a leaf bundles, but excludes descendant bundles |
| [Resource types] | `page`, `image`, `video`, etc. | all but `page` |

[single]: /templates/types/#single
[home]: /templates/types/#home
[section]: /templates/types/#section
[taxonomy]: /templates/types/#taxonomy
[term]: /templates/types/#term

Files with [resource type] `page` include content written in Markdown, HTML, AsciiDoc, Pandoc, reStructuredText, and Emacs Org Mode. In a leaf bundle, excluding the index file, these files are only accessible as page resources. In a branch bundle, these files are only accessible as content pages.

## Leaf bundles
Expand Down Expand Up @@ -149,9 +155,7 @@ Use [build options] in front matter to create an unpublished leaf or branch bund

[`Resources`]: /methods/page/resources/
[build options]: content-management/build-options/
[list]: /templates/lists/
[page kinds]: /getting-started/glossary/#page-kind
[page resources]: /content-management/page-resources/
[resource type]: /getting-started/glossary/#resource-type
[resource types]: /getting-started/glossary/#resource-type
[single]: /templates/single-page-templates/
2 changes: 1 addition & 1 deletion content/en/content-management/related.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Hugo uses a set of factors to identify a page's related content based on front m

## 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:
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 template:

{{< code file=layouts/partials/related.html >}}
{{ $related := .Site.RegularPages.Related . | first 5 }}
Expand Down
6 changes: 3 additions & 3 deletions content/en/content-management/sections.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ Hugo has a defined [lookup order] to determine which template to use when render

With the file structure from the [example above](#overview):

Content directory|List page template
Content directory|Section template
:--|:--
content/products|layouts/products/list.html
content/products/product-1|layouts/products/list.html
content/products/product-1/benefits|layouts/products/list.html

Content directory|Single page template
Content directory|Single template
:--|:--
content/products|layouts/products/single.html
content/products/product-1|layouts/products/single.html
Expand Down Expand Up @@ -159,6 +159,6 @@ Home » Products » Product 1 » Benefits » Benefit 1
[archetype]: /content-management/archetypes/
[content type]: /content-management/types/
[directory structure]: /getting-started/directory-structure/
[section templates]: /templates/section-templates/
[section templates]: /templates/types/#section
[leaf bundles]: /content-management/page-bundles/#leaf-bundles
[branch bundles]: /content-management/page-bundles/#branch-bundles
6 changes: 3 additions & 3 deletions content/en/content-management/shortcodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,9 @@ To learn how to configure your Hugo site to meet the new EU privacy regulation,
To learn more about creating custom shortcodes, see the [shortcode template documentation].

[privacy protections]: /about/privacy/
[partials]: /templates/partials/
[partials]: /templates/partial/
[quickstart]: /getting-started/quick-start/
[sctemps]: /templates/shortcode-templates/
[shortcode template documentation]: /templates/shortcode-templates/
[sctemps]: /templates/shortcode/
[shortcode template documentation]: /templates/shortcode/
[Vimeo]: https://vimeo.com/
[YouTube Videos]: https://www.youtube.com/
8 changes: 3 additions & 5 deletions content/en/content-management/taxonomies.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ disableKinds = ["taxonomy","term"]

When taxonomies are used---and [taxonomy templates] are provided---Hugo will automatically create both a page listing all the taxonomy's terms and individual pages with lists of content associated with each term. For example, a `categories` taxonomy declared in your configuration and used in your content front matter will create the following pages:

* A single page at `example.com/categories/` that lists all the [terms within the taxonomy]
* A single page at `example.com/categories/` that lists all the terms within the taxonomy
* [Individual taxonomy list pages][taxonomy templates] (e.g., `/categories/development/`) for each of the terms that shows a listing of all pages marked as part of that taxonomy within any content file's [front matter]

## Configure taxonomies
Expand Down Expand Up @@ -142,7 +142,7 @@ categories = ['Category A','Category B']

## Order taxonomies

A content file can assign weight for each of its associate taxonomies. Taxonomic weight can be used for sorting or ordering content in [taxonomy list templates] and is declared in a content file's [front matter]. The convention for declaring taxonomic weight is `taxonomyname_weight`.
A content file can assign weight for each of its associate taxonomies. Taxonomic weight can be used for sorting or ordering content in [taxonomy templates] and is declared in a content file's [front matter]. The convention for declaring taxonomic weight is `taxonomyname_weight`.

The following show a piece of content that has a weight of 22, which can be used for ordering purposes when rendering the pages assigned to the "a", "b" and "c" values of the `tags` taxonomy. It has also been assigned the weight of 44 when rendering the "d" category page.

Expand Down Expand Up @@ -171,7 +171,5 @@ wikipedia: "https://en.wikipedia.org/wiki/Bruce_Willis"
[content type]: /content-management/types/
[documentation on archetypes]: /content-management/archetypes/
[front matter]: /content-management/front-matter/
[taxonomy list templates]: /templates/taxonomy-templates/#taxonomy-templates
[taxonomy templates]: /templates/taxonomy-templates/
[terms within the taxonomy]: /templates/taxonomy-templates/#term-templates
[taxonomy templates]: /templates/types/#taxonomy
[site configuration]: /getting-started/configuration/
2 changes: 1 addition & 1 deletion content/en/content-management/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ A **content type** is a way to organize your content. Hugo resolves the content

A content type is used to

- Determine how the content is rendered. See [Template Lookup Order](/templates/lookup-order/) and [Content Views](/templates/views) for more.
- Determine how the content is rendered. See [Template Lookup Order](/templates/lookup-order/) and [Content Views](/templates/content-view) for more.
- Determine which [archetype](/content-management/archetypes/) template to use for new content.
2 changes: 1 addition & 1 deletion content/en/contribute/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ CGO_ENABLED=1 go install -tags extended github.com/gohugoio/hugo@latest
To build and install a specific release:

```sh
CGO_ENABLED=1 go install -tags extended github.com/gohugoio/hugo@v0.126.0
CGO_ENABLED=1 go install -tags extended github.com/gohugoio/hugo@v0.128.0
```

To build and install at the latest commit on the master branch:
Expand Down
2 changes: 2 additions & 0 deletions content/en/contribute/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ Although we do not strictly adhere to the [Microsoft Writing Style Guide], it is
Please link to the [glossary of terms] when necessary, and use the terms consistently throughout the documentation. Of special note:

- The term "front matter" is two words unless you are referring to the configuration key
- The term "home page" is two words
- The term "website" is one word
- The term "standalone" is one word, not hyphenated
- Use the word "map" instead of "dictionary"
- Use the word "flag" instead of "option" when referring to a command line flag
Expand Down
4 changes: 1 addition & 3 deletions content/en/functions/collections/After.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The template above is rendered to:

## Example of `after` with `first`: 2nd&ndash;4th most recent articles

You can use `after` in combination with the [`first`] function and Hugo's [powerful sorting methods][lists]. Let's assume you have a list page at `example.com/articles`. You have 10 articles, but you want your templating for the [list/section page] to show only two rows:
You can use `after` in combination with the [`first`] function and Hugo's [powerful sorting methods](/quick-reference/page-collections/#sort). Let's assume you have a `section` page at `example.com/articles`. You have 10 articles, but you want your template to show only two rows:

1. The top row is titled "Featured" and shows only the most recently published article (i.e. by `publishdate` in the content files' front matter).
2. The second row is titled "Recent Articles" and shows only the 2nd- to 4th-most recently published articles.
Expand Down Expand Up @@ -66,6 +66,4 @@ You can use `after` in combination with the [`first`] function and Hugo's [power
{{< /code >}}

[`first`]: /functions/collections/first/
[list/section page]: /templates/section-templates/
[lists]: /templates/lists/#sort-content
[`slice`]: /functions/collections/slice/
2 changes: 1 addition & 1 deletion content/en/functions/collections/Group.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ aliases: [/functions/group]
{{ end }}
```

The page group you get from `group` is of the same type you get from the built-in [group methods](/templates/lists#group-content) in Hugo. The example above can be [paginated](/templates/pagination/).
The page group you get from `group` is of the same type you get from the built-in [group methods](/quick-reference/page-collections/#group) in Hugo. The example above can be [paginated](/templates/pagination/).
3 changes: 0 additions & 3 deletions content/en/functions/collections/Intersect.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,3 @@ A useful example is to use it as `AND` filters when combined with where:
The above fetches regular pages not of `page` or `about` type unless they are pinned. And finally, we exclude all pages with no `images` set in Page parameters.

See [union](/functions/collections/union) for `OR`.

[partials]: /templates/partials/
[single]: /templates/single-page-templates/
2 changes: 0 additions & 2 deletions content/en/functions/crypto/FNV32a.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ action:
aliases: [/functions/crypto.fnv32a]
---

{{< new-in 0.98.0 >}}

This function calculates the 32-bit [FNV1a hash](https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function#FNV-1a_hash) of a given string according to the [specification](https://datatracker.ietf.org/doc/html/draft-eastlake-fnv-12):

```go-html-template
Expand Down
Loading

0 comments on commit 748bf06

Please sign in to comment.