Skip to content

Commit 3a4c2a2

Browse files
committed
theme: Address Hugo v0.156.0 deprecations
1 parent 4f1a2bd commit 3a4c2a2

File tree

9 files changed

+14
-14
lines changed

9 files changed

+14
-14
lines changed

layouts/_partials/helpers/validation/validate-keywords.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/}}
1212
{{/* prettier-ignore-end */ -}}
1313
{{- $t := debug.Timer "validateKeywords" }}
14-
{{- $allowedKeywords := collections.Apply site.Data.keywords "strings.ToLower" "." }}
14+
{{- $allowedKeywords := collections.Apply hugo.Data.keywords "strings.ToLower" "." }}
1515
{{- range $p := site.Pages }}
1616
{{- range .Params.keywords }}
1717
{{- if not (in $allowedKeywords (lower .)) }}

layouts/_partials/layouts/home/sponsors.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{{ $isFooter := (eq $gtag "footer") }}
44
{{ $utmSource := cond $isFooter "hugofooter" "hugohome" }}
55
{{ $containerClass := .containerClass | default "mx-auto max-w-7xl px-6 lg:px-8" }}
6-
{{ with .ctx.Site.Data.sponsors }}
6+
{{ with hugo.Data.sponsors }}
77
<div class="{{ $containerClass }}">
88
<h2 class="font-bold text-2xl mb-6 tracking-tighter">Hugo Sponsors</h2>
99
<div class="grid grid-cols-1 lg:grid-cols-3 gap-x-8 gap-y-6">

layouts/_shortcodes/chroma-lexers.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<th>Identifiers</th>
1313
</thead>
1414
<tbody>
15-
{{- range site.Data.docs.chroma.lexers }}
15+
{{- range hugo.Data.docs.chroma.lexers }}
1616
<tr>
1717
<td>{{ .Name }}</td>
1818
<td>

layouts/_shortcodes/code-toggle.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
{{- /*
33
Renders syntax-highlighted configuration data in JSON, TOML, and YAML formats.
44

5-
@param {string} [config] The section of site.Data.docs.config to render.
5+
@param {string} [config] The section of hugo.Data.docs.config to render.
66
@param {bool} [copy=false] Whether to display a copy-to-clipboard button.
7-
@param {string} [dataKey] The section of site.Data.docs to render.
7+
@param {string} [dataKey] The section of hugo.Data.docs to render.
88
@param {string} [file] The file name to display above the rendered code.
99
@param {bool} [fm=false] Whether to render the code as front matter.
10-
@param {bool} [skipHeader=false] Whether to omit top level key(s) when rendering a section of site.Data.docs.config.
10+
@param {bool} [skipHeader=false] Whether to omit top level key(s) when rendering a section of hugo.Data.docs.config.
1111

1212
@example {{< code-toggle file=hugo config=build />}}
1313

@@ -55,15 +55,15 @@
5555
{{- if $config }}
5656
{{- $file = $file | default "hugo" }}
5757
{{- $sections := (split $config ".") }}
58-
{{- $configSection := index $.Site.Data.docs.config $sections }}
58+
{{- $configSection := index hugo.Data.docs.config $sections }}
5959
{{- $code = dict $sections $configSection }}
6060
{{- if $skipHeader }}
6161
{{- $code = $configSection }}
6262
{{- end }}
6363
{{- else if $dataKey }}
6464
{{- $file = $file | default $dataKey }}
6565
{{- $sections := (split $dataKey ".") }}
66-
{{- $code = index $.Site.Data.docs $sections }}
66+
{{- $code = index hugo.Data.docs $sections }}
6767
{{- else }}
6868
{{- $code = $.Inner }}
6969
{{- end }}

layouts/_shortcodes/datatable.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{ $package := (index .Params 0) }}
22
{{ $listname := (index .Params 1) }}
3-
{{ $list := (index (index .Site.Data.docs $package) $listname) }}
3+
{{ $list := (index (index hugo.Data.docs $package) $listname) }}
44
{{ $fields := after 2 .Params }}
55

66

layouts/_shortcodes/eturl.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
*/ -}}
1313
{{/* prettier-ignore-end */ -}}
1414
{{- with $filename := or (.Get "filename") (.Get 0) }}
15-
{{- with site.Data.embedded_template_urls }}
15+
{{- with hugo.Data.embedded_template_urls }}
1616
{{- with index . $filename }}
17-
{{- urls.JoinPath site.Data.embedded_template_urls.base_url . }}
17+
{{- urls.JoinPath hugo.Data.embedded_template_urls.base_url . }}
1818
{{- else }}
1919
{{- errorf "The %q shortcode was unable to find a URL for the embedded template named %q. Check the name. See %s" $.Name $filename $.Position }}
2020
{{- end }}

layouts/_shortcodes/list-pages-in-section.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
{{/* Build slice of filtered pages. */}}
2929
{{ with $filter }}
30-
{{ with index site.Data.page_filters . }}
30+
{{ with index hugo.Data.page_filters . }}
3131
{{ range . }}
3232
{{ with site.GetPage . }}
3333
{{ $filteredPages = $filteredPages | append . }}

layouts/_shortcodes/root-configuration-keys.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{{/* prettier-ignore-end */ -}}
88
{{- /* Create scratch map of key:filename. */}}
99
{{- $s := newScratch }}
10-
{{- range $k, $v := site.Data.docs.config }}
10+
{{- range $k, $v := hugo.Data.docs.config }}
1111
{{- if or (reflect.IsMap .) (reflect.IsSlice .) }}
1212
{{- $s.Set $k ($k | humanize | anchorize) }}
1313
{{- end }}

layouts/_shortcodes/syntax-highlighting-styles.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
{{- $examples := $examples | append $example }}
5252

5353
{{- /* Render */}}
54-
{{- with site.Data.docs.chroma.styles }}
54+
{{- with hugo.Data.docs.chroma.styles }}
5555
{{- range $style := . }}
5656

5757
### {{ $style }} {class="!mt-7 !mb-6"}{{/* Do not indent. */}}

0 commit comments

Comments
 (0)