mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-13 18:15:45 +00:00
Add som code fence lang tags
This commit is contained in:
1 parent
21d4f97d15
commit
4e7123d208
1 file changed
+4
-4
@@ -138,7 +138,7 @@ outputs:
|
|||||||
|
|
||||||
The following is an example of `YAML` front matter in a content file that defines output formats for the rendered `Page`:
|
The following is an example of `YAML` front matter in a content file that defines output formats for the rendered `Page`:
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
---
|
---
|
||||||
date: "2016-03-19"
|
date: "2016-03-19"
|
||||||
outputs:
|
outputs:
|
||||||
@@ -152,7 +152,7 @@ outputs:
|
|||||||
|
|
||||||
Each `Page` has both an `.OutputFormats` (all formats, including the current) and an `.AlternativeOutputFormats` variable, the latter of which is useful for creating a `link rel` list in your site's `<head>`:
|
Each `Page` has both an `.OutputFormats` (all formats, including the current) and an `.AlternativeOutputFormats` variable, the latter of which is useful for creating a `link rel` list in your site's `<head>`:
|
||||||
|
|
||||||
```
|
```html
|
||||||
{{ range .AlternativeOutputFormats -}}
|
{{ range .AlternativeOutputFormats -}}
|
||||||
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">
|
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
@@ -162,7 +162,7 @@ Note that `.Permalink` and `.RelPermalink` on `Page` will return the first outpu
|
|||||||
|
|
||||||
This is how you link to a given output format:
|
This is how you link to a given output format:
|
||||||
|
|
||||||
```
|
```html
|
||||||
{{ with .OutputFormats.Get "json" -}}
|
{{ with .OutputFormats.Get "json" -}}
|
||||||
<a href="{{ .Permalink }}">{{ .Name }}</a>
|
<a href="{{ .Permalink }}">{{ .Name }}</a>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -170,7 +170,7 @@ This is how you link to a given output format:
|
|||||||
|
|
||||||
From content files, you can use the [`ref` or `relref` shortcodes](/content-management/shortcodes/#ref-and-relref):
|
From content files, you can use the [`ref` or `relref` shortcodes](/content-management/shortcodes/#ref-and-relref):
|
||||||
|
|
||||||
```
|
```html
|
||||||
[Neat]({{</* ref "blog/neat.md" "amp" */>}})
|
[Neat]({{</* ref "blog/neat.md" "amp" */>}})
|
||||||
[Who]({{</* relref "about.md#who" "amp" */>}})
|
[Who]({{</* relref "about.md#who" "amp" */>}})
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in new issue
Block a user