@@ -113,7 +113,7 @@ {{ block "footer" . }}{{ partialCached "site-footer.html" . }}{{ end }} - {{ partial "hooks/before-body-end" . }} + {{ partial "hooks/before-body-end.html" . }} diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/_default/page.html b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/_default/page.html index e9938dfab..108d32323 100644 --- a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/_default/page.html +++ b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/_default/page.html @@ -38,7 +38,7 @@ Featured Image for {{ $.Title }} {{ end }} -
+
{{- partial "docs/functions-signatures.html" . -}} {{- partial "docs/functions-return-type.html" . -}} diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/_default/single.html b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/_default/single.html index 1dfaf920b..092a69270 100644 --- a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/_default/single.html +++ b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/_default/single.html @@ -13,7 +13,7 @@
diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/index.html b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/index.html index 93dfdd6c6..3df97ae42 100644 --- a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/index.html +++ b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/index.html @@ -1,27 +1,27 @@ {{ define "header" }} - {{ partial "hero" . }} - {{ partial "boxes-small-news" . }} + {{ partial "hero.html" . }} + {{ partial "boxes-small-news.html" . }} {{ end }} {{ define "main" }}
- {{- partial "home-page-sections/features-icons" . -}} + {{- partial "home-page-sections/features-icons.html" . -}}
{{ partial "home-page-sections/sponsors.html" (dict "cx" . "gtag" "home" ) }} - {{- partial "home-page-sections/features-single" . -}} + {{- partial "home-page-sections/features-single.html" . -}} - {{- partial "home-page-sections/showcase.html" . -}} + {{- partial "home-page-sections/showcase.html" . -}}
- {{- partial "home-page-sections/installation" . -}} + {{- partial "home-page-sections/installation.html" . -}}
- {{- partial "home-page-sections/tweets" . -}} + {{- partial "home-page-sections/tweets.html" . -}}
- {{- partial "home-page-sections/open-source-involvement" . -}} + {{- partial "home-page-sections/open-source-involvement.html" . -}}
{{ end }} diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/news/list.html b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/news/list.html index 32f72a446..5165c8a13 100644 --- a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/news/list.html +++ b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/news/list.html @@ -47,7 +47,7 @@ {{/* Sort by date (descending) and render. */}} {{ range sort $news_items "Date" "desc" }} - {{ partial "boxes-section-summaries" (dict "context" . "classes" $interior_classes "fullcontent" false) }} + {{ partial "boxes-section-summaries.html" (dict "context" . "classes" $interior_classes "fullcontent" false) }} {{ end }} diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/news/single.html b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/news/single.html index 200daa70a..eb34bedd7 100644 --- a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/news/single.html +++ b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/news/single.html @@ -34,9 +34,6 @@ Go to Hugo Releases for the release downloads.

{{ end }} - - {{ partial "nav-links" .}} + {{ partial "nav-links.html" .}}
- {{ partial "nav-button-open" .}} + {{ partial "nav-button-open.html" .}}
diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/pagelayout.html b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/pagelayout.html index a3887bb14..e6b644b2f 100644 --- a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/pagelayout.html +++ b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/pagelayout.html @@ -24,7 +24,7 @@ {{ $pages = $.context.Pages }} {{ end }} {{ range $pages }} - {{ partial "boxes-section-summaries" (dict "context" . "classes" $interior_classes "fullcontent" true) }} + {{ partial "boxes-section-summaries.html" (dict "context" . "classes" $interior_classes "fullcontent" true) }} {{ end }} diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/toc.html b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/toc.html deleted file mode 100644 index 583feec4f..000000000 --- a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/toc.html +++ /dev/null @@ -1,13 +0,0 @@ - - diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/code-toggle.html b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/code-toggle.html index 7198348b8..d1131132d 100644 --- a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/code-toggle.html +++ b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/code-toggle.html @@ -2,7 +2,7 @@ Renders syntax-highlighted configuration data in JSON, TOML, and YAML formats. @param {string} [config] The section of site.Data.docs.config to render. - @param {bool} [copy=true] If true, display a copy to clipboard button. + @param {bool} [copy=false] If true, display a copy to clipboard button. @param {string} [file] The file name to display above the rendered code. @param {bool} [fm=false] If true, render the code as front matter. @param {bool} [skipHeader=false] If false, omit top level key(s) when rendering a section of site.Data.docs.config. diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/code.html b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/code.html index b6fd09c25..dd21551cb 100644 --- a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/code.html +++ b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/code.html @@ -1,26 +1,22 @@ {{- /* Renders syntax highlighted code. -@param {bool} [copy=true] If true, display a copy to clipboard button. +@param {bool} [copy=false] If true, display a copy to clipboard button. @param {string} [file] The file name to display above the rendered code. @param {string} [lang] The code language of the inner content. @returns {template.HTML} */}} -{{- /* Initialize. */}} -{{- $copy := false }} -{{- $file := " " }} -{{- $lang := "" }} - {{- /* Get parameters. */}} -{{- $file = .Get "file" }} -{{- $lang = or (.Get "lang") (path.Ext $file | strings.TrimPrefix ".") "text" }} +{{- $copy := false }} {{- if in (slice "false" false 0) (.Get "copy") }} {{- $copy = false }} {{- else if in (slice "true" true 1) (.Get "copy")}} {{- $copy = true }} {{- end }} +{{- $file := or (.Get "file") " " }} +{{- $lang := or (.Get "lang") (path.Ext $file | strings.TrimPrefix ".") "text" }} {{- /* Use the go-html-template Chroma lexer for HTML. */}} {{- if eq $lang "html" }} @@ -29,7 +25,7 @@ Renders syntax highlighted code. {{- /* Render. */}}
-
{{ or $file "nbsp;" }}
+
{{ $file | htmlUnescape }}
{{- if $copy }} {{- end }} diff --git a/layouts/shortcodes/deprecated-in.html b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/deprecated-in.html similarity index 100% rename from layouts/shortcodes/deprecated-in.html rename to _vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/deprecated-in.html diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/directoryindex.html b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/directoryindex.html deleted file mode 100644 index 37e7d3ad1..000000000 --- a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/directoryindex.html +++ /dev/null @@ -1,13 +0,0 @@ -{{- $pathURL := .Get "pathURL" -}} -{{- $path := .Get "path" -}} -{{- $files := readDir $path -}} - - - -{{- range $files }} - - - - -{{- end }} -
Size in bytesName
{{ .Size }} {{ .Name }}
diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/docfile.html b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/docfile.html deleted file mode 100644 index 2f982aae8..000000000 --- a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/docfile.html +++ /dev/null @@ -1,11 +0,0 @@ -{{ $file := .Get 0}} -{{ $filepath := $file }} -{{ $syntax := index (split $file ".") 1 }} -{{ $syntaxoverride := eq (len .Params) 2 }} -
-
{{$filepath}}
- -
{{- readFile $file -}}
-
diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/exfile.html b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/exfile.html deleted file mode 100644 index 226782957..000000000 --- a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/exfile.html +++ /dev/null @@ -1,12 +0,0 @@ -{{ $file := .Get 0}} -{{ $filepath := replace $file "static/" ""}} -{{ $syntax := index (split $file ".") 1 }} -{{ $syntaxoverride := eq (len .Params) 2 }} -
-
{{$filepath}}
- -
{{- readFile $file -}}
- Source -
diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/exfm.html b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/exfm.html deleted file mode 100644 index c0429bbe1..000000000 --- a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/exfm.html +++ /dev/null @@ -1,13 +0,0 @@ - -{{ $file := .Get 0}} -{{ $filepath := replace $file "static/" ""}} -{{ $syntax := index (split $file ".") 1 }} -{{ $syntaxoverride := eq (len .Params) 2 }} -
-
{{$filepath}}
- -
{{- readFile $file -}}
- Source -
\ No newline at end of file diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/gh.html b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/gh.html deleted file mode 100644 index e027dc0f0..000000000 --- a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/gh.html +++ /dev/null @@ -1,9 +0,0 @@ -{{ range .Params }} - {{ if eq (substr . 0 1) "@" }} - {{ . }} - {{ else if eq (substr . 0 2) "0x" }} - {{ substr . 2 6 }} - {{ else }} - #{{ . }} - {{ end }} -{{ end }} \ No newline at end of file diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/ghrepo.html b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/ghrepo.html deleted file mode 100644 index e9df40d6a..000000000 --- a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/ghrepo.html +++ /dev/null @@ -1 +0,0 @@ -GitHub repository \ No newline at end of file diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/img.html b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/img.html index ec39061ca..ea5b6de1d 100644 --- a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/img.html +++ b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/img.html @@ -316,9 +316,9 @@ Renders the given image using the given filter, if any. {{- /* Render. */}} {{- if $example }} -

{{ or (T "original") "original" | strings.FirstUpper }}

+

Original

{{ $alt }} -

{{ or (T "processed") "processed" | strings.FirstUpper }}

+

Processed

{{ $alt }} {{- else -}} {{ $alt }} diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/imgproc.html b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/imgproc.html index c76b782c3..c09133ba8 100644 --- a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/imgproc.html +++ b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/imgproc.html @@ -6,7 +6,7 @@ Renders the given image using the given process specification. @returns template.HTML -@example {{< imgproc "sunset.jpg" "resize 300x" }} +@example {{< imgproc "sunset.jpg" "resize 300x" />}} */}} {{- with $.Get 0 }} diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/new-in.html b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/new-in.html index 71d1abfdf..9236cf2bc 100644 --- a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/new-in.html +++ b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/new-in.html @@ -4,7 +4,7 @@ {{ end }} {{ $version = $version | strings.TrimPrefix "v" }} -   - {{- end }} -
-
- {{- range $langs }} -
- {{- $hCode := $code | transform.Remarshal . }} - {{- if and $fm (in (slice "toml" "yaml") .) }} - {{- $hCode = printf "%s\n%s\n%s" $placeHolder $hCode $placeHolder }} - {{- end }} - {{- $hCode = $hCode | replaceRE `\n+` "\n" }} - {{ highlight $hCode . "" | replaceRE $placeHolder (index $delimiters .) | safeHTML }} -
- {{- if $copy }} - - {{- /* Functionality located within filesaver.js The copy here is located in the css with .copy class so it can be replaced with JS on success */}} - {{- end }} - {{- end }} -
- diff --git a/layouts/shortcodes/code.html b/layouts/shortcodes/code.html deleted file mode 100644 index dd21551cb..000000000 --- a/layouts/shortcodes/code.html +++ /dev/null @@ -1,35 +0,0 @@ -{{- /* -Renders syntax highlighted code. - -@param {bool} [copy=false] If true, display a copy to clipboard button. -@param {string} [file] The file name to display above the rendered code. -@param {string} [lang] The code language of the inner content. - -@returns {template.HTML} -*/}} - -{{- /* Get parameters. */}} -{{- $copy := false }} -{{- if in (slice "false" false 0) (.Get "copy") }} - {{- $copy = false }} -{{- else if in (slice "true" true 1) (.Get "copy")}} - {{- $copy = true }} -{{- end }} -{{- $file := or (.Get "file") " " }} -{{- $lang := or (.Get "lang") (path.Ext $file | strings.TrimPrefix ".") "text" }} - -{{- /* Use the go-html-template Chroma lexer for HTML. */}} -{{- if eq $lang "html" }} - {{- $lang = "go-html-template" }} -{{- end }} - -{{- /* Render. */}} -
-
{{ $file | htmlUnescape }}
- {{- if $copy }} - - {{- end }} -
- {{- highlight (trim .Inner "\n\r") $lang }} -
-
diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html deleted file mode 100644 index ea5b6de1d..000000000 --- a/layouts/shortcodes/img.html +++ /dev/null @@ -1,374 +0,0 @@ -{{- /* -Renders the given image using the given filter, if any. - -@param {string} src The path to the image which must be a remote, page, or global resource. -@param {string} [filter] The filter to apply to the image (case-insensitive). -@param {string} [filterArgs] A comma-delimited list of arguments to pass to the filter. -@param {bool} [example=false] If true, renders a before/after example. -@param {int} [exampleWidth=384] Image width, in pixels, when rendering a before/after example. - -@returns {template.HTML} - -@examples - - {{< img src="zion-national-park.jpg" >}} - - {{< img src="zion-national-park.jpg" alt="Zion National Park" >}} - - {{< img - src="zion-national-park.jpg" - alt="Zion National Park" - filter="grayscale" - >}} - - {{< img - src="zion-national-park.jpg" - alt="Zion National Park" - filter="process" - filterArgs="resize 400x webp" - >}} - - {{< img - src="zion-national-park.jpg" - alt="Zion National Park" - filter="colorize" - filterArgs="180,50,20" - >}} - - {{< img - src="zion-national-park.jpg" - alt="Zion National Park" - filter="grayscale" - example=true - >}} - - {{< img - src="zion-national-park.jpg" - alt="Zion National Park" - filter="grayscale" - example=true - exampleWidth=400 - >}} - - When using the text filter, provide the arguments in this order: - - 0. The text - 1. The horizontal offset, in pixels, relative to the left of the image (default 20) - 2. The vertical offset, in pixels, relative to the top of the image (default 20) - 3. The font size in pixels (default 64) - 4. The line height (default 1.2) - 5. The font color (default #ffffff) - - {{< img - src="images/examples/zion-national-park.jpg" - alt="Zion National Park" - filter="Text" - filterArgs="Zion National Park,25,250,56" - example=true - >}} - - When using the padding filter, provide all arguments in this order: - - 0. Padding top - 1. Padding right - 2. Padding bottom - 3. Padding right - 4. Canvas color - - {{< img - src="images/examples/zion-national-park.jpg" - alt="Zion National Park" - filter="Padding" - filterArgs="20,50,20,50,#0705" - example=true - >}} - -*/}} - -{{- /* Initialize. */}} -{{- $alt := "" }} -{{- $src := "" }} -{{- $filter := "" }} -{{- $filterArgs := slice }} -{{- $example := false }} -{{- $exampleWidth := 384 }} - -{{- /* Default values to use with the text filter. */}} -{{ $textFilterOpts := dict - "xOffset" 20 - "yOffset" 20 - "fontSize" 64 - "lineHeight" 1.2 - "fontColor" "#ffffff" - "fontPath" "https://github.com/google/fonts/raw/main/apache/roboto/static/Roboto-Regular.ttf" -}} - -{{- /* Get and validate parameters. */}} -{{- with .Get "alt" }} - {{- $alt = .}} -{{- end }} - -{{- with .Get "src" }} - {{- $src = . }} -{{- else }} - {{- errorf "The %q shortcode requires a file parameter. See %s" .Name .Position }} -{{- end }} - -{{- with .Get "filter" }} - {{- $filter = . | lower }} -{{- end }} - -{{- $validFilters := slice - "brightness" "colorbalance" "colorize" "contrast" "gamma" "gaussianblur" - "grayscale" "hue" "invert" "none" "opacity" "overlay" "padding" "pixelate" - "process" "saturation" "sepia" "sigmoid" "text" "unsharpmask" -}} - -{{- with $filter }} - {{- if not (in $validFilters .) }} - {{- errorf "The filter passed to the %q shortcode is invalid. The filter must be one of %s. See %s" $.Name (delimit $validFilters ", " ", or ") $.Position }} - {{- end }} -{{- end }} - -{{- with .Get "filterArgs" }} - {{- $filterArgs = split . "," }} - {{- $filterArgs = apply $filterArgs "trim" "." " " }} -{{- end }} - -{{- if in (slice "false" false 0) (.Get "example") }} - {{- $example = false }} -{{- else if in (slice "true" true 1) (.Get "example")}} - {{- $example = true }} -{{- end }} - -{{- with .Get "exampleWidth" }} - {{- $exampleWidth = . | int }} -{{- end }} - -{{- /* Get image. */}} -{{- $ctx := dict "page" .Page "src" $src "name" .Name "position" .Position }} -{{- $i := partial "inline/get-resource.html" $ctx }} - -{{- /* Resize if rendering before/after examples. */}} -{{- if $example }} - {{- $i = $i.Resize (printf "%dx" $exampleWidth) }} -{{- end }} - -{{- /* Create filter. */}} -{{- $f := "" }} -{{- $ctx := dict "filter" $filter "args" $filterArgs "name" .Name "position" .Position }} -{{- if eq $filter "brightness" }} - {{- $ctx = merge $ctx (dict "argsRequired" 1) }} - {{- template "validate-arg-count" $ctx }} - {{- $filterArgs = apply $filterArgs "float" "." }} - {{- $ctx = merge $ctx (dict "argName" "percentage" "argValue" (index $filterArgs 0) "min" -100 "max" 100) }} - {{- template "validate-arg-value" $ctx }} - {{- $f = images.Brightness (index $filterArgs 0) }} -{{- else if eq $filter "colorbalance" }} - {{- $ctx = merge $ctx (dict "argsRequired" 3) }} - {{- template "validate-arg-count" $ctx }} - {{- $filterArgs = apply $filterArgs "float" "." }} - {{- $ctx = merge $ctx (dict "argName" "percentage red" "argValue" (index $filterArgs 0) "min" -100 "max" 500) }} - {{- template "validate-arg-value" $ctx }} - {{- $ctx = merge $ctx (dict "argName" "percentage green" "argValue" (index $filterArgs 1) "min" -100 "max" 500) }} - {{- template "validate-arg-value" $ctx }} - {{- $ctx = merge $ctx (dict "argName" "percentage blue" "argValue" (index $filterArgs 2) "min" -100 "max" 500) }} - {{- template "validate-arg-value" $ctx }} - {{- $f = images.ColorBalance (index $filterArgs 0) (index $filterArgs 1) (index $filterArgs 2) }} -{{- else if eq $filter "colorize" }} - {{- $ctx = merge $ctx (dict "argsRequired" 3) }} - {{- template "validate-arg-count" $ctx }} - {{- $filterArgs = apply $filterArgs "float" "." }} - {{- $ctx = merge $ctx (dict "argName" "hue" "argValue" (index $filterArgs 0) "min" 0 "max" 360) }} - {{- template "validate-arg-value" $ctx }} - {{- $ctx = merge $ctx (dict "argName" "saturation" "argValue" (index $filterArgs 1) "min" 0 "max" 100) }} - {{- template "validate-arg-value" $ctx }} - {{- $ctx = merge $ctx (dict "argName" "percentage" "argValue" (index $filterArgs 2) "min" 0 "max" 100) }} - {{- template "validate-arg-value" $ctx }} - {{- $f = images.Colorize (index $filterArgs 0) (index $filterArgs 1) (index $filterArgs 2) }} -{{- else if eq $filter "contrast" }} - {{- $ctx = merge $ctx (dict "argsRequired" 1) }} - {{- template "validate-arg-count" $ctx }} - {{- $filterArgs = apply $filterArgs "float" "." }} - {{- $ctx = merge $ctx (dict "argName" "percentage" "argValue" (index $filterArgs 0) "min" -100 "max" 100) }} - {{- template "validate-arg-value" $ctx }} - {{- $f = images.Contrast (index $filterArgs 0) }} -{{- else if eq $filter "gamma" }} - {{- $ctx = merge $ctx (dict "argsRequired" 1) }} - {{- template "validate-arg-count" $ctx }} - {{- $filterArgs = apply $filterArgs "float" "." }} - {{- $ctx = merge $ctx (dict "argName" "gamma" "argValue" (index $filterArgs 0) "min" 0 "max" 100) }} - {{- template "validate-arg-value" $ctx }} - {{- $f = images.Gamma (index $filterArgs 0) }} -{{- else if eq $filter "gaussianblur" }} - {{- $ctx = merge $ctx (dict "argsRequired" 1) }} - {{- template "validate-arg-count" $ctx }} - {{- $filterArgs = apply $filterArgs "float" "." }} - {{- $ctx = merge $ctx (dict "argName" "sigma" "argValue" (index $filterArgs 0) "min" 0 "max" 1000) }} - {{- template "validate-arg-value" $ctx }} - {{- $f = images.GaussianBlur (index $filterArgs 0) }} -{{- else if eq $filter "grayscale" }} - {{- $ctx = merge $ctx (dict "argsRequired" 0) }} - {{- template "validate-arg-count" $ctx }} - {{- $f = images.Grayscale }} -{{- else if eq $filter "hue" }} - {{- $ctx = merge $ctx (dict "argsRequired" 1) }} - {{- template "validate-arg-count" $ctx }} - {{- $filterArgs = apply $filterArgs "float" "." }} - {{- $ctx = merge $ctx (dict "argName" "shift" "argValue" (index $filterArgs 0) "min" -180 "max" 180) }} - {{- template "validate-arg-value" $ctx }} - {{- $f = images.Hue (index $filterArgs 0) }} -{{- else if eq $filter "invert" }} - {{- $ctx = merge $ctx (dict "argsRequired" 0) }} - {{- template "validate-arg-count" $ctx }} - {{- $f = images.Invert }} -{{- else if eq $filter "opacity" }} - {{- $ctx = merge $ctx (dict "argsRequired" 1) }} - {{- template "validate-arg-count" $ctx }} - {{- $filterArgs = apply $filterArgs "float" "." }} - {{- $ctx = merge $ctx (dict "argName" "opacity" "argValue" (index $filterArgs 0) "min" 0 "max" 1) }} - {{- template "validate-arg-value" $ctx }} - {{- $f = images.Opacity (index $filterArgs 0) }} -{{- else if eq $filter "overlay" }} - {{- $ctx = merge $ctx (dict "argsRequired" 3) }} - {{- template "validate-arg-count" $ctx }} - {{- $ctx := dict "src" (index $filterArgs 0) "name" .Name "position" .Position }} - {{- $overlayImg := partial "inline/get-resource.html" $ctx }} - {{- $f = images.Overlay $overlayImg (index $filterArgs 1 | float ) (index $filterArgs 2 | float) }} -{{- else if eq $filter "padding" }} - {{- $ctx = merge $ctx (dict "argsRequired" 5) }} - {{- template "validate-arg-count" $ctx }} - {{- $f = images.Padding - (index $filterArgs 0 | int) - (index $filterArgs 1 | int) - (index $filterArgs 2 | int) - (index $filterArgs 3 | int) - (index $filterArgs 4) - }} -{{- else if eq $filter "pixelate" }} - {{- $ctx = merge $ctx (dict "argsRequired" 1) }} - {{- template "validate-arg-count" $ctx }} - {{- $filterArgs = apply $filterArgs "float" "." }} - {{- $ctx = merge $ctx (dict "argName" "size" "argValue" (index $filterArgs 0) "min" 0 "max" 1000) }} - {{- template "validate-arg-value" $ctx }} - {{- $f = images.Pixelate (index $filterArgs 0) }} -{{- else if eq $filter "process" }} - {{- $ctx = merge $ctx (dict "argsRequired" 1) }} - {{- template "validate-arg-count" $ctx }} - {{- $f = images.Process (index $filterArgs 0) }} -{{- else if eq $filter "saturation" }} - {{- $ctx = merge $ctx (dict "argsRequired" 1) }} - {{- template "validate-arg-count" $ctx }} - {{- $filterArgs = apply $filterArgs "float" "." }} - {{- $ctx = merge $ctx (dict "argName" "percentage" "argValue" (index $filterArgs 0) "min" -100 "max" 500) }} - {{- template "validate-arg-value" $ctx }} - {{- $f = images.Saturation (index $filterArgs 0) }} -{{- else if eq $filter "sepia" }} - {{- $ctx = merge $ctx (dict "argsRequired" 1) }} - {{- template "validate-arg-count" $ctx }} - {{- $filterArgs = apply $filterArgs "float" "." }} - {{- $ctx = merge $ctx (dict "argName" "percentage" "argValue" (index $filterArgs 0) "min" 0 "max" 100) }} - {{- template "validate-arg-value" $ctx }} - {{- $f = images.Sepia (index $filterArgs 0) }} -{{- else if eq $filter "sigmoid" }} - {{- $ctx = merge $ctx (dict "argsRequired" 2) }} - {{- template "validate-arg-count" $ctx }} - {{- $filterArgs = apply $filterArgs "float" "." }} - {{- $ctx = merge $ctx (dict "argName" "midpoint" "argValue" (index $filterArgs 0) "min" 0 "max" 1) }} - {{- template "validate-arg-value" $ctx }} - {{- $ctx = merge $ctx (dict "argName" "factor" "argValue" (index $filterArgs 1) "min" -10 "max" 10) }} - {{- template "validate-arg-value" $ctx }} - {{- $f = images.Sigmoid (index $filterArgs 0) (index $filterArgs 1) }} -{{- else if eq $filter "text" }} - {{- $ctx = merge $ctx (dict "argsRequired" 1) }} - {{- template "validate-arg-count" $ctx }} - {{- $ctx := dict "src" $textFilterOpts.fontPath "name" .Name "position" .Position }} - {{- $font := or (partial "inline/get-resource.html" $ctx) }} - {{- $fontSize := or (index $filterArgs 3 | int) $textFilterOpts.fontSize }} - {{- $lineHeight := math.Max (or (index $filterArgs 4 | float) $textFilterOpts.lineHeight) 1 }} - {{- $opts := dict - "x" (or (index $filterArgs 1 | int) $textFilterOpts.xOffset) - "y" (or (index $filterArgs 2 | int) $textFilterOpts.yOffset) - "size" $fontSize - "linespacing" (mul (sub $lineHeight 1) $fontSize) - "color" (or (index $filterArgs 5) $textFilterOpts.fontColor) - "font" $font - }} - {{- $f = images.Text (index $filterArgs 0) $opts }} -{{- else if eq $filter "unsharpmask" }} - {{- $ctx = merge $ctx (dict "argsRequired" 3) }} - {{- template "validate-arg-count" $ctx }} - {{- $filterArgs = apply $filterArgs "float" "." }} - {{- $ctx = merge $ctx (dict "argName" "sigma" "argValue" (index $filterArgs 0) "min" 0 "max" 500) }} - {{- template "validate-arg-value" $ctx }} - {{- $ctx = merge $ctx (dict "argName" "amount" "argValue" (index $filterArgs 1) "min" 0 "max" 100) }} - {{- template "validate-arg-value" $ctx }} - {{- $ctx = merge $ctx (dict "argName" "threshold" "argValue" (index $filterArgs 2) "min" 0 "max" 1) }} - {{- template "validate-arg-value" $ctx }} - {{- $f = images.UnsharpMask (index $filterArgs 0) (index $filterArgs 1) (index $filterArgs 2) }} -{{- end }} - -{{- /* Apply filter. */}} -{{- $fi := $i }} -{{- with $f }} - {{- $fi = $i.Filter . }} -{{- end }} - -{{- /* Render. */}} -{{- if $example }} -

Original

- {{ $alt }} -

Processed

- {{ $alt }} -{{- else -}} - {{ $alt }} -{{- end }} - -{{- define "validate-arg-count" }} - {{- $msg := "When using the %q filter, the %q shortcode requires an args parameter with %d %s. See %s" }} - {{- if lt (len .args) .argsRequired }} - {{- $text := "values" }} - {{- if eq 1 .argsRequired }} - {{- $text = "value" }} - {{- end }} - {{- errorf $msg .filter .name .argsRequired $text .position }} - {{- end }} -{{- end }} - -{{- define "validate-arg-value" }} - {{- $msg := "The %q argument passed to the %q shortcode is invalid. Expected a value in the range [%v,%v], but received %v. See %s" }} - {{- if or (lt .argValue .min) (gt .argValue .max) }} - {{- errorf $msg .argName .name .min .max .argValue .position }} - {{- end }} -{{- end }} - -{{- define "partials/inline/get-resource.html" }} - {{- $r := "" }} - {{- $u := urls.Parse .src }} - {{- $msg := "The %q shortcode was unable to resolve %s. See %s" }} - {{- if $u.IsAbs }} - {{- with resources.GetRemote $u.String }} - {{- with .Err }} - {{- errorf "%s" }} - {{- else }} - {{- /* This is a remote resource. */}} - {{- $r = . }} - {{- end }} - {{- else }} - {{- errorf $msg $.name $u.String $.position }} - {{- end }} - {{- else }} - {{- with .page.Resources.Get (strings.TrimPrefix "./" $u.Path) }} - {{- /* This is a page resource. */}} - {{- $r = . }} - {{- else }} - {{- with resources.Get $u.Path }} - {{- /* This is a global resource. */}} - {{- $r = . }} - {{- else }} - {{- errorf $msg $.name $u.Path $.position }} - {{- end }} - {{- end }} - {{- end }} - {{- return $r}} -{{- end -}} diff --git a/layouts/shortcodes/imgproc.html b/layouts/shortcodes/imgproc.html deleted file mode 100644 index c09133ba8..000000000 --- a/layouts/shortcodes/imgproc.html +++ /dev/null @@ -1,37 +0,0 @@ -{{- /* -Renders the given image using the given process specification. - -@param {string} (positional parameter 0) The path to the image, relative to the current page. The image must be a page resource. -@param {string}} (positional parameter 1) The image processing specification. - -@returns template.HTML - -@example {{< imgproc "sunset.jpg" "resize 300x" />}} -*/}} - -{{- with $.Get 0 }} - {{- with $i := $.Page.Resources.Get . }} - {{- with $spec := $.Get 1 }} - {{- with $i.Process . }} -
- -
- - {{- with $.Inner }} - {{ . }} - {{- else }} - {{ $spec }} - {{- end }} - -
-
- {{- end }} - {{- else }} - {{- errorf "The %q shortcode requires a positional parameter (1) containing the image processing specification. See %s" $.Name $.Position }} - {{- end }} - {{- else }} - {{- errorf "The %q shortcode was unable to find %q. See %s" $.Name . $.Position }} - {{- end }} -{{- else }} - {{- errorf "The %q shortcode requires a positional parameter (0) indicating the image path, relative to the current page. See %s" $.Name $.Position }} -{{- end }} diff --git a/layouts/shortcodes/new-in.html b/layouts/shortcodes/new-in.html deleted file mode 100644 index 9236cf2bc..000000000 --- a/layouts/shortcodes/new-in.html +++ /dev/null @@ -1,13 +0,0 @@ -{{ $version := .Get 0 }} -{{ if not $version }} - {{ errorf "Missing version in new-in shortcode " }} -{{ end }} -{{ $version = $version | strings.TrimPrefix "v" }} -
diff --git a/layouts/shortcodes/note.html b/layouts/shortcodes/note.html deleted file mode 100644 index 99818114e..000000000 --- a/layouts/shortcodes/note.html +++ /dev/null @@ -1,7 +0,0 @@ -{{ $_hugo_config := `{ "version": 1 }` }} - -