mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-27 22:09:53 +02:00
Merge commit '7c62d6ef1654c0383eae474d3bd9ddf7754c1f30'
This commit is contained in:
@@ -506,7 +506,7 @@ See [lang.FormatNumber] and [lang.FormatNumberCustom] for details.
|
||||
With this template code:
|
||||
|
||||
```go-html-template
|
||||
{{ 512.5032 | lang.FormatPercent 2 }} ---> 512.50%
|
||||
{{ 512.5032 | lang.FormatPercent 2 }} → 512.50%
|
||||
```
|
||||
|
||||
The rendered page displays:
|
||||
|
@@ -85,19 +85,19 @@ You can show content summaries with the following code. You could use the follow
|
||||
|
||||
{{< code file="page-list-with-summaries.html" >}}
|
||||
{{ range first 10 .Pages }}
|
||||
<article>
|
||||
<!-- this <div> includes the title summary -->
|
||||
<div>
|
||||
<h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
|
||||
{{ .Summary }}
|
||||
</div>
|
||||
{{ if .Truncated }}
|
||||
<article>
|
||||
<!-- this <div> includes the title summary -->
|
||||
<div>
|
||||
<h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
|
||||
{{ .Summary }}
|
||||
</div>
|
||||
{{ if .Truncated }}
|
||||
<!-- This <div> includes a read more link, but only if the summary is truncated... -->
|
||||
<div>
|
||||
<a href="{{ .RelPermalink }}">Read More…</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
</article>
|
||||
{{ end }}
|
||||
</article>
|
||||
{{ end }}
|
||||
{{< /code >}}
|
||||
|
||||
|
@@ -50,17 +50,17 @@ The following is an example of a very basic [single page template]:
|
||||
|
||||
{{< code file="layout/_default/single.html" >}}
|
||||
{{ define "main" }}
|
||||
<main>
|
||||
<main>
|
||||
<article>
|
||||
<header>
|
||||
<header>
|
||||
<h1>{{ .Title }}</h1>
|
||||
</header>
|
||||
{{ .Content }}
|
||||
</header>
|
||||
{{ .Content }}
|
||||
</article>
|
||||
<aside>
|
||||
{{ .TableOfContents }}
|
||||
{{ .TableOfContents }}
|
||||
</aside>
|
||||
</main>
|
||||
</main>
|
||||
{{ end }}
|
||||
{{< /code >}}
|
||||
|
||||
|
Reference in New Issue
Block a user