Permalink
Browse files

Clean up formatting in variable definition lists

  • Loading branch information...
bep committed Nov 22, 2017
1 parent 149c2c1 commit 16be43e7d7bcf768b6654312410784d54d4d3964
View
@@ -24,25 +24,25 @@ For information on creating shortcodes and templates that tap into Hugo's file-r
The `.File` object contains the following fields:
`.File.Path`
.File.Path
: the original relative path of the page (e.g., `content/posts/foo.en.md`)
`.File.LogicalName`
.File.LogicalName
: the name of the content file that represents a page (e.g., `foo.en.md`)
`.File.TranslationBaseName`
.File.TranslationBaseName
: the filename without extension or optional language identifier (e.g., `foo`)
`.File.BaseFileName`
.File.BaseFileName
: the filename without extension (e.g., `foo.en`)
`.File.Ext`
.File.Ext
: the file extension of the content file (e.g., `md`); this can also be called using `.File.Extension` as well. Note that it is *only* the extension without `.`.
`.File.Lang`
.File.Lang
: the language associated with the given file if Hugo's [Multilingual features][multilingual] are enabled (e.g., `en`)
`.File.Dir`
.File.Dir
: given the path `content/posts/dir1/dir2/`, the relative directory path of the content file will be returned (e.g., `posts/dir1/dir2/`)
[Multilingual]: /content-management/multilingual/
View
@@ -33,22 +33,22 @@ Hugo's Git integrations should be fairly performant but *can* increase your buil
The `GitInfo` object contains the following fields:
`.AbbreviatedHash`
.AbbreviatedHash
: the abbreviated commit hash (e.g., `866cbcc`)
`.AuthorName`
.AuthorName
: the author's name, respecting `.mailmap`
`.AuthorEmail`
.AuthorEmail
: the author's email address, respecting `.mailmap`
`.AuthorDate`
.AuthorDate
: the author date
`.Hash`
.Hash
: the commit hash (e.g., `866cbccdab588b9908887ffd3b4f2667e94090c3`)
`.Subject`
.Subject
: commit message subject (e.g., `tpl: Add custom index function`)
## `.Lastmod`
@@ -21,16 +21,16 @@ wip: false
It contains the following fields:
`.Hugo.Generator`
.Hugo.Generator
: `<meta>` tag for the version of Hugo that generated the site. `.Hugo.Generator` outputs a *complete* HTML tag; e.g. `<meta name="generator" content="Hugo 0.18" />`
`.Hugo.Version`
.Hugo.Version
: the current version of the Hugo binary you are using e.g. `0.13-DEV`<br>
`.Hugo.CommitHash`
.Hugo.CommitHash
: the git commit hash of the current Hugo binary e.g. `0e8bed9ccffba0df554728b46c5bbf6d78ae5247`
`.Hugo.BuildDate`
.Hugo.BuildDate
: the compile date of the current Hugo binary formatted with RFC 3339 e.g. `2002-10-02T10:00:00-05:00`<br>
{{% note "Use the Hugo Generator Tag" %}}
View
@@ -20,31 +20,31 @@ toc: false
The [menu template][] has the following properties:
`.URL`
.URL
: string
`.Name`
.Name
: string
`.Menu`
.Menu
: string
`.Identifier`
.Identifier
: string
`.Pre`
.Pre
: template.HTML
`.Post`
.Post
: template.HTML
`.Weight`
.Weight
: int
`.Parent`
.Parent
: string
`.Children`
.Children
: Menu
[menu template]: /templates/menu-templates/
View
@@ -26,156 +26,156 @@ See [`.Scratch`](/functions/scratch/) for page-scoped, writable variables.
## Page Variables
`.AlternativeOutputFormats`
.AlternativeOutputFormats
: contains all alternative formats for a given page; this variable is especially useful `link rel` list in your site's `<head>`. (See [Output Formats](/templates/output-formats/).)
`.Content`
.Content
: the content itself, defined below the front matter.
`.Data`
.Data
: the data specific to this type of page.
`.Date`
.Date
: the date associated with the page; `.Date` pulls from the `date` field in a content's front matter. See also `.ExpiryDate`, `.PublishDate`, and `.Lastmod`.
`.Description`
.Description
: the description for the page.
`.Dir`
.Dir
: the path of the folder containing this content file. The path is relative to the `content` folder.
`.Draft`
.Draft
: a boolean, `true` if the content is marked as a draft in the front matter.
`.ExpiryDate`
.ExpiryDate
: the date on which the content is scheduled to expire; `.ExpiryDate` pulls from the `expirydate` field in a content's front matter. See also `.PublishDate`, `.Date`, and `.Lastmod`.
`.File`
.File
: filesystem-related data for this content file. See also [File Variables][].
`.FuzzyWordCount`
.FuzzyWordCount
: the approximate number of words in the content.
`.Hugo`
.Hugo
: see [Hugo Variables](/variables/hugo/).
`.IsHome`
.IsHome
: `true` in the context of the [homepage](/templates/homepage/).
`.IsNode`
.IsNode
: always `false` for regular content pages.
`.IsPage`
.IsPage
: always `true` for regular content pages.
`.IsTranslated`
.IsTranslated
: `true` if there are translations to display.
`.Keywords`
.Keywords
: the meta keywords for the content.
`.Kind`
.Kind
: the page's *kind*. Possible return values are `page`, `home`, `section`, `taxonomy`, or `taxonomyTerm`. Note that there are also `RSS`, `sitemap`, `robotsTXT`, and `404` kinds, but these are only available during the rendering of each of these respective page's kind and therefore *not* available in any of the `Pages` collections.
`.Lang`
.Lang
: language taken from the language extension notation.
`.Language`
.Language
: a language object that points to the language's definition in the site
`config`.
`.Lastmod`
.Lastmod
: the date the content was last modified. `.Lastmod` pulls from the `lastmod` field in a content's front matter.
- If `lastmod` is not set, and `.GitInfo` feature is disabled, the front matter `date` field will be used.
- If `lastmod` is not set, and `.GitInfo` feature is enabled, `.GitInfo.AuthorDate` will be used instead.
See also `.ExpiryDate`, `.Date`, `.PublishDate`, and [`.GitInfo`][gitinfo].
`.LinkTitle`
.LinkTitle
: access when creating links to the content. If set, Hugo will use the `linktitle` from the front matter before `title`.
`.Next`
.Next
: pointer to the following content (based on the `publishdate` field in front matter).
`.NextInSection`
.NextInSection
: pointer to the following content within the same section (based on `publishdate` field in front matter).
`.OutputFormats`
.OutputFormats
: contains all formats, including the current format, for a given page. Can be combined the with [`.Get` function](/functions/get/) to grab a specific format. (See [Output Formats](/templates/output-formats/).)
`.Pages`
.Pages
: a collection of associated pages. This value will be `nil` for regular content pages. `.Pages` is an alias for `.Data.Pages`.
`.Permalink`
.Permalink
: the Permanent link for this page; see [Permalinks](/content-management/urls/)
`.Plain`
.Plain
: the Page content stripped of HTML tags and presented as a string.
`.PlainWords`
.PlainWords
: the Page content stripped of HTML as a `[]string` using Go's [`strings.Fields`](https://golang.org/pkg/strings/#Fields) to split `.Plain` into a slice.
`.Prev`
.Prev
: Pointer to the previous content (based on `publishdate` in front matter).
`.PrevInSection`
.PrevInSection
: Pointer to the previous content within the same section (based on `publishdate` in front matter). For example, `{{if .PrevInSection}}{{.PrevInSection.Permalink}}{{end}}`.
`.PublishDate`
.PublishDate
: the date on which the content was or will be published; `.Publishdate` pulls from the `publishdate` field in a content's front matter. See also `.ExpiryDate`, `.Date`, and `.Lastmod`.
`.RSSLink`
.RSSLink
: link to the taxonomies' RSS link.
`.RawContent`
.RawContent
: raw markdown content without the front matter. Useful with [remarkjs.com](
http://remarkjs.com)
`.ReadingTime`
.ReadingTime
: the estimated time, in minutes, it takes to read the content.
`.Ref`
.Ref
: returns the permalink for a given reference (e.g., `.Ref "sample.md"`). `.Ref` does *not* handle in-page fragments correctly. See [Cross References](/content-management/cross-references/).
`.RelPermalink`
.RelPermalink
: the relative permanent link for this page.
`.RelRef`
.RelRef
: returns the relative permalink for a given reference (e.g., `RelRef
"sample.md"`). `.RelRef` does *not* handle in-page fragments correctly. See [Cross References](/content-management/cross-references/).
`.Site`
.Site
: see [Site Variables](/variables/site/).
`.Summary`
.Summary
: a generated summary of the content for easily showing a snippet in a summary view. The breakpoint can be set manually by inserting <code>&lt;!&#x2d;&#x2d;more&#x2d;&#x2d;&gt;</code> at the appropriate place in the content page. See [Content Summaries](/content-management/summaries/) for more details.
`.TableOfContents`
.TableOfContents
: the rendered [table of contents](/content-management/toc/) for the page.
`.Title`
.Title
: the title for this page.
`.Translations`
.Translations
: a list of translated versions of the current page. See [Multilingual Mode](/content-management/multilingual/) for more information.
`.Truncated`
.Truncated
: a boolean, `true` if the `.Summary` is truncated. Useful for showing a "Read more..." link only when necessary. See [Summaries](/content-management/summaries/) for more information.
`.Type`
.Type
: the [content type](/content-management/types/) of the content (e.g., `post`).
`.URL`
.URL
: the URL for the page relative to the web root. Note that a `url` set directly in front matter overrides the default relative URL for the rendered page.
`.UniqueID`
.UniqueID
: the MD5-checksum of the content file's path.
`.Weight`
.Weight
: assigned weight (in the front matter) to this content, used in sorting.
`.WordCount`
.WordCount
: the number of words in the content.
## Section Variables and Methods
@@ -20,13 +20,13 @@ toc: false
[Shortcodes][shortcodes] have access to parameters delimited in the shortcode declaration via [`.Get`][getfunction], page- and site-level variables, and also the following shortcode-specific fields:
`.Parent`
.Parent
: provides access to the parent shortcode context in nested shortcodes. This can be very useful for inheritance of common shortcode parameters from the root.
`.IsNamedParams`
.IsNamedParams
: boolean that returns `true` when the shortcode in question uses [named rather than positional parameters][shortcodes]
`.Inner`
.Inner
: represents the content between the opening and closing shortcode tags when a [closing shortcode][markdownshortcode] is used
[getfunction]: /functions/get/
Oops, something went wrong.

0 comments on commit 16be43e

Please sign in to comment.