mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-08-04 04:58:55 -04:00
theme: Format layouts
``` npx prettier --write layouts ```
This commit is contained in:
parent
aa3cd839a2
commit
e68431034e
@ -2,7 +2,6 @@
|
|||||||
**/icons.html
|
**/icons.html
|
||||||
# These are whitespace sensitive.
|
# These are whitespace sensitive.
|
||||||
layouts/_default/_markup/render-code*
|
layouts/_default/_markup/render-code*
|
||||||
layouts/shortcodes/glossary.html
|
|
||||||
|
|
||||||
# Odd template syntax.
|
# Odd template syntax.
|
||||||
layouts/_default/_markup/render-heading*
|
layouts/_default/_markup/render-heading*
|
||||||
@ -13,3 +12,4 @@ layouts/partials/layouts/head/head.html
|
|||||||
# Auto generated.
|
# Auto generated.
|
||||||
assets/css/components/chroma*.css
|
assets/css/components/chroma*.css
|
||||||
assets/jsconfig.json
|
assets/jsconfig.json
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<img
|
<img
|
||||||
src="{{ `images/gopher-side_color.svg` | relURL }}"
|
src="{{ `images/gopher-side_color.svg` | relURL }}"
|
||||||
alt="gopher"
|
alt="gopher"
|
||||||
class="w-32 ml-12 float-right" />
|
class="w-32 ml-12 float-right">
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<div class="mt-10 flex items-center justify-center gap-x-6">
|
<div class="mt-10 flex items-center justify-center gap-x-6">
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
{{/* prettier-ignore-start */ -}}
|
||||||
{{- /* Last modified: 2025-01-19T14:44:56-08:00 */}}
|
{{- /* Last modified: 2025-01-19T14:44:56-08:00 */}}
|
||||||
|
|
||||||
{{- /*
|
{{- /*
|
||||||
@ -76,7 +77,7 @@ either of these shortcodes in conjunction with this render hook.
|
|||||||
|
|
||||||
@returns {template.html}
|
@returns {template.html}
|
||||||
*/}}
|
*/}}
|
||||||
|
{{/* prettier-ignore-end */ -}}
|
||||||
{{- /* Initialize. */}}
|
{{- /* Initialize. */}}
|
||||||
{{- $renderHookName := "link" }}
|
{{- $renderHookName := "link" }}
|
||||||
|
|
||||||
@ -185,14 +186,16 @@ either of these shortcodes in conjunction with this render hook.
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- /* Render anchor element. */ -}}
|
{{- /* Render anchor element. */ -}}
|
||||||
<a aria-label="{{ .PlainText }}"
|
<a
|
||||||
|
aria-label="{{ .PlainText }}"
|
||||||
{{- with .Title }}title="{{ . }}"{{- end }}
|
{{- with .Title }}title="{{ . }}"{{- end }}
|
||||||
{{- range $k, $v := $attrs }}
|
{{- range $k, $v := $attrs }}
|
||||||
{{- if $v }}
|
{{- if $v }}
|
||||||
{{- printf " %s=%q" $k ($v | transform.HTMLEscape) | safeHTMLAttr }}
|
{{- printf " %s=%q" $k ($v | transform.HTMLEscape) | safeHTMLAttr }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
>{{ .Text }}</a>
|
>{{ .Text }}</a
|
||||||
|
>
|
||||||
|
|
||||||
{{- define "partials/inline/h-rh-l/validate-fragment.html" }}
|
{{- define "partials/inline/h-rh-l/validate-fragment.html" }}
|
||||||
{{- /*
|
{{- /*
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
<div class="flex flex-col w-full p-0 m-0">
|
<div class="flex flex-col w-full p-0 m-0">
|
||||||
{{ partial "layouts/home/opensource.html" . }}
|
{{ partial "layouts/home/opensource.html" . }}
|
||||||
<hr class="border-t border-gray-200 dark:border-gray-800 my-10 lg:my-14" />
|
<hr class="border-t border-gray-200 dark:border-gray-800 my-10 lg:my-14">
|
||||||
{{ partial "layouts/home/sponsors.html" (dict "ctx" . "gtag" "home" ) }}
|
{{ partial "layouts/home/sponsors.html" (dict "ctx" . "gtag" "home" ) }}
|
||||||
<hr class="border-t border-gray-200 dark:border-gray-800 my-10 lg:my-14" />
|
<hr class="border-t border-gray-200 dark:border-gray-800 my-10 lg:my-14">
|
||||||
{{ partial "layouts/home/features.html" . }}
|
{{ partial "layouts/home/features.html" . }}
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
@ -15,7 +15,7 @@
|
|||||||
<img
|
<img
|
||||||
src="{{ `images/hugo-logo-wide.svg`| relURL }}"
|
src="{{ `images/hugo-logo-wide.svg`| relURL }}"
|
||||||
alt="Hugo Logo"
|
alt="Hugo Logo"
|
||||||
class="w-64 aspect-3/1 mx-auto mb-8" />
|
class="w-64 aspect-3/1 mx-auto mb-8">
|
||||||
<h1
|
<h1
|
||||||
class="text-4xl font-bold tracking-tight text-balance text-gray-900 dark:text-gray-300 sm:text-6xl">
|
class="text-4xl font-bold tracking-tight text-balance text-gray-900 dark:text-gray-300 sm:text-6xl">
|
||||||
The world’s fastest framework for building websites
|
The world’s fastest framework for building websites
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
{{/* prettier-ignore-start */ -}}
|
||||||
{{/*
|
{{/*
|
||||||
Parses the serialized data from the given URL and returns a map or an array.
|
Parses the serialized data from the given URL and returns a map or an array.
|
||||||
|
|
||||||
@ -8,7 +9,7 @@ Supports CSV, JSON, TOML, YAML, and XML.
|
|||||||
|
|
||||||
@example {{ partial "get-remote-data.html" "https://example.org/foo.json" }}
|
@example {{ partial "get-remote-data.html" "https://example.org/foo.json" }}
|
||||||
*/}}
|
*/}}
|
||||||
|
{{/* prettier-ignore-end */ -}}
|
||||||
{{ $url := . }}
|
{{ $url := . }}
|
||||||
{{ $data := dict }}
|
{{ $data := dict }}
|
||||||
{{ with try (resources.GetRemote $url) }}
|
{{ with try (resources.GetRemote $url) }}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<link
|
<link
|
||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
href="{{ $r.RelPermalink }}"
|
href="{{ $r.RelPermalink }}"
|
||||||
{{ template `render-attributes` $attr }} />
|
{{ template `render-attributes` $attr }}>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ with $r | minify | fingerprint }}
|
{{ with $r | minify | fingerprint }}
|
||||||
<link
|
<link
|
||||||
@ -13,7 +13,7 @@
|
|||||||
href="{{ .RelPermalink }}"
|
href="{{ .RelPermalink }}"
|
||||||
integrity="{{ .Data.Integrity }}"
|
integrity="{{ .Data.Integrity }}"
|
||||||
crossorigin="anonymous"
|
crossorigin="anonymous"
|
||||||
{{ template `render-attributes` $attr }} />
|
{{ template `render-attributes` $attr }}>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
@ -9,17 +9,17 @@
|
|||||||
<source
|
<source
|
||||||
srcset="{{ $imageWebp.RelPermalink }}"
|
srcset="{{ $imageWebp.RelPermalink }}"
|
||||||
type="image/webp"
|
type="image/webp"
|
||||||
media="(min-width: 1200px)" />
|
media="(min-width: 1200px)">
|
||||||
<source
|
<source
|
||||||
srcset="{{ $image.RelPermalink }}"
|
srcset="{{ $image.RelPermalink }}"
|
||||||
type="image/jpeg"
|
type="image/jpeg"
|
||||||
media="(min-width: 1200px)" />
|
media="(min-width: 1200px)">
|
||||||
<source srcset="{{ $image1xWebp.RelPermalink }}" type="image/webp" />
|
<source srcset="{{ $image1xWebp.RelPermalink }}" type="image/webp">
|
||||||
<source srcset="{{ $image1x.RelPermalink }}" type="image/jpeg" />
|
<source srcset="{{ $image1x.RelPermalink }}" type="image/jpeg">
|
||||||
<img
|
<img
|
||||||
class="{{ $class }}"
|
class="{{ $class }}"
|
||||||
src="{{ $image1x.RelPermalink }}"
|
src="{{ $image1x.RelPermalink }}"
|
||||||
alt=""
|
alt=""
|
||||||
width="{{ $image1x.Width }}"
|
width="{{ $image1x.Width }}"
|
||||||
height="{{ $image1x.Height }}" />
|
height="{{ $image1x.Height }}">
|
||||||
</picture>
|
</picture>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<footer class="print:hidden bg-blue-950 mt-8 sm:mt-24 border-t-1 border-gray-800">
|
<footer
|
||||||
|
class="print:hidden bg-blue-950 mt-8 sm:mt-24 border-t-1 border-gray-800">
|
||||||
<div class="mx-auto max-w-7xl pt-16 pb-8 sm:pt-18 lg:pt-20">
|
<div class="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">
|
<div class="xl:grid xl:grid-cols-3 xl:gap-8">
|
||||||
{{/* Column 1 */}}
|
{{/* Column 1 */}}
|
||||||
@ -9,13 +10,13 @@
|
|||||||
href="https://github.com/gohugoio/hugo/graphs/contributors"
|
href="https://github.com/gohugoio/hugo/graphs/contributors"
|
||||||
class="text-blue-300 hover:underline"
|
class="text-blue-300 hover:underline"
|
||||||
>Hugo Authors</a
|
>Hugo Authors</a
|
||||||
><br />
|
><br>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<img
|
<img
|
||||||
src="/images/hugo-logo-wide.svg"
|
src="/images/hugo-logo-wide.svg"
|
||||||
alt="Hugo Logo"
|
alt="Hugo Logo"
|
||||||
class="aspect-3/1 w-40" />
|
class="aspect-3/1 w-40">
|
||||||
|
|
||||||
<ul class="space-y-2 text-gray-200">
|
<ul class="space-y-2 text-gray-200">
|
||||||
<li class="hover:text-white">
|
<li class="hover:text-white">
|
||||||
|
@ -20,6 +20,6 @@
|
|||||||
height="{{ .Height }}"
|
height="{{ .Height }}"
|
||||||
@load="$event.target.classList.remove('_opacity-0')"
|
@load="$event.target.classList.remove('_opacity-0')"
|
||||||
alt="QR code linking to {{ $.page.Permalink }}"
|
alt="QR code linking to {{ $.page.Permalink }}"
|
||||||
class="{{ $img_class }}" />
|
class="{{ $img_class }}">
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<div class="print:hidden">
|
<div class="print:hidden">
|
||||||
<hr class="border-t border-gray-200 dark:border-gray-800 my-10 lg:my-16" />
|
<hr class="border-t border-gray-200 dark:border-gray-800 my-10 lg:my-16">
|
||||||
|
|
||||||
<div class="text-gray-800 dark:text-gray-300 font-semibold">
|
<div class="text-gray-800 dark:text-gray-300 font-semibold">
|
||||||
Last updated:
|
Last updated:
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
{{ $fillColor = "fill-slate-500 dark:fill-slate-400" }}
|
{{ $fillColor = "fill-slate-500 dark:fill-slate-400" }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
|
||||||
<button
|
<button
|
||||||
{{ if .standalone }}
|
{{ if .standalone }}
|
||||||
x-data @click="$dispatch('search-toggle')"
|
x-data @click="$dispatch('search-toggle')"
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
arial-label="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"
|
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"
|
placeholder="Search docs"
|
||||||
x-ref="input" />
|
x-ref="input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="relative mt-6 flex-1 px-4 sm:px-6">
|
<div class="relative mt-6 flex-1 px-4 sm:px-6">
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<meta property="og:title" content="{{ .Title }}" />
|
<meta property="og:title" content="{{ .Title }}">
|
||||||
<meta
|
<meta
|
||||||
property="og:description"
|
property="og:description"
|
||||||
content="{{ with .Description }}
|
content="{{ with .Description }}
|
||||||
@ -9,56 +9,56 @@
|
|||||||
{{ else }}
|
{{ else }}
|
||||||
{{ with .Site.Params.description }}{{ . }}{{ end }}
|
{{ with .Site.Params.description }}{{ . }}{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}" />
|
{{ end }}">
|
||||||
<meta
|
<meta
|
||||||
property="og:type"
|
property="og:type"
|
||||||
content="{{ if .IsPage }}
|
content="{{ if .IsPage }}
|
||||||
article
|
article
|
||||||
{{ else }}
|
{{ else }}
|
||||||
website
|
website
|
||||||
{{ end }}" />
|
{{ end }}">
|
||||||
<meta property="og:url" content="{{ .Permalink }}" />
|
<meta property="og:url" content="{{ .Permalink }}">
|
||||||
|
|
||||||
{{- with $.Params.images -}}
|
{{- with $.Params.images -}}
|
||||||
{{- range first 6 . }}
|
{{- range first 6 . }}
|
||||||
<meta property="og:image" content="{{ . | absURL }}" />
|
<meta property="og:image" content="{{ . | absURL }}">
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- $featured := partial "opengraph/get-featured-image.html" . }}
|
{{- $featured := partial "opengraph/get-featured-image.html" . }}
|
||||||
{{- with $featured -}}
|
{{- with $featured -}}
|
||||||
<meta property="og:image" content="{{ $featured.Permalink }}" />
|
<meta property="og:image" content="{{ $featured.Permalink }}">
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- with $.Site.Params.images }}
|
{{- with $.Site.Params.images }}
|
||||||
<meta property="og:image" content="{{ index . 0 | absURL }}" />
|
<meta property="og:image" content="{{ index . 0 | absURL }}">
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- if .IsPage }}
|
{{- if .IsPage }}
|
||||||
{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
|
{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
|
||||||
<meta property="article:section" content="{{ .Section }}" />
|
<meta property="article:section" content="{{ .Section }}">
|
||||||
{{ with .PublishDate }}
|
{{ with .PublishDate }}
|
||||||
<meta
|
<meta
|
||||||
property="article:published_time"
|
property="article:published_time"
|
||||||
{{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />
|
{{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }}>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ with .Lastmod }}
|
{{ with .Lastmod }}
|
||||||
<meta
|
<meta
|
||||||
property="article:modified_time"
|
property="article:modified_time"
|
||||||
{{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />
|
{{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }}>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- with .Params.audio }}<meta property="og:audio" content="{{ . }}" />{{ end }}
|
{{- with .Params.audio }}<meta property="og:audio" content="{{ . }}">{{ end }}
|
||||||
{{- with .Params.locale }}
|
{{- with .Params.locale }}
|
||||||
<meta property="og:locale" content="{{ . }}" />
|
<meta property="og:locale" content="{{ . }}">
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{- with .Site.Params.title }}
|
{{- with .Site.Params.title }}
|
||||||
<meta property="og:site_name" content="{{ . }}" />
|
<meta property="og:site_name" content="{{ . }}">
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{- with .Params.videos }}
|
{{- with .Params.videos }}
|
||||||
{{- range . }}
|
{{- range . }}
|
||||||
<meta property="og:video" content="{{ . | absURL }}" />
|
<meta property="og:video" content="{{ . | absURL }}">
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
@ -71,7 +71,7 @@
|
|||||||
{{- $series := index $siteSeries ($name | urlize) }}
|
{{- $series := index $siteSeries ($name | urlize) }}
|
||||||
{{- range $page := first 6 $series.Pages }}
|
{{- range $page := first 6 $series.Pages }}
|
||||||
{{- if ne $page.Permalink $permalink }}
|
{{- if ne $page.Permalink $permalink }}
|
||||||
<meta property="og:see_also" content="{{ $page.Permalink }}" />
|
<meta property="og:see_also" content="{{ $page.Permalink }}">
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
@ -80,5 +80,5 @@
|
|||||||
|
|
||||||
{{- /* Facebook Page Admin ID for Domain Insights */}}
|
{{- /* Facebook Page Admin ID for Domain Insights */}}
|
||||||
{{- with site.Params.social.facebook_admin }}
|
{{- with site.Params.social.facebook_admin }}
|
||||||
<meta property="fb:admins" content="{{ . }}" />
|
<meta property="fb:admins" content="{{ . }}">
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
@ -4,4 +4,3 @@
|
|||||||
<dd>{{ with .Aliases }}{{ delimit . ", " }}{{ end }}</dd>
|
<dd>{{ with .Aliases }}{{ delimit . ", " }}{{ end }}</dd>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</dl>
|
</dl>
|
||||||
|
|
@ -9,6 +9,7 @@
|
|||||||
{{ $fields := after 3 .Params }}
|
{{ $fields := after 3 .Params }}
|
||||||
{{ $list := where $list $filter1 $filter2 $filter3 }}
|
{{ $list := where $list $filter1 $filter2 $filter3 }}
|
||||||
|
|
||||||
|
|
||||||
<table class="table table-bordered">
|
<table class="table table-bordered">
|
||||||
<tr>
|
<tr>
|
||||||
{{ range $fields }}
|
{{ range $fields }}
|
||||||
@ -28,7 +29,8 @@
|
|||||||
strings.ReplaceRE `\[` "<ol><li>" |
|
strings.ReplaceRE `\[` "<ol><li>" |
|
||||||
strings.ReplaceRE `\s` "</li><li>" |
|
strings.ReplaceRE `\s` "</li><li>" |
|
||||||
strings.ReplaceRE `\]` "</li></ol>" |
|
strings.ReplaceRE `\]` "</li></ol>" |
|
||||||
safeHTML }}
|
safeHTML
|
||||||
|
}}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ $tdContent }}
|
{{ $tdContent }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
{{/* prettier-ignore-start */ -}}
|
||||||
{{- /*
|
{{- /*
|
||||||
Renders a callout indicating the version in which a feature was deprecated.
|
Renders a callout indicating the version in which a feature was deprecated.
|
||||||
|
|
||||||
@ -16,6 +17,7 @@
|
|||||||
{{< /new-in >}}
|
{{< /new-in >}}
|
||||||
|
|
||||||
*/}}
|
*/}}
|
||||||
|
{{/* prettier-ignore-end */ -}}
|
||||||
{{- with $version := .Get 0 | strings.TrimLeft "vV" }}
|
{{- with $version := .Get 0 | strings.TrimLeft "vV" }}
|
||||||
{{- $href := printf "https://github.com/gohugoio/hugo/releases/tag/v%s" $version }}
|
{{- $href := printf "https://github.com/gohugoio/hugo/releases/tag/v%s" $version }}
|
||||||
{{- $inner := strings.TrimSpace $.Inner }}
|
{{- $inner := strings.TrimSpace $.Inner }}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
{{/* prettier-ignore-start */ -}}
|
||||||
{{- /*
|
{{- /*
|
||||||
Renders an absolute URL to the source code for an embedded template.
|
Renders an absolute URL to the source code for an embedded template.
|
||||||
|
|
||||||
@ -11,7 +12,7 @@ embedded_templates.toml file in the data directory.
|
|||||||
@example {{% et robots.txt %}}
|
@example {{% et robots.txt %}}
|
||||||
@example {{% et filename=robots.txt %}}
|
@example {{% et filename=robots.txt %}}
|
||||||
*/}}
|
*/}}
|
||||||
|
{{/* prettier-ignore-end */ -}}
|
||||||
{{- /* Get parameters. */}}
|
{{- /* Get parameters. */}}
|
||||||
{{- $filename := "" -}}
|
{{- $filename := "" -}}
|
||||||
{{- if .IsNamedParams -}}
|
{{- if .IsNamedParams -}}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
{{/* prettier-ignore-start */ -}}
|
||||||
{{- /*
|
{{- /*
|
||||||
Renders the definition of the given glossary term.
|
Renders the definition of the given glossary term.
|
||||||
|
|
||||||
@ -7,11 +8,13 @@ Renders the definition of the given glossary term.
|
|||||||
@example {{% glossary-term float %}}
|
@example {{% glossary-term float %}}
|
||||||
@example {{% glossary-term "floating point" %}}
|
@example {{% glossary-term "floating point" %}}
|
||||||
*/}}
|
*/}}
|
||||||
|
{{/* prettier-ignore-end */ -}}
|
||||||
{{- with .Get 0 }}
|
{{- with .Get 0 }}
|
||||||
{{- $path := printf "/quick-reference/glossary/%s" (urlize .) }}
|
{{- $path := printf "/quick-reference/glossary/%s" (urlize .) }}
|
||||||
{{- with site.GetPage $path }}
|
{{- with site.GetPage $path }}
|
||||||
|
{{/* prettier-ignore-start */ -}}
|
||||||
{{ .RenderShortcodes }} {{/* Do not indent. Do not remove non-breaking space. */}}
|
{{ .RenderShortcodes }} {{/* Do not indent. Do not remove non-breaking space. */}}
|
||||||
|
{{/* prettier-ignore-end */ -}}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
{{- errorf "The glossary term (%s) shortcode was unable to find %s: see %s" $.Name $path $.Position }}
|
{{- errorf "The glossary term (%s) shortcode was unable to find %s: see %s" $.Name $path $.Position }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
{{/* prettier-ignore-start */ -}}
|
||||||
{{- /*
|
{{- /*
|
||||||
Renders the glossary of terms.
|
Renders the glossary of terms.
|
||||||
|
|
||||||
@ -54,3 +55,4 @@ shortcode.
|
|||||||
{{- else }}
|
{{- else }}
|
||||||
{{- errorf "The %q shortcode was unable to get %s: see %s" .Name $path .Position}}
|
{{- errorf "The %q shortcode was unable to get %s: see %s" .Name $path .Position}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{/* prettier-ignore-end */ -}}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
{{/* prettier-ignore-start */ -}}
|
||||||
{{- /*
|
{{- /*
|
||||||
Renders the given image using the given filter, if any.
|
Renders the given image using the given filter, if any.
|
||||||
|
|
||||||
@ -84,7 +85,7 @@ Renders the given image using the given filter, if any.
|
|||||||
>}}
|
>}}
|
||||||
|
|
||||||
*/}}
|
*/}}
|
||||||
|
{{/* prettier-ignore-end */ -}}
|
||||||
{{- /* Initialize. */}}
|
{{- /* Initialize. */}}
|
||||||
{{- $alt := "" }}
|
{{- $alt := "" }}
|
||||||
{{- $src := "" }}
|
{{- $src := "" }}
|
||||||
@ -334,11 +335,23 @@ Renders the given image using the given filter, if any.
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if $example }}
|
{{- if $example }}
|
||||||
<p>Original</p>
|
<p>Original</p>
|
||||||
<img class="{{ $class}}" style="width: initial;" src="{{ $i.RelPermalink }}" alt="{{ $alt }}">
|
<img
|
||||||
|
class="{{ $class }}"
|
||||||
|
style="width: initial;"
|
||||||
|
src="{{ $i.RelPermalink }}"
|
||||||
|
alt="{{ $alt }}">
|
||||||
<p>Processed</p>
|
<p>Processed</p>
|
||||||
<img class="{{ $class }}" style="width: initial;" src="{{ $fi.RelPermalink }}" alt="{{ $alt }}">
|
<img
|
||||||
|
class="{{ $class }}"
|
||||||
|
style="width: initial;"
|
||||||
|
src="{{ $fi.RelPermalink }}"
|
||||||
|
alt="{{ $alt }}">
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
<img class='di' style="width: initial;" src="{{ $fi.RelPermalink }}" alt="{{ $alt }}">
|
<img
|
||||||
|
class="di"
|
||||||
|
style="width: initial;"
|
||||||
|
src="{{ $fi.RelPermalink }}"
|
||||||
|
alt="{{ $alt }}">
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- define "validate-arg-count" }}
|
{{- define "validate-arg-count" }}
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
src="{{ .RelPermalink }}"
|
src="{{ .RelPermalink }}"
|
||||||
width="{{ .Width }}"
|
width="{{ .Width }}"
|
||||||
height="{{ .Height }}"
|
height="{{ .Height }}"
|
||||||
alt="{{ $.Get `alt` }}" />
|
alt="{{ $.Get `alt` }}">
|
||||||
<figcaption class="not-prose text-sm">
|
<figcaption class="not-prose text-sm">
|
||||||
{{- with $.Inner }}
|
{{- with $.Inner }}
|
||||||
{{ . }}
|
{{ . }}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
{{/* prettier-ignore-start */ -}}
|
||||||
{{- /*
|
{{- /*
|
||||||
Renders the page using the RenderShortcode method on the Page object.
|
Renders the page using the RenderShortcode method on the Page object.
|
||||||
|
|
||||||
@ -8,7 +9,7 @@ You must call this shortcode using the {{% %}} notation.
|
|||||||
|
|
||||||
@example {{% include "functions/_common/glob-patterns" %}}
|
@example {{% include "functions/_common/glob-patterns" %}}
|
||||||
*/}}
|
*/}}
|
||||||
|
{{/* prettier-ignore-end */ -}}
|
||||||
{{- with .Get 0 }}
|
{{- with .Get 0 }}
|
||||||
{{- with or ($.Page.GetPage .) (site.GetPage .) }}
|
{{- with or ($.Page.GetPage .) (site.GetPage .) }}
|
||||||
{{- .RenderShortcodes }}
|
{{- .RenderShortcodes }}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
{{/* prettier-ignore-start */ -}}
|
||||||
{{- /*
|
{{- /*
|
||||||
Renders a description list of the pages in the given section.
|
Renders a description list of the pages in the given section.
|
||||||
|
|
||||||
@ -30,7 +31,7 @@ omitElementIDs to true for the subset.
|
|||||||
@example {{< list-pages-in-section path=/functions/images filter=some_filter filterType=exclude titlePrefix=foo >}}
|
@example {{< list-pages-in-section path=/functions/images filter=some_filter filterType=exclude titlePrefix=foo >}}
|
||||||
@example {{< list-pages-in-section path=/functions/images filter=some_filter filterType=exclude titlePrefix=foo omitElementIDs=true >}}
|
@example {{< list-pages-in-section path=/functions/images filter=some_filter filterType=exclude titlePrefix=foo omitElementIDs=true >}}
|
||||||
*/}}
|
*/}}
|
||||||
|
{{/* prettier-ignore-end */ -}}
|
||||||
{{- /* Initialize. */}}
|
{{- /* Initialize. */}}
|
||||||
{{- $filter := or "" (.Get "filter" | lower) }}
|
{{- $filter := or "" (.Get "filter" | lower) }}
|
||||||
{{- $filterType := or (.Get "filterType") "none" | lower }}
|
{{- $filterType := or (.Get "filterType") "none" | lower }}
|
||||||
@ -80,7 +81,9 @@ omitElementIDs to true for the subset.
|
|||||||
{{- $id := path.Join .File.Dir .File.ContentBaseName | replaceRE `[\|/]` ":" | lower }}
|
{{- $id := path.Join .File.Dir .File.ContentBaseName | replaceRE `[\|/]` ":" | lower }}
|
||||||
{{- $idAttribute = printf " id=%q" $id }}
|
{{- $idAttribute = printf " id=%q" $id }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
<dt {{- $idAttribute | safeHTMLAttr }}><a href="{{ $page.RelPermalink }}">{{ $linkTitle }}</a></dt>
|
<dt {{- $idAttribute | safeHTMLAttr }}>
|
||||||
|
<a href="{{ $page.RelPermalink }}">{{ $linkTitle }}</a>
|
||||||
|
</dt>
|
||||||
<dd>{{- $page.Description | $page.RenderString }}</dd>
|
<dd>{{- $page.Description | $page.RenderString }}</dd>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -1 +1,3 @@
|
|||||||
Also see [Module Mounts Config](/hugo-modules/configuration/#module-configuration-mounts) for an alternative way to configure this directory.
|
Also see [Module Mounts
|
||||||
|
Config](/hugo-modules/configuration/#module-configuration-mounts) for an
|
||||||
|
alternative way to configure this directory.
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
{{/* prettier-ignore-start */ -}}
|
||||||
{{- /*
|
{{- /*
|
||||||
Renders a callout or badge indicating the version in which a feature was added.
|
Renders a callout or badge indicating the version in which a feature was added.
|
||||||
|
|
||||||
@ -22,6 +23,7 @@
|
|||||||
Some descriptive text here.
|
Some descriptive text here.
|
||||||
{{< /new-in >}}
|
{{< /new-in >}}
|
||||||
*/}}
|
*/}}
|
||||||
|
{{/* prettier-ignore-end */ -}}
|
||||||
{{- $majorVersionDiffThreshold := 0 }}
|
{{- $majorVersionDiffThreshold := 0 }}
|
||||||
{{- $minorVersionDiffThreshold := 30 }}
|
{{- $minorVersionDiffThreshold := 30 }}
|
||||||
{{- $displayExpirationWarning := true }}
|
{{- $displayExpirationWarning := true }}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
{{/* prettier-ignore-start */ -}}
|
||||||
{{- /*
|
{{- /*
|
||||||
Renders a callout.
|
Renders a callout.
|
||||||
|
|
||||||
@ -9,6 +10,7 @@
|
|||||||
Some descriptive text here.
|
Some descriptive text here.
|
||||||
{{< /note >}}
|
{{< /note >}}
|
||||||
*/}}
|
*/}}
|
||||||
|
{{/* prettier-ignore-end */ -}}
|
||||||
{{- $text := .Inner | strings.TrimSpace | .Page.RenderString (dict "display" "block") }}
|
{{- $text := .Inner | strings.TrimSpace | .Page.RenderString (dict "display" "block") }}
|
||||||
{{- partial "layouts/blocks/alert.html" (dict
|
{{- partial "layouts/blocks/alert.html" (dict
|
||||||
"color" "blue"
|
"color" "blue"
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
{{/* prettier-ignore-start */ -}}
|
||||||
{{/*
|
{{/*
|
||||||
Renders the child sections of the given top-level section, listing each child's immediate descendants.
|
Renders the child sections of the given top-level section, listing each child's immediate descendants.
|
||||||
|
|
||||||
@ -37,3 +38,4 @@ Renders the child sections of the given top-level section, listing each child's
|
|||||||
{{ else }}
|
{{ else }}
|
||||||
{{ errorf "The %q shortcodes was unable to find the %q section. See %s" .Name $section .Position }}
|
{{ errorf "The %q shortcodes was unable to find the %q section. See %s" .Name $section .Position }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{/* prettier-ignore-end */ -}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user