Keywords
Syntax
PAGE.Keywords
Returns
[]string
By default, Hugo evaluates the keywords when creating collections of related content.
content/recipes/sushi.md
---
keywords:
- tuna
- sriracha
- nori
- rice
title: How to make spicy tuna hand rolls
---
+++
keywords = ['tuna', 'sriracha', 'nori', 'rice']
title = 'How to make spicy tuna hand rolls'
+++
{
"keywords": [
"tuna",
"sriracha",
"nori",
"rice"
],
"title": "How to make spicy tuna hand rolls"
}
To list the keywords within a template:
{{ range .Keywords }}
{{ . }}
{{ end }}
Or use the delimit function:
{{ delimit .Keywords ", " ", and " }} → tuna, sriracha, nori, and rice
Keywords are also a useful taxonomy:
hugo.
taxonomies:
category: categories
keyword: keywords
tag: tags
[taxonomies]
category = 'categories'
keyword = 'keywords'
tag = 'tags'
{
"taxonomies": {
"category": "categories",
"keyword": "keywords",
"tag": "tags"
}
}