mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-19 16:15:50 +00:00
content: Replace calls to the code shortcode with fenced code blocks
This commit is contained in:
1 parent
b23c9a583a
commit
fd628be6ed
110 files changed
+483
-555
No files matched your search
@@ -32,13 +32,13 @@ content/
|
||||
|
||||
And these templates:
|
||||
|
||||
{{< code file=layouts/_default/list.html >}}
|
||||
```go-html-template {file="layouts/_default/list.html"}
|
||||
{{ range .Pages.ByWeight }}
|
||||
<h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
|
||||
{{ end }}
|
||||
{{< /code >}}
|
||||
```
|
||||
|
||||
{{< code file=layouts/_default/single.html >}}
|
||||
```go-html-template {file="layouts/_default/single.html"}
|
||||
{{ with .Prev }}
|
||||
<a href="{{ .RelPermalink }}">Previous</a>
|
||||
{{ end }}
|
||||
@@ -46,7 +46,7 @@ And these templates:
|
||||
{{ with .Next }}
|
||||
<a href="{{ .RelPermalink }}">Next</a>
|
||||
{{ end }}
|
||||
{{< /code >}}
|
||||
```
|
||||
|
||||
When you visit page-2:
|
||||
|
||||
|
||||
@@ -32,13 +32,13 @@ content/
|
||||
|
||||
And these templates:
|
||||
|
||||
{{< code file=layouts/_default/list.html >}}
|
||||
```go-html-template {file="layouts/_default/list.html"}
|
||||
{{ range .Pages.ByWeight }}
|
||||
<h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
|
||||
{{ end }}
|
||||
{{< /code >}}
|
||||
```
|
||||
|
||||
{{< code file=layouts/_default/single.html >}}
|
||||
```go-html-template {file="layouts/_default/single.html"}
|
||||
{{ with .PrevInSection }}
|
||||
<a href="{{ .RelPermalink }}">Previous</a>
|
||||
{{ end }}
|
||||
@@ -46,7 +46,7 @@ And these templates:
|
||||
{{ with .NextInSection }}
|
||||
<a href="{{ .RelPermalink }}">Next</a>
|
||||
{{ end }}
|
||||
{{< /code >}}
|
||||
```
|
||||
|
||||
When you visit page-2:
|
||||
|
||||
|
||||
@@ -32,13 +32,13 @@ content/
|
||||
|
||||
And these templates:
|
||||
|
||||
{{< code file=layouts/_default/list.html >}}
|
||||
```go-html-template {file="layouts/_default/list.html"}
|
||||
{{ range .Pages.ByWeight }}
|
||||
<h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
|
||||
{{ end }}
|
||||
{{< /code >}}
|
||||
```
|
||||
|
||||
{{< code file=layouts/_default/single.html >}}
|
||||
```go-html-template {file="layouts/_default/single.html"}
|
||||
{{ $pages := .CurrentSection.Pages.ByWeight }}
|
||||
|
||||
{{ with $pages.Prev . }}
|
||||
@@ -48,7 +48,7 @@ And these templates:
|
||||
{{ with $pages.Next . }}
|
||||
<a href="{{ .RelPermalink }}">Next</a>
|
||||
{{ end }}
|
||||
{{< /code >}}
|
||||
```
|
||||
|
||||
When you visit page-2:
|
||||
|
||||
@@ -57,7 +57,7 @@ When you visit page-2:
|
||||
|
||||
To reverse the meaning of _next_ and _previous_ you can chain the [`Reverse`] method to the page collection definition:
|
||||
|
||||
{{< code file=layouts/_default/single.html >}}
|
||||
```go-html-template {file="layouts/_default/single.html"}
|
||||
{{ $pages := .CurrentSection.Pages.ByWeight.Reverse }}
|
||||
|
||||
{{ with $pages.Prev . }}
|
||||
@@ -67,6 +67,6 @@ To reverse the meaning of _next_ and _previous_ you can chain the [`Reverse`] me
|
||||
{{ with $pages.Next . }}
|
||||
<a href="{{ .RelPermalink }}">Next</a>
|
||||
{{ end }}
|
||||
{{< /code >}}
|
||||
```
|
||||
|
||||
[`Reverse`]: /methods/pages/reverse/
|
||||
@@ -34,9 +34,9 @@ To capture the "genres" `Taxonomy` object from within any template, use the [`Ta
|
||||
|
||||
To capture the "genres" `Taxonomy` object when rendering its page with a taxonomy template, use the [`Terms`] method on the page's [`Data`] object:
|
||||
|
||||
{{< code file=layouts/_default/taxonomy.html >}}
|
||||
```go-html-template {file="layouts/_default/taxonomy.html"}
|
||||
{{ $taxonomyObject := .Data.Terms }}
|
||||
{{< /code >}}
|
||||
```
|
||||
|
||||
To inspect the data structure:
|
||||
|
||||
|
||||
Reference in new issue
Block a user