diff options
| author | etienne <admin@MacBook-Pro-de-Admin.local> | 2014-10-21 23:35:24 +0200 |
|---|---|---|
| committer | etienne <admin@MacBook-Pro-de-Admin.local> | 2014-10-21 23:35:24 +0200 |
| commit | 667e11c4ec3835d959aab1797647bd0a49869674 (patch) | |
| tree | 84c6c5f20686574009f1dccc0f27a7192ff165e7 /content/taxonomies/usage.md | |
Init commit
Diffstat (limited to 'content/taxonomies/usage.md')
| -rw-r--r-- | content/taxonomies/usage.md | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/content/taxonomies/usage.md b/content/taxonomies/usage.md new file mode 100644 index 0000000..f55b865 --- /dev/null +++ b/content/taxonomies/usage.md @@ -0,0 +1,72 @@ +--- +date: 2014-05-26 +linktitle: Usage +menu: + main: + parent: taxonomy +next: /taxonomies/displaying +prev: /taxonomies/overview +title: Using Taxonomies +weight: 15 +--- + +## Defining taxonomies for a site + +Taxonomies must be defined in the site configuration before they can be +used throughout the site. You need to provide both the plural and +singular labels for each taxonomy. + +Here is an example configuration in YAML that specifies three taxonomies +(the default two, plus `series`). + +Notice the format is **singular key** : *plural value*. +### config.yaml + + --- + Taxonomies: + tag: "tags" + category: "categories" + series: "series" + --- + +## Assigning taxonomy values to content + +Once an taxonomy is defined at the site level, any piece of content +can be assigned to it regardless of content type or section. + +Assigning content to an taxonomy is done in the front matter. +Simply create a variable with the *plural* name of the taxonomy +and assign all terms you want to apply to this content. + +**taxonomy values are case insensitive** + +### Front Matter Example (in TOML) + + +++ + title = "Hugo: A fast and flexible static site generator" + tags = [ "Development", "Go", "fast", "Blogging" ] + categories = [ "Development" ] + series = [ "Go Web Dev" ] + slug = "hugo" + project_url = "http://github.com/spf13/hugo" + +++ + +### Front Matter Example (in JSON) + + { + "title": "Hugo: A fast and flexible static site generator", + "tags": [ + "Development", + "Go", + "fast", + "Blogging" + ], + "categories" : [ + "Development" + ], + "series" : [ + "Go Web Dev" + ], + "slug": "hugo", + "project_url": "http://github.com/spf13/hugo" + } |
