Skip to content

Commit

Permalink
Squashed 'docs/' changes from ac2c4a487..cfd74b57d
Browse files Browse the repository at this point in the history
cfd74b57d Add a config file update step.
5957d8815 Wrap cache configuration in code-toggle
914405c0e capitalization and indentation fix for taxonomies page (#1159)
223b80f42 Fix page kinds shortcode not rendering on Taxonomies page (#1158)
a9b6fa984 Clarify weight description.
29e121681 Warn about zero weights in front matter.
27ce7ba8c Release 0.73.0
e9596b2ee Merge branch 'temp73'
074a270cd releaser: Add release notes to /docs for release of 0.73.0
4f56a9fc0 width fix of expanding code box in documentation (#1156)
f27254d60 css fix of expanding code box in documentation (#1155)
43b576178 Fix incorrect directory name in quick-start (#1154)
16726eacf Add GroupByLastmod
73c31758e Fix for broken link again (#1151)
d07067295 Fix broken link (#1144)
bc0b484d1 Rename taxonomy kinds from taxonomy to term, taxonomyTerm to taxonomy
674d71842 Fix Typo on Docker section of installation page
b87778165 Merge commit 'efa74c5c6e6ff1daddeb5834ea7c69bed2acf171'
c7cdebed3 tpl/crypto: Add hmac
260130cc0 Allow hook template per section/type
1f70519d8 releaser: Add release notes to /docs for release of 0.72.0
8516d540c Merge commit '9e1dcefc5f559944b70d2fa520f6acd5c56a69f2'
c49195c69 common/maps: Add Scratch.Values
78072df81 Add redirect support to the server
90ca0af6b Fix typo in install instructions

git-subtree-dir: docs
git-subtree-split: cfd74b57d968d98f88d3ddaee651d9cbe79b7ce1
  • Loading branch information
bep committed Jul 7, 2020
1 parent efa74c5 commit 6aa5c91
Show file tree
Hide file tree
Showing 22 changed files with 388 additions and 101 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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 @@ -135,7 +135,7 @@ videos
: an array of paths to videos related to the page; used by the `opengraph` [internal template](/templates/internal) to populate `og:video`.

weight
: used for [ordering your content in lists][ordering]. Lower weight gets higher precedence. So content with lower weight will come first.
: 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.

\<taxonomies\>
: 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._
Expand Down
23 changes: 12 additions & 11 deletions content/en/content-management/taxonomies.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
title: Taxonomies
linktitle:
description: Hugo includes support for user-defined taxonomies to help you demonstrate logical relationships between content for the end users of your website.
description: Hugo includes support for user-defined taxonomies..
date: 2017-02-01
publishdate: 2017-02-01
lastmod: 2017-02-01
keywords: [taxonomies,metadata,front matter,terms]
categories: [content management]
menu:
Expand Down Expand Up @@ -32,7 +31,6 @@ Term
Value
: a piece of content assigned to a term

{{< youtube pCPCQgqC8RA >}}

## Example Taxonomy: Movie Website

Expand Down Expand Up @@ -97,9 +95,13 @@ Without adding a single line to your [site config][config] file, Hugo will autom
If you do not want Hugo to create any taxonomies, set `disableKinds` in your [site config][config] to the following:

{{< code-toggle copy="false" >}}
disableKinds = ["taxonomy","taxonomyTerm"]
disableKinds = ["taxonomy","term"]
{{</ code-toggle >}}

{{< 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.

{{% page-kinds %}}

### Default Destinations

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:
Expand Down Expand Up @@ -190,18 +192,17 @@ By using taxonomic weight, the same piece of content can appear in different pos
Currently taxonomies only support the [default `weight => date` ordering of list content](/templates/lists/#default-weight-date). For more information, see the documentation on [taxonomy templates](/templates/taxonomy-templates/).
{{% /note %}}

## Add custom metadata to a Taxonomy Term
## Add custom metadata a Taxonomy or Term

If you need to add custom metadata to your taxonomy terms, you will need to create a page for that term at `/content/<TAXONOMY>/<TERM>/_index.md` and add your metadata in it's front matter. Continuing with our 'Actors' example, let's say you want to add a wikipedia page link to each actor. Your terms pages would be something like this:
If you need to add custom metadata to your taxonomy terms, you will need to create a page for that term at `/content/<TAXONOMY>/<TERM>/_index.md` and add your metadata in it's front matter. Continuing with our 'Actors' example, let's say you want to add a Wikipedia page link to each actor. Your terms pages would be something like this:

{{< code file="/content/actors/bruce-willis/_index.md" >}}
---
title: "Bruce Willis"
wikipedia: "https://en.wikipedia.org/wiki/Bruce_Willis"
---
---
title: "Bruce Willis"
wikipedia: "https://en.wikipedia.org/wiki/Bruce_Willis"
---
{{< /code >}}

You can later use your custom metadata as shown in the [Taxonomy Terms Templates documentation](/templates/taxonomy-templates/#displaying-custom-metadata-in-taxonomy-terms-templates).

[`urlize` template function]: /functions/urlize/
[content section]: /content-management/sections/
Expand Down
34 changes: 34 additions & 0 deletions content/en/functions/hmac.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: hmac
linktitle: hmac
description: Compute the cryptographic checksum of a message.
godocref:
date: 2020-05-29
publishdate: 2020-05-29
lastmod: 2020-05-29
categories: [functions]
menu:
docs:
parent: "functions"
keywords: [hmac,checksum]
signature: ["hmac HASH_TYPE KEY MESSAGE"]
workson: []
hugoversion:
relatedfuncs: [hmac]
deprecated: false
aliases: [hmac]
---

`hmac` returns a cryptographic hash that uses a key to sign a message.

```
{{ hmac "sha256" "Secret key" "Hello world, gophers!"}},
<!-- returns the string "b6d11b6c53830b9d87036272ca9fe9d19306b8f9d8aa07b15da27d89e6e34f40"
```

Supported hash functions:

* md5
* sha1
* sha256
* sha512
2 changes: 2 additions & 0 deletions content/en/getting-started/configuration-markup.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ Note that this is only supported with the [Goldmark](#goldmark) renderer.

Render Hooks allow custom templates to override markdown rendering functionality. You can do this by creating templates with base names `render-{feature}` 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" >}}

The features currently supported are:

* `image`
Expand Down
6 changes: 3 additions & 3 deletions content/en/getting-started/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ disableHugoGeneratorInject (false)
: Hugo will, by default, inject a generator meta tag in the HTML head on the _home page only_. You can turn it off, but we would really appreciate if you don't, as this is a good way to watch Hugo's popularity on the rise.

disableKinds ([])
: Enable disabling of all pages of the specified *Kinds*. Allowed values in this list: `"page"`, `"home"`, `"section"`, `"taxonomy"`, `"taxonomyTerm"`, `"RSS"`, `"sitemap"`, `"robotsTXT"`, `"404"`.
: Enable disabling of all pages of the specified *Kinds*. Allowed values in this list: `"page"`, `"home"`, `"section"`, `"taxonomy"`, `"term"`, `"RSS"`, `"sitemap"`, `"robotsTXT"`, `"404"`.

disableLiveReload (false)
: Disable automatic live reloading of browser window.
Expand Down Expand Up @@ -514,7 +514,7 @@ Default configuration:

Since Hugo 0.52 you can configure more than just the `cacheDir`. This is the default configuration:

```toml
{{< code-toggle >}}
[caches]
[caches.getjson]
dir = ":cacheDir/:project"
Expand All @@ -531,7 +531,7 @@ maxAge = -1
[caches.modules]
dir = ":cacheDir/modules"
maxAge = -1
```
{{< /code-toggle >}}

You can override any of these cache settings in your own `config.toml`.

Expand Down
2 changes: 1 addition & 1 deletion content/en/getting-started/installing.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Ideally, you should install it somewhere in your `PATH` for easy use. `/usr/loca

### Docker

We currently do not official Hugo images for Docker, but we do recommend these up to date distributions: https://hub.docker.com/r/klakegg/hugo/
We currently do not offer official Hugo images for Docker, but we do recommend these up to date distributions: https://hub.docker.com/r/klakegg/hugo/

### Homebrew (macOS)

Expand Down
2 changes: 1 addition & 1 deletion content/en/getting-started/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ The above will create a new Hugo site in a folder named `quickstart`.

See [themes.gohugo.io](https://themes.gohugo.io/) for a list of themes to consider. This quickstart uses the beautiful [Ananke theme](https://themes.gohugo.io/gohugo-theme-ananke/).

First, download the theme from GitHub and add it to your site's `theme` directory:
First, download the theme from GitHub and add it to your site's `themes` directory:

```bash
cd quickstart
Expand Down
1 change: 1 addition & 0 deletions content/en/hosting-and-deployment/hosting-on-github.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ This is a much simpler setup as your Hugo files and generated content are publis
* Press <kbd>Ctrl</kbd>+<kbd>C</kbd> to kill the server
* Before proceeding run `rm -rf public` to completely remove the `public` directory
6. `git submodule add -b master https://github.com/<USERNAME>/<USERNAME>.github.io.git public`. This creates a git [submodule][]. Now when you run the `hugo` command to build your site to `public`, the created `public` directory will have a different remote origin (i.e. hosted GitHub repository).
7. Make sure the `baseURL` in your config file is updated with: `<USERNAME>.github.io`

### Put it Into a Script

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions content/en/news/0.73.0-relnotes/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@

---
date: 2020-06-23
title: "Summer Breeze"
description: "Taxonomy terms cleanup, render hooks per section/type, HMAC function, and more."
categories: ["Releases"]
---

Again, a release on the small side. Some new features -- one example is that we now support hook templates per section/type, see [#7349](https://github.com/gohugoio/hugo/issues/7349) -- and some important bug fixes.

But the most important part of this release is that we have now finally cleaned up the terms used for the taxonomy page kinds. This has made the taxonomy feature in Hugo harder to understand than it needed to be. The old/new values for these are `taxonomy` => `term` and `taxonomyTerm` => `taxonomy`. We have taken great care to avoid site breakage. See [#6911](https://github.com/gohugoio/hugo/issues/6911) for more information.

This release represents **21 contributions by 9 contributors** to the main Hugo code base.bjorn.erik.pedersen leads the Hugo development with a significant amount of contributions, but also a big shoutout to helfper, moorereason, and onedrawingperday for their ongoing contributions.
And a big thanks to [@digitalcraftsman](https://github.com/digitalcraftsman) for his relentless work on keeping the themes site in pristine condition and to [@davidsneighbour](https://github.com/davidsneighbour), [@coliff](https://github.com/coliff) and [@kaushalmodi](https://github.com/kaushalmodi) for all the great work on the documentation site.

Many have also been busy writing and fixing the documentation in [hugoDocs](https://github.com/gohugoio/hugoDocs),
which has received **30 contributions by 14 contributors**. A special thanks to christianoliff, bjorn.erik.pedersen, patrick, and hello for their work on the documentation site.


## Notes

* Rename taxonomy kinds from taxonomy to term, taxonomyTerm to taxonomy [#6911](https://github.com/gohugoio/hugo/issues/6911)

## Enhancements

### Templates

* tpl/crypto: Add hmac

### Other

* Remove some old release notes
* Create robots.txt in the domain root directory [#5160](https://github.com/gohugoio/hugo/issues/5160)[#4193](https://github.com/gohugoio/hugo/issues/4193)
* Make GroupByParamDate work with string params [#3983](https://github.com/gohugoio/hugo/issues/3983)
* Add GroupByLastmod [#7408](https://github.com/gohugoio/hugo/issues/7408)
* Rename taxonomy kinds from taxonomy to term, taxonomyTerm to taxonomy [#6911](https://github.com/gohugoio/hugo/issues/6911)[#7395](https://github.com/gohugoio/hugo/issues/7395)
* Add genDocsHelper mage target
* Regenerate templates
* Beautify HTML generated by pagination template [#7199](https://github.com/gohugoio/hugo/issues/7199)
* Add a nested data dir test
* Use os.PathError in RootMappingFs.doLstat
* Remove credit (#7347)
* Allow hook template per section/type [#7349](https://github.com/gohugoio/hugo/issues/7349)

## Fixes

### Templates

* Fix bad rounding in NumFmt [#7116](https://github.com/gohugoio/hugo/issues/7116)

### Other

* Fix aliases with path in baseURL
* Fix server data race/nil pointer in withMaps [#7392](https://github.com/gohugoio/hugo/issues/7392)
* Fix order of GetTerms [#7213](https://github.com/gohugoio/hugo/issues/7213)
* Fix aliases with uglyURLs
* Fix crash for closing shortcode with no .Inner set [#6857](https://github.com/gohugoio/hugo/issues/6857)[#7330](https://github.com/gohugoio/hugo/issues/7330)
* Fix aliases with relativeURLs
* Fix URL rewrites vs fast render server mode [#7357](https://github.com/gohugoio/hugo/issues/7357)





37 changes: 36 additions & 1 deletion content/en/templates/lists.md
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ In the above example, you may want `{{.Title}}` to point the `title` field you h
### By Publish Date

{{< code file="layouts/partials/by-page-publish-date.html" >}}
<!-- Groups content by month according to the "publishdate" field in front matter -->
<!-- Groups content by month according to the "publishDate" field in front matter -->
{{ range .Pages.GroupByPublishDate "2006-01" }}
<h3>{{ .Key }}</h3>
<ul>
Expand All @@ -438,6 +438,41 @@ In the above example, you may want `{{.Title}}` to point the `title` field you h
{{ end }}
{{< /code >}}


### By Lastmod

{{< code file="layouts/partials/by-page-lastmod.html" >}}
<!-- Groups content by month according to the "lastMod" field in front matter -->
{{ range .Pages.GroupByLastmod "2006-01" }}
<h3>{{ .Key }}</h3>
<ul>
{{ range .Pages }}
<li>
<a href="{{ .Permalink }}">{{ .Title }}</a>
<div class="meta">{{ .Lastmod.Format "Mon, Jan 2, 2006" }}</div>
</li>
{{ end }}
</ul>
{{ end }}
{{< /code >}}

### By Expiry Date

{{< code file="layouts/partials/by-page-expiry-date.html" >}}
<!-- Groups content by month according to the "expiryDate" field in front matter -->
{{ range .Pages.GroupByExpiryDate "2006-01" }}
<h3>{{ .Key }}</h3>
<ul>
{{ range .Pages }}
<li>
<a href="{{ .Permalink }}">{{ .Title }}</a>
<div class="meta">{{ .ExpiryDate.Format "Mon, Jan 2, 2006" }}</div>
</li>
{{ end }}
</ul>
{{ end }}
{{< /code >}}

### By Page Parameter

{{< code file="layouts/partials/by-page-param.html" >}}
Expand Down
8 changes: 4 additions & 4 deletions content/en/templates/lookup-order.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Type
: Is value of `type` if set in front matter, else it is the name of the root section (e.g. "blog"). It will always have a value, so if not set, the value is "page".

Section
: Is relevant for `section`, `taxonomy` and `taxonomyTerm` types.
: Is relevant for `section`, `taxonomy` and `term` types.

{{% note %}}
**Tip:** The examples below looks long and complex. That is the flexibility talking. Most Hugo sites contain just a handful of templates:
Expand Down Expand Up @@ -72,13 +72,13 @@ In Hugo, layouts can live in either the project's or the themes' layout folders,

{{< datatable-filtered "output" "layouts" "Kind == section" "Example" "OutputFormat" "Suffix" "Template Lookup Order" >}}

## Examples: Layout Lookup for Taxonomy List Pages
## Examples: Layout Lookup for Taxonomy Pages

{{< datatable-filtered "output" "layouts" "Kind == taxonomy" "Example" "OutputFormat" "Suffix" "Template Lookup Order" >}}

## Examples: Layout Lookup for Taxonomy Terms Pages
## Examples: Layout Lookup for Term Pages

{{< datatable-filtered "output" "layouts" "Kind == taxonomyTerm" "Example" "OutputFormat" "Suffix" "Template Lookup Order" >}}
{{< datatable-filtered "output" "layouts" "Kind == term" "Example" "OutputFormat" "Suffix" "Template Lookup Order" >}}



Expand Down
12 changes: 8 additions & 4 deletions content/en/templates/output-formats.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ Formats are set based on that.
| `page` | HTML |
| `home` | HTML, RSS |
| `section` | HTML, RSS |
| `taxonomyTerm` | HTML, RSS |
| `taxonomy` | HTML, RSS |
| `taxonomy` | HTML, RSS |
| `term` | HTML, RSS |

### Customizing Output Formats

Expand All @@ -156,10 +156,14 @@ Example from site config file:


Note that in the above examples, the *output formats* for `section`,
`taxonomyTerm` and `taxonomy` will stay at their default value `["HTML",
`taxonomy` and `term` will stay at their default value `["HTML",
"RSS"]`.

* The `outputs` definition is per [`Page` `Kind`][page_kinds] (`page`, `home`, `section`, `taxonomy`, or `taxonomyTerm`).
{{< 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 `outputs` section.

{{% page-kinds %}}

* The `outputs` definition is per [`Page` `Kind`][page_kinds] (`page`, `home`, `section`, `taxonomy`, or `term`).
* The names (e.g. `HTML`, `AMP`) used must match the `Name` of a defined *Output Format*.
* These names are case insensitive.
* These can be overridden per `Page` in the front matter of content files.
Expand Down
8 changes: 1 addition & 7 deletions content/en/templates/section-templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,7 @@ See [Template Lookup](/templates/lookup-order/).

Every `Page` in Hugo has a `.Kind` attribute.

| Kind | Description | Example |
|----------------|--------------------------------------------------------------------|-------------------------------------------------------------------------------|
| `home` | The home page | `/index.html` |
| `page` | A page showing a _regular page_ | `my-post` page (`/posts/my-post/index.html`) |
| `section` | A page listing _regular pages_ from a given [_section_][sections] | `posts` section (`/posts/index.html`) |
| `taxonomy` | A page listing _regular pages_ from a given _taxonomy term_ | page for the term `awesome` from `tags` taxonomy (`/tags/awesome/index.html`) |
| `taxonomyTerm` | A page listing terms from a given _taxonomy_ | page for the `tags` taxonomy (`/tags/index.html`) |
{{% page-kinds %}}

## `.Site.GetPage` with Sections

Expand Down
Loading

0 comments on commit 6aa5c91

Please sign in to comment.