diff options
Diffstat (limited to 'docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes')
29 files changed, 858 insertions, 166 deletions
diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/chroma-lexers.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/chroma-lexers.html new file mode 100644 index 000000000..2e10c3dee --- /dev/null +++ b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/chroma-lexers.html @@ -0,0 +1,6 @@ +<dl> + {{ range .Site.Data.docs.chroma.lexers }} + <dt>{{ .Name }}</dt> + <dd>{{ with .Aliases }}{{ delimit . ", " }}{{ end }}</dd> + {{ end }} +</dl> diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/code-toggle.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/code-toggle.html index c695a7aae..d1131132d 100644 --- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/code-toggle.html +++ b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/code-toggle.html @@ -1,24 +1,101 @@ -{{ $langs := (slice "yaml" "toml" "json") }} -<div class="code relative" {{ with .Get "file" }}id="{{ . | urlize}}"{{ end }}> - <div class="code-nav flex flex-nowrap items-stretch"> - {{- with .Get "file" -}} - <div class="san-serif f6 dib lh-solid pl2 pv2 mr2">{{ . }}.</div> - {{- end -}} - {{ range $langs }} - <button data-toggle-tab="{{ . }}" class="tab-button {{ cond (eq . "yaml") "active" ""}} ba san-serif f6 dib lh-solid ph2 pv2">{{ . }}</button> - {{ end }} - </div> - <div class="tab-content"> - {{ range $langs }} - <div data-pane="{{ . }}" class="code-copy-content nt3 tab-pane {{ cond (eq . "yaml") "active" ""}}"> - {{ highlight ($.Inner | transform.Remarshal . | safeHTML) . ""}} - </div> - {{ if ne ($.Get "copy") "false" }} - <button class="needs-js copy copy-toggle bg-accent-color-dark f6 absolute top-0 right-0 lh-solid hover-bg-primary-color-dark bn white ph3 pv2" title="Copy this code to your clipboard." data-clipboard-action="copy" aria-label="copy button"> - </button> - {{/* 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 }} - </div> +{{- /* + 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=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. + + @returns {template.HTML} +*/}} + +{{- /* Initialize. */}} +{{- $config := "" }} +{{- $dataKey := "" }} +{{- $copy := false }} +{{- $file := "" }} +{{- $fm := false }} +{{- $skipHeader := false }} + +{{- /* Get parameters. */}} +{{- $config = .Get "config" }} +{{- $dataKey = .Get "dataKey" }} +{{- $file = .Get "file" }} +{{- if in (slice "false" false 0) (.Get "copy") }} + {{- $copy = false }} +{{- else if in (slice "true" true 1) (.Get "copy") }} + {{- $copy = true }} +{{- end }} +{{- if in (slice "false" false 0) (.Get "fm") }} + {{- $fm = false }} +{{- else if in (slice "true" true 1) (.Get "fm") }} + {{- $fm = true }} +{{- end }} +{{- if in (slice "false" false 0) (.Get "skipHeader") }} + {{- $skipHeader = false }} +{{- else if in (slice "true" true 1) (.Get "skipHeader") }} + {{- $skipHeader = true }} +{{- end }} + +{{- /* Define constants. */}} +{{- $delimiters := dict "toml" "+++" "yaml" "---" }} +{{- $langs := slice "yaml" "toml" "json" }} +{{- $placeHolder := "#-hugo-placeholder-#" }} + +{{- /* Render. */}} +{{- $code := "" }} +{{- if $config }} + {{- $file = $file | default "hugo" }} + {{- $sections := (split $config ".") }} + {{- $configSection := index $.Site.Data.docs.config $sections }} + {{- $code = dict $sections $configSection }} + {{- if $skipHeader }} + {{- $code = $configSection }} + {{- end }} +{{- else if $dataKey }} + {{- $file = $file | default $dataKey }} + {{- $sections := (split $dataKey ".") }} + {{- $code = index $.Site.Data.docs $sections }} +{{- else }} + {{- $code = $.Inner }} +{{- end }} +<div class="code relative" {{ with $file }}id="{{ . | urlize }}"{{ end }}> + <div class="code-nav flex flex-nowrap items-stretch"> + {{- with $file }} + <div class="san-serif f6 dib lh-solid pl2 pv2 mr2"> + {{ . }}{{ if not $fm }}.{{ end }} + </div> + {{- end }} + {{- range $langs }} + <button + data-toggle-tab="{{ . }}" + class="tab-button {{ cond (eq . "yaml") "active" "" }} ba san-serif f6 dib lh-solid ph2 pv2"> + {{ . }} + </button> + + {{- end }} + </div> + <div class="tab-content"> + {{- range $langs }} + <div + data-pane="{{ . }}" + class="code-copy-content nt3 tab-pane {{ cond (eq . "yaml") "active" "" }}"> + {{- $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 }} + </div> + {{- if $copy }} + <button + class="needs-js copy copy-toggle bg-accent-color-dark f6 absolute top-0 right-0 lh-solid hover-bg-primary-color-dark bn white ph3 pv2" + title="Copy this code to your clipboard." + data-clipboard-action="copy" + aria-label="copy button"></button> + {{- /* 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 }} + </div> </div> diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/code.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/code.html index 6df49956a..dd21551cb 100644 --- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/code.html +++ b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/code.html @@ -1,15 +1,35 @@ -<div class="code relative bg-primary-color moon-gray" id="{{.Get "file" | urlize}}"> - {{- with .Get "file" -}} - <div class="filename san-serif f6 dib lh-solid pl2 pv2">{{.}}</div> - {{- end -}} - - {{ if ne (.Get "copy") "false" }} - <button class="needs-js copy bg-accent-color-dark f6 absolute top-0 right-0 lh-solid hover-bg-primary-color-dark bn white ph3 pv2" title="Copy this code to your clipboard." data-clipboard-action="copy" aria-label="copy button"> - </button> - {{/* 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}} - <div class="code-copy-content nt3" {{with .Get "download"}}id="{{.}}"{{end}}> - {{- .Inner -}} - </div> +{{- /* +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. */}} +<div class="code relative" id="{{ $file | urlize }}"> + <div class="f6 dib lh-solid pl2 pv2">{{ $file | htmlUnescape }}</div> + {{- if $copy }} + <button class="needs-js copy bg-accent-color-dark f6 absolute top-0 right-0 lh-solid hover-bg-primary-color-dark bn white ph3 pv2" title="Copy this code to your clipboard." data-clipboard-action="copy" aria-label="copy button"></button> + {{- end }} + <div class="code-copy-content nt3"> + {{- highlight (trim .Inner "\n\r") $lang }} + </div> </div> diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/datatable-filtered.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/datatable-filtered.html new file mode 100644 index 000000000..ff3f299bd --- /dev/null +++ b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/datatable-filtered.html @@ -0,0 +1,39 @@ +{{ $package := (index .Params 0) }} +{{ $listname := (index .Params 1) }} +{{ $filter := split (index .Params 2) " " }} +{{ $filter1 := index $filter 0 }} +{{ $filter2 := index $filter 1 }} +{{ $filter3 := index $filter 2 }} + +{{ $list := (index (index .Site.Data.docs $package) $listname) }} +{{ $fields := after 3 .Params }} +{{ $list := where $list $filter1 $filter2 $filter3 }} + +<table class="table table-bordered"> + <tr> + {{ range $fields }} + <th>{{ . }}</th> + {{ end }} + </tr> + {{ range $list }} + <tr> + {{ range $k, $v := . }} + {{ $.Scratch.Set $k $v }} + {{ end }} + {{ range $k, $v := $fields }} + <td> + {{ $tdContent := $.Scratch.Get . }} + {{ if eq $k 3 }} + {{ printf "%v" $tdContent | + strings.ReplaceRE `\[` "<ol><li>" | + strings.ReplaceRE `\s` "</li><li>" | + strings.ReplaceRE `\]` "</li></ol>" | + safeHTML }} + {{ else }} + {{ $tdContent }} + {{ end}} + </td> + {{ end }} + </tr> + {{ end }} +</table> diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/datatable.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/datatable.html index 7ddda86d0..12054f89d 100644 --- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/datatable.html +++ b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/datatable.html @@ -1,18 +1,33 @@ -<table class="utils-table"> -<thead> - <tr> - <td class="col-title">Title</td> - <td class="col-author">Author</td> - <td class="col-date">Date</td> - </tr> -</thead> -<tbody> - {{ range $ind, $art := $.Site.Data.articles.article }} - <tr> - <td><a href="{{$art.url}}" target="_blank">{{$art.title | markdownify }}</a></td> - <td>{{ $art.author | markdownify }}</td> - <td>{{ $art.date }}</td> - </tr> - {{ end }} -</tbody> -</table>
\ No newline at end of file +{{ $package := (index .Params 0) }} +{{ $listname := (index .Params 1) }} +{{ $list := (index (index .Site.Data.docs $package) $listname) }} +{{ $fields := after 2 .Params }} + + +<table class="table table-bordered"> + <tr> + {{ range $fields }} + {{ $s := . }} + {{ if eq $s "_key" }} + {{ $s = "Type" }} + {{ end }} + <th>{{ $s }}</th> + {{ end }} + </tr> + {{ range $k1, $v1 := $list }} + <tr> + {{ range $k2, $v2 := . }} + {{ $.Scratch.Set $k2 $v2 }} + {{ end }} + {{ range $fields }} + {{ $s := "" }} + {{ if eq . "_key" }} + {{ $s = $k1 }} + {{ else }} + {{ $s = $.Scratch.Get . }} + {{ end }} + <td>{{ $s }}</td> + {{ end }} + </tr> + {{ end }} +</table> diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/deprecated-in.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/deprecated-in.html new file mode 100644 index 000000000..cab85541d --- /dev/null +++ b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/deprecated-in.html @@ -0,0 +1,14 @@ +{{ $_hugo_config := `{ "version": 1 }` }} + +{{ with .Get 0 }} + {{ $version := printf "v%v" (strings.TrimLeft "vV" .) }} + {{ $href := printf "https://github.com/gohugoio/hugo/releases/tag/%s" $version }} + <aside> + <div class="admonition-content bl bw2 b--dark-red" > + <p>Deprecated in <a href="{{ $href }}">{{ $version }}</a></p> + {{ $.Inner }} + </div> + </aside> +{{ else }} + {{ errorf "The %q shortcode requires a single positional parameter indicating version. See %s" .Name .Position }} +{{ end }} diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/directoryindex.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/directoryindex.html deleted file mode 100644 index 37e7d3ad1..000000000 --- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/directoryindex.html +++ /dev/null @@ -1,13 +0,0 @@ -{{- $pathURL := .Get "pathURL" -}} -{{- $path := .Get "path" -}} -{{- $files := readDir $path -}} -<table> - <th>Size in bytes</th> - <th>Name</th> -{{- range $files }} - <tr> - <td>{{ .Size }}</td> - <td><a href="{{ $pathURL }}{{ .Name | relURL }}" target="_blank"> {{ .Name }}</a></td> - </tr> -{{- end }} -</table> diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/docfile.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/docfile.html deleted file mode 100644 index 2f982aae8..000000000 --- a/docs/_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 }} -<div class="code-copy" id="{{$file | urlize}}"> - <div class="code-copy-header"><div class="action-buttons"></div><span title="" class="filename">{{$filepath}}</span><i class="icon-{{$syntax}} input"></i></div> - <button class="copy-button" title="Copy to clipboard" data-clipboard-snippet> - <div class="copy-text"><i class="icon-clipboard"></i> COPY</div> - </button> - <pre><code class="language-{{if $syntaxoverride}}{{.Get 1}}{{else}}{{$syntax}}{{end}}">{{- readFile $file -}}</code></pre> -</div> diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/exfile.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/exfile.html deleted file mode 100644 index 226782957..000000000 --- a/docs/_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 }} -<div class="code-copy" id="{{$file | urlize}}"> - <div class="code-copy-header examplesite"><div class="action-buttons"></div><span class="filename"><i class="icon-website"></i>{{$filepath}}</span><i class="icon-{{$syntax}} input"></i></div> - <button class="copy-button" title="Copy to clipboard" data-clipboard-snippet> - <div class="copy-text"><i class="icon-clipboard"></i> COPY</div> - </button> - <pre><code class="language-{{if $syntaxoverride}}{{.Get 1}}{{else}}{{$syntax}}{{end}}">{{- readFile $file -}}</code></pre> - <a role="button" target="_blank" href="{{$.Site.Params.ghdocsrepo}}{{$file}}" title="See {{$filepath}} source on GitHub" class="tooltip see-on-github" data-tooltip="See {{$filepath}} source on GitHub">Source<i class="icon-github"></i></a> -</div> diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/exfm.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/exfm.html deleted file mode 100644 index c0429bbe1..000000000 --- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/exfm.html +++ /dev/null @@ -1,13 +0,0 @@ -<!-- Similar to exfile.html but *only* pulls the front matter from the example/content/*md --> -{{ $file := .Get 0}} -{{ $filepath := replace $file "static/" ""}} -{{ $syntax := index (split $file ".") 1 }} -{{ $syntaxoverride := eq (len .Params) 2 }} -<div class="code-copy" id="{{$file | urlize}}"> - <div class="code-copy-header examplesite"><div class="action-buttons"></div><span title="" class="filename">{{$filepath}}</span><i class="icon-{{$syntax}} input"></i></div> - <button class="copy-button" title="Copy to clipboard" data-clipboard-snippet> - <div class="copy-text"><i class="icon-clipboard"></i> COPY</div> - </button> - <pre><code class="language-{{if $syntaxoverride}}{{.Get 1}}{{else}}{{$syntax}}{{end}}">{{- readFile $file -}}</code></pre> - <a role="button" target="_blank" href="{{$.Site.Params.ghdocsrepo}}{{$file}}" title="See {{$filepath}} on GitHub" class="see-on-github">Source<i class="icon-github"></i></a> -</div>
\ No newline at end of file diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/funcsig.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/funcsig.html new file mode 100644 index 000000000..4e96504ab --- /dev/null +++ b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/funcsig.html @@ -0,0 +1,4 @@ +<h4 class="minor mb1 pt2 primary-color-dark">Syntax</h4> +<pre class="f5 mb4 ph3 pv2 bg-light-gray overflow-x-auto" style="border-left:4px solid #0594CB;"> + {{- .Inner -}} +</pre> diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/gh.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/gh.html deleted file mode 100644 index e027dc0f0..000000000 --- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/gh.html +++ /dev/null @@ -1,9 +0,0 @@ -{{ range .Params }} - {{ if eq (substr . 0 1) "@" }} - <a href="//github.com/{{ substr . 1 }}">{{ . }}</a> - {{ else if eq (substr . 0 2) "0x" }} - <a href="//github.com/gohugoio/hugo/commit/{{ substr . 2 }}">{{ substr . 2 6 }}</a> - {{ else }} - <a href="//github.com/gohugoio/hugo/issues/{{ . }}">#{{ . }}</a> - {{ end }} -{{ end }}
\ No newline at end of file diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/ghrepo.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/ghrepo.html deleted file mode 100644 index e9df40d6a..000000000 --- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/ghrepo.html +++ /dev/null @@ -1 +0,0 @@ -<a href="{{$.Site.Params.ghrepo}}" target="_blank">GitHub repository</a>
\ No newline at end of file diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/gomodules-info.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/gomodules-info.html new file mode 100644 index 000000000..b56758ac3 --- /dev/null +++ b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/gomodules-info.html @@ -0,0 +1,17 @@ +{{ $text := ` +Most of the commands for **Hugo Modules** require a newer version of Go installed (see https://golang.org/dl/) and the relevant VCS client (e.g. Git, see https://git-scm.com/downloads/ ). If you have an "older" site running on Netlify, you may have to set GO_VERSION to 1.12 in your Environment settings. + +For more information about Go Modules, see: + +* https://github.com/golang/go/wiki/Modules +* https://blog.golang.org/using-go-modules +` }} + +<aside class="admonition note"> + <div class="note-icon"> + {{partial "svg/exclamation.svg" (dict "size" "20px" ) }} + </div> + <div class="admonition-content"> + {{- $text | markdownify -}} + </div> +</aside> diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/img.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/img.html new file mode 100644 index 000000000..ea5b6de1d --- /dev/null +++ b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/img.html @@ -0,0 +1,374 @@ +{{- /* +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 |