Skip to content

Commit 575d603

Browse files
jmooringbep
authored andcommitted
Update docs for v0.141.0
Closes gohugoio#2808
1 parent a0a442d commit 575d603

File tree

30 files changed

+787
-932
lines changed

30 files changed

+787
-932
lines changed

assets/images/examples/mask.png

134 KB
Loading

content/en/about/privacy.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ respectDoNotTrack = false
3939
[privacy.instagram]
4040
disable = false
4141
simple = false
42-
[privacy.twitter]
42+
[privacy.vimeo]
4343
disable = false
4444
enableDNT = false
4545
simple = false
46-
[privacy.vimeo]
46+
[privacy.x]
4747
disable = false
4848
enableDNT = false
4949
simple = false
@@ -64,10 +64,10 @@ disable = true
6464
disable = true
6565
[privacy.instagram]
6666
disable = true
67-
[privacy.twitter]
68-
disable = true
6967
[privacy.vimeo]
7068
disable = true
69+
[privacy.x]
70+
disable = true
7171
[privacy.youtube]
7272
disable = true
7373
{{< /code-toggle >}}
@@ -92,19 +92,19 @@ simple
9292
disableInlineCSS = true
9393
{{< /code-toggle >}}
9494

95-
### Twitter
95+
### X
9696

9797
enableDNT
98-
: Enabling this for the twitter/tweet shortcode, the tweet and its embedded page on your site are not used for purposes that include personalized suggestions and personalized ads.
98+
: Enabling this for the x shortcode, the post and its embedded page on your site are not used for purposes that include personalized suggestions and personalized ads.
9999

100100
simple
101-
: If simple mode is enabled, a static and no-JS version of a tweet will be built.
101+
: If simple mode is enabled, a static and no-JS version of a post will be built.
102102

103-
**Note:** If you use the _simple mode_ for Twitter, you may want to disable the inline styles provided by Hugo:
103+
**Note:** If you use the _simple mode_ for X, you may want to disable the inline styles provided by Hugo:
104104

105105
{{< code-toggle file=hugo >}}
106106
[services]
107-
[services.twitter]
107+
[services.x]
108108
disableInlineCSS = true
109109
{{< /code-toggle >}}
110110

content/en/commands/hugo.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ hugo [flags]
7272
* [hugo completion](/commands/hugo_completion/) - Generate the autocompletion script for the specified shell
7373
* [hugo config](/commands/hugo_config/) - Display site configuration
7474
* [hugo convert](/commands/hugo_convert/) - Convert front matter to another format
75-
* [hugo deploy](/commands/hugo_deploy/) - Deploy your site to a cloud provider
7675
* [hugo env](/commands/hugo_env/) - Display version and environment info
7776
* [hugo gen](/commands/hugo_gen/) - Generate documentation and syntax highlighting styles
7877
* [hugo import](/commands/hugo_import/) - Import a site from another system

content/en/content-management/content-adapters.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -193,14 +193,14 @@ Step 3
193193
{{/* Get remote data. */}}
194194
{{ $data := dict }}
195195
{{ $url := "https://gohugo.io/shared/examples/data/books.json" }}
196-
{{ with resources.GetRemote $url }}
196+
{{ with try (resources.GetRemote $url) }}
197197
{{ with .Err }}
198198
{{ errorf "Unable to get remote resource %s: %s" $url . }}
199-
{{ else }}
199+
{{ else with .Value }}
200200
{{ $data = . | transform.Unmarshal }}
201+
{{ else }}
202+
{{ errorf "Unable to get remote resource %s" $url }}
201203
{{ end }}
202-
{{ else }}
203-
{{ errorf "Unable to get remote resource %s" $url }}
204204
{{ end }}
205205

206206
{{/* Add pages and page resources. */}}
@@ -223,10 +223,10 @@ Step 3
223223
{{/* Add page resource. */}}
224224
{{ $item := . }}
225225
{{ with $url := $item.cover }}
226-
{{ with resources.GetRemote $url }}
226+
{{ with try (resources.GetRemote $url) }}
227227
{{ with .Err }}
228228
{{ errorf "Unable to get remote resource %s: %s" $url . }}
229-
{{ else }}
229+
{{ else with .Value }}
230230
{{ $content := dict "mediaType" .MediaType.Type "value" .Content }}
231231
{{ $params := dict "alt" $item.title }}
232232
{{ $resource := dict
@@ -235,9 +235,9 @@ Step 3
235235
"path" (printf "%s/cover.%s" $item.title .MediaType.SubType)
236236
}}
237237
{{ $.AddResource $resource }}
238+
{{ else }}
239+
{{ errorf "Unable to get remote resource %s" $url }}
238240
{{ end }}
239-
{{ else }}
240-
{{ errorf "Unable to get remote resource %s" $url }}
241241
{{ end }}
242242
{{ end }}
243243

content/en/content-management/image-processing/index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ Example 3: A more concise way to skip image rendering if the resource is not fou
8888
Example 4: Skips rendering if there's problem accessing a remote resource.
8989

9090
```go-html-template
91-
{{ $u := "https://gohugo.io/img/hugo-logo.png" }}
92-
{{ with resources.GetRemote $u }}
91+
{{ $url := "https://gohugo.io/img/hugo-logo.png" }}
92+
{{ with try (resources.GetRemote $url) }}
9393
{{ with .Err }}
9494
{{ errorf "%s" . }}
95-
{{ else }}
95+
{{ else with .Value }}
9696
<img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}">
97+
{{ else }}
98+
{{ errorf "Unable to get remote resource %q" $url }}
9799
{{ end }}
98-
{{ else }}
99-
{{ errorf "Unable to get remote resource %q" $u }}
100100
{{ end }}
101101
```
102102

content/en/content-management/related.md

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -157,22 +157,3 @@ pattern
157157

158158
toLower
159159
: (`bool`) See above.
160-
161-
## Performance considerations
162-
163-
**Fast is Hugo's middle name** and we would not have released this feature had it not been blistering fast.
164-
165-
This feature has been in the back log and requested by many for a long time. The development got this recent kick start from this Twitter thread:
166-
167-
{{< tweet user="scott_lowe" id="898398437527363585" >}}
168-
169-
Scott S. Lowe removed the "Related Content" section built using the `intersect` template function on tags, and the build time dropped from 30 seconds to less than 2 seconds on his 1700 content page sized blog.
170-
171-
He should now be able to add an improved version of that "Related Content" section without giving up the fast live-reloads. But it's worth noting that:
172-
173-
* If you don't use any of the `Related` methods, you will not use the Relate Content feature, and performance will be the same as before.
174-
* Calling `.RegularPages.Related` etc. will create one inverted index, also sometimes named posting list, that will be reused for any lookups in that same page collection. Doing that in addition to, as an example, calling `.Pages.Related` will work as expected, but will create one additional inverted index. This should still be very fast, but worth having in mind, especially for bigger sites.
175-
176-
{{% note %}}
177-
We currently do not index **Page content**. We thought we would release something that will make most people happy before we start solving [Sherlock's last case](https://github.com/joearms/sherlock).
178-
{{% /note %}}

content/en/content-management/shortcodes.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,6 @@ Rendered:
498498
{{% note %}}
499499
To override Hugo's embedded `twitter` shortcode, copy the [source code] to a file with the same name in the layouts/shortcodes directory.
500500

501-
You may call the `twitter` shortcode by using its `tweet` alias.
502-
503501
[source code]: {{% eturl twitter %}}
504502
{{% /note %}}
505503

content/en/functions/data/GetCSV.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,16 @@ Consider using the [`resources.GetRemote`] function with [`transform.Unmarshal`]
134134

135135
```go-html-template
136136
{{ $data := dict }}
137-
{{ $u := "https://example.org/pets.csv" }}
138-
{{ with resources.GetRemote $u }}
137+
{{ $url := "https://example.org/pets.csv" }}
138+
{{ with try (resources.GetRemote $url) }}
139139
{{ with .Err }}
140140
{{ errorf "%s" . }}
141-
{{ else }}
141+
{{ else with .Value }}
142142
{{ $opts := dict "delimiter" "," }}
143143
{{ $data = . | transform.Unmarshal $opts }}
144+
{{ else }}
145+
{{ errorf "Unable to get remote resource %q" $url }}
144146
{{ end }}
145-
{{ else }}
146-
{{ errorf "Unable to get remote resource %q" $u }}
147147
{{ end }}
148148
```
149149

content/en/functions/data/GetJSON.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,15 @@ Consider using the [`resources.GetRemote`] function with [`transform.Unmarshal`]
137137

138138
```go-html-template
139139
{{ $data := dict }}
140-
{{ $u := "https://example.org/books.json" }}
141-
{{ with resources.GetRemote $u }}
140+
{{ $url := "https://example.org/books.json" }}
141+
{{ with try (resources.GetRemote $url) }}
142142
{{ with .Err }}
143143
{{ errorf "%s" . }}
144-
{{ else }}
144+
{{ else with .Value }}
145145
{{ $data = . | transform.Unmarshal }}
146+
{{ else }}
147+
{{ errorf "Unable to get remote resource %q" $url }}
146148
{{ end }}
147-
{{ else }}
148-
{{ errorf "Unable to get remote resource %q" $u }}
149149
{{ end }}
150150
```
151151

content/en/functions/encoding/Base64Decode.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ https://api.github.com/repos/gohugoio/hugo/readme
2525
To retrieve and render the content:
2626

2727
```go-html-template
28-
{{ $u := "https://api.github.com/repos/gohugoio/hugo/readme" }}
29-
{{ with resources.GetRemote $u }}
28+
{{ $url := "https://api.github.com/repos/gohugoio/hugo/readme" }}
29+
{{ with try (resources.GetRemote $url) }}
3030
{{ with .Err }}
3131
{{ errorf "%s" . }}
32-
{{ else }}
32+
{{ else with .Value}}
3333
{{ with . | transform.Unmarshal }}
3434
{{ .content | base64Decode | markdownify }}
3535
{{ end }}
36+
{{ else }}
37+
{{ errorf "Unable to get remote resource %q" $url }}
3638
{{ end }}
37-
{{ else }}
38-
{{ errorf "Unable to get remote resource %q" $u }}
3939
{{ end }}
4040
```

0 commit comments

Comments
 (0)