mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-14 20:37:55 -05:00
ef6f101e75
1214f6ffb Document cleanDestinationDir configuration setting 27ca65463 Clarify .Page.Param method (#1953) 3fa1792d2 Document the usage of `hardWrap` option for markdown rendering (#1951) 8b5afdfb4 Update theme 207e7f0a0 fix docs for getting remote font 1f7094b9e Correct typo f9d6445c4 Added missing `/` in URL generator (#1946) 3a22ee7d6 Remove translations b3b900f3f Update introduction.md aca440052 rm Forestry - facing end-of-life shortly (#1944) af0014e14 Update scss-sass.md 1c43bbbc9 Merge branch 'docs/goworkspace' d034175ca netlify: Hugo 0.109.0 d3a6a5c3f Merge branch 'tempv0.109.0' e033dbead docs: Regen docs helper JSON 452bf675c resource/page: Add Page.Ancestors 12edd7363 Add some docs for workspaces 8f0fcba6b Add HUGO_PUBLISHDIR to the Node environment 4e66d98ad Update theme 808aee6f6 config: Update to ga v4 1de2bc5a9 config: Update to ga v4 ddb5fd6b0 Merge commit '41bc6f702aa54200530efbf4267e5c823df3028d' 54c54bf76 modules: Adjust watch logic vs workspace use definitions git-subtree-dir: docs git-subtree-split: 1214f6ffbf680e853746aaeb6cb097b28c0c556b
3 KiB
3 KiB
title | linktitle | description | date | publishdate | lastmod | categories | keywords | menu | weight | sections_weight | draft | aliases | toc | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Single Page Templates | The primary view of content in Hugo is the single view. Hugo will render every Markdown file provided with a corresponding single template. | 2017-02-01 | 2017-02-01 | 2017-04-06 |
|
|
|
60 | 60 | false |
|
true |
Single Page Template Lookup Order
See Template Lookup.
Example Single Page Templates
Content pages are of the type page
and will therefore have all the page variables and site variables available to use in their templates.
posts/single.html
This single page template makes use of Hugo base templates, the .Format
function for dates, the .WordCount
page variable, and ranges through the single content's specific taxonomies. with
is also used to check whether the taxonomies are set in the front matter.
{{< code file="layouts/posts/single.html" download="single.html" >}} {{ define "main" }}
{{ .Title }}
To easily generate new instances of a content type (e.g., new .md
files in a section like project/
) with preconfigured front matter, use content archetypes.