ref: bb02a14b1e815eda7e8ecc5db8976ed51e3e3e9f
parent: ba8f652acc0c7345462a13b17501151869be3d90
author: spf13 <[email protected]>
date: Fri Aug 29 19:42:26 EDT 2014
Adding a page listing the different methods available to Taxonomies.
--- /dev/null
+++ b/docs/content/taxonomies/methods.md
@@ -1,0 +1,54 @@
+---
+date: 2014-05-26
+linktitle: Structure & Methods
+menu:
+ main:
+ parent: taxonomy
+next: /extras/aliases
+prev: /taxonomies/ordering
+title: Using Taxonomies
+weight: 75
+---
+
+Hugo makes a set of values and methods available on the various Taxonomy structures.
+
+## Taxonomy Methods
+
+A Taxonomy is a `map[string]WeightedPages`.
+
+**.Get(term)** Returns the WeightedPages for a term. <br>
+**.Count(term)** The number of pieces of content assigned to this term.<br>
+**.Alphabetical** Returns an OrderedTaxonomy (slice) ordered by Term. <br>
+**.ByCount** Returns an OrderedTaxonomy (slice) ordered by number of entries. <br>
+
+## OrderedTaxonomy
+
+Since Maps are unordered, an OrderedTaxonomy is a special structure that has a defined order.
+
+ []struct {
+ Name string
+ WeightedPages WeightedPages
+ }
+
+Each element of the slice has:
+
+**.Term** The Term used.<br>
+**.WeightedPages** A slice of Weighted Pages.<br>
+**.Count** The number of pieces of content assigned to this term.<br>
+**.Pages** All Pages assigned to this term. All [list methods](/templates/list/) are available to this.<br>
+
+## WeightedPages
+
+WeightedPages is simply a slice of WeightedPage.
+
+ type WeightedPages []WeightedPage
+
+**.Count(term)** The number of pieces of content assigned to this term.<br>
+**.Pages** Returns a slice of pages, which then can be ordered using any of the [list methods](/templates/list/). <br>
+
+
+
+
+
+
+
--- a/docs/content/taxonomies/ordering.md
+++ b/docs/content/taxonomies/ordering.md
@@ -7,7 +7,7 @@
main:
identifier: Ordering Taxonomies
parent: taxonomy
-next: /extras/aliases
+next: /taxonomies/functions
prev: /taxonomies/templates
title: Ordering Taxonomies
weight: 60
--- a/docs/content/templates/partials.md
+++ b/docs/content/templates/partials.md
@@ -11,19 +11,17 @@
weight: 80
---
-It's not a requirement to have this, but in practice it's very
-convenient to split out common template portions into a partial template
-that can be included anywhere. As you create the rest of your templates
-you will include templates from the /layout/partials directory.
+In practice it's very convenient to split out common template portions into a
+partial template that can be included anywhere. As you create the rest of your
+templates you will include templates from the /layout/partials directory.
Partials are especially important for themes as it gives users an opportunity
to overwrite just a small part of your theme, while maintaining future compatibility.
-In fact theme developers may want to include a few partials with empty html
+Theme developers may want to include a few partials with empty html
files in the theme just so end users have an easy place to inject their
customized content.
-
I've found it helpful to include a header and footer template in
partials so I can include those in all the full page layouts. There is
nothing special about header.html and footer.html other than they seem
@@ -41,9 +39,9 @@
Version v0.12 of Hugo introduced the partial call inside the template system.
This is a change to the way partials were handled previously inside the
-template system. This is a change to hthe way partials were handled previously.
-Previously Hugo didn’t treat partials specially and you could include a partial
-template with the `template` call in the standard template language.
+template system. In earlier versions, Hugo didn’t treat partials specially and
+you could include a partial template with the `template` call in the standard
+template language.
With the addition of the theme system in v0.11 it became apparent that a theme
& override aware partial was needed.