mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-31 22:41:53 +02:00
Merge commit '5be51ac3db225d5df501ed1fa1499c41d97dbf65'
This commit is contained in:
@@ -1,14 +1,9 @@
|
||||
---
|
||||
title: Single templates
|
||||
description: Create a single template to render a single page.
|
||||
categories: [templates]
|
||||
categories: []
|
||||
keywords: []
|
||||
menu:
|
||||
docs:
|
||||
parent: templates
|
||||
weight: 70
|
||||
weight: 70
|
||||
toc: true
|
||||
weight: 60
|
||||
aliases: [/layout/content/,/templates/single-page-templates/]
|
||||
---
|
||||
|
||||
@@ -16,12 +11,12 @@ The single template below inherits the site's shell from the [base template].
|
||||
|
||||
[base template]: /templates/types/
|
||||
|
||||
{{< code file=layouts/_default/single.html >}}
|
||||
```go-html-template {file="layouts/_default/single.html"}
|
||||
{{ define "main" }}
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{ .Content }}
|
||||
{{ end }}
|
||||
{{< /code >}}
|
||||
```
|
||||
|
||||
Review the [template lookup order] to select a template path that provides the desired level of specificity.
|
||||
|
||||
@@ -29,7 +24,7 @@ Review the [template lookup order] to select a template path that provides the d
|
||||
|
||||
The single template below inherits the site's shell from the base template, and renders the page title, creation date, content, and a list of associated terms in the "tags" taxonomy.
|
||||
|
||||
{{< code file=layouts/_default/single.html >}}
|
||||
```go-html-template {file="layouts/_default/single.html"}
|
||||
{{ define "main" }}
|
||||
<section>
|
||||
<h1>{{ .Title }}</h1>
|
||||
@@ -53,4 +48,4 @@ The single template below inherits the site's shell from the base template, and
|
||||
</aside>
|
||||
</section>
|
||||
{{ end }}
|
||||
{{< /code >}}
|
||||
```
|
||||
|
Reference in New Issue
Block a user