mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-10 14:14:42 -04:00
content: Fix editing errors
This commit is contained in:
parent
606547b48f
commit
bc478f98f9
@ -37,7 +37,7 @@ Use these methods within a content adapter.
|
|||||||
|
|
||||||
Adds a page to the site.
|
Adds a page to the site.
|
||||||
|
|
||||||
```go-html-template {file="content/books/"}
|
```go-html-template {file="content/books/_content.gotmpl"}
|
||||||
{{ $content := dict
|
{{ $content := dict
|
||||||
"mediaType" "text/markdown"
|
"mediaType" "text/markdown"
|
||||||
"value" "The _Hunchback of Notre Dame_ was written by Victor Hugo."
|
"value" "The _Hunchback of Notre Dame_ was written by Victor Hugo."
|
||||||
@ -55,7 +55,7 @@ Adds a page to the site.
|
|||||||
|
|
||||||
Adds a page resource to the site.
|
Adds a page resource to the site.
|
||||||
|
|
||||||
```go-html-template {file="content/books/"}
|
```go-html-template {file="content/books/_content.gotmpl"}
|
||||||
{{ with resources.Get "images/a.jpg" }}
|
{{ with resources.Get "images/a.jpg" }}
|
||||||
{{ $content := dict
|
{{ $content := dict
|
||||||
"mediaType" .MediaType.Type
|
"mediaType" .MediaType.Type
|
||||||
@ -81,7 +81,7 @@ Then retrieve the new page resource with something like:
|
|||||||
|
|
||||||
Returns the `Site` to which the pages will be added.
|
Returns the `Site` to which the pages will be added.
|
||||||
|
|
||||||
```go-html-template {file="content/books/"}
|
```go-html-template {file="content/books/_content.gotmpl"}
|
||||||
{{ .Site.Title }}
|
{{ .Site.Title }}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ Returns the `Site` to which the pages will be added.
|
|||||||
|
|
||||||
Returns a persistent “scratch pad” to store and manipulate data. The main use case for this is to transfer values between executions when [EnableAllLanguages](#enablealllanguages) is set. See [examples](/methods/page/store/).
|
Returns a persistent “scratch pad” to store and manipulate data. The main use case for this is to transfer values between executions when [EnableAllLanguages](#enablealllanguages) is set. See [examples](/methods/page/store/).
|
||||||
|
|
||||||
```go-html-template {file="content/books/"}
|
```go-html-template {file="content/books/_content.gotmpl"}
|
||||||
{{ .Store.Set "key" "value" }}
|
{{ .Store.Set "key" "value" }}
|
||||||
{{ .Store.Get "key" }}
|
{{ .Store.Get "key" }}
|
||||||
```
|
```
|
||||||
|
@ -132,7 +132,7 @@ lazyQuotes
|
|||||||
|
|
||||||
targetType
|
targetType
|
||||||
: {{< new-in 0.146.7 />}}
|
: {{< new-in 0.146.7 />}}
|
||||||
: (`string`) The target data type, either `` or `map`. Default is ``.
|
: (`string`) The target data type, either `slice` or `map`. Default is ``.
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
@ -148,7 +148,7 @@ The examples below use this CSV file:
|
|||||||
To render an HTML table from a CSV file:
|
To render an HTML table from a CSV file:
|
||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
{{ $data := }}
|
{{ $data := slice }}
|
||||||
{{ $file := "pets.csv" }}
|
{{ $file := "pets.csv" }}
|
||||||
{{ with or (.Resources.Get $file) (resources.Get $file) }}
|
{{ with or (.Resources.Get $file) (resources.Get $file) }}
|
||||||
{{ $opts := dict "targetType" "slice" }}
|
{{ $opts := dict "targetType" "slice" }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user