Merge commit '5be51ac3db225d5df501ed1fa1499c41d97dbf65'

This commit is contained in:
Bjørn Erik Pedersen
2025-04-10 13:04:51 +02:00
987 changed files with 12379 additions and 14083 deletions

View File

@@ -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 >}}
```