From ba8f652acc0c7345462a13b17501151869be3d90 Mon Sep 17 00:00:00 2001 From: spf13 Date: Fri, 29 Aug 2014 23:41:53 -0400 Subject: [PATCH] More taxonomy examples in templates. --- docs/content/templates/terms.md | 26 ++++++++++++++++++++++++++ docs/content/templates/variables.md | 4 ++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/docs/content/templates/terms.md b/docs/content/templates/terms.md index 3c9f5445d..858eeccf7 100644 --- a/docs/content/templates/terms.md +++ b/docs/content/templates/terms.md @@ -89,6 +89,32 @@ content tagged with each tag. {{ partial "footer.html" }} +Another example listing the content for each term (ordered by Date) + + + {{ partial "header.html" . }} + {{ partial "subheader.html" . }} + +
+
+

{{ .Title }}

+ + {{ $data := .Data }} + {{ range $key,$value := .Data.Terms.ByCount }} +

{{ $value.Name }} {{ $value.Count }}

+
    + {{ range $value.Pages.ByDate }} +
  • + {{ .Title }} +
  • + {{ end }} +
+ {{ end }} +
+
+ + {{ partial "footer.html" }} + ## Ordering Hugo can order the meta data in two different ways. It can be ordered by the diff --git a/docs/content/templates/variables.md b/docs/content/templates/variables.md index f76a6465c..2a6ef22a0 100644 --- a/docs/content/templates/variables.md +++ b/docs/content/templates/variables.md @@ -34,7 +34,7 @@ matter, content or derived from file location. **.Permalink** The Permanent link for this page.
**.RelPermalink** The Relative permanent link for this page.
**.LinkTitle** Access when creating links to this content. Will use linktitle if set in front-matter, else title
-**.Indexes** These will use the field name of the plural form of the index (see tags and categories above)
+**.Taxonomies** These will use the field name of the plural form of the index (see tags and categories above)
**.RSSLink** Link to the indexes' rss link
**.TableOfContents** The rendered table of contents for this content
**.Prev** Pointer to the previous content (based on pub date)
@@ -76,7 +76,7 @@ includes indexes, lists and the homepage. Also available is `.Site` which has the following: **.Site.BaseUrl** The base URL for the site as defined in the config.json file.
-**.Site.Indexes** The indexes for the entire site.
+**.Site.Taxonomies** The indexes for the entire site.
**.Site.LastChange** The date of the last change of the most recent content.
**.Site.Recent** Array of all content ordered by Date, newest first.
**.Site.Params** A container holding the values from `params` in your site configuration file.