2013-10-31 13:51:13 +00:00
|
|
|
|
---
|
2014-05-29 22:42:05 +00:00
|
|
|
|
aliases:
|
|
|
|
|
- /indexes/overview/
|
|
|
|
|
- /doc/indexes/
|
|
|
|
|
- /extras/indexes
|
|
|
|
|
date: 2013-07-01
|
|
|
|
|
linktitle: Overview
|
2014-04-23 07:00:11 +00:00
|
|
|
|
menu:
|
|
|
|
|
main:
|
2014-05-29 22:42:05 +00:00
|
|
|
|
identifier: taxonomy overview
|
|
|
|
|
parent: taxonomy
|
|
|
|
|
next: /taxonomies/usage
|
|
|
|
|
prev: /templates/404
|
|
|
|
|
title: Taxonomy Overview
|
|
|
|
|
weight: 10
|
2013-10-31 13:51:13 +00:00
|
|
|
|
---
|
|
|
|
|
|
2014-05-27 22:32:57 +00:00
|
|
|
|
Hugo includes support for user defined groupings of content called
|
|
|
|
|
taxonomies. Taxonomies give us a way to classify our content so we can
|
|
|
|
|
demonstrate relationships in a variety of logical ways.
|
|
|
|
|
|
|
|
|
|
The default taxonomies for Hugo are tags and categories. These
|
2014-08-31 11:08:36 +00:00
|
|
|
|
taxonomies are common to many website systems (WordPress, Drupal,
|
|
|
|
|
Jekyll). Unlike all of those systems, Hugo makes it trivial to customize
|
2014-05-27 22:32:57 +00: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
|
|
|
|
|
common uses would include categories, tags, groups, series and many
|
|
|
|
|
more.
|
|
|
|
|
|
2014-10-07 23:52:58 +00:00
|
|
|
|
When taxonomies are used (and templates are provided), Hugo will
|
2014-05-27 22:32:57 +00: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
|
|
|
|
|
|
|
|
|
|
**Term:** A key within that taxonomy
|
|
|
|
|
|
|
|
|
|
**Value:** A piece of content assigned to that Term
|
|
|
|
|
|
|
|
|
|
## Example
|
|
|
|
|
|
2014-10-07 23:52:58 +00:00
|
|
|
|
For example, if I was writing about movies, I may want the following
|
2014-05-27 22:32:57 +00:00
|
|
|
|
taxonomies:
|
|
|
|
|
|
|
|
|
|
* Actors
|
|
|
|
|
* Directors
|
|
|
|
|
* Studios
|
|
|
|
|
* Genre
|
|
|
|
|
* Year
|
|
|
|
|
* Awards
|
|
|
|
|
|
2014-10-07 23:52:58 +00:00
|
|
|
|
I would then specify in each movie’s front-matter the specific terms for
|
2014-05-27 22:32:57 +00: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 23:52:58 +00:00
|
|
|
|
From the perspective of the taxonomy, it could be visualized as:
|
2014-05-27 22:32:57 +00: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 23:52:58 +00:00
|
|
|
|
From the perspective of the content, it would appear differently, though
|
2014-05-27 22:32:57 +00: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 13:51:13 +00:00
|
|
|
|
|