---
aliases:
- /doc/variables/
- /layout/variables/
lastmod: 2015-12-08
date: 2013-07-01
linktitle: Variables
menu:
main:
parent: layout
next: /templates/content
prev: /templates/functions
title: Template Variables
weight: 20
toc: true
---
Hugo makes a set of values available to the templates. Go templates are context based. The following
are available in the context for the templates.
## Page Variables
The following is a list of most of the accessible variables which can be
defined for a piece of content. Many of these will be defined in the front
matter, content or derived from file location.
**See also:** [Scratch](/extras/scratch) for page-scoped writable variables.
**.Title** The title for the content.
**.Content** The content itself, defined below the front matter.
**.Summary** A generated summary of the content for easily showing a snippet in a summary view. Note that the breakpoint can be set manually by inserting <!--more-->
at the appropriate place in the content page. See [Summaries](/content/summaries/) for more details.
**.Truncated** A boolean, `true` if the `.Summary` is truncated. Useful for showing a "Read more..." link only if necessary. See [Summaries](/content/summaries/) for more details.
**.Description** The description for the content.
**.Keywords** The meta keywords for this content.
**.Date** The date the content is associated with.
**.Lastmod** The date the content was last modified.
**.PublishDate** The date the content is published on.
**.Type** The content [type](/content/types/) (e.g. post).
**.Section** The [section](/content/sections/) this content belongs to.
**.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`.
**.RSSLink** Link to the taxonomies' RSS link.
**.TableOfContents** The rendered table of contents for this content.
**.Prev** Pointer to the previous content (based on pub date).
**.Next** Pointer to the following content (based on pub date).
**.PrevInSection** Pointer to the previous content within the same section (based on pub date)
**.NextInSection** Pointer to the following content within the same section (based on pub date)
**.FuzzyWordCount** The approximate number of words in the content.
**.WordCount** The number of words in the content.
**.ReadingTime** The estimated time it takes to read the content in minutes.
**.Weight** Assigned weight (in the front matter) to this content, used in sorting.
**.RawContent** Raw Markdown content without the metadata header. Useful with [remarkjs.com](http://remarkjs.com)
**.Draft** A boolean, `true` if the content is marked as a draft in the front matter.
**.IsNode** Always false for pages.
**.IsPage** Always true for page.
**.Site** See [Site Variables]({{< relref "#site-variables" >}}) below.
**.Hugo** See [Hugo Variables]({{< relref "#hugo-variables" >}}) below.
## Page Params
Any other value defined in the front matter, including taxonomies, will be made available under `.Params`.
For example, the *tags* and *categories* taxonomies are accessed with:
* **.Params.tags**
* **.Params.categories**
**All Params are only accessible using all lowercase characters.**
This is particularly useful for the introduction of user defined fields in content files. For example, a Hugo website on book reviews could have in the front matter of /content/review/book01.md
---
...
affiliatelink: "http://www.my-book-link.here"
recommendedby: "my Mother"
---
Which would then be accessible to a template at `/themes/yourtheme/layouts/review/single.html` through `.Params.affiliatelink` and `.Params.recommendedby`, respectively. Two common situations where these could be introduced are as a value of a certain attribute (like `href=""` below) or by itself to be displayed. Sample syntaxes include:
It was recommended by {{ .Params.recommendedby }}.
which would renderIt was recommended by my Mother.
**See also:** [Archetypes]({{% ref "content/archetypes.md" %}}) for consistency of `Params` across pieces of content. ### Param method In Hugo you can declare params both for the site and the individual page. A common use case is to have a general value for the site and a more specific value for some of the pages (i.e. an image). With the `Param` method the most specific value will be selected for you, and it is safe to use it in any template (it's defined on both Page and Node): ``` $.Param "image" ``` ## Node Variables In Hugo, a node is any page not rendered directly by a content file. This includes taxonomies, lists and the homepage. **See also:** [Scratch](/extras/scratch) for global node variables. **.Title** The title for the content.