Skip to content

Commit c4611ea

Browse files
authored
Rework introduction to templating
1 parent 64154fb commit c4611ea

File tree

17 files changed

+418
-537
lines changed

17 files changed

+418
-537
lines changed

.cspell.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,11 @@
2020
],
2121
"ignoreRegExpList": [
2222
"# cspell: ignore fenced code blocks",
23-
"^(\\s*`{3,}).*[\\s\\S]*?^\\1",
23+
"^(\\s*`{3,}).*[\\s\\S]*?^\\1$",
2424
"# cspell: ignore words joined with dot",
2525
"\\w+\\.\\w+",
2626
"# cspell: ignore strings within backticks",
2727
"`.+`",
28-
"# cspell: ignore strings within single quotes",
29-
"'.+'",
3028
"# cspell: ignore strings within double quotes",
3129
"\".+\"",
3230
"# cspell: ignore strings within brackets",

content/en/about/hugo-and-gdpr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ aliases: [/privacy/,/gdpr/]
2222
Note that:
2323

2424
* These settings have their defaults setting set to _off_, i.e. how it worked before Hugo `0.41`. You must do your own evaluation of your site and apply the appropriate settings.
25-
* These settings work with the [internal templates](/templates/internal/). Some theme may contain custom templates for embedding services like Google Analytics. In that case these options have no effect.
25+
* These settings work with the [embedded templates](/templates/embedded/). Some theme may contain custom templates for embedding services like Google Analytics. In that case these options have no effect.
2626
* We will continue this work and improve this further in future Hugo versions.
2727

2828
## All privacy settings

content/en/content-management/comments.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ For many websites, this is enough configuration. However, you also have the opti
3737

3838
### Render Hugo's built-in Disqus partial template
3939

40-
Disqus has its own [internal template](/templates/internal/#disqus) available, to render it add the following code where you want comments to appear:
40+
Disqus has its own [internal template](/templates/embedded/#disqus) available, to render it add the following code where you want comments to appear:
4141

4242
```go-html-template
4343
{{ template "_internal/disqus.html" . }}
@@ -66,7 +66,7 @@ Open-source commenting systems:
6666
- [Utterances](https://utteranc.es/)
6767

6868
[configuration]: /getting-started/configuration/
69-
[disquspartial]: /templates/internal/#disqus
69+
[disquspartial]: /templates/embedded/#disqus
7070
[disqussetup]: https://disqus.com/profile/signup/
7171
[forum]: https://discourse.gohugo.io
7272
[front matter]: /content-management/front-matter/

content/en/content-management/toc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ A collection of textile samples lay spread out on the table - Samsa was a travel
110110

111111
Hugo will take this AsciiDoc and create a table of contents store it in the page variable `.TableOfContents`, in the same as described for Markdown.
112112

113-
[conditionals]: /templates/introduction/#conditionals
113+
[conditionals]: /templates/introduction/#conditional-blocks
114114
[front matter]: /content-management/front-matter/
115115
[pagevars]: /methods/page/
116116
[partials]: /templates/partials/

content/en/functions/collections/Where.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ To return a collection of future events:
243243
{{ $futureEvents := where $events "Params.eventDate" "gt" now }}
244244
```
245245

246-
When working with YAML or JSON, or quoted TOML values, custom dates are strings; you cannot compare them with `time.Time` values. String comparisons may be possible if the custom date layout is consistent from one page to the next. However, to be safe, filter the pages by ranging through the collection:
246+
When working with YAML or JSON, or quoted TOML values, custom dates are strings; you cannot compare them with `time.Time` values. String comparisons may be possible if the custom date layout is consistent from one page to the next. To be safe, filter the pages by ranging through the collection:
247247

248248
```go-html-template
249249
{{ $events := where .Site.RegularPages "Type" "events" }}

content/en/functions/go-template/template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ action:
1313
signatures: ['template NAME [CONTEXT]']
1414
---
1515

16-
Use the `template` function to execute [internal templates]. For example:
16+
Use the `template` function to execute [embedded templates]. For example:
1717

1818
```go-html-template
1919
{{ range (.Paginate .Pages).Pages }}
@@ -46,4 +46,4 @@ The example above can be rewritten using an [inline partial] template:
4646

4747
[`partial`]: /functions/partials/include/
4848
[inline partial]: /templates/partials/#inline-partials
49-
[internal templates]: /templates/internal/
49+
[embedded templates]: /templates/embedded/

content/en/functions/resources/FromString.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Place this in your baseof.html template:
3737
{{ $m := dict
3838
"hugo_version" hugo.Version
3939
"build_date" (now.Format $rfc3339)
40-
"last_modified" (site.LastChange.Format $rfc3339)
40+
"last_modified" (site.Lastmod.Format $rfc3339)
4141
}}
4242
{{ $json := jsonify $m }}
4343
{{ $r := resources.FromString "site.json" $json }}
@@ -61,7 +61,7 @@ Combine `resources.FromString` with [`resources.ExecuteAsTemplate`] if your stri
6161
{{ $m := dict
6262
"hugo_version" hugo.Version
6363
"build_date" (now.Format $rfc3339)
64-
"last_modified" (site.LastChange.Format $rfc3339)
64+
"last_modified" (site.Lastmod.Format $rfc3339)
6565
}}
6666
{{ $json := jsonify $m }}
6767
`

content/en/functions/strings/ContainsNonSpace.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: strings.ContainsNonSpace
3-
description: Reports whether the given string contains any non-space characters as defined by Unicodes White Space property.
3+
description: Reports whether the given string contains any non-space characters as defined by Unicode's White Space property.
44
categories: []
55
keywords: []
66
action:
@@ -24,7 +24,7 @@ aliases: [/functions/strings.containsnonspace]
2424
{{ strings.ContainsNonSpace "\n abc" }} → true
2525
```
2626

27-
Common white space characters include:
27+
Common whitespace characters include:
2828

2929
```text
3030
'\t', '\n', '\v', '\f', '\r', ' '

content/en/getting-started/glossary.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ A template called with the `.Page.Render` method. See [details](/templates/
9898

9999
###### context
100100

101-
Represented by a dot "." within a [template action](#template-action), context is the current location in a data structure. For example, while iterating over a [collection](#collection) of pages, the context within each iteration is the page's data structure. The context received by each template depends on template type and/or how it was called. See [details](/templates/introduction/#the-dot).
101+
Represented by a dot "." within a [template action](#template-action), context is the current location in a data structure. For example, while iterating over a [collection](#collection) of pages, the context within each iteration is the page's data structure. The context received by each template depends on template type and/or how it was called. See [details](/templates/introduction/#context).
102102

103103
###### default sort order
104104

@@ -363,6 +363,14 @@ A numbered sequence of elements. Unlike Go's [array](#array) data type, slices a
363363

364364
A sequence of bytes. For example, `"What is 6 times 7?"` .
365365

366+
###### string literal (interpreted)
367+
368+
Interpreted string literals are character sequences between double quotes, as in "foo". Within the quotes, any character may appear except a newline and an unescaped double quote. The text between the quotes forms the value of the literal, with backslash escapes interpreted. See [details](https://go.dev/ref/spec#String_literals).
369+
370+
###### string literal (raw)
371+
372+
Raw string literals are character sequences between backticks, as in \`bar\`. Within the backticks, any character may appear except a backtick. Backslashes have no special meaning and the string may contain newlines. Carriage return characters ('\r') inside raw string literals are discarded from the raw string value. See [details](https://go.dev/ref/spec#String_literals).
373+
366374
###### taxonomic weight
367375

368376
Defined in front matter and unique to each taxonomy, this [weight](#weight) determines the sort order of page collections contained within a [taxonomy object](#taxonomy-object). See [details](/templates/taxonomy-templates/#assign-weight).

content/en/methods/page/Path.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Methods|Functions|Shortcodes
108108
[`Shortcode.Ref`]||
109109
[`Shortcode.RelRef`]||
110110

111-
[`urls.Ref`]: functions/urls/ref/
111+
[`urls.Ref`]: /functions/urls/ref/
112112
[`urls.RelRef`]: /functions/urls/relref/
113113
[`Page.GetPage`]: /methods/page/getpage/
114114
[`Site.GetPage`]: /methods/site/getpage/

0 commit comments

Comments
 (0)