mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
Merge commit 'b9bd35d72e14932fb6588ff62b90cddef0a060fc' as 'docs'
This commit is contained in:
2
docs/layouts/shortcodes/asciicast.html
Normal file
2
docs/layouts/shortcodes/asciicast.html
Normal file
@@ -0,0 +1,2 @@
|
||||
{{ $id := .Get 0 }}
|
||||
<script type="text/javascript" src="https://asciinema.org/a/{{ $id }}.js" id="asciicast-{{ $id }}" data-rows="10" async></script>
|
6
docs/layouts/shortcodes/chroma-lexers.html
Normal file
6
docs/layouts/shortcodes/chroma-lexers.html
Normal file
@@ -0,0 +1,6 @@
|
||||
<dl>
|
||||
{{ range .Site.Data.docs.chroma.lexers }}
|
||||
<dt>{{ .Name }}</dt>
|
||||
<dd>{{ delimit .Aliases ", " }}</dd>
|
||||
{{ end }}
|
||||
</dl>
|
25
docs/layouts/shortcodes/code.html
Normal file
25
docs/layouts/shortcodes/code.html
Normal file
@@ -0,0 +1,25 @@
|
||||
{{ $file := .Get "file" }}
|
||||
{{ $codeLang := "" }}
|
||||
{{ $suffix := findRE "(\\.[^.]+)$" $file 1 }}
|
||||
{{ with $suffix }}
|
||||
{{ $codeLang = (index . 0 | strings.TrimPrefix ".") }}
|
||||
{{ end }}
|
||||
{{ with .Get "codeLang" }}{{ $codeLang = . }}{{ end }}
|
||||
{{ if eq $codeLang "html"}}
|
||||
{{ $codeLang = "go-html-template" }}
|
||||
{{ end }}
|
||||
<div class="code relative" id="{{ $file | urlize}}">
|
||||
{{- with $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}}>
|
||||
{{ if .Get "nocode" }}{{ $.Inner }}{{ else }}{{ with $codeLang }}{{- highlight $.Inner . "" | -}}{{ else }}<pre><code>{{- .Inner | string -}}</code></pre>{{ end }}{{ end }}
|
||||
</div>
|
||||
|
||||
</div>
|
28
docs/layouts/shortcodes/datatable-filtered.html
Normal file
28
docs/layouts/shortcodes/datatable-filtered.html
Normal file
@@ -0,0 +1,28 @@
|
||||
{{ $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 $fields }}
|
||||
<td>{{ $.Scratch.Get . }}</td>
|
||||
{{ end }}
|
||||
</tr>
|
||||
{{ end }}
|
||||
</table>
|
22
docs/layouts/shortcodes/datatable.html
Normal file
22
docs/layouts/shortcodes/datatable.html
Normal file
@@ -0,0 +1,22 @@
|
||||
{{ $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 }}
|
||||
<th>{{ . }}</th>
|
||||
{{ end }}
|
||||
</tr>
|
||||
{{ range $list }}
|
||||
<tr>
|
||||
{{ range $k, $v := . }}
|
||||
{{ $.Scratch.Set $k $v }}
|
||||
{{ end }}
|
||||
{{ range $fields }}
|
||||
<td>{{ $.Scratch.Get . }}</td>
|
||||
{{ end }}
|
||||
</tr>
|
||||
{{ end }}
|
||||
</table>
|
13
docs/layouts/shortcodes/directoryindex.html
Normal file
13
docs/layouts/shortcodes/directoryindex.html
Normal file
@@ -0,0 +1,13 @@
|
||||
{{- $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>
|
11
docs/layouts/shortcodes/docfile.html
Normal file
11
docs/layouts/shortcodes/docfile.html
Normal file
@@ -0,0 +1,11 @@
|
||||
{{ $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>
|
12
docs/layouts/shortcodes/exfile.html
Normal file
12
docs/layouts/shortcodes/exfile.html
Normal file
@@ -0,0 +1,12 @@
|
||||
{{ $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>
|
13
docs/layouts/shortcodes/exfm.html
Normal file
13
docs/layouts/shortcodes/exfm.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<!-- 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>
|
4
docs/layouts/shortcodes/funcsig.html
Normal file
4
docs/layouts/shortcodes/funcsig.html
Normal file
@@ -0,0 +1,4 @@
|
||||
<h4 class="minor mb1 pt2 primary-color-dark">Syntax</h4>
|
||||
<pre class="f5 mb4 ph3 pv2 bg-light-gray" style="border-left:4px solid #0594CB;">
|
||||
{{- .Inner -}}
|
||||
</pre>
|
9
docs/layouts/shortcodes/gh.html
Normal file
9
docs/layouts/shortcodes/gh.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{{ 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 }}
|
1
docs/layouts/shortcodes/ghrepo.html
Normal file
1
docs/layouts/shortcodes/ghrepo.html
Normal file
@@ -0,0 +1 @@
|
||||
<a href="{{$.Site.Params.ghrepo}}" target="_blank">GitHub repository</a>
|
17
docs/layouts/shortcodes/gomodules-info.html
Normal file
17
docs/layouts/shortcodes/gomodules-info.html
Normal file
@@ -0,0 +1,17 @@
|
||||
{{ $text := `
|
||||
Most of the commands for **Hugo Modules** requires 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>
|
25
docs/layouts/shortcodes/imgproc.html
Normal file
25
docs/layouts/shortcodes/imgproc.html
Normal file
@@ -0,0 +1,25 @@
|
||||
{{ $original := .Page.Resources.GetMatch (printf "*%s*" (.Get 0)) }}
|
||||
{{ $command := .Get 1 }}
|
||||
{{ $options := .Get 2 }}
|
||||
{{ if eq $command "Fit"}}
|
||||
{{ .Scratch.Set "image" ($original.Fit $options) }}
|
||||
{{ else if eq $command "Resize"}}
|
||||
{{ .Scratch.Set "image" ($original.Resize $options) }}
|
||||
{{ else if eq $command "Fill"}}
|
||||
{{ .Scratch.Set "image" ($original.Fill $options) }}
|
||||
{{ else }}
|
||||
{{ errorf "Invalid image processing command: Must be one of Fit, Fill or Resize."}}
|
||||
{{ end }}
|
||||
{{ $image := .Scratch.Get "image" }}
|
||||
<figure style="padding: 0.25rem; margin: 2rem 0; background-color: #cccc">
|
||||
<img style="max-width: 100%; width: auto; height: auto;" src="{{ $image.RelPermalink }}" width="{{ $image.Width }}" height="{{ $image.Height }}">
|
||||
<figcaption>
|
||||
<small>
|
||||
{{ with .Inner }}
|
||||
{{ . }}
|
||||
{{ else }}
|
||||
.{{ $command }} "{{ $options }}"
|
||||
{{ end }}
|
||||
</small>
|
||||
</figcaption>
|
||||
</figure>
|
1
docs/layouts/shortcodes/module-mounts-note.html
Normal file
1
docs/layouts/shortcodes/module-mounts-note.html
Normal file
@@ -0,0 +1 @@
|
||||
Also see [Module Mounts Config](/hugo-modules/configuration/#module-config-mounts) for an alternative way to configure this directory (from Hugo 0.56).
|
1
docs/layouts/shortcodes/nohighlight.html
Normal file
1
docs/layouts/shortcodes/nohighlight.html
Normal file
@@ -0,0 +1 @@
|
||||
<pre><code class="hljs nohighlight">{{ .Inner }}</code></pre>
|
9
docs/layouts/shortcodes/note.html
Normal file
9
docs/layouts/shortcodes/note.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{{ $_hugo_config := `{ "version": 1 }` }}
|
||||
<aside class="admonition note">
|
||||
<div class="note-icon">
|
||||
{{partial "svg/exclamation.svg" (dict "size" "20px" ) }}
|
||||
</div>
|
||||
<!-- <h2 id="{{if .Get 0}}{{.Get 0 | urlize}}{{else}}note{{end}}">{{if .Get 0}}{{.Get 0 | markdownify}}{{else}}Note{{end}}</h2> -->
|
||||
<!-- <h3>Note</h3> -->
|
||||
<div class="admonition-content">{{- .Inner -}}</div>
|
||||
</aside>
|
8
docs/layouts/shortcodes/output.html
Normal file
8
docs/layouts/shortcodes/output.html
Normal file
@@ -0,0 +1,8 @@
|
||||
{{$file := .Get "file"}}
|
||||
{{$icon := index (split $file ".") 1 }}
|
||||
<div class="code" id="{{$file | urlize}}">
|
||||
<div class="filename" title="{{$file}}">{{$file}}</div>
|
||||
<div class="code-copy-content output-content">
|
||||
<pre><code>{{- .Inner | string -}}</code></pre>
|
||||
</div>
|
||||
</div>
|
8
docs/layouts/shortcodes/readfile.html
Normal file
8
docs/layouts/shortcodes/readfile.html
Normal file
@@ -0,0 +1,8 @@
|
||||
{{$file := .Get "file"}}
|
||||
{{- if eq (.Get "markdown") "true" -}}
|
||||
{{- $file | readFile | markdownify -}}
|
||||
{{- else if (.Get "highlight") -}}
|
||||
{{- highlight ($file | readFile) (.Get "highlight") "" -}}
|
||||
{{- else -}}
|
||||
{{ $file | readFile | safeHTML }}
|
||||
{{- end -}}
|
9
docs/layouts/shortcodes/tip.html
Normal file
9
docs/layouts/shortcodes/tip.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{{ $_hugo_config := `{ "version": 1 }` }}
|
||||
<aside class="admonition tip">
|
||||
<div class="tip-icon">
|
||||
{{partial "svg/exclamation.svg" .}}
|
||||
</div>
|
||||
<!-- <h2 id="{{if .Get 0}}{{.Get 0 | urlize}}{{else}}tip{{end}}">{{if .Get 0}}{{.Get 0 | markdownify}}{{else}}Tip{{end}}</h2> -->
|
||||
<!-- <h3>Tip</h3> -->
|
||||
<div class="admonition-content">{{- .Inner -}}</div>
|
||||
</aside>
|
1
docs/layouts/shortcodes/todo.html
Normal file
1
docs/layouts/shortcodes/todo.html
Normal file
@@ -0,0 +1 @@
|
||||
{{ if .Inner }}{{ end }}
|
9
docs/layouts/shortcodes/warning.html
Normal file
9
docs/layouts/shortcodes/warning.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{{ $_hugo_config := `{ "version": 1 }` }}
|
||||
<aside class="admonition warning">
|
||||
<div class="admonition-icon">
|
||||
{{partial "svg/exclamation.svg" .}}
|
||||
</div>
|
||||
<!-- <h2 id="{{if .Get 0}}{{.Get 0 | urlize}}{{else}}warning{{end}}">{{if .Get 0}}{{.Get 0 | markdownify}}{{else}}Warning{{end}}</h2> -->
|
||||
<!-- <h3>Warning</h3> -->
|
||||
<div class="admonition-content">{{- .Inner -}}</div>
|
||||
</aside>
|
11
docs/layouts/shortcodes/yt.html
Normal file
11
docs/layouts/shortcodes/yt.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<div class="video-wrapper" data-streaming="youtube" data-videoid="{{.Get "id"}}" >
|
||||
<i class="icon-video-play-button shortcode"></i>
|
||||
{{if (.Get "thumbnail")}}
|
||||
<div style="background-image:url(/images/thumbnails/{{.Get "thumbnail"}})" alt="YouTube Thumbnail" class="video-thumbnail"></div>
|
||||
{{else}}
|
||||
<div style="background-image:url(//img.youtube.com/vi/{{.Get "id"}}/0.jpg)" alt="YouTube Thumbnail" class="video-thumbnail"></div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{ if (.Get "description") }}
|
||||
<div class="video-description">{{ .Get "description" | markdownify }}</div>
|
||||
{{ end }}
|
Reference in New Issue
Block a user