content: Fix editing errors

This commit is contained in:
Joe Mooring 2025-05-06 06:08:56 -07:00 committed by GitHub
parent 606547b48f
commit bc478f98f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View File

@ -37,7 +37,7 @@ Use these methods within a content adapter.
Adds a page to the site.
```go-html-template {file="content/books/"}
```go-html-template {file="content/books/_content.gotmpl"}
{{ $content := dict
"mediaType" "text/markdown"
"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.
```go-html-template {file="content/books/"}
```go-html-template {file="content/books/_content.gotmpl"}
{{ with resources.Get "images/a.jpg" }}
{{ $content := dict
"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.
```go-html-template {file="content/books/"}
```go-html-template {file="content/books/_content.gotmpl"}
{{ .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/).
```go-html-template {file="content/books/"}
```go-html-template {file="content/books/_content.gotmpl"}
{{ .Store.Set "key" "value" }}
{{ .Store.Get "key" }}
```

View File

@ -132,7 +132,7 @@ lazyQuotes
targetType
: {{< 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
@ -148,7 +148,7 @@ The examples below use this CSV file:
To render an HTML table from a CSV file:
```go-html-template
{{ $data := }}
{{ $data := slice }}
{{ $file := "pets.csv" }}
{{ with or (.Resources.Get $file) (resources.Get $file) }}
{{ $opts := dict "targetType" "slice" }}