Merge commit '5be51ac3db225d5df501ed1fa1499c41d97dbf65'

This commit is contained in:
Bjørn Erik Pedersen
2025-04-10 13:04:51 +02:00
987 changed files with 12379 additions and 14083 deletions

View File

@@ -1,4 +1,4 @@
{{- with .Params.action.aliases }}
{{- with .Params.functions_and_methods.aliases }}
{{- $label := "Alias" }}
{{- if gt (len .) 1 }}
{{- $label = "Aliases" }}

View File

@@ -1,4 +1,4 @@
{{- with .Params.action.returnType }}
{{- with .Params.functions_and_methods.returnType }}
<p class="font-bold text-dark dark:text-light mt-2">Returns</p>
<div class="font-sm font-mono ml-3 sm:ml-6 mt-0 sm:mt-1">
{{- . -}}

View File

@@ -1,4 +1,4 @@
{{- with .Params.action.signatures }}
{{- with .Params.functions_and_methods.signatures }}
<p class="font-bold text-dark dark:text-light">Syntax</p>
{{- range . }}
{{- $signature := . }}

View File

@@ -0,0 +1,23 @@
<span class="h-3"></span>
<table class="mt-auto">
<tbody>
<tr>
<td class="align-top text-red-700">weight:</td>
<td class="align-top pl-2 w-full">
{{ .Weight }}
</td>
</tr>
<tr>
<td class="align-top text-red-700">keywords:</td>
<td class="align-top pl-2">
{{ delimit (or .Keywords "") ", " }}
</td>
</tr>
<tr>
<td class="align-top text-red-700">categories:</td>
<td class="align-top pl-2">
{{ delimit (or .Params.categories "") ", " }}
</td>
</tr>
</tbody>
</table>

View File

@@ -1,3 +1,4 @@
{{/* prettier-ignore-start */ -}}
{{/*
Parses the serialized data from the given URL and returns a map or an array.
@@ -8,7 +9,7 @@ Supports CSV, JSON, TOML, YAML, and XML.
@example {{ partial "get-remote-data.html" "https://example.org/foo.json" }}
*/}}
{{/* prettier-ignore-end */ -}}
{{ $url := . }}
{{ $data := dict }}
{{ with try (resources.GetRemote $url) }}

View File

@@ -5,7 +5,7 @@
<link
rel="stylesheet"
href="{{ $r.RelPermalink }}"
{{ template `render-attributes` $attr }} />
{{ template `render-attributes` $attr }}>
{{ else }}
{{ with $r | minify | fingerprint }}
<link
@@ -13,7 +13,7 @@
href="{{ .RelPermalink }}"
integrity="{{ .Data.Integrity }}"
crossorigin="anonymous"
{{ template `render-attributes` $attr }} />
{{ template `render-attributes` $attr }}>
{{ end }}
{{ end }}

View File

@@ -9,17 +9,17 @@
<source
srcset="{{ $imageWebp.RelPermalink }}"
type="image/webp"
media="(min-width: 1200px)" />
media="(min-width: 1200px)">
<source
srcset="{{ $image.RelPermalink }}"
type="image/jpeg"
media="(min-width: 1200px)" />
<source srcset="{{ $image1xWebp.RelPermalink }}" type="image/webp" />
<source srcset="{{ $image1x.RelPermalink }}" type="image/jpeg" />
media="(min-width: 1200px)">
<source srcset="{{ $image1xWebp.RelPermalink }}" type="image/webp">
<source srcset="{{ $image1x.RelPermalink }}" type="image/jpeg">
<img
class="{{ $class }}"
src="{{ $image1x.RelPermalink }}"
alt=""
width="{{ $image1x.Width }}"
height="{{ $image1x.Height }}" />
height="{{ $image1x.Height }}">
</picture>

View File

@@ -0,0 +1,22 @@
{{/* prettier-ignore-start */ -}}
{{- /*
We use the front matter keywords field to determine related content. To ensure
consistency, during site build we validate each keyword against the entries in
data/keywords.yaml.
As of March 5, 2025, this feature is experimental, pending usability
assessment. We anticipate that the number of additions to data/keywords.yaml
will decrease over time, though the initial implementation will require some
effort.
*/}}
{{/* prettier-ignore-end */ -}}
{{- $t := debug.Timer "validateKeywords" }}
{{- $allowedKeywords := collections.Apply site.Data.keywords "strings.ToLower" "." }}
{{- range $p := site.Pages }}
{{- range .Params.keywords }}
{{- if not (in $allowedKeywords (lower .)) }}
{{- warnf "The word or phrase %q is not in the keywords data file. See %s." . $p.Page.String }}
{{- end }}
{{- end }}
{{- end }}
{{- $t.Stop }}

View File

@@ -1,8 +1,8 @@
{{ $title := .title | default "" }}
{{ $color := .color | default "yellow" }}
{{ $icon := .icon | default "exclamation" }}
{{ $text := .text | default "" }}
{{ $class := .class | default "mt-6 mb-8" }}
{{- $title := .title | default "" }}
{{- $color := .color | default "yellow" }}
{{- $icon := .icon | default "exclamation-triangle" }}
{{- $text := .text | default "" }}
{{- $class := .class | default "mt-6 mb-8" }}
<div
class="border-l-4 overflow-x-auto border-{{ $color }}-400 bg-{{ $color }}-50 dark:bg-{{ $color }}-950 border-1 border-{{ $color }}-100 dark:border-{{ $color }}-900 p-4 {{ $class }}">
<div class="flex">
@@ -12,15 +12,13 @@
</svg>
</div>
<div class="ml-3">
{{ with $title }}
{{- with $title }}
<h3 class="text-{{ $color }}-800">
{{ . }}
</h3>
{{ end }}
{{- end }}
<div class="mt-2">
<p>
{{ $text }}
</p>
{{ $text }}
</div>
</div>
</div>

View File

@@ -15,7 +15,7 @@
{{ $isLast := eq $i (sub (len $ancestors) 1) }}
<a
href="{{ $p.RelPermalink }}"
class="truncate text-blue-600 hover:text-blue-500 {{ if $isCurrentSection }}
class="truncate text-blue-600 hover:text-blue-500 dark:text-blue-500 dark:hover:text-blue-400 {{ if $isCurrentSection }}
current-section
{{ end }}"
>{{ $p.LinkTitle }}</a

View File

@@ -0,0 +1,5 @@
{{ $humanDate := time.Format "January 2, 2006" . }}
{{ $machineDate := time.Format "2006-01-02T15:04:05-07:00" . }}
<time {{ printf "datetime=%q" $machineDate | safeHTMLAttr }}>
{{ $humanDate }}
</time>

View File

@@ -1,4 +1,5 @@
<footer class="print:hidden bg-blue-950 mt-8 sm:mt-24 border-t-1 border-gray-800">
<footer
class="print:hidden bg-blue-950 mt-8 sm:mt-24 border-t-1 border-gray-800">
<div class="mx-auto max-w-7xl pt-16 pb-8 sm:pt-18 lg:pt-20">
<div class="xl:grid xl:grid-cols-3 xl:gap-8">
{{/* Column 1 */}}
@@ -9,13 +10,13 @@
href="https://github.com/gohugoio/hugo/graphs/contributors"
class="text-blue-300 hover:underline"
>Hugo Authors</a
><br />
><br>
</div>
<img
src="/images/hugo-logo-wide.svg"
alt="Hugo Logo"
class="aspect-3/1 w-40" />
class="aspect-3/1 w-40">
<ul class="space-y-2 text-gray-200">
<li class="hover:text-white">

View File

@@ -1,6 +1,3 @@
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
{{ hugo.Generator }}

View File

@@ -2,7 +2,7 @@
x-data="navbar"
class="print:hidden sticky top-0 z-50 bg-blue-950 flex flex-none flex-wrap items-center justify-between px-4 py-5 shadow-md shadow-slate-900/5 transition duration-500 sm:px-6 lg:px-8 dark:shadow-none"
:class="$store.nav.scroll.atTop ? '': 'bg-blue-950/80'">
<div class="relative flex basis-0 items-cente mr-2 lg:mr-8">
<div class="relative flex basis-0 items-center mr-2 lg:mr-8">
{{ with site.Home }}
<a
class="text-white text-xl font-bold upper"

View File

@@ -1,9 +1,9 @@
{{ $t := debug.Timer "qr" }}
{{ $qr := partial "partials/_inline/qr" (dict
{{ $qr := partial "_inline/qr" (dict
"page" $
"img_class" "w-10 bg-white view-transition-qr" )
}}
{{ $qrBig := partial "partials/_inline/qr" (dict "page" $ "img_class" "w-64 p-4") }}
{{ $qrBig := partial "_inline/qr" (dict "page" $ "img_class" "w-64 p-4") }}
{{ $t.Stop }}
<div
class="hidden lg:block cursor-pointer outline-2 hover:outline-3 outline-blue-500 w-10 h-10">
@@ -20,6 +20,6 @@
height="{{ .Height }}"
@load="$event.target.classList.remove('_opacity-0')"
alt="QR code linking to {{ $.page.Permalink }}"
class="{{ $img_class }}" />
class="{{ $img_class }}">
{{ end }}
{{ end }}

View File

@@ -17,7 +17,7 @@
<div class="relative pl-9">
<dt class="inline font-bold text-gray-900 dark:text-gray-300">
<svg
class="absolute top-1 left-1 size-5 text-blue-600"
class="absolute top-1 left-1 size-5 text-blue-500"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
@@ -32,11 +32,12 @@
Popular.
</dt>
<dd class="inline ml-1">
As of writing this, Hugo has
{{ $githubInfo.stargazers_count }}
stars on GitHub. Join the crowd and hit the
Hugo has
{{ $githubInfo.stargazers_count | lang.FormatNumber 0 }}
stars on GitHub as of {{ now.Format "January 2, 2006" }}.
Join the crowd and hit the
<a
class="text-blue-600 hover:text-blue-700 font-semibold"
class="text-blue-500 hover:text-blue-500 font-semibold"
href="https://github.com/gohugoio/hugo"
>Star button</a
>.
@@ -45,7 +46,7 @@
<div class="relative pl-9">
<dt class="inline font-bold text-gray-900 dark:text-gray-300">
<svg
class="absolute top-1 left-1 size-5 text-blue-600"
class="absolute top-1 left-1 size-5 text-blue-500"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
@@ -63,7 +64,7 @@
Hugo has a large and active community. If you have questions or
need help, you can ask in the
<a
class="text-blue-600 hover:text-blue-700 font-semibold"
class="text-blue-500 hover:text-blue-500 font-semibold"
href="https://discourse.gohugo.io"
>Hugo forums</a
>.
@@ -72,7 +73,7 @@
<div class="relative pl-9">
<dt class="inline font-bold text-gray-900 dark:text-gray-300">
<svg
class="absolute top-1 left-1 size-5 text-blue-600"
class="absolute top-1 left-1 size-5 text-blue-500"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
@@ -89,7 +90,7 @@
<dd class="inline ml-1">
Hugo has a fast
<a
class="text-blue-600 hover:text-blue-700 font-semibold"
class="text-blue-500 hover:text-blue-500 font-semibold"
href="https://github.com/gohugoio/hugo/releases"
>release</a
>

View File

@@ -3,8 +3,6 @@
{{ $isFooter := (eq $gtag "footer") }}
{{ $utmSource := cond $isFooter "hugofooter" "hugohome" }}
{{ $containerClass := .containerClass | default "mx-auto max-w-7xl px-6 lg:px-8" }}
{{/* TODO1 prod: onclick="trackOutboundLink({{ printf "'%s', '%s'" $gtagID $url | safeJS }});"
*/}}
{{ with .ctx.Site.Data.sponsors }}
<div class="{{ $containerClass }}">
<h2 class="font-bold text-2xl mb-6 tracking-tighter">Hugo Sponsors</h2>
@@ -21,6 +19,9 @@
<a
href="{{ $url }}"
title="{{ .title | default .name }}"
{{ if hugo.IsProduction }}
onclick="trackOutboundLink({{ printf "'%s', '%s'" $gtagID $url | safeJS }});"
{{ end }}
class="group inline-block w-full h-full shadow-md dark:shadow-gray-600"
{{ with .link_attr }}{{ . | safeHTMLAttr }}{{ end }}>
<div

View File

@@ -1 +1,3 @@
{{/* Empty for now */}}
{{- if .IsHome }}
{{- partial "helpers/validation/validate-keywords.html" }}
{{- end }}

View File

@@ -0,0 +1,8 @@
{{ if or .IsSection .IsPage }}
<div class="hidden print:flex justify-between border-b-1 border-b-gray-400 mb-4">
<p class="flex flex-col justify-end text-4xl mb-3">Hugo Documentation</p>
{{ with images.QR .Permalink (dict "scale" 3) }}
<img class="mb-2 -mr-2" src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}" alt="Link to {{ $.Permalink }}">
{{ end }}
</div>
{{end }}

View File

@@ -22,16 +22,6 @@
</symbol>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="icon--exclamation" viewBox="0 0 24 24">
<path
fill-rule="evenodd"
d="M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"
clip-rule="evenodd" />
</symbol>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="icon--copy" viewBox="0 0 24 24">
<path
@@ -45,9 +35,36 @@
</symbol>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="icon--github" viewBox="0 0 24 24" aria-hidden="true">
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 2C6.477 2 2 6.463 2 11.97c0 4.404 2.865 8.14 6.839 9.458.5.092.682-.216.682-.48 0-.236-.008-.864-.013-1.695-2.782.602-3.369-1.337-3.369-1.337-.454-1.151-1.11-1.458-1.11-1.458-.908-.618.069-.606.069-.606 1.003.07 1.531 1.027 1.531 1.027.892 1.524 2.341 1.084 2.91.828.092-.643.35-1.083.636-1.332-2.22-.251-4.555-1.107-4.555-4.927 0-1.088.39-1.979 1.029-2.675-.103-.252-.446-1.266.098-2.638 0 0 .84-.268 2.75 1.022A9.607 9.607 0 0 1 12 6.82c.85.004 1.705.114 2.504.336 1.909-1.29 2.747-1.022 2.747-1.022.546 1.372.202 2.386.1 2.638.64.696 1.028 1.587 1.028 2.675 0 3.83-2.339 4.673-4.566 4.92.359.307.678.915.678 1.846 0 1.332-.012 2.407-.012 2.734 0 .267.18.577.688.48 3.97-1.32 6.833-5.054 6.833-9.458C22 6.463 17.522 2 12 2Z"></path>
</symbol>
</svg>
<symbol id="icon--github" viewBox="0 0 24 24" aria-hidden="true">
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 2C6.477 2 2 6.463 2 11.97c0 4.404 2.865 8.14 6.839 9.458.5.092.682-.216.682-.48 0-.236-.008-.864-.013-1.695-2.782.602-3.369-1.337-3.369-1.337-.454-1.151-1.11-1.458-1.11-1.458-.908-.618.069-.606.069-.606 1.003.07 1.531 1.027 1.531 1.027.892 1.524 2.341 1.084 2.91.828.092-.643.35-1.083.636-1.332-2.22-.251-4.555-1.107-4.555-4.927 0-1.088.39-1.979 1.029-2.675-.103-.252-.446-1.266.098-2.638 0 0 .84-.268 2.75 1.022A9.607 9.607 0 0 1 12 6.82c.85.004 1.705.114 2.504.336 1.909-1.29 2.747-1.022 2.747-1.022.546 1.372.202 2.386.1 2.638.64.696 1.028 1.587 1.028 2.675 0 3.83-2.339 4.673-4.566 4.92.359.307.678.915.678 1.846 0 1.332-.012 2.407-.012 2.734 0 .267.18.577.688.48 3.97-1.32 6.833-5.054 6.833-9.458C22 6.463 17.522 2 12 2Z"></path>
</symbol>
</svg>
{{/* https://heroicons.com/mini exclamation-circle */}}
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="icon--exclamation-circle" viewBox="0 0 24 24" aria-hidden="true">
<path fill-rule="evenodd" d="M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-8-5a.75.75 0 0 1 .75.75v4.5a.75.75 0 0 1-1.5 0v-4.5A.75.75 0 0 1 10 5Zm0 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" clip-rule="evenodd" />
</symbol>
</svg>
{{/* https://heroicons.com/mini exclamation-triangle */}}
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="icon--exclamation-triangle" viewBox="0 0 24 24" aria-hidden="true">
<path fill-rule="evenodd" d="M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" clip-rule="evenodd" />
</symbol>
</svg>
{{/* https://heroicons.com/mini information-circle */}}
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="icon--information-circle" viewBox="0 0 24 24" aria-hidden="true">
<path fill-rule="evenodd" d="M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-7-4a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM9 9a.75.75 0 0 0 0 1.5h.253a.25.25 0 0 1 .244.304l-.459 2.066A1.75 1.75 0 0 0 10.747 15H11a.75.75 0 0 0 0-1.5h-.253a.25.25 0 0 1-.244-.304l.459-2.066A1.75 1.75 0 0 0 9.253 9H9Z" clip-rule="evenodd" />
</symbol>
</svg>
{{/* https://heroicons.com/mini light-bulb */}}
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="icon--light-bulb" viewBox="0 0 24 24" aria-hidden="true">
<path d="M10 1a6 6 0 0 0-3.815 10.631C7.237 12.5 8 13.443 8 14.456v.644a.75.75 0 0 0 .572.729 6.016 6.016 0 0 0 2.856 0A.75.75 0 0 0 12 15.1v-.644c0-1.013.762-1.957 1.815-2.825A6 6 0 0 0 10 1ZM8.863 17.414a.75.75 0 0 0-.226 1.483 9.066 9.066 0 0 0 2.726 0 .75.75 0 0 0-.226-1.483 7.553 7.553 0 0 1-2.274 0Z" />
</symbol>
</svg>

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

@@ -17,10 +17,12 @@
<li>
<a
class="text-sm {{ if eq . $ }}
font-bold text-blue-600 focus:font-bold dark:text-blue-200
hover:text-blue-600 scroll-active
font-bold text-blue-600 hover:text-blue-600
dark:hover:text-blue-200 dark:text-blue-200 focus:font-bold
scroll-active
{{ else }}
text-blue-600 hover:text-blue-500
text-blue-600 hover:text-blue-500 dark:text-blue-500
dark:hover:text-blue-400
{{ end }}"
href="{{ .RelPermalink }}"
>{{ .LinkTitle }}</a

View File

@@ -1,5 +1,5 @@
<div class="print:hidden">
<hr class="border-t border-gray-200 dark:border-gray-800 my-10 lg:my-16" />
<hr class="border-t border-gray-200 dark:border-gray-800 my-10 lg:my-16">
<div class="text-gray-800 dark:text-gray-300 font-semibold">
Last updated:
@@ -14,11 +14,13 @@
</div>
{{ with .File }}
{{ $href := printf "%sedit/master/content/%s/%s" site.Params.ghrepo $.Lang .Path }}
<a
href="{{ $href }}"
class="mt-4 inline-block not-prose bg-blue-600 hover:bg-blue-800 text-white hover:text-white font-bold py-2 px-4 rounded">
Improve this page
</a>
{{ if not .IsContentAdapter }}
{{ $href := printf "%sedit/master/content/%s/%s" site.Params.ghrepo $.Lang .Path }}
<a
href="{{ $href }}"
class="mt-4 inline-block not-prose bg-blue-600 hover:bg-blue-800 text-white hover:text-white font-bold py-2 px-4 rounded">
Improve this page
</a>
{{ end }}
{{ end }}
</div>

View File

@@ -1,22 +1,7 @@
{{- $heading := "See also" }}
{{- $related := slice }}
{{- $related := site.Pages.Related . }}
{{- $related = $related | complement .CurrentSection.Pages | first 7 }}
{{- if .Params.action.related }}
{{- $related = slice }}
{{- range .Params.action.related }}
{{- $path := . | lower }}
{{- with or (site.GetPage $path) ($.GetPage $path) }}
{{- $related = $related | append . }}
{{- else }}
{{/* TODO1 make error */}}
{{- warnf "The 'related' partial was unable to get page %s" . }}
{{- end }}
{{- end }}
{{- else }}
{{- $related = site.RegularPages.Related . }}
{{- end }}
{{/* Avoid repeating pages that's listed in In this section. */}}
{{- $related = $related | complement .CurrentSection.RegularPages | first 7 }}
{{- with $related }}
{{ $.Store.Set "hasRelated" true }}
<h2
@@ -27,9 +12,9 @@
{{- range . }}
<li>
<a
class="text-sm text-blue-600 hover:text-blue-500"
class="text-sm text-blue-600 hover:text-blue-500 dark:text-blue-500 dark:hover:text-blue-400"
href="{{ .RelPermalink }}"
>{{ .LinkTitle }}</a
>{{ or .Params.altTitle .Title }}</a
>
</li>
{{- end }}

View File

@@ -0,0 +1,45 @@
<div class="flex items-center gap-1">
<span class="">Search by</span
><svg
width="77"
height="19"
aria-label="Algolia"
role="img"
id="l1"
class="fill-gray-600 dark:fill-gray-400"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 2196.2 500">
<path
class=""
d="M1070.38,275.3V5.91c0-3.63-3.24-6.39-6.82-5.83l-50.46,7.94c-2.87,.45-4.99,2.93-4.99,5.84l.17,273.22c0,12.92,0,92.7,95.97,95.49,3.33,.1,6.09-2.58,6.09-5.91v-40.78c0-2.96-2.19-5.51-5.12-5.84-34.85-4.01-34.85-47.57-34.85-54.72Z"></path>
<rect
class="cls-1"
x="1845.88"
y="104.73"
width="62.58"
height="277.9"
rx="5.9"
ry="5.9"></rect>
<path
class=""
d="M1851.78,71.38h50.77c3.26,0,5.9-2.64,5.9-5.9V5.9c0-3.62-3.24-6.39-6.82-5.83l-50.77,7.95c-2.87,.45-4.99,2.92-4.99,5.83v51.62c0,3.26,2.64,5.9,5.9,5.9Z"></path>
<path
class=""
d="M1764.03,275.3V5.91c0-3.63-3.24-6.39-6.82-5.83l-50.46,7.94c-2.87,.45-4.99,2.93-4.99,5.84l.17,273.22c0,12.92,0,92.7,95.97,95.49,3.33,.1,6.09-2.58,6.09-5.91v-40.78c0-2.96-2.19-5.51-5.12-5.84-34.85-4.01-34.85-47.57-34.85-54.72Z"></path>
<path
class=""
d="M1631.95,142.72c-11.14-12.25-24.83-21.65-40.78-28.31-15.92-6.53-33.26-9.85-52.07-9.85-18.78,0-36.15,3.17-51.92,9.85-15.59,6.66-29.29,16.05-40.76,28.31-11.47,12.23-20.38,26.87-26.76,44.03-6.38,17.17-9.24,37.37-9.24,58.36,0,20.99,3.19,36.87,9.55,54.21,6.38,17.32,15.14,32.11,26.45,44.36,11.29,12.23,24.83,21.62,40.6,28.46,15.77,6.83,40.12,10.33,52.4,10.48,12.25,0,36.78-3.82,52.7-10.48,15.92-6.68,29.46-16.23,40.78-28.46,11.29-12.25,20.05-27.04,26.25-44.36,6.22-17.34,9.24-33.22,9.24-54.21,0-20.99-3.34-41.19-10.03-58.36-6.38-17.17-15.14-31.8-26.43-44.03Zm-44.43,163.75c-11.47,15.75-27.56,23.7-48.09,23.7-20.55,0-36.63-7.8-48.1-23.7-11.47-15.75-17.21-34.01-17.21-61.2,0-26.89,5.59-49.14,17.06-64.87,11.45-15.75,27.54-23.52,48.07-23.52,20.55,0,36.63,7.78,48.09,23.52,11.47,15.57,17.36,37.98,17.36,64.87,0,27.19-5.72,45.3-17.19,61.2Z"></path>
<path
class=""
d="M894.42,104.73h-49.33c-48.36,0-90.91,25.48-115.75,64.1-14.52,22.58-22.99,49.63-22.99,78.73,0,44.89,20.13,84.92,51.59,111.1,2.93,2.6,6.05,4.98,9.31,7.14,12.86,8.49,28.11,13.47,44.52,13.47,1.23,0,2.46-.03,3.68-.09,.36-.02,.71-.05,1.07-.07,.87-.05,1.75-.11,2.62-.2,.34-.03,.68-.08,1.02-.12,.91-.1,1.82-.21,2.73-.34,.21-.03,.42-.07,.63-.1,32.89-5.07,61.56-30.82,70.9-62.81v57.83c0,3.26,2.64,5.9,5.9,5.9h50.42c3.26,0,5.9-2.64,5.9-5.9V110.63c0-3.26-2.64-5.9-5.9-5.9h-56.32Zm0,206.92c-12.2,10.16-27.97,13.98-44.84,15.12-.16,.01-.33,.03-.49,.04-1.12,.07-2.24,.1-3.36,.1-42.24,0-77.12-35.89-77.12-79.37,0-10.25,1.96-20.01,5.42-28.98,11.22-29.12,38.77-49.74,71.06-49.74h49.33v142.83Z"></path>
<path
class=""
d="M2133.97,104.73h-49.33c-48.36,0-90.91,25.48-115.75,64.1-14.52,22.58-22.99,49.63-22.99,78.73,0,44.89,20.13,84.92,51.59,111.1,2.93,2.6,6.05,4.98,9.31,7.14,12.86,8.49,28.11,13.47,44.52,13.47,1.23,0,2.46-.03,3.68-.09,.36-.02,.71-.05,1.07-.07,.87-.05,1.75-.11,2.62-.2,.34-.03,.68-.08,1.02-.12,.91-.1,1.82-.21,2.73-.34,.21-.03,.42-.07,.63-.1,32.89-5.07,61.56-30.82,70.9-62.81v57.83c0,3.26,2.64,5.9,5.9,5.9h50.42c3.26,0,5.9-2.64,5.9-5.9V110.63c0-3.26-2.64-5.9-5.9-5.9h-56.32Zm0,206.92c-12.2,10.16-27.97,13.98-44.84,15.12-.16,.01-.33,.03-.49,.04-1.12,.07-2.24,.1-3.36,.1-42.24,0-77.12-35.89-77.12-79.37,0-10.25,1.96-20.01,5.42-28.98,11.22-29.12,38.77-49.74,71.06-49.74h49.33v142.83Z"></path>
<path
class=""
d="M1314.05,104.73h-49.33c-48.36,0-90.91,25.48-115.75,64.1-11.79,18.34-19.6,39.64-22.11,62.59-.58,5.3-.88,10.68-.88,16.14s.31,11.15,.93,16.59c4.28,38.09,23.14,71.61,50.66,94.52,2.93,2.6,6.05,4.98,9.31,7.14,12.86,8.49,28.11,13.47,44.52,13.47h0c17.99,0,34.61-5.93,48.16-15.97,16.29-11.58,28.88-28.54,34.48-47.75v50.26h-.11v11.08c0,21.84-5.71,38.27-17.34,49.36-11.61,11.08-31.04,16.63-58.25,16.63-11.12,0-28.79-.59-46.6-2.41-2.83-.29-5.46,1.5-6.27,4.22l-12.78,43.11c-1.02,3.46,1.27,7.02,4.83,7.53,21.52,3.08,42.52,4.68,54.65,4.68,48.91,0,85.16-10.75,108.89-32.21,21.48-19.41,33.15-48.89,35.2-88.52V110.63c0-3.26-2.64-5.9-5.9-5.9h-56.32Zm0,64.1s.65,139.13,0,143.36c-12.08,9.77-27.11,13.59-43.49,14.7-.16,.01-.33,.03-.49,.04-1.12,.07-2.24,.1-3.36,.1-1.32,0-2.63-.03-3.94-.1-40.41-2.11-74.52-37.26-74.52-79.38,0-10.25,1.96-20.01,5.42-28.98,11.22-29.12,38.77-49.74,71.06-49.74h49.33Z"></path>
<path
class="cls-1"
d="M249.83,0C113.3,0,2,110.09,.03,246.16c-2,138.19,110.12,252.7,248.33,253.5,42.68,.25,83.79-10.19,120.3-30.03,3.56-1.93,4.11-6.83,1.08-9.51l-23.38-20.72c-4.75-4.21-11.51-5.4-17.36-2.92-25.48,10.84-53.17,16.38-81.71,16.03-111.68-1.37-201.91-94.29-200.13-205.96,1.76-110.26,92-199.41,202.67-199.41h202.69V407.41l-115-102.18c-3.72-3.31-9.42-2.66-12.42,1.31-18.46,24.44-48.53,39.64-81.93,37.34-46.33-3.2-83.87-40.5-87.34-86.81-4.15-55.24,39.63-101.52,94-101.52,49.18,0,89.68,37.85,93.91,85.95,.38,4.28,2.31,8.27,5.52,11.12l29.95,26.55c3.4,3.01,8.79,1.17,9.63-3.3,2.16-11.55,2.92-23.58,2.07-35.92-4.82-70.34-61.8-126.93-132.17-131.26-80.68-4.97-148.13,58.14-150.27,137.25-2.09,77.1,61.08,143.56,138.19,145.26,32.19,.71,62.03-9.41,86.14-26.95l150.26,133.2c6.44,5.71,16.61,1.14,16.61-7.47V9.48C499.66,4.25,495.42,0,490.18,0H249.83Z"></path>
</svg>
</div>

View File

@@ -1,19 +1,22 @@
{{ $textColor := "text-gray-300" }}
{{ $fillColor := "fill-slate-400 dark:fill-slate-500" }}
{{ if .standalone }}
{{ $textColor = "text-gray-800 dark:text-gray-300 " }}
{{ $fillColor = "fill-slate-500 dark:fill-slate-400" }}
{{ end }}
<button
{{ if .standalone }}
x-data @click="$dispatch('search-toggle')"
{{ end }}
type="button"
class="grid cursor-pointer w-full text-gray-500 lg:w-56 grid-cols-[auto_1fr_auto] items-center rounded-md px-2 sm:px-4 py-2 text-left text-xs/6 lg:text-sm/6 outline-0 sm:outline-1 -outline-offset-1 outline-gray-600">
aria-label="Search"
class="{{ $textColor }} grid cursor-pointer w-full lg:w-56 grid-cols-[auto_1fr_auto] items-center rounded-md px-2 sm:px-4 py-2 text-left text-xs/6 lg:text-sm/6 outline-0 sm:outline-1 -outline-offset-1 outline-gray-600">
<svg
class="pointer-events-none -ml-0.5 mr-2 size-5 sm:size-4 fill-slate-400 dark:fill-slate-500">
class="{{ $fillColor }} pointer-events-none -ml-0.5 mr-2 size-5 sm:size-4">
<use href="#icon--search"></use>
</svg>
<span class="hidden lg:inline">Search docs</span
><kbd
class="hidden font-sans text-xs/4 text-gray-400 dark:text-gray-400 sm:[.os-macos_&amp;]:block"
><span class="text-gray-400/70 "></span>K</kbd
><kbd
class="hidden font-sans text-xs/4 text-gray-400 sm:not-[.os-macos_&amp;]:block dark:text-gray-400"
><span class="text-gray-400/70">Ctrl</span>&nbsp;K</kbd
>
<span class="hidden lg:inline">Search docs</span>
<span class="hidden lg:inline">/</span>
</button>

View File

@@ -31,15 +31,16 @@
x-model.debounce.100ms="query"
@click="search()"
type="search"
arial-label="Search"
class="text-gray-800 dark:text-gray-100 bg-white/40 dark:bg-gray-900 shadow rounded border-0 p-3 w-full"
placeholder="Search docs"
x-ref="input" />
x-ref="input">
</div>
</div>
<div class="relative mt-6 flex-1 px-4 sm:px-6">
<div class="relative mt-6 flex-1 px-4 sm:px-6 h-full">
<ul
role="list"
class="divide-y divide-gray-200 dark:divide-gray-900">
class="divide-y divide-gray-200 dark:divide-gray-900 h-[calc(100%-6rem)] overflow-y-auto">
<template
x-for="[group, entries] in Object.entries(result)"
:key="group">
@@ -75,8 +76,15 @@
</template>
</ul>
</div>
{{/* End listing */ -}}
</div>
</div>
<div
class="z-40 fixed pointer-events-auto bottom-0 right-0 dark:text-gray-300 text-gray-800 float-right mr-8 mb-4 text-sm lg:text-md"
x-show="open"
x-transition.opacity.duration.800ms>
{{ partial "layouts/search/algolialogo.html" }}
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,7 @@
<template id="anchor-heading">
<a class="hidden group-hover:inline-flex items-center" aria-label="Anchor">
<svg class="ml-2 fill-primary hover:fill-primary/70 w-4 h-4">
<use href="#icon--anchor"></use>
</svg>
</a>
</template>

View File

@@ -1,33 +1,37 @@
{{ with .Fragments.Headings }}
{{ $.Store.Set "hasToc" true }}
<div
x-data="toc"
class="sticky top-[8rem] h-screen overflow-y-auto overflow-x-hidden">
<h2
class="text-base font-semibold tracking-tight text-gray-600 dark:text-gray-400">
On this page
</h2>
<nav class="w-56 mt-2">
<ul>
{{ template "render-toc-level" . }}
</ul>
</nav>
</div>
{{ with .Fragments }}
{{ with .Headings }}
<div
x-data="toc"
class="sticky top-[8rem] h-screen overflow-y-auto overflow-x-hidden">
<h2
class="text-base font-semibold tracking-tight text-gray-600 dark:text-gray-400">
On this page
</h2>
<nav class="w-56 mt-2">
<ul>
{{ template "render-toc-level" (dict "h" . "p" $) }}
</ul>
</nav>
</div>
{{ end }}
{{ end }}
{{ define "render-toc-level" }}
{{ range . }}
{{ if and .ID (or (ge .Level 2) (lt .Level 4)) }}
{{ range .h }}
{{ if and .ID (and (ge .Level 2) (le .Level 4)) }}
{{ $indentation := "ml-0" }}
{{ if eq .Level 3 }}
{{ $indentation = "ml-2 lg:ml-3" }}
{{ else if eq .Level 4 }}
{{ $indentation = "ml-4 lg:ml-6" }}
{{ end }}
{{ $.p.Store.Set "hasToc" true }}
<li>
<a
href="#{{ .ID }}"
x-ref="{{ .ID }}"
@click.stop="setActive('{{ .ID }}')"
class="block pb-1 text-blue-600 hover:text-blue-500{{ if gt .Level 2 }}
ml-2 lg:ml-3 text-sm
{{ else }}
text-sm
{{ end }}"
class="block pb-1 text-blue-600 hover:text-blue-500 dark:text-blue-500 dark:hover:text-blue-400 text-sm {{ $indentation }}"
:class="{'font-bold dark:text-blue-200 dark:hover:text-blue-300' : activeHeading === '{{ .ID }}'}">
{{ .Title | safeHTML }}
</a>
@@ -35,7 +39,7 @@
{{ end }}
{{ with .Headings }}
<ul>
{{ template "render-toc-level" . }}
{{ template "render-toc-level" (dict "h" . "p" $.p) }}
</ul>
{{ end }}
{{ end }}

View File

@@ -1,45 +0,0 @@
{{ $news_items := slice }}
{{/* Get releases from GitHub. */}}
{{ $u := "https://api.github.com/repos/gohugoio/hugo/releases" }}
{{ $releases := partial "helpers/funcs/get-remote-data.html" $u }}
{{ $releases = where $releases "draft" false }}
{{ $releases = where $releases "prerelease" false }}
{{ range $releases | first 20 }}
{{ $publishDate := .published_at | time.AsTime }}
{{/* Correct the v0.138.0 release date. See https://github.com/gohugoio/hugo/issues/13066. */}}
{{ if eq .name "v0.138.0" }}
{{ $publishDate = "2024-11-06T11:22:34Z" | time.AsTime }}
{{ end }}
{{ $ctx := dict
"Date" $publishDate
"Title" (printf "Release %s" .name)
"LinkTitle" (printf "Release %s" .name)
"Permalink" .html_url
"RelPermalink" .html_url
"Section" "news"
"Summary" ""
}}
{{ $news_items = $news_items | append $ctx }}
{{ end }}
{{/* Get content pages from news section. */}}
{{ range .Pages }}
{{ $ctx := dict
"Date" .Date
"Title" .Title
"LinkTitle" .Title
"RelPermalink" .RelPermalink
"Section" "news"
"Summary" .Summary
"Params" (dict "description" .Description)
}}
{{ $news_items = $news_items | append $ctx }}
{{ end }}
{{/* Sort by date (descending) and render. */}}
{{ $news_items = sort $news_items "Date" "desc" }}
{{ return $news_items }}

View File

@@ -1,4 +1,4 @@
<meta property="og:title" content="{{ .Title }}" />
<meta property="og:title" content="{{ .Title }}">
<meta
property="og:description"
content="{{ with .Description }}
@@ -9,56 +9,56 @@
{{ else }}
{{ with .Site.Params.description }}{{ . }}{{ end }}
{{ end }}
{{ end }}" />
{{ end }}">
<meta
property="og:type"
content="{{ if .IsPage }}
article
{{ else }}
website
{{ end }}" />
<meta property="og:url" content="{{ .Permalink }}" />
{{ end }}">
<meta property="og:url" content="{{ .Permalink }}">
{{- with $.Params.images -}}
{{- range first 6 . }}
<meta property="og:image" content="{{ . | absURL }}" />
<meta property="og:image" content="{{ . | absURL }}">
{{ end -}}
{{- else -}}
{{- $featured := partial "opengraph/get-featured-image.html" . }}
{{- with $featured -}}
<meta property="og:image" content="{{ $featured.Permalink }}" />
<meta property="og:image" content="{{ $featured.Permalink }}">
{{- else -}}
{{- with $.Site.Params.images }}
<meta property="og:image" content="{{ index . 0 | absURL }}" />
<meta property="og:image" content="{{ index . 0 | absURL }}">
{{ end -}}
{{- end -}}
{{- end -}}
{{- if .IsPage }}
{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
<meta property="article:section" content="{{ .Section }}" />
<meta property="article:section" content="{{ .Section }}">
{{ with .PublishDate }}
<meta
property="article:published_time"
{{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />
{{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }}>
{{ end }}
{{ with .Lastmod }}
<meta
property="article:modified_time"
{{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />
{{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }}>
{{ end }}
{{- end -}}
{{- with .Params.audio }}<meta property="og:audio" content="{{ . }}" />{{ end }}
{{- with .Params.audio }}<meta property="og:audio" content="{{ . }}">{{ end }}
{{- with .Params.locale }}
<meta property="og:locale" content="{{ . }}" />
<meta property="og:locale" content="{{ . }}">
{{ end }}
{{- with .Site.Params.title }}
<meta property="og:site_name" content="{{ . }}" />
<meta property="og:site_name" content="{{ . }}">
{{ end }}
{{- with .Params.videos }}
{{- range . }}
<meta property="og:video" content="{{ . | absURL }}" />
<meta property="og:video" content="{{ . | absURL }}">
{{ end }}
{{ end }}
@@ -71,7 +71,7 @@
{{- $series := index $siteSeries ($name | urlize) }}
{{- range $page := first 6 $series.Pages }}
{{- if ne $page.Permalink $permalink }}
<meta property="og:see_also" content="{{ $page.Permalink }}" />
<meta property="og:see_also" content="{{ $page.Permalink }}">
{{ end }}
{{- end }}
{{ end }}
@@ -80,5 +80,5 @@
{{- /* Facebook Page Admin ID for Domain Insights */}}
{{- with site.Params.social.facebook_admin }}
<meta property="fb:admins" content="{{ . }}" />
<meta property="fb:admins" content="{{ . }}">
{{ end }}