Merge commit 'a024bc7d76fcc5e49e8210f9b0896db9ef21861a'

This commit is contained in:
Bjørn Erik Pedersen
2025-02-13 10:40:34 +01:00
817 changed files with 5301 additions and 14766 deletions

View File

@@ -0,0 +1,12 @@
{{- with .Params.action.aliases }}
{{- $label := "Alias" }}
{{- if gt (len .) 1 }}
{{- $label = "Aliases" }}
{{- end }}
<p class="font-bold text-dark dark:text-light mt-2">{{ $label }}</p>
{{- range . }}
<div class="font-sm font-mono ml-3 sm:ml-6 mt-0 sm:mt-1">
{{- . -}}
</div>
{{- end }}
{{- end -}}

View File

@@ -0,0 +1,6 @@
{{- with .Params.action.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">
{{- . -}}
</div>
{{- end -}}

View File

@@ -0,0 +1,12 @@
{{- with .Params.action.signatures }}
<p class="font-bold text-dark dark:text-light">Syntax</p>
{{- range . }}
{{- $signature := . }}
{{- if $.Params.function.returnType }}
{{- $signature = printf "%s ⟼ %s" . $.Params.function.returnType }}
{{- end }}
<div class="font-sm font-mono ml-3 sm:ml-6 mt-0 sm:mt-1">
{{- $signature -}}
</div>
{{- end }}
{{- end -}}

View File

@@ -0,0 +1,25 @@
{{ $colors := slice "slate" "green" "cyan" "blue" }}
{{ with .single }}
{{ $colors = slice . }}
{{ end }}
{{ $shades := slice 300 400 500 }}
{{ if not .dark }}
{{ $shades = slice 700 800 }}
{{ end }}
{{ $hash := (hash.FNV32a .text) }}
{{ $i := mod $hash (len $colors) }}
{{ $j := mod $hash (len $shades) }}
{{ $color := index $colors $i }}
{{ $shade1 := index $shades $j }}
{{ $shade2 := 0 }}
{{ $shade3 := 0 }}
{{ if gt $shade1 500 }}
{{ $shade2 = math.Min (sub $shade1 500) 100 | int }}
{{ $shade3 = sub $shade1 100 }}
{{ else }}
{{ $shade2 = math.Max (add $shade1 500) 700 | int }}
{{ $shade3 = add $shade1 200 }}
{{ end }}
{{ $res := dict "color" $color "shade1" $shade1 "shade2" $shade2 "shade3" $shade3 }}
{{ return $res }}

View File

@@ -0,0 +1,28 @@
{{ $url := "https://api.github.com/repos/gohugoio/hugo" }}
{{ $cacheKey := print $url (now.Format "2006-01-02") }}
{{ $headers := dict }}
{{ with os.Getenv "HUGO_GH_TOKEN" }}
{{ $headers = dict "Authorization" (printf "Bearer %s" .) }}
{{ end }}
{{ $opts := dict "headers" $headers "key" $cacheKey }}
{{ $githubRepoInfo := dict }}
{{ with try (resources.GetRemote $url $opts) }}
{{ with .Err }}
{{ warnf "Failed to get GitHub repo info: %s" . }}
{{ else with (.Value | transform.Unmarshal) }}
{{ $githubRepoInfo = dict
"html_url" .html_url
"stargazers_url" .stargazers_url
"watchers_count" .watchers_count
"stargazers_count" .stargazers_count
"forks_count" .forks_count
"contributors_url" .contributors_url
"releases_url" .releases_url
"forks_count" .forks_count
}}
{{ else }}
{{ errorf "Unable to get remote resource %q" $url }}
{{ end }}
{{ end }}
{{ return $githubRepoInfo }}

View File

@@ -0,0 +1,23 @@
{{/*
Parses the serialized data from the given URL and returns a map or an array.
Supports CSV, JSON, TOML, YAML, and XML.
@param {string} . The URL from which to retrieve the serialized data.
@returns {any}
@example {{ partial "get-remote-data.html" "https://example.org/foo.json" }}
*/}}
{{ $url := . }}
{{ $data := dict }}
{{ with try (resources.GetRemote $url) }}
{{ with .Err }}
{{ errorf "%s" . }}
{{ else with .Value }}
{{ $data = .Content | transform.Unmarshal }}
{{ else }}
{{ errorf "Unable to get remote resource %q" $url }}
{{ end }}
{{ end }}
{{ return $data }}

View File

@@ -0,0 +1,27 @@
{{ with site.Config.Services.GoogleAnalytics.ID }}
<script
async
src="https://www.googletagmanager.com/gtag/js?id={{ . }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
{{ $site := site.BaseURL | replaceRE "^https?://(www\\.)?([^/]+).*" "$2" }}
gtag('config', '{{ . }}', {'anonymize_ip': true, 'dimension1': '{{ $site }}', 'dimension2': '{{ getenv "BRANCH" }}'});
/**
* Function that tracks a click on an outbound link in Analytics.
* Setting the transport method to 'beacon' lets the hit be sent
* using 'navigator.sendBeacon' in browser that support it.
*/
var trackOutboundLink = function(id, url) {
gtag('event', 'click', {
'event_category': 'outbound',
'event_label': id,
'transport_type': 'beacon'
});
}
</script>
{{ end }}

View File

@@ -0,0 +1,28 @@
{{ $r := .r }}
{{ $attr := .attributes | default dict }}
{{ if hugo.IsDevelopment }}
<link
rel="stylesheet"
href="{{ $r.RelPermalink }}"
{{ template `render-attributes` $attr }} />
{{ else }}
{{ with $r | minify | fingerprint }}
<link
rel="stylesheet"
href="{{ .RelPermalink }}"
integrity="{{ .Data.Integrity }}"
crossorigin="anonymous"
{{ template `render-attributes` $attr }} />
{{ end }}
{{ end }}
{{ define "render-attributes" }}
{{- range $k, $v := . -}}
{{- if $v -}}
{{- printf ` %s=%q` $k $v | safeHTMLAttr -}}
{{- else -}}
{{- printf ` %s` $k | safeHTMLAttr -}}
{{- end -}}
{{- end -}}
{{ end }}

View File

@@ -0,0 +1,15 @@
{{ $r := .r }}
{{ $attr := .attributes | default dict }}
{{ if hugo.IsDevelopment }}
<script
src="{{ $r.RelPermalink }}"
{{ template `render-attributes` $attr }}></script>
{{ else }}
{{ with $r | fingerprint }}
<script
src="{{ .RelPermalink }}"
integrity="{{ .Data.Integrity }}"
crossorigin="anonymous"
{{ template `render-attributes` $attr }}></script>
{{ end }}
{{ end }}

View File

@@ -0,0 +1,25 @@
{{ $image := .image }}
{{ $width := .width | default 1000 }}
{{ $width1x := div $width 2 }}
{{ $imageWebp := $image.Resize (printf "%dx webp" $width) }}
{{ $image1x := $image.Resize (printf "%dx" $width1x) }}
{{ $image1xWebp := $image.Resize (printf "%dx webp" $width1x) }}
{{ $class := .class | default "h-64 tablet:h-96 lg:h-full w-full object-cover lg:absolute" }}
<picture>
<source
srcset="{{ $imageWebp.RelPermalink }}"
type="image/webp"
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" />
<img
class="{{ $class }}"
src="{{ $image1x.RelPermalink }}"
alt=""
width="{{ $image1x.Width }}"
height="{{ $image1x.Height }}" />
</picture>

View File

@@ -0,0 +1,27 @@
{{ $title := .title | default "" }}
{{ $color := .color | default "yellow" }}
{{ $icon := .icon | default "exclamation" }}
{{ $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">
<div class="shrink-0">
<svg class="fill-{{ $color }}-500 dark:fill-{{ $color }}-400 h-7 w-7">
<use href="#icon--{{ $icon }}"></use>
</svg>
</div>
<div class="ml-3">
{{ with $title }}
<h3 class="text-{{ $color }}-800">
{{ . }}
</h3>
{{ end }}
<div class="mt-2">
<p>
{{ $text }}
</p>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,30 @@
<div x-data="{open: false}">
<div @click="open = true">
{{ .modal_button }}
</div>
<div
x-cloak
x-show="open"
x-transition:enter.opacity.duration.200ms
x-transition:leave.opacity.duration.300ms
x-trap.inert.noscroll="open"
@keydown.esc.window="open = false"
@click.self="open = false"
class="fixed inset-0 z-30 flex items-end justify-center bg-black/50 pb-8 backdrop-blur-xs sm:items-center"
role="dialog"
aria-modal="true"
aria-label="Modal">
<div
x-show="open"
x-transition:enter.opacity.scale.60.origin.top.right.duration.300ms.delay.200ms
class="flex content-center items-center justify-center max-w-lg flex-col overflow-hidden bg-white dark:bg-blue-950 border-2 border-gray-300 dark:border-gray-800 shadow-lg sm:shadow-xl">
<div
class="border-b border-outline border-gray-300 dark:border-gray-800 p-2 lg:p-4">
<h3 class="text-sm font-semibold">
{{ .modal_title }}
</h3>
</div>
{{ .modal_content }}
</div>
</div>
</div>

View File

@@ -0,0 +1,44 @@
{{ $documentation := site.GetPage "/documentation" }}
<nav aria-label="breadcrumb" class="flex breadcrumbs">
<ol class="inline-flex items-center flex-wrap tracking-tight">
{{ $currentSection := .CurrentSection }}
{{ $ancestors := .Ancestors.Reverse }}
{{ range $i, $p := $ancestors }}
{{ $isCurrentSection := eq $p $currentSection }}
{{/* We currently have a slightly odd structure. */}}
{{ if eq $p site.Home }}
{{ $p = $documentation }}
{{ end }}
<li class="flex items-center">
{{ $isLast := eq $i (sub (len $ancestors) 1) }}
<a
href="{{ $p.RelPermalink }}"
class="truncate text-blue-600 hover:text-blue-500 {{ if $isCurrentSection }}
current-section
{{ end }}"
>{{ $p.LinkTitle }}</a
>
{{ if ne $ $documentation }}
{{ template "breadcrumbs-arrow" . }}
{{ end }}
</li>
{{ end }}
{{ if ne $ $documentation }}
{{ $isCurrentSection := eq $ $currentSection }}
<li
class="truncate text-gray-700 dark:text-gray-300 {{ if $isCurrentSection }}
current-section
{{ end }}">
{{ $.LinkTitle }}
</li>
{{ end }}
</ol>
</nav>
{{ define "breadcrumbs-arrow" }}
<svg class="fill-gray-500 dark:fill-gray-100 w-3 h-3 mx-2">
<use href="#icon--chevron-right"></use>
</svg>
{{ end }}

View File

@@ -0,0 +1,9 @@
<header>
{{ partial "layouts/breadcrumbs.html" . }}
{{ if and .IsPage (not (eq .Layout "list")) }}
<h1
class="font-display mt-6 sm:mt-8 text-3xl tracking-tight text-slate-900 dark:text-white">
{{ .Title }}
</h1>
{{ end }}
</header>

View File

@@ -0,0 +1,47 @@
{{/* This is currently not in use, but kept in case I change my mind. */}}
<nav
role="navigation"
id="explorer"
class="overflow-x-hidden w-54"
x-data="explorer"
data-turbo-permanent
@turbo:load.window="onLoad()"
@turbo:before-render.window="onBeforeRender()"
x-cloak>
<ul class="w-full">
{{ $root := site.GetPage "/" }}
{{ template "docs-explorer-section" (dict "p" $root "level" 0 ) }}
</ul>
</nav>
{{ define "docs-explorer-section" }}
{{ $p := .p }}
{{ $level := .level }}
{{ $pleft := $level }}
{{ if gt $level 0 }}
{{ $pleft = add $level 1 }}
{{ end }}
{{ $pl := printf "pl-%d" $pleft }}
{{ $pages := $p.Sections }}
{{ range $pages }}
{{ $hasChildren := gt (len .Pages) 0 }}
{{ $class := cond (eq $level 0) "text-primary hover:text-primary/70" "text-gray-900 dark:text-gray-400 hover:dark:text-gray-300" }}
<li class="w-full">
<a
@click="toggleNode('{{ .RelPermalink }}')"
href="{{ .RelPermalink }}"
x-ref="{{ .RelPermalink }}"
:class="isCurrent('{{ .RelPermalink }}') ? 'font-bold underline': 'font-normal'"
class="block cursor-pointer {{ $pl }} {{ $class }} focus:font-bold hover:underline focus:underline tracking-tight leading-7">
{{ .LinkTitle }}
</a>
{{ if $hasChildren }}
<ul class="w-full" x-show="isOpen('{{ .RelPermalink }}')">
{{ template "docs-explorer-section" (dict "p" . "level" (add $level 1)) }}
</ul>
{{ end }}
</li>
{{ end }}
{{ end }}

View File

@@ -0,0 +1,72 @@
<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 */}}
<div class="flex flex-col items-center justify-between space-y-8">
<div class="text-gray-200">
By the
<a
href="https://github.com/gohugoio/hugo/graphs/contributors"
class="text-blue-300 hover:underline"
>Hugo Authors</a
><br />
</div>
<img
src="/images/hugo-logo-wide.svg"
alt="Hugo Logo"
class="aspect-3/1 w-40" />
<ul class="space-y-2 text-gray-200">
<li class="hover:text-white">
<a href="https://fosstodon.org/@gohugoio" class="">@GoHugoIO</a>
</li>
<li class="hover:text-white">
<a href="https://twitter.com/spf13" class="">@spf13</a>
</li>
<li class="hover:text-white">
<a href="https://twitter.com/bepsays" class="">@bepsays</a>
</li>
<li class="mt-6">
<a
href="https://github.com/gohugoio/hugo/issues/new"
class="text-sm/6 text-gray-200 hover:text-white"
>File an issue</a
>
</li>
<li>
<a
href="https://discourse.gohugo.io/"
class="text-sm/6 text-gray-200 hover:text-white"
>Get help</a
>
</li>
<li>
<a
href="https://themes.gohugo.io/"
class="text-sm/6 text-gray-200 hover:text-white"
>Find a theme</a
>
</li>
</ul>
</div>
{{/* Sponsors */}}
<div
class="mt-16 xl:mt-0 col-span-2 text-gray-200 max-w-3xl flex items-center content-center justify-center mx-auto">
{{ partial "layouts/home/sponsors.html" (dict
"ctx" .
"gtag" "footer"
)
}}
</div>
</div>
<div class="mt-16 border-t border-white/10 pt-8 sm:mt-20 lg:mt-24">
<p class="text-sm/6 text-gray-200">
The Hugo logos are copyright © Steve Francia 2013{{ now.Year }}. The
Hugo Gopher is based on an original work by Renée French.
</p>
</div>
</div>
</footer>

View File

@@ -0,0 +1,11 @@
{{ $githubInfo := partialCached "helpers/funcs/get-github-info.html" . "-" }}
{{ $opts := dict "minify" true }}
{{ with resources.Get "js/head-early.js" | js.Build $opts }}
{{ partial "helpers/linkjs.html" (dict "r" . "attributes" (dict "async" "")) }}
{{ end }}
{{ with resources.Get "js/main.js" | js.Build $opts }}
{{ partial "helpers/linkjs.html" (dict "r" . "attributes" (dict "defer" "")) }}
{{ end }}
{{ with resources.Get "js/turbo.js" | js.Build $opts }}
{{ partial "helpers/linkjs.html" (dict "r" . "attributes" (dict "defer" "")) }}
{{ end }}

View File

@@ -0,0 +1,52 @@
<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 }}
{{ if hugo.IsProduction }}
<meta name="robots" content="index, follow" />
{{ else }}
<meta name="robots" content="noindex, nofollow" />
{{ end }}
<title>
{{ with .Title }}{{ . }} |{{ end }}
{{ .Site.Title }}
</title>
<link rel=apple-touch-icon sizes=180x180 href=/apple-touch-icon.png>
<link rel=icon type=image/png href=/favicon-32x32.png sizes=32x32>
<link rel=icon type=image/png href=/favicon-16x16.png sizes=16x16>
<link rel=manifest href=/manifest.json>
<link rel=mask-icon href=/safari-pinned-tab.svg color=#0594cb>
<meta name="turbo-prefetch" content="true">
<meta name="view-transition" content="same-origin">
{{ range .AlternativeOutputFormats -}}
<link
rel="{{ .Rel }}"
type="{{ .MediaType.Type }}"
href="{{ .RelPermalink | safeURL }}" />
{{ end -}}
<meta
name="description"
content="{{ with .Description }}
{{ . }}
{{ else }}
{{ with .Site.Params.description }}{{ . }}{{ end }}
{{ end }}
" />
{{ partial "opengraph/opengraph.html" . }}
{{- template "_internal/schema.html" . -}}
{{- template "_internal/twitter_cards.html" . -}}
{{ if hugo.IsProduction }}
{{ partial "helpers/gtag.html" . }}
{{ end }}

View File

@@ -0,0 +1,16 @@
{{ with partialCached "helpers/funcs/get-github-info.html" . "-" }}
<a
href="{{ .html_url | safeURL }}"
target="_blank"
class="font-normal font-mono tracking-tighter flex items-center bg-gray-100 hover:bg-gray-200 dark:bg-gray-600 dark:hover:bg-gray-700 text-sm text-black dark:text-white h-10 border-none cursor-pointer relative py-1 px-2 rounded-md"
aria-label="Star on GitHub">
<svg class="mr-[4px] fill-gray-800 dark:fill-gray-100 w-6 h-6">
<use href="#icon--github"></use>
</svg>
<span class="hidden md:inline mr-[3px]">Star</span>
<span class="hidden md:inline">{{ .stargazers_count }}</span>
<span class="inline md:hidden">
{{ printf "%0.1fk" (div .stargazers_count 1000) }}
</span>
</a>
{{ end }}

View File

@@ -0,0 +1,44 @@
<header
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">
{{ with site.Home }}
<a
class="text-white text-xl font-bold upper"
href="{{ .RelPermalink }}"
aria-label="{{ .LinkTitle }}"
>HUGO</a
>
{{ end }}
</div>
<div
class=" relative flex flex-grow basis-0 items-center min-w-24 max-w-3xl overflow-x-auto">
{{ range .Site.Menus.global }}
<a
href="{{ .URL }}"
class="font-semibold text-gray-300 hover:text-gray-400 ml-4"
>{{ .Name }}</a
>
{{ end }}
</div>
<div class="-my-5 pl-2 grow-0">
{{/* Search. */}}
{{ partial "layouts/search/input.html" . }}
</div>
<div
class="relative ml-0 md:ml-8 flex basis-0 justify-end gap-0 sm:gap-1 xl:grow-1">
{{/* QR code. */}}
{{ partial "layouts/header/qr.html" . }}
{{/* Theme selector. */}}
{{ partial "layouts/header/theme.html" . }}
{{/* Social. */}}
<div
class="hidden sm:block ml-2 sm:ml-6 h-6 fill-slate-400 group-hover:fill-slate-500 dark:group-hover:fill-slate-300">
{{ partial "layouts/header/githubstars.html" . }}
</div>
</div>
</header>

View File

@@ -0,0 +1,25 @@
{{ $t := debug.Timer "qr" }}
{{ $qr := partial "partials/_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") }}
{{ $t.Stop }}
<div
class="hidden lg:block cursor-pointer outline-2 hover:outline-3 outline-blue-500 w-10 h-10">
{{ partial "layouts/blocks/modal.html" (dict "modal_button" $qr "modal_content" $qrBig "modal_title" (printf "QR code linking to %s" $.Permalink )) }}
</div>
{{ define "partials/_inline/qr" }}
{{ $img_class := .img_class | default "w-10" }}
{{ with images.QR $.page.Permalink (dict "targetDir" "images/qr") }}
<img
src="{{ .RelPermalink }}"
width="{{ .Width }}"
height="{{ .Height }}"
@load="$event.target.classList.remove('_opacity-0')"
alt="QR code linking to {{ $.page.Permalink }}"
class="{{ $img_class }}" />
{{ end }}
{{ end }}

View File

@@ -0,0 +1,35 @@
<div class="ml-2 sm:ml-6 flex items-center" x-data>
<button
@click="$store.nav.userSettings.toggleColorScheme()"
aria-label="Toggle color scheme"
id="theme-toggle"
type="button"
class="inline-flex cursor-pointer items-center p-2 bg-orange-600 hover:bg-orange-700 dark:bg-gray-600 dark:hover:bg-gray-700 border border-transparent rounded-full shadow-sm text-white hover:text-gray-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-slate-500">
<svg
aria-hidden="true"
class="w-3 h-3 sm:w-5 sm:h-5"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg">
<path
x-show="$store.nav.userSettings.colorScheme() == 1"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"></path>
<path
x-show="$store.nav.userSettings.colorScheme() == 2"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"></path>
<path
x-show="$store.nav.userSettings.colorScheme() == 3"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"></path>
</svg>
</button>
</div>

View File

@@ -0,0 +1,56 @@
{{/* icons source: https://heroicons.com/ */}}
{{ $dataTOML := `
[[features]]
heading = "Optimized for speed"
copy = "Written in Go, optimized for speed and designed for flexibility. With its advanced templating system and fast asset pipelines, Hugo renders a large site in seconds, often less."
icon = """<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M15.59 14.37a6 6 0 0 1-5.84 7.38v-4.8m5.84-2.58a14.98 14.98 0 0 0 6.16-12.12A14.98 14.98 0 0 0 9.631 8.41m5.96 5.96a14.926 14.926 0 0 1-5.841 2.58m-.119-8.54a6 6 0 0 0-7.381 5.84h4.8m2.581-5.84a14.927 14.927 0 0 0-2.58 5.84m2.699 2.7c-.103.021-.207.041-.311.06a15.09 15.09 0 0 1-2.448-2.448 14.9 14.9 0 0 1 .06-.312m-2.24 2.39a4.493 4.493 0 0 0-1.757 4.306 4.493 4.493 0 0 0 4.306-1.758M16.5 9a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z" />
</svg>
"""
[[features]]
heading = "Flexible framework"
copy = "With its multilingual support, and powerful taxonomy system, Hugo is widely used to create documentation sites, landing pages, corporate, government, nonprofit, education, news, event, and project sites."
icon = """<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125" />
</svg>
"""
[[features]]
heading = "Fast assets pipeline"
copy = "Image processing (convert, resize, crop, rotate, adjust colors, apply filters, overlay text and images, and extract EXIF data), JavaScript bundling (tree shake, code splitting), Sass processing, great TailwindCSS support."
icon = """<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
<path stroke-linecap="round" stroke-linejoin="round" d="m2.25 15.75 5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5 1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H3.75A1.5 1.5 0 0 0 2.25 6v12a1.5 1.5 0 0 0 1.5 1.5Zm10.5-11.25h.008v.008h-.008V8.25Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z" />
</svg>
"""
[[features]]
heading = "Embedded web server"
copy = "Use Hugo's embedded web server during development to instantly see changes to content, structure, behavior, and presentation. "
icon = """<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M12 21a9.004 9.004 0 0 0 8.716-6.747M12 21a9.004 9.004 0 0 1-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 0 1 7.843 4.582M12 3a8.997 8.997 0 0 0-7.843 4.582m15.686 0A11.953 11.953 0 0 1 12 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0 1 21 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0 1 12 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 0 1 3 12c0-1.605.42-3.113 1.157-4.418" />
</svg>
"""
`
}}
{{ $data := $dataTOML | transform.Unmarshal }}
<div class="mx-auto max-w-7xl px-6 lg:px-8">
<div class="mx-auto max-w-2xl lg:max-w-4xl">
<dl
class="grid max-w-xl grid-cols-1 gap-x-8 gap-y-10 lg:max-w-none lg:grid-cols-2 lg:gap-y-16">
{{ range $data.features }}
<div class="relative pl-16">
<dt
class="text-base/7 font-semibold text-gray-900 dark:text-gray-300">
<div
class="absolute top-0 left-0 flex size-10 items-center justify-center rounded-full bg-blue-600 p-2 fill-white text-white">
{{ .icon | safeHTML }}
</div>
{{ .heading }}
</dt>
<dd class="mt-2 text-base/7 text-gray-600 dark:text-gray-400">
{{ .copy }}
</dd>
</div>
{{ end }}
</dl>
</div>
</div>

View File

@@ -0,0 +1,110 @@
{{ $githubInfo := partialCached "helpers/funcs/get-github-info.html" . "-" }}
<div class="mx-auto max-w-7xl px-6 lg:px-8">
<div
class="mx-auto grid max-w-2xl grid-cols-1 gap-x-8 gap-y-10 lg:mx-0 lg:max-w-none lg:grid-cols-2">
<div class="lg:pr-8">
<div class="lg:max-w-lg">
<p
class="text-4xl font-bold tracking-tight text-pretty text-gray-900 dark:text-gray-300 sm:text-5xl">
Open source
</p>
<p class="mt-6 text-lg/8 text-gray-600 dark:text-gray-400">
Hugo is open source and free to use. It is distributed under the
Apache 2.0 License.
</p>
<dl
class="mt-10 max-w-xl space-y-8 text-base/7 text-gray-600 dark:text-gray-300 lg:max-w-none">
<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"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
class="size-6">
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M6 20.25h12m-7.5-3v3m3-3v3m-10.125-3h17.25c.621 0 1.125-.504 1.125-1.125V4.875c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125Z" />
</svg>
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
<a
class="text-blue-600 hover:text-blue-700 font-semibold"
href="https://github.com/gohugoio/hugo"
>Star button</a
>.
</dd>
</div>
<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"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
class="size-6">
<path
stroke-linecap="round"
stroke-linejoin="round"
d="m20.893 13.393-1.135-1.135a2.252 2.252 0 0 1-.421-.585l-1.08-2.16a.414.414 0 0 0-.663-.107.827.827 0 0 1-.812.21l-1.273-.363a.89.89 0 0 0-.738 1.595l.587.39c.59.395.674 1.23.172 1.732l-.2.2c-.212.212-.33.498-.33.796v.41c0 .409-.11.809-.32 1.158l-1.315 2.191a2.11 2.11 0 0 1-1.81 1.025 1.055 1.055 0 0 1-1.055-1.055v-1.172c0-.92-.56-1.747-1.414-2.089l-.655-.261a2.25 2.25 0 0 1-1.383-2.46l.007-.042a2.25 2.25 0 0 1 .29-.787l.09-.15a2.25 2.25 0 0 1 2.37-1.048l1.178.236a1.125 1.125 0 0 0 1.302-.795l.208-.73a1.125 1.125 0 0 0-.578-1.315l-.665-.332-.091.091a2.25 2.25 0 0 1-1.591.659h-.18c-.249 0-.487.1-.662.274a.931.931 0 0 1-1.458-1.137l1.411-2.353a2.25 2.25 0 0 0 .286-.76m11.928 9.869A9 9 0 0 0 8.965 3.525m11.928 9.868A9 9 0 1 1 8.965 3.525" />
</svg>
Active.
</dt>
<dd class="inline ml-1">
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"
href="https://discourse.gohugo.io"
>Hugo forums</a
>.
</dd>
</div>
<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"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
class="size-6">
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 0 1-1.125-1.125M3.375 19.5h1.5C5.496 19.5 6 18.996 6 18.375m-3.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-1.5A1.125 1.125 0 0 1 18 18.375M20.625 4.5H3.375m17.25 0c.621 0 1.125.504 1.125 1.125M20.625 4.5h-1.5C18.504 4.5 18 5.004 18 5.625m3.75 0v1.5c0 .621-.504 1.125-1.125 1.125M3.375 4.5c-.621 0-1.125.504-1.125 1.125M3.375 4.5h1.5C5.496 4.5 6 5.004 6 5.625m-3.75 0v1.5c0 .621.504 1.125 1.125 1.125m0 0h1.5m-1.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m1.5-3.75C5.496 8.25 6 7.746 6 7.125v-1.5M4.875 8.25C5.496 8.25 6 8.754 6 9.375v1.5m0-5.25v5.25m0-5.25C6 5.004 6.504 4.5 7.125 4.5h9.75c.621 0 1.125.504 1.125 1.125m1.125 2.625h1.5m-1.5 0A1.125 1.125 0 0 1 18 7.125v-1.5m1.125 2.625c-.621 0-1.125.504-1.125 1.125v1.5m2.625-2.625c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125M18 5.625v5.25M7.125 12h9.75m-9.75 0A1.125 1.125 0 0 1 6 10.875M7.125 12C6.504 12 6 12.504 6 13.125m0-2.25C6 11.496 5.496 12 4.875 12M18 10.875c0 .621-.504 1.125-1.125 1.125M18 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m-12 5.25v-5.25m0 5.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125m-12 0v-1.5c0-.621-.504-1.125-1.125-1.125M18 18.375v-5.25m0 5.25v-1.5c0-.621.504-1.125 1.125-1.125M18 13.125v1.5c0 .621.504 1.125 1.125 1.125M18 13.125c0-.621.504-1.125 1.125-1.125M6 13.125v1.5c0 .621-.504 1.125-1.125 1.125M6 13.125C6 12.504 5.496 12 4.875 12m-1.5 0h1.5m-1.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M19.125 12h1.5m0 0c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h1.5m14.25 0h1.5" />
</svg>
Frequent releases.
</dt>
<dd class="inline ml-1">
Hugo has a fast
<a
class="text-blue-600 hover:text-blue-700 font-semibold"
href="https://github.com/gohugoio/hugo/releases"
>release</a
>
cycle. The project is actively maintained and new features are
added regularly.
</dd>
</div>
</dl>
</div>
</div>
{{ partial "helpers/picture.html" (dict
"image" (resources.Get "images/hugo-github-screenshot.png")
"alt" "Hugo GitHub Repository"
"width" 640
"class" "w-full max-w-[38rem] ring-1 shadow-xl dark:shadow-gray-500 ring-gray-400/10")
}}
</div>
</div>

View File

@@ -0,0 +1,43 @@
{{ $gtag := .gtag | default "unknown" }}
{{ $gtag := .gtag | default "unknown" }}
{{ $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>
<div class="grid grid-cols-1 lg:grid-cols-3 gap-x-8 gap-y-6">
{{ range .banners }}
<div class="max-w-64" style="background-color: {{ .bgcolor }};">
{{ $query_params := .query_params | default "" }}
{{ $url := .link }}
{{ if not .no_query_params }}
{{ $url = printf "%s?%s%s" .link $query_params (querify "utm_source" (.utm_source | default $utmSource ) "utm_medium" (.utm_medium | default "banner") "utm_campaign" (.utm_campaign | default "hugosponsor") "utm_content" (.utm_content | default "gohugoio")) | safeURL }}
{{ end }}
{{ $logo := resources.Get .logo }}
{{ $gtagID := printf "Sponsor %s %s" .name $gtag | title }}
<a
href="{{ $url }}"
title="{{ .title | default .name }}"
class="group inline-block w-full h-full shadow-md dark:shadow-gray-600"
{{ with .link_attr }}{{ . | safeHTMLAttr }}{{ end }}>
<div
class="flex w-full h-full p-8 items-center justify-center content-center transition duration-500 hover:scale-105 {{ if .show_on_hover }}
invisible group-hover:visible
{{ end }}">
{{ with $logo }}
{{ .Content | safeHTML }}
{{ else }}
<span class="text-4xl font-bold text-white">
{{ .name }}
</span>
{{ end }}
</div>
</a>
</div>
{{ end }}
</div>
</div>
{{ end }}

View File

@@ -0,0 +1 @@
{{/* Empty for now */}}

View File

@@ -0,0 +1,3 @@
{{ with resources.Get "js/body-start.js" | js.Build (dict "minify" true) }}
{{ partial "helpers/linkjs.html" (dict "r" . "attributes" (dict "" "")) }}
{{ end }}

View File

@@ -0,0 +1,53 @@
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="icon--chevron-right" viewBox="0 0 20 20">
<path
fill-rule="evenodd"
d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
clip-rule="evenodd"></path>
</symbol>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="icon--search" viewBox="0 0 20 20">
<path
d="M16.293 17.707a1 1 0 0 0 1.414-1.414l-1.414 1.414ZM9 14a5 5 0 0 1-5-5H2a7 7 0 0 0 7 7v-2ZM4 9a5 5 0 0 1 5-5V2a7 7 0 0 0-7 7h2Zm5-5a5 5 0 0 1 5 5h2a7 7 0 0 0-7-7v2Zm8.707 12.293-3.757-3.757-1.414 1.414 3.757 3.757 1.414-1.414ZM14 9a4.98 4.98 0 0 1-1.464 3.536l1.414 1.414A6.98 6.98 0 0 0 16 9h-2Zm-1.464 3.536A4.98 4.98 0 0 1 9 14v2a6.98 6.98 0 0 0 4.95-2.05l-1.414-1.414Z" />
</symbol>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="icon--anchor" viewBox="0 0 24 24">
<path d="M0 0h24v24H0z" fill="none" />
<path
d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z" />
</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
fill="none"
stroke="currentColor"
stroke-width="1.5"
aria-hidden="true"
stroke-linecap="round"
stroke-linejoin="round"
d="M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 002.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 00-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25zM6.75 12h.008v.008H6.75V12zm0 3h.008v.008H6.75V15zm0 3h.008v.008H6.75V18z"></path>
</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>

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@@ -0,0 +1,32 @@
{{- with .CurrentSection.RegularPages }}
{{ $hasTocOrRelated := or ($.Store.Get "hasToc") ($.Store.Get "hasRelated") }}
<div
class="overflow-y-auto {{ if $hasTocOrRelated }}
max-h-96
{{ else }}
sticky top-[8rem] max-h-[70vh]
{{ end }} relative mt-2 mb-8"
data-turbo-preserve-scroll-container="in-this-section">
<h2
class="text-base font-semibold tracking-tight text-gray-600 dark:text-gray-400">
In this section
</h2>
<ul id="in-sthis-section" class="mt-2">
{{- range . }}
<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
{{ else }}
text-blue-600 hover:text-blue-500
{{ end }}"
href="{{ .RelPermalink }}"
>{{ .LinkTitle }}</a
>
</li>
{{- end }}
</ul>
</div>
{{- end }}

View File

@@ -0,0 +1,24 @@
<div class="print:hidden">
<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:
{{ .Lastmod.Format "January 2, 2006" }}{{ with .GitInfo }}
:
<a
class="text-blue-600 hover:text-blue-500"
href="{{ $.Site.Params.ghrepo }}commit/{{ .Hash }}"
>{{ .Subject }} ({{ .AbbreviatedHash }})</a
>
{{ end }}
</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>
{{ end }}
</div>

View File

@@ -0,0 +1,37 @@
{{- $heading := "See also" }}
{{- $related := slice }}
{{- 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
class="text-base font-semibold tracking-tight text-gray-600 dark:text-gray-400">
{{ $heading }}
</h2>
<ul class="mt-2 mb-8">
{{- range . }}
<li>
<a
class="text-sm text-blue-600 hover:text-blue-500"
href="{{ .RelPermalink }}"
>{{ .LinkTitle }}</a
>
</li>
{{- end }}
</ul>
{{- end }}

View File

@@ -0,0 +1,19 @@
<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">
<svg
class="pointer-events-none -ml-0.5 mr-2 size-5 sm:size-4 fill-slate-400 dark:fill-slate-500">
<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
>
</button>

View File

@@ -0,0 +1,4 @@
<div x-data="search" class="flex w-full">
{{ partial "layouts/search/button.html" (dict "page" . "standalone" false) }}
{{ partial "layouts/search/results.html" . }}
</div>

View File

@@ -0,0 +1,82 @@
<div
class="fixed inset-0 overflow-hidden z-20"
:class="{'fixed': open}"
aria-label="Search docs"
role="dialog"
aria-modal="true"
@keydown.right="$focus.next()"
@keydown.left="$focus.previous()"
@keydown.esc="open=false"
x-cloak>
<div class="absolute inset-0 overflow-hidden z-20" x-show="open">
<div class="absolute inset-0" aria-hidden="true"></div>
<div
class="pointer-events-none fixed inset-y-0 right-0 flex max-w-full pl-10"
@click.outside="open = false">
<div
class="pointer-events-auto w-screen max-w-md"
x-show="open"
x-transition:enter="transform transition ease-in-out duration-300 sm:duration-500"
x-transition:enter-start="translate-x-full"
x-transition:enter-end="translate-x-0"
x-transition:leave="transform transition ease-in-out duration-300 sm:duration-500"
x-transition:leave-start="translate-x-0"
x-transition:leave-end="translate-x-full">
<div
class="flex h-full flex-col overflow-y-scroll dark:bg-blue-950/96 bg-white py-6 shadow-sm dark:shadow-gray-800">
<div class="px-4 sm:px-6">
<div class="flex items-start justify-between">
<input
x-model.debounce.100ms="query"
@click="search()"
type="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" />
</div>
</div>
<div class="relative mt-6 flex-1 px-4 sm:px-6">
<ul
role="list"
class="divide-y divide-gray-200 dark:divide-gray-900">
<template
x-for="[group, entries] in Object.entries(result)"
:key="group">
<li class="py-4">
<div
class="mb-1 dark:text-gray-300 font-semibold uppercase tracking-widest text-sm"
x-text="group"></div>
<template x-for="entry in entries" :key="entry.objectID">
<a
class="flex flex-nowrap space-x-4 py-2 text-sm leading-5 text-gray-900 dark:text-gray-500 hover:dark:text-gray-800 hover:bg-gray-50 dark:hover:bg-gray-500 focus:outline-none focus:bg-gray-50 dark:focus:bg-gray-800 cursor-pointer transition duration-150 ease-in-out"
:href="entry.url">
<span
class="w-1/3 text-xs text-right text-gray-500 dark:text-gray-300"
x-text="entry.hierarchy.lvl1">
</span>
<div class="w-2/3">
<h3
class="text-md font-bold"
x-html="entry.getHeadingHTML()"></h3>
<template
x-if="entry._snippetResult && entry._snippetResult.content">
<div class="two-lines-ellipsis mt-1">
<span></span>
<span x-html="entry._snippetResult.content.value">
</span>
<span></span>
</div>
</template>
</div>
</a>
</template>
</li>
</template>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,42 @@
{{ 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>
{{ end }}
{{ define "render-toc-level" }}
{{ range . }}
{{ if and .ID (or (ge .Level 2) (lt .Level 4)) }}
<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="{'font-bold dark:text-blue-200 dark:hover:text-blue-300' : activeHeading === '{{ .ID }}'}">
{{ .Title | safeHTML }}
</a>
</li>
{{ end }}
{{ with .Headings }}
<ul>
{{ template "render-toc-level" . }}
</ul>
{{ end }}
{{ end }}
{{ end }}

View File

@@ -0,0 +1,45 @@
{{ $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

@@ -0,0 +1,26 @@
{{ $images := $.Resources.ByType "image" }}
{{ $featured := $images.GetMatch "*feature*" }}
{{ if not $featured }}
{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}
{{ end }}
{{ if not $featured }}
{{ $featured = resources.Get "/opengraph/gohugoio-card-base-1.png" }}
{{ $size := 80 }}
{{ $title := $.LinkTitle }}
{{ if gt (len $title) 20 }}
{{ $size = 70 }}
{{ end }}
{{ $text := $title }}
{{ $textOptions := dict
"color" "#FFF"
"size" $size
"lineSpacing" 10
"x" 65 "y" 80
"font" (resources.Get "/opengraph/mulish-black.ttf")
}}
{{ $featured = $featured | images.Filter (images.Text $text $textOptions) }}
{{ end }}
{{ return $featured }}

View File

@@ -0,0 +1,84 @@
<meta property="og:title" content="{{ .Title }}" />
<meta
property="og:description"
content="{{ with .Description }}
{{ . }}
{{ else }}
{{ if .IsPage }}
{{ .Summary }}
{{ else }}
{{ with .Site.Params.description }}{{ . }}{{ end }}
{{ end }}
{{ end }}" />
<meta
property="og:type"
content="{{ if .IsPage }}
article
{{ else }}
website
{{ end }}" />
<meta property="og:url" content="{{ .Permalink }}" />
{{- with $.Params.images -}}
{{- range first 6 . }}
<meta property="og:image" content="{{ . | absURL }}" />
{{ end -}}
{{- else -}}
{{- $featured := partial "opengraph/get-featured-image.html" . }}
{{- with $featured -}}
<meta property="og:image" content="{{ $featured.Permalink }}" />
{{- else -}}
{{- with $.Site.Params.images }}
<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 }}" />
{{ with .PublishDate }}
<meta
property="article:published_time"
{{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />
{{ end }}
{{ with .Lastmod }}
<meta
property="article:modified_time"
{{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />
{{ end }}
{{- end -}}
{{- with .Params.audio }}<meta property="og:audio" content="{{ . }}" />{{ end }}
{{- with .Params.locale }}
<meta property="og:locale" content="{{ . }}" />
{{ end }}
{{- with .Site.Params.title }}
<meta property="og:site_name" content="{{ . }}" />
{{ end }}
{{- with .Params.videos }}
{{- range . }}
<meta property="og:video" content="{{ . | absURL }}" />
{{ end }}
{{ end }}
{{- /* If it is part of a series, link to related articles */}}
{{- $permalink := .Permalink }}
{{- $siteSeries := .Site.Taxonomies.series }}
{{ with .Params.series }}
{{- range $name := . }}
{{- $series := index $siteSeries ($name | urlize) }}
{{- range $page := first 6 $series.Pages }}
{{- if ne $page.Permalink $permalink }}
<meta property="og:see_also" content="{{ $page.Permalink }}" />
{{ end }}
{{- end }}
{{ end }}
{{ end }}
{{- /* Facebook Page Admin ID for Domain Insights */}}
{{- with site.Params.social.facebook_admin }}
<meta property="fb:admins" content="{{ . }}" />
{{ end }}