2013-10-31 09:51:13 -04:00
|
|
|
|
---
|
2014-05-29 18:42:05 -04:00
|
|
|
|
aliases:
|
|
|
|
|
- /indexes/overview/
|
|
|
|
|
- /doc/indexes/
|
|
|
|
|
- /extras/indexes
|
|
|
|
|
date: 2013-07-01
|
|
|
|
|
linktitle: Overview
|
2014-04-23 03:00:11 -04:00
|
|
|
|
menu:
|
|
|
|
|
main:
|
2014-05-29 18:42:05 -04:00
|
|
|
|
identifier: taxonomy overview
|
|
|
|
|
parent: taxonomy
|
|
|
|
|
next: /taxonomies/usage
|
|
|
|
|
prev: /templates/404
|
|
|
|
|
title: Taxonomy Overview
|
|
|
|
|
weight: 10
|
2013-10-31 09:51:13 -04:00
|
|
|
|
---
|
|
|
|
|
|
2014-12-04 11:26:12 -05:00
|
|
|
|
Hugo includes support for user-defined groupings of content called
|
2015-01-29 14:34:56 -05:00
|
|
|
|
taxonomies.[^1] Taxonomies give us a way to classify our content so we can
|
2014-05-27 18:32:57 -04:00
|
|
|
|
demonstrate relationships in a variety of logical ways.
|
|
|
|
|
|
2015-01-29 14:34:56 -05:00
|
|
|
|
[^1]: Taxonomies were called *indexes* in Hugo prior to v0.11.
|
|
|
|
|
|
|
|
|
|
The default taxonomies for Hugo are *tags* and *categories*. These
|
2014-12-04 11:26:12 -05:00
|
|
|
|
taxonomies are common to many website systems (e.g. WordPress, Drupal,
|
2014-08-31 07:08:36 -04:00
|
|
|
|
Jekyll). Unlike all of those systems, Hugo makes it trivial to customize
|
2014-05-27 18:32:57 -04:00
|
|
|
|
the taxonomies you will be using for your site however you wish. Another
|
|
|
|
|
good use for taxonomies is to group a set of posts into a series. Other
|
2015-01-29 14:34:56 -05:00
|
|
|
|
common uses would include *categories*, *tags*, *groups*, *series* and many
|
2014-05-27 18:32:57 -04:00
|
|
|
|
more.
|
|
|
|
|
|
2014-10-07 19:52:58 -04:00
|
|
|
|
When taxonomies are used (and templates are provided), Hugo will
|
2014-05-27 18:32:57 -04:00
|
|
|
|
automatically create pages listing all of the taxonomies, their terms
|
|
|
|
|
and all of the content attached to those terms.
|
|
|
|
|
|
|
|
|
|
## Definitions
|
|
|
|
|
|
|
|
|
|
**Taxonomy:** A categorization that can be used to classify content
|
|
|
|
|
|
2015-08-04 14:00:08 -04:00
|
|
|
|
**Term:** A key within that taxonomy
|
2014-05-27 18:32:57 -04:00
|
|
|
|
|
|
|
|
|
**Value:** A piece of content assigned to that Term
|
|
|
|
|
|
|
|
|
|
## Example
|
|
|
|
|
|
2014-10-07 19:52:58 -04:00
|
|
|
|
For example, if I was writing about movies, I may want the following
|
2014-05-27 18:32:57 -04:00
|
|
|
|
taxonomies:
|
|
|
|
|
|
|
|
|
|
* Actors
|
|
|
|
|
* Directors
|
|
|
|
|
* Studios
|
|
|
|
|
* Genre
|
|
|
|
|
* Year
|
|
|
|
|
* Awards
|
|
|
|
|
|
2014-10-07 19:52:58 -04:00
|
|
|
|
I would then specify in each movie’s front-matter the specific terms for
|
2014-05-27 18:32:57 -04:00
|
|
|
|
each of those taxonomies. Hugo would then automatically create pages for
|
|
|
|
|
each Actor, Director, Studio, Genre, Year and Award listing all of the
|
|
|
|
|
Movies that matched that specific Actor, Director, etc.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Taxonomy Organization
|
|
|
|
|
|
|
|
|
|
Let’s use an example to demonstrate the different labels in action.
|
2014-10-07 19:52:58 -04:00
|
|
|
|
From the perspective of the taxonomy, it could be visualized as:
|
2014-05-27 18:32:57 -04:00
|
|
|
|
|
|
|
|
|
Actor <- Taxonomy
|
|
|
|
|
Bruce Willis <- Term
|
|
|
|
|
The Six Sense <- Content
|
|
|
|
|
Unbreakable <- Content
|
|
|
|
|
Moonrise Kingdom <- Content
|
|
|
|
|
Samuel L. Jackson <- Term
|
|
|
|
|
Unbreakable <- Content
|
|
|
|
|
The Avengers <- Content
|
|
|
|
|
xXx <- Content
|
|
|
|
|
|
2014-10-07 19:52:58 -04:00
|
|
|
|
From the perspective of the content, it would appear differently, though
|
2014-05-27 18:32:57 -04:00
|
|
|
|
the data and labels used are the same:
|
|
|
|
|
|
|
|
|
|
Unbreakable <- Content
|
|
|
|
|
Actors <- Taxonomy
|
|
|
|
|
Bruce Willis <- Term
|
|
|
|
|
Samuel L. Jackson <- Term
|
|
|
|
|
Director <- Taxonomy
|
|
|
|
|
M. Night Shyamalan <- Term
|
|
|
|
|
...
|
|
|
|
|
Moonrise Kingdom <- Content
|
|
|
|
|
Actors <- Taxonomy
|
|
|
|
|
Bruce Willis <- Term
|
|
|
|
|
Bill Murray <- Term
|
|
|
|
|
Director <- Taxonomy
|
|
|
|
|
Wes Anderson <- Term
|
|
|
|
|
...
|
2013-10-31 09:51:13 -04:00
|
|
|
|
|