Debian Codegraph @

docs/content/en/configuration/taxonomies.md

raw
1 ---
2 title: Configure taxonomies
3 linkTitle: Taxonomies
4 description: Configure taxonomies.
5 categories: []
6 keywords: []
7 ---
8
9 The default configuration defines two [taxonomies](g), `categories` and `tags`.
10
11 {{< code-toggle config=taxonomies />}}
12
13 When creating a taxonomy:
14
15 - Use the singular form for the key (e.g., `category`).
16 - Use the plural form for the value (e.g., `categories`).
17
18 Then use the value as the key in front matter:
19
20 <!-- markdownlint-disable MD007 MD032 -->
21 {{< code-toggle file=content/example.md fm=true >}}
22 title: Example
23 categories:
24 - vegetarian
25 - gluten-free
26 tags:
27 - appetizer
28 - main course
29 {{< /code-toggle >}}
30 <!-- markdownlint-enable MD007 MD032 -->
31 If you do not expect to assign more than one [term](g) from a given taxonomy to a content page, you may use the singular form for both key and value:
32
33 {{< code-toggle file=hugo >}}
34 taxonomies:
35 author: author
36 {{< /code-toggle >}}
37
38 Then in front matter:
39
40 <!-- markdownlint-disable MD007 MD032 -->
41 {{< code-toggle file=content/example.md fm=true >}}
42 title: Example
43 author:
44 - Robert Smith
45 {{< /code-toggle >}}
46 <!-- markdownlint-enable MD007 MD032 -->
47
48 The example above illustrates that even with a single term, the value is still provided as an array.
49
50 You must explicitly define the default taxonomies to maintain them when adding a new one:
51
52 {{< code-toggle file=hugo >}}
53 taxonomies:
54 author: author
55 category: categories
56 tag: tags
57 {{< /code-toggle >}}
58
59 To disable the taxonomy system, use the [`disableKinds`][] setting in the root of your project configuration to disable the `taxonomy` and `term` page [kinds](g).
60
61 {{< code-toggle file=hugo >}}
62 disableKinds = ['taxonomy','term']
63 {{< /code-toggle >}}
64
65 See the [taxonomies][] section for more information.
66
67 [`disableKinds`]: /configuration/all/#disablekinds
68 [taxonomies]: /content-management/taxonomies/