mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-31 22:41:53 +02:00
Merge commit 'b3d87dd0fd746f07f9afa6e6a2969aea41da6a38'
This commit is contained in:
12
docs/layouts/_partials/docs/functions-aliases.html
Normal file
12
docs/layouts/_partials/docs/functions-aliases.html
Normal file
@@ -0,0 +1,12 @@
|
||||
{{- with .Params.functions_and_methods.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 -}}
|
6
docs/layouts/_partials/docs/functions-return-type.html
Normal file
6
docs/layouts/_partials/docs/functions-return-type.html
Normal file
@@ -0,0 +1,6 @@
|
||||
{{- 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">
|
||||
{{- . -}}
|
||||
</div>
|
||||
{{- end -}}
|
12
docs/layouts/_partials/docs/functions-signatures.html
Normal file
12
docs/layouts/_partials/docs/functions-signatures.html
Normal file
@@ -0,0 +1,12 @@
|
||||
{{- with .Params.functions_and_methods.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 -}}
|
23
docs/layouts/_partials/helpers/debug/list-item-metadata.html
Normal file
23
docs/layouts/_partials/helpers/debug/list-item-metadata.html
Normal 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>
|
25
docs/layouts/_partials/helpers/funcs/color-from-string.html
Normal file
25
docs/layouts/_partials/helpers/funcs/color-from-string.html
Normal 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 }}
|
28
docs/layouts/_partials/helpers/funcs/get-github-info.html
Normal file
28
docs/layouts/_partials/helpers/funcs/get-github-info.html
Normal 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 }}
|
24
docs/layouts/_partials/helpers/funcs/get-remote-data.html
Normal file
24
docs/layouts/_partials/helpers/funcs/get-remote-data.html
Normal file
@@ -0,0 +1,24 @@
|
||||
{{/* prettier-ignore-start */ -}}
|
||||
{{/*
|
||||
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" }}
|
||||
*/}}
|
||||
{{/* prettier-ignore-end */ -}}
|
||||
{{ $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 }}
|
27
docs/layouts/_partials/helpers/gtag.html
Normal file
27
docs/layouts/_partials/helpers/gtag.html
Normal 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 }}
|
28
docs/layouts/_partials/helpers/linkcss.html
Normal file
28
docs/layouts/_partials/helpers/linkcss.html
Normal 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 }}
|
15
docs/layouts/_partials/helpers/linkjs.html
Normal file
15
docs/layouts/_partials/helpers/linkjs.html
Normal 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 }}
|
27
docs/layouts/_partials/helpers/picture.html
Normal file
27
docs/layouts/_partials/helpers/picture.html
Normal file
@@ -0,0 +1,27 @@
|
||||
{{ $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" }}
|
||||
{{ $loading := .loading | default "eager" }}
|
||||
<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=""
|
||||
loading="{{ $loading }}"
|
||||
width="{{ $image1x.Width }}"
|
||||
height="{{ $image1x.Height }}">
|
||||
</picture>
|
@@ -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 }}
|
25
docs/layouts/_partials/layouts/blocks/alert.html
Normal file
25
docs/layouts/_partials/layouts/blocks/alert.html
Normal file
@@ -0,0 +1,25 @@
|
||||
{{- $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">
|
||||
<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">
|
||||
{{ $text }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
30
docs/layouts/_partials/layouts/blocks/modal.html
Normal file
30
docs/layouts/_partials/layouts/blocks/modal.html
Normal 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>
|
44
docs/layouts/_partials/layouts/breadcrumbs.html
Normal file
44
docs/layouts/_partials/layouts/breadcrumbs.html
Normal 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 dark:text-blue-500 dark:hover:text-blue-400 {{ 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 }}
|
5
docs/layouts/_partials/layouts/date.html
Normal file
5
docs/layouts/_partials/layouts/date.html
Normal 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>
|
9
docs/layouts/_partials/layouts/docsheader.html
Normal file
9
docs/layouts/_partials/layouts/docsheader.html
Normal 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>
|
47
docs/layouts/_partials/layouts/explorer.html
Normal file
47
docs/layouts/_partials/layouts/explorer.html
Normal 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 }}
|
73
docs/layouts/_partials/layouts/footer.html
Normal file
73
docs/layouts/_partials/layouts/footer.html
Normal file
@@ -0,0 +1,73 @@
|
||||
<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>
|
11
docs/layouts/_partials/layouts/head/head-js.html
Normal file
11
docs/layouts/_partials/layouts/head/head-js.html
Normal 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 }}
|
49
docs/layouts/_partials/layouts/head/head.html
Normal file
49
docs/layouts/_partials/layouts/head/head.html
Normal file
@@ -0,0 +1,49 @@
|
||||
<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 }}
|
16
docs/layouts/_partials/layouts/header/githubstars.html
Normal file
16
docs/layouts/_partials/layouts/header/githubstars.html
Normal 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 }}
|
44
docs/layouts/_partials/layouts/header/header.html
Normal file
44
docs/layouts/_partials/layouts/header/header.html
Normal 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-center 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>
|
25
docs/layouts/_partials/layouts/header/qr.html
Normal file
25
docs/layouts/_partials/layouts/header/qr.html
Normal file
@@ -0,0 +1,25 @@
|
||||
{{ $t := debug.Timer "qr" }}
|
||||
{{ $qr := partial "_inline/qr" (dict
|
||||
"page" $
|
||||
"img_class" "w-10 bg-white view-transition-qr" )
|
||||
}}
|
||||
{{ $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">
|
||||
{{ 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 }}
|
35
docs/layouts/_partials/layouts/header/theme.html
Normal file
35
docs/layouts/_partials/layouts/header/theme.html
Normal 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>
|
56
docs/layouts/_partials/layouts/home/features.html
Normal file
56
docs/layouts/_partials/layouts/home/features.html
Normal 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>
|
111
docs/layouts/_partials/layouts/home/opensource.html
Normal file
111
docs/layouts/_partials/layouts/home/opensource.html
Normal file
@@ -0,0 +1,111 @@
|
||||
{{ $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-500"
|
||||
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">
|
||||
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-500 hover:text-blue-500 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-500"
|
||||
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-500 hover:text-blue-500 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-500"
|
||||
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-500 hover:text-blue-500 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>
|
44
docs/layouts/_partials/layouts/home/sponsors.html
Normal file
44
docs/layouts/_partials/layouts/home/sponsors.html
Normal file
@@ -0,0 +1,44 @@
|
||||
{{ $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" }}
|
||||
{{ 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 }}"
|
||||
{{ 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
|
||||
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 }}
|
3
docs/layouts/_partials/layouts/hooks/body-end.html
Normal file
3
docs/layouts/_partials/layouts/hooks/body-end.html
Normal file
@@ -0,0 +1,3 @@
|
||||
{{- if .IsHome }}
|
||||
{{- partial "helpers/validation/validate-keywords.html" }}
|
||||
{{- end }}
|
@@ -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 }}
|
3
docs/layouts/_partials/layouts/hooks/body-start.html
Normal file
3
docs/layouts/_partials/layouts/hooks/body-start.html
Normal 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 }}
|
70
docs/layouts/_partials/layouts/icons.html
Normal file
70
docs/layouts/_partials/layouts/icons.html
Normal file
@@ -0,0 +1,70 @@
|
||||
<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--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>
|
||||
|
||||
{{/* 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>
|
After Width: | Height: | Size: 5.0 KiB |
34
docs/layouts/_partials/layouts/in-this-section.html
Normal file
34
docs/layouts/_partials/layouts/in-this-section.html
Normal file
@@ -0,0 +1,34 @@
|
||||
{{- 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 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 dark:text-blue-500
|
||||
dark:hover:text-blue-400
|
||||
{{ end }}"
|
||||
href="{{ .RelPermalink }}"
|
||||
>{{ .LinkTitle }}</a
|
||||
>
|
||||
</li>
|
||||
{{- end }}
|
||||
</ul>
|
||||
</div>
|
||||
{{- end }}
|
26
docs/layouts/_partials/layouts/page-edit.html
Normal file
26
docs/layouts/_partials/layouts/page-edit.html
Normal file
@@ -0,0 +1,26 @@
|
||||
<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 }}
|
||||
{{ 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>
|
22
docs/layouts/_partials/layouts/related.html
Normal file
22
docs/layouts/_partials/layouts/related.html
Normal file
@@ -0,0 +1,22 @@
|
||||
{{- $heading := "See also" }}
|
||||
{{- $related := site.Pages.Related . }}
|
||||
{{- $related = $related | complement .CurrentSection.Pages | 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 dark:text-blue-500 dark:hover:text-blue-400"
|
||||
href="{{ .RelPermalink }}"
|
||||
>{{ or .Params.altTitle .Title }}</a
|
||||
>
|
||||
</li>
|
||||
{{- end }}
|
||||
</ul>
|
||||
{{- end }}
|
45
docs/layouts/_partials/layouts/search/algolialogo.html
Normal file
45
docs/layouts/_partials/layouts/search/algolialogo.html
Normal 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>
|
22
docs/layouts/_partials/layouts/search/button.html
Normal file
22
docs/layouts/_partials/layouts/search/button.html
Normal file
@@ -0,0 +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"
|
||||
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="{{ $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>
|
||||
<span class="hidden lg:inline">/</span>
|
||||
</button>
|
4
docs/layouts/_partials/layouts/search/input.html
Normal file
4
docs/layouts/_partials/layouts/search/input.html
Normal 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>
|
90
docs/layouts/_partials/layouts/search/results.html
Normal file
90
docs/layouts/_partials/layouts/search/results.html
Normal file
@@ -0,0 +1,90 @@
|
||||
<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"
|
||||
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">
|
||||
</div>
|
||||
</div>
|
||||
<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 h-[calc(100%-6rem)] overflow-y-auto">
|
||||
<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>
|
||||
{{/* 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>
|
7
docs/layouts/_partials/layouts/templates.html
Normal file
7
docs/layouts/_partials/layouts/templates.html
Normal 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>
|
46
docs/layouts/_partials/layouts/toc.html
Normal file
46
docs/layouts/_partials/layouts/toc.html
Normal file
@@ -0,0 +1,46 @@
|
||||
{{ 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 .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 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>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ with .Headings }}
|
||||
<ul>
|
||||
{{ template "render-toc-level" (dict "h" . "p" $.p) }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
26
docs/layouts/_partials/opengraph/get-featured-image.html
Normal file
26
docs/layouts/_partials/opengraph/get-featured-image.html
Normal 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 }}
|
84
docs/layouts/_partials/opengraph/opengraph.html
Normal file
84
docs/layouts/_partials/opengraph/opengraph.html
Normal 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 }}
|
Reference in New Issue
Block a user