diff --git a/docs/content/content/front-matter.md b/docs/content/content/front-matter.md index 5e61ce3ed..a733215a4 100644 --- a/docs/content/content/front-matter.md +++ b/docs/content/content/front-matter.md @@ -80,25 +80,23 @@ Field names are always normalized to lowercase (e.g. `camelCase: true` is availa ### Required variables -
-
title
The title for the content
-
description
The description for the content
-
date
The date the content will be sorted by
-
taxonomies
These will use the field name of the plural form of the index (see tags and categories above)
-
+* **title** The title for the content +* **description** The description for the content +* **date** The date the content will be sorted by +* **taxonomies** These will use the field name of the plural form of the index (see tags and categories above) ### Optional variables -
-
redirect
Mark the post as a redirect post
-
draft
If true, the content will not be rendered unless hugo is called with --buildDrafts
-
publishdate
If in the future, content will not be rendered unless hugo is called with --buildFuture
-
type
The type of the content (will be derived from the directory automatically if unset)
-
weight
Used for sorting
-
markup
(Experimental) Specify "rst" for reStructuredText (requires rst2html) or "md" (default) for Markdown
-
slug
The token to appear in the tail of the URL, or
-
url
The full path to the content from the web root.
-
+* **redirect** Mark the post as a redirect post +* **draft** If true, the content will not be rendered unless `hugo` is called with `--buildDrafts` +* **publishdate** If in the future, content will not be rendered unless `hugo` is called with `--buildFuture` +* **type** The type of the content (will be derived from the directory automatically if unset) +* **weight** Used for sorting +* **markup** *(Experimental)* Specify `"rst"` for reStructuredText (requires + `rst2html`) or `"md"` (default) for Markdown +* **slug** The token to appear in the tail of the URL, + *or*
+* **url** The full path to the content from the web root.
*If neither `slug` or `url` is present, the filename will be used.* diff --git a/docs/content/extras/menus.md b/docs/content/extras/menus.md index 5ca77997c..957432567 100644 --- a/docs/content/extras/menus.md +++ b/docs/content/extras/menus.md @@ -27,30 +27,24 @@ access it via `.Site.Menus.main`. A menu entry has the following properties: -
-
Url
string
-
Name
string
-
Menu
string
-
Identifier
string
-
Pre
template.HTML
-
Post
template.HTML
-
Weight
int
-
Parent
string
-
Children
Menu
-
+* **Url** string +* **Name** string +* **Menu** string +* **Identifier** string +* **Pre** template.HTML +* **Post** template.HTML +* **Weight** int +* **Parent** string +* **Children** Menu And the following functions: -
-
HasChildren
bool
-
+* **HasChildren** bool Additionally, there are some relevant functions available on the page: -
-
IsMenuCurrent
(menu string, menuEntry *MenuEntry ) bool
-
HasMenuCurrent
(menu string, menuEntry *MenuEntry) bool
-
+* **IsMenuCurrent** (menu string, menuEntry *MenuEntry ) bool +* **HasMenuCurrent** (menu string, menuEntry *MenuEntry) bool ## Adding content to menus diff --git a/docs/content/extras/permalinks.md b/docs/content/extras/permalinks.md index 813f8d7fc..2bac230d5 100644 --- a/docs/content/extras/permalinks.md +++ b/docs/content/extras/permalinks.md @@ -39,16 +39,15 @@ the URL . The following is a list of values that can be used in a permalink definition. All references to time are dependent on the content's date. -
-
:year
the 4-digit year
-
:month
the 2-digit zero-padded month (01, 02, …, 12)
-
:monthname
the name of the month in English (“January”, “February”, …)
-
:day
the 2-digit zero-padded day (01, 02, …, 31)
-
:weekday
the 1-digit day of the week (Sunday = 0)
-
:weekdayname
the name of the day of the week in English (“Sunday”, “Monday”, …)
-
:yearday
the 1- to 3-digit day of the year, in the range [1,365] or [1,366]
-
:section
the content’s section
-
:title
the content’s title
-
:slug
the content’s slug (or title if no slug)
-
:filename
the content’s filename (without extension)
-
+ * **:year** the 4-digit year + * **:month** the 2-digit month + * **:monthname** the name of the month + * **:day** the 2-digit day + * **:weekday** the 1-digit day of the week (Sunday = 0) + * **:weekdayname** the name of the day of the week + * **:yearday** the 1- to 3-digit day of the year + * **:section** the content's section + * **:title** the content's title + * **:slug** the content's slug (or title if no slug) + * **:filename** the content's filename (without extension) + diff --git a/docs/content/taxonomies/methods.md b/docs/content/taxonomies/methods.md index 10694d357..d7a3bc3fa 100644 --- a/docs/content/taxonomies/methods.md +++ b/docs/content/taxonomies/methods.md @@ -16,12 +16,10 @@ Hugo makes a set of values and methods available on the various Taxonomy structu A Taxonomy is a `map[string]WeightedPages`. -
-
.Get(term)
Returns the WeightedPages for a term.
-
.Count(term)
The number of pieces of content assigned to this term.
-
.Alphabetical
Returns an OrderedTaxonomy (slice) ordered by Term.
-
.ByCount
Returns an OrderedTaxonomy (slice) ordered by number of entries.
-
+**.Get(term)** Returns the WeightedPages for a term.
+**.Count(term)** The number of pieces of content assigned to this term.
+**.Alphabetical** Returns an OrderedTaxonomy (slice) ordered by Term.
+**.ByCount** Returns an OrderedTaxonomy (slice) ordered by number of entries.
## OrderedTaxonomy @@ -34,12 +32,10 @@ Since Maps are unordered, an OrderedTaxonomy is a special structure that has a d Each element of the slice has: -
-
.Term
The Term used.
-
.WeightedPages
A slice of Weighted Pages.
-
.Count
The number of pieces of content assigned to this term.
-
.Pages
All Pages assigned to this term. All list methods are available to this.
-
+**.Term** The Term used.
+**.WeightedPages** A slice of Weighted Pages.
+**.Count** The number of pieces of content assigned to this term.
+**.Pages** All Pages assigned to this term. All [list methods](/templates/list/) are available to this.
## WeightedPages @@ -47,7 +43,12 @@ WeightedPages is simply a slice of WeightedPage. type WeightedPages []WeightedPage -
-
.Count(term)
The number of pieces of content assigned to this term.
-
.Pages
Returns a slice of pages, which then can be ordered using any of the list methods.
-
+**.Count(term)** The number of pieces of content assigned to this term.
+**.Pages** Returns a slice of pages, which then can be ordered using any of the [list methods](/templates/list/).
+ + + + + + + diff --git a/docs/content/templates/variables.md b/docs/content/templates/variables.md index 828431068..712453571 100644 --- a/docs/content/templates/variables.md +++ b/docs/content/templates/variables.md @@ -22,111 +22,94 @@ 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. -
-
.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.
- -
.Description
The description for the content.
-
.Keywords
The meta keywords for this content.
-
.Date
The date the content is associated with.
-
.PublishDate
The date the content is published on.
-
.Type
The content type (e.g. post).
-
.Section
The section 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.
-
.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).
-
.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.
-
.IsNode
Always false for pages.
-
.IsPage
Always true for page.
-
.Site
See Site Variables below.
-
.Hugo
See Hugo Variables below
-
+**.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.
+**.Description** The description for the content.
+**.Keywords** The meta keywords for this content.
+**.Date** The date the content is associated with.
+**.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.
+**.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).
+**.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.
+**.IsNode** Always false for pages.
+**.IsPage** Always true for page.
+**.Site** See site variables below.
+**.Hugo** See Hugo variables below
## Page Params Any other value defined in the front matter, including indexes will be made available under `.Params`. Take for example I'm using tags and categories as my indexes. The following would be how I would access them: -* `.Params.tags` -* `.Params.categories` - -**All Params are only accessible using all lowercase characters** +**.Params.tags**
+**.Params.categories**
+
+**All Params are only accessible using all lowercase characters**
## Node Variables -In Hugo, a node is any page not rendered directly by a content file. This +In Hugo a node is any page not rendered directly by a content file. This includes indexes, lists and the homepage. -
-
.Title
The title for the content.
-
.Date
The date the content is published on.
-
.Permalink
The Permanent link for this node
-
.Url
The relative URL for this node.
-
.Ref(ref)
-
Returns the permalink for ref. See cross-references. Does not handle in-page fragments correctly.
-
.RelRef(ref)
-
Returns the relative permalink for ref. See cross-references. Does not handle in-page fragments correctly.
-
.RSSLink
Link to the indexes’ RSS link
-
.Data
The data specific to this type of node.
-
.IsNode
Always true for nodes.
-
.IsPage
Always false for nodes.
-
.Site
See Site Variables below
-
.Hugo
See Hugo Variables below
-
+**.Title** The title for the content.
+**.Date** The date the content is published on.
+**.Permalink** The Permanent link for this node
+**.Url** The relative url for this node.
+**.Ref(ref)** Returns the permalink for `ref`. See [cross-references]({{% ref "extras/crossreferences.md" %}}). Does not handle in-page fragments correctly.
+**.RelRef(ref)** Returns the relative permalink for `ref`. See [cross-references]({{% ref "extras/crossreferences.md" %}}). Does not handle in-page fragments correctly.
+**.RSSLink** Link to the indexes' rss link
+**.Data** The data specific to this type of node.
+**.IsNode** Always true for nodes.
+**.IsPage** Always false for nodes.
+**.Site** See site variables below
+**.Hugo** See site variables below
## Site Variables Also available is `.Site` which has the following: -
-
.Site.BaseUrl
The base URL for the site as defined in the site configuration file.
-
.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 the params section of your site configuration file. For example, a TOML config file might look like this: -
baseurl = "http://yoursite.example.com/"
+**.Site.BaseUrl** The base URL for the site as defined in the site configuration file.
+**.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 the `params` section of your site configuration file. For example, a TOML config file might look like this: -[params] - description = "Tesla's Awesome Hugo Site" - author = "Nikola Tesla" -
-
.Site.Sections
Top level directories of the site.
-
.Site.Pages
All of the content pages of the site.
-
.Site.Files
All of the source files of the site.
-
.Site.Menus
All of the menus in the site.
-
.Site.Title
A string representing the title of the site.
-
.Site.Author
A map of the authors as defined in the site configuration.
-
.Site.LanguageCode
A string representing the language as defined in the site configuration.
-
.Site.DisqusShortname
A string representing the shortname of the Disqus shortcode as defined in the site configuration.
-
.Site.Copyright
A string representing the copyright of your web site as defined in the site configuration.
-
.Site.LastChange
A string representing the last time content has been updated.
-
.Site.Permalinks
A string to override the default permalink format. Defined in the site configuration.
-
.Site.BuildDrafts
A boolean (Default: false) to indicate whether to build drafts. Defined in the site configuration.
-
+ baseurl = "http://yoursite.example.com/" + + [params] + description = "Tesla's Awesome Hugo Site" + author = "Nikola Tesla" +**.Site.Sections** Top level directories of the site.
+**.Site.Pages** All of the content pages of the site.
+**.Site.Files** All of the source files of the site.
+**.Site.Menus** All of the menus in the site.
+**.Site.Title** A string representing the title of the site.
+**.Site.Author** A map of the authors as defined in the site configuration.
+**.Site.LanguageCode** A string representing the language as defined in the site configuration.
+**.Site.DisqusShortname** A string representing the shortname of the Disqus shortcode as defined in the site configuration.
+**.Site.Copyright** A string representing the copyright of your web site as defined in the site configuration.
+**.Site.LastChange** A string representing the last time content has been updated.
+**.Site.Permalinks** A string to override the default permalink format. Defined in the site configuration.
+**.Site.BuildDrafts** A boolean (Default: false) to indicate whether to build drafts. Defined in the site configuration.
## Hugo Variables Also available is `.Hugo` which has the following: -
-
.Hugo.Generator
-
Meta tag for the version of Hugo that generated the site. Highly recommended to be included by default in all theme headers so we can start to track Hugo usage and popularity, e.g. <meta name="generator" content="Hugo 0.13" />
-
.Hugo.Version
-
The current version of the Hugo binary you are using, e.g. 0.13-DEV
-
.Hugo.CommitHash
-
The git commit hash of the current Hugo binary, e.g. 0e8bed9ccffba0df554728b46c5bbf6d78ae5247
-
.Hugo.BuildDate
-
The compile date of the current Hugo binary formatted with RFC 3339, e.g. 2002-10-02T10:00:00-05:00
-
+**.Hugo.Generator** Meta tag for the version of Hugo that generated the site. Highly recommended to be included by default in all theme headers so we can start to track Hugo usage and popularity. e.g. ``
+**.Hugo.Version** The current version of the Hugo binary you are using e.g. `0.13-DEV`
+**.Hugo.CommitHash** The git commit hash of the current Hugo binary e.g. `0e8bed9ccffba0df554728b46c5bbf6d78ae5247`
+**.Hugo.BuildDate** The compile date of the current Hugo binary formatted with RFC 3339 e.g. `2002-10-02T10:00:00-05:00`