---
title: "Indexes"
date: "2013-07-01"
aliases: ["/doc/indexes/"]
---
Hugo includes support for user defined indexes of content. In our
terminology an index is best thought of as tags applied to content
but they can be used for far more than just tags. Other common
uses would include categories, groups, series. For the purpose of
this document we will just use tags for our example. For a more
complete example see [spf13.com-hugo](http://github.com/spf13/spf13.com-hugo).
## Defining Indexes for a site
Indexes must be defined in the site configuration, before they
can be used throughout the site.
Here is an example configuration in YAML that specifies two indexes.
Notice the format is **singular key** : *plural value*. While
we could use an inflection library to pluralize this, they currently
support only a few languages, so instead we've opted for user defined
pluralization.
**config.yaml**
---
indexes:
tag: "tags"
topic: "topics"
baseurl: "http://spf13.com/"
title: "Steve Francia is spf13.com"
---
## Creating index templates
For each index type a template needs to be provided to render the index page.
In the case of tags, this will render the content for /tags/TAGNAME/.
The template must be called the singular name of the index and placed in
layouts/indexes
.
└── layouts
└── indexes
└── category.html
The template will be provided Data about the index.
### Variables
The following variables are available to the index template:
**.Title** The title for the content.
**.Date** The date the content is published on.
**.Permalink** The Permanent link for this page.
**.RSSLink** Link to the indexes' rss link.
**.Data.Pages** The content that is assigned this index.
**.Data.`singular`** The index itself.
#### Example
{{ template "chrome/header.html" . }}
{{ template "chrome/subheader.html" . }}
{{ .Title }}
{{ range .Data.Pages }}
{{ .Render "summary"}}
{{ end }}