Fix default data type

This commit is contained in:
Joe Mooring 2024-04-03 14:19:03 -07:00 committed by GitHub
parent 61319af7ad
commit b276bb17f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 14 additions and 14 deletions

View File

@ -93,7 +93,7 @@ my-project/
```
```go-html-template
{{ $data := "" }}
{{ $data := dict }}
{{ $p := "data/pets.csv" }}
{{ with resources.Get $p }}
{{ $opts := dict "delimiter" "," }}
@ -117,7 +117,7 @@ my-project/
```
```go-html-template
{{ $data := "" }}
{{ $data := dict }}
{{ $p := "pets.csv" }}
{{ with .Resources.Get $p }}
{{ $opts := dict "delimiter" "," }}
@ -132,7 +132,7 @@ my-project/
Consider using the [`resources.GetRemote`] function with [`transform.Unmarshal`] when accessing a remote resource to improve error handling and cache control.
```go-html-template
{{ $data := "" }}
{{ $data := dict }}
{{ $u := "https://example.org/pets.csv" }}
{{ with resources.GetRemote $u }}
{{ with .Err }}

View File

@ -98,7 +98,7 @@ my-project/
```
```go-html-template
{{ $data := "" }}
{{ $data := dict }}
{{ $p := "data/books.json" }}
{{ with resources.Get $p }}
{{ $data = .Content | transform.Unmarshal }}
@ -121,7 +121,7 @@ my-project/
```
```go-html-template
{{ $data := "" }}
{{ $data := dict }}
{{ $p := "books.json" }}
{{ with .Resources.Get $p }}
{{ $data = .Content | transform.Unmarshal }}
@ -135,7 +135,7 @@ my-project/
Consider using the [`resources.GetRemote`] function with [`transform.Unmarshal`] when accessing a remote resource to improve error handling and cache control.
```go-html-template
{{ $data := "" }}
{{ $data := dict }}
{{ $u := "https://example.org/books.json" }}
{{ with resources.GetRemote $u }}
{{ with .Err }}

View File

@ -11,7 +11,7 @@ action:
---
```go-html-template
{{ $data := "" }}
{{ $data := dict }}
{{ $p := "data/books.json" }}
{{ with resources.Get $p }}
{{ $opts := dict "delimiter" "," }}

View File

@ -73,7 +73,7 @@ When retrieving remote data, use the [`transform.Unmarshal`] function to [unmars
[unmarshal]: /getting-started/glossary/#unmarshal
```go-html-template
{{ $data := "" }}
{{ $data := dict }}
{{ $url := "https://example.org/books.json" }}
{{ with resources.GetRemote $url }}
{{ with .Err }}

View File

@ -46,10 +46,10 @@ assets/
```
```go-html-template
{{ $data := "" }}
{{ $data := dict }}
{{ $path := "data/books.json" }}
{{ with resources.Get $path }}
{{ with unmarshal .Content }}
{{ with .Content | transform.Unmarshal }}
{{ $data = . }}
{{ end }}
{{ else }}
@ -75,10 +75,10 @@ content/
```
```go-html-template
{{ $data := "" }}
{{ $data := dict }}
{{ $path := "books.json" }}
{{ with .Resources.Get $path }}
{{ with unmarshal .Content }}
{{ with .Content | transform.Unmarshal }}
{{ $data = . }}
{{ end }}
{{ else }}
@ -95,7 +95,7 @@ content/
A remote resource is a file on a remote server, accessible via HTTP or HTTPS.
```go-html-template
{{ $data := "" }}
{{ $data := dict }}
{{ $url := "https://example.org/books.json" }}
{{ with resources.GetRemote $url }}
{{ with .Err }}
@ -166,7 +166,7 @@ When unmarshaling an XML file, do not include the root node when accessing data.
Get the remote data:
```go-html-template
{{ $data := "" }}
{{ $data := dict }}
{{ $url := "https://example.org/books/index.xml" }}
{{ with resources.GetRemote $url }}
{{ with .Err }}