diff options
Diffstat (limited to 'docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials')
18 files changed, 155 insertions, 79 deletions
diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/boxes-section-summaries.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/boxes-section-summaries.html index b7e37c47c..b293dc17d 100644 --- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/boxes-section-summaries.html +++ b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/boxes-section-summaries.html @@ -1,35 +1,46 @@ <div class="relative {{ .classes }} weight-{{ .context.Weight }}"> - <div class="bg-white mb2 pa3 pa4-l gray"> + + {{ $href := .context.RelPermalink }} {{ if eq .context.Section "news" }} - <date class="f6 db" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}"> + {{ $href = .context.Permalink }} + <time class="f6 db" datetime="{{ .context.Date.Format `2006-01-02T15:04:05Z07:00` }}"> {{ .context.Date.Format "January 2, 2006" }} - </date> + </time> {{ end }} <h1 class="near-black f3"> - <a href="{{ .context.RelPermalink }}" class="link primary-color dim"> - {{- if eq .context.Section "functions" -}} - {{ .context.LinkTitle }} - {{- else -}} + <a href="{{ $href }}" class="link primary-color dim"> {{ .context.Title }} - {{- end -}} </a> </h1> - <div class="lh-copy links"> - {{ if .context.Params.description }} + {{ if eq .context.Section "commands" }} + {{ replaceRE `(?s).*?##\s.*?\n\n(.*?)\n.*` "$1" .context.RawContent }} + {{ else }} + + {{ if in (slice "functions" "methods") .context.Type }} + {{ with $signature := index .context.Params.action.signatures 0 }} + {{ if $.context.Params.action.returnType }} + {{ $signature = printf "%s ⟼ %s" $signature $.context.Params.action.returnType }} + {{ end }} + <pre class="f6 mb3 ph3 pv2 bg-light-gray overflow-x-auto"> + {{- $signature -}} + </pre> + {{ end }} + {{ end }} + + {{ if .context.Params.description }} {{ .context.Params.description | markdownify }} {{ else }} {{ .context.Summary }} - {{ end }} - - <a href="{{ .context.RelPermalink }}" class="f6 mt2 db link primary-color dim"> - Read More » - </a> + {{ end }} + {{ end }} + <a href="{{ $href }}" class="f6 mt2 db link primary-color dim"> + Read More » + </a> </div> - </div> </div> diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/boxes-small-news.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/boxes-small-news.html index 0b0125740..0d53c5465 100644 --- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/boxes-small-news.html +++ b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/boxes-small-news.html @@ -1,18 +1 @@ -<section class="relative w-100 bg-black white"> - <div class="flex flex-wrap w-90-l center center mw9"> - <!-- <a href="/news/" class="link accent-color tr-ns f6 w-100 w-50-m w-10-l bg-animate hover-bg-accent-color hover-white pv3 pv4-l ph3 ph4-l dib"> - Latest News: - </a> --> - {{ range first 4 ( sort (where .Site.RegularPages "Section" "news") "Date" "desc" ) }} - <!-- only show 2 boxes on mobile --> - {{ $.Scratch.Add "i" 1 }}{{ $i := $.Scratch.Get "i" }} - <a href="{{ .RelPermalink }}" class="link lh-copy light-gray f6 w-100 w-50-m w-25-l bg-animate hover-bg-accent-color hover-white pv3 pv4-ns ph3 ph4-ns{{ if ge $i 3 }} dn dib-l{{ else }} dib{{ end }}"> - <span class="f6 gray pb1 db"> - {{ .Date.Format "January 2, 2006" }} - </span> - {{ .Params.description | markdownify | truncate 100 "…"}} - </a> - {{ end }} - - </div> -</section> +{{/* Empty for now. */}} diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/docs/functions-aliases.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/docs/functions-aliases.html new file mode 100644 index 000000000..3db9db4dc --- /dev/null +++ b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/docs/functions-aliases.html @@ -0,0 +1,12 @@ +{{- with .Params.action.aliases }} + {{- $label := "Alias" }} + {{- if gt (len .) 1 }} + {{- $label = "Aliases" }} + {{- end }} + <p class="fw7 primary-color-dark">{{ $label }}</p> + {{- range . }} + <pre class="f5 ph3 pv2 bg-light-gray" style="border-left:4px solid #0594CB;"> + {{- . -}} + </pre> + {{- end }} +{{- end -}} diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/docs/functions-return-type.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/docs/functions-return-type.html new file mode 100644 index 000000000..5b01bb560 --- /dev/null +++ b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/docs/functions-return-type.html @@ -0,0 +1,6 @@ +{{- with .Params.action.returnType }} + <p class="fw7 primary-color-dark">Returns</p> + <pre class="f5 ph3 pv2 bg-light-gray" style="border-left:4px solid #0594CB;"> + {{- . -}} + </pre> +{{- end -}} diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/docs/functions-signature.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/docs/functions-signature.html deleted file mode 100644 index 090b9243b..000000000 --- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/docs/functions-signature.html +++ /dev/null @@ -1,11 +0,0 @@ -{{ if isset .Params "signature" -}} - {{- with .Params.signature }} - <h2 class="minor mb1 pt4 primary-color-dark">Syntax</h2> - {{- range . }} - <pre class="f5 mb4 ph3 pv2 bg-light-gray" style="border-left:4px solid #0594CB;"> - {{- . -}} - </pre> - {{- end }} - {{- end -}} -{{ end }} -{{/* The inline style overrides `pre` styling defaults */}} diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/docs/functions-signatures.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/docs/functions-signatures.html new file mode 100644 index 000000000..dce160227 --- /dev/null +++ b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/docs/functions-signatures.html @@ -0,0 +1,12 @@ +{{- with .Params.action.signatures }} + <p class="fw7 primary-color-dark">Syntax</p> + {{- range . }} + {{- $signature := . }} + {{- if $.Params.function.returnType }} + {{- $signature = printf "%s ⟼ %s" . $.Params.function.returnType }} + {{- end }} + <pre class="f5 ph3 pv2 bg-light-gray overflow-x-auto" style="border-left:4px solid #0594CB;"> + {{- $signature -}} + </pre> + {{- end }} +{{- end -}} diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/gtag.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/gtag.html index fe9f4d2aa..7c6a9ade5 100644 --- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/gtag.html +++ b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/gtag.html @@ -1,4 +1,4 @@ -{{ with .Site.GoogleAnalytics }} +{{ with site.Config.Services.GoogleAnalytics.ID }} <script async src="https://www.googletagmanager.com/gtag/js?id={{ . }}"></script> <script> window.dataLayer = window.dataLayer || []; diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/home-page-sections/tweets.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/home-page-sections/tweets.html index 5aebf6737..32eb46ba8 100644 --- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/home-page-sections/tweets.html +++ b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/home-page-sections/tweets.html @@ -6,6 +6,7 @@ <div class="flex-ns flex-wrap justify-between"> + {{ if $.Site.Data.homepagetweets }} {{ range first 4 (sort $.Site.Data.homepagetweets.tweet "date" "desc" ) }} <div class="homepage-tweet relative {{ $interior_classes }} br1 mid-gray pv3 nested-links shadow-5"> <div class="absolute top-0 left-0 ma2 o-10"> @@ -21,5 +22,6 @@ </blockquote> </div> {{ end }} + {{ end }} </div> </div> diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/hooks/before-body-end.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/hooks/before-body-end.html index 426abd018..dab653508 100644 --- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/hooks/before-body-end.html +++ b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/hooks/before-body-end.html @@ -1 +1,7 @@ -{{/* Deliberately empty */}} +{{ if .Page.Store.Get "hasMermaid" }} + <script type="module" async> + import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@9/+esm'; + + mermaid.initialize({ startOnLoad: true }); + </script> +{{ end }} diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/maintenance-pages-table.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/maintenance-pages-table.html new file mode 100644 index 000000000..a2429a335 --- /dev/null +++ b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/maintenance-pages-table.html @@ -0,0 +1,24 @@ +<table class="collapse ba br2 b--black-10 pv2 ph3"> + <thead> + <tr> + <th class="pv2 ph3 tl f6 fw6 ttu">LastMod</th> + <th class="pv2 ph3 tl f6 fw6 ttu">Link</th> + <th class="pv2 ph3 tl f6 fw6 ttu">GitHub</th> + </tr> + </thead> + <tbody> + {{ range . }} + <tr class="striped--light-gray"> + <td class="pv2 ph3">{{ .Lastmod.Format "2006-01-02" }}</td> + <td class="pv2 ph3"> + <a href="{{ .Permalink }}">{{ .Title }}</a> + </td> + <td class="pv2 ph3"> + <a href="{{.Site.Params.ghrepo}}blob/master/content/{{.Lang }}/{{.File.Path}}"> + {{ with .GitInfo }}{{ .Subject }}{{ else }}Source{{ end }} + </a> + </td> + </tr> + {{ end }} + </tbody> +</table>
\ No newline at end of file diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/nav-top.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/nav-top.html index d8e87eb63..f64111409 100644 --- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/nav-top.html +++ b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/nav-top.html @@ -9,8 +9,8 @@ </a> </div> - {{ partial "nav-links" .}} + {{ partial "nav-links.html" .}} <div class="dn-l"> - {{ partial "nav-button-open" .}} + {{ partial "nav-button-open.html" .}} </div> </header> diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/opengraph/opengraph.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/opengraph/opengraph.html index c8ff64889..6d195ede6 100644 --- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/opengraph/opengraph.html +++ b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/opengraph/opengraph.html @@ -39,4 +39,4 @@ {{ end }}{{ end }} {{- /* Facebook Page Admin ID for Domain Insights */}} -{{- with .Site.Social.facebook_admin }}<meta property="fb:admins" content="{{ . }}" />{{ end }}
\ No newline at end of file +{{- with site.Params.social.facebook_admin }}<meta property="fb:admins" content="{{ . }}" />{{ end }} diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/opengraph/twitter_cards.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/opengraph/twitter_cards.html index 9d25d0315..456f87b1c 100644 --- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/opengraph/twitter_cards.html +++ b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/opengraph/twitter_cards.html @@ -17,6 +17,6 @@ {{- end }} <meta name="twitter:title" content="{{ .Title }}"/> <meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}"/> -{{ with .Site.Social.twitter -}} +{{ with site.Params.social.twitter -}} <meta name="twitter:site" content="@{{ . }}"/> -{{ end -}}
\ No newline at end of file +{{ end -}} diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/pagelayout.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/pagelayout.html index dd048223e..e6b644b2f 100644 --- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/pagelayout.html +++ b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/pagelayout.html @@ -16,13 +16,15 @@ </div> </article> - <!-- TODO: May be a good idea in this case to add monthly archives --> - <div class="flex flex-wrap"> {{ $interior_classes := .context.Site.Params.flex_box_interior_classes }} <section class="flex-ns flex-wrap justify-between w-100"> - {{ range $section_to_display }} - {{ partial "boxes-section-summaries" (dict "context" . "classes" $interior_classes "fullcontent" true) }} + {{ $pages := $section_to_display }} + {{ if in (slice "functions" "methods") $.context.Type }} + {{ $pages = $.context.Pages }} + {{ end }} + {{ range $pages }} + {{ partial "boxes-section-summaries.html" (dict "context" . "classes" $interior_classes "fullcontent" true) }} {{ end }} </section> </div> diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/related.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/related.html index fb11699af..ff7435668 100644 --- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/related.html +++ b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/related.html @@ -1,9 +1,22 @@ -{{ $related := .Site.RegularPages.Related . | first 5 }} -{{ with $related }} -<h2>See Also</h2> -<ul> - {{ range . }} - <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li> - {{ end }} -</ul> -{{ end }}
\ No newline at end of file +{{- $heading := "See also" }} +{{- $related := site.RegularPages.Related . | first 5 }} + +{{- if in (slice "functions" "methods") .Type }} + {{- $related = slice }} + {{- range .Params.action.related }} + {{- with site.GetPage (lower .) }} + {{- $related = $related | append . }} + {{- else }} + {{- errorf "The 'related' partial was unable to get page %s" . }} + {{- end }} + {{- end }} +{{- end }} + +{{- with $related }} + <h2>{{ $heading }}</h2> + <ul> + {{- range . }} + <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li> + {{- end }} + </ul> +{{- end }} diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/right-sidebar.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/right-sidebar.html new file mode 100644 index 000000000..ecdbeb33f --- /dev/null +++ b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/right-sidebar.html @@ -0,0 +1,29 @@ +<aside class="right-0 f6 pv4 pv0-ns ph4-l nested-list-reset nested-copy-line-height"> + <div class="nested-links"> + {{- partial "previous-next-links-in-section.html" . }} + </div> + + {{- /* Table of contents is visible if toc = true in front matter. */}} + {{- if .Params.toc }} + <div class="nested-links"> + <p class="f5 fw8 mid-gray mb0">On this page</p> + {{- .TableOfContents }} + </div> + {{- end }} + + {{- /* Section menu for single pages is visible if showSectionMenu = true in top level section page. */}} + {{- if .FirstSection.Params.showSectionMenu }} + {{- with .CurrentSection.RegularPages }} + <p class="mb0"><a class="link f5 fw8 mid-gray" href="{{ $.CurrentSection.RelPermalink }}">In this section</a></p> + <nav> + <ul> + {{- range . }} + <li> + <a style="padding: 2px 5px;" class="dib link hover-bg-black-40 hover-white blue nl1" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a> + </li> + {{- end }} + </ul> + </nav> + {{- end }} + {{- end }} +</aside> diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/social-follow.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/social-follow.html index 5c7430759..ce16953c8 100644 --- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/social-follow.html +++ b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/social-follow.html @@ -1,6 +1,6 @@ {{/* Disable Twitter for now as we lost access to the account. - with .Site.Social.twitter }} + with site.Params.social.twitter }} <a href="https://twitter.com/intent/follow?screen_name={{ . }}" title="Follow on Twitter" class="link-transition twitter link dib z-999 pt3 pt0-l mr2"> {{ partial "svg/twitter.svg" (dict "size" "32px") }} </a> diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/toc.html b/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/toc.html deleted file mode 100644 index 583feec4f..000000000 --- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/toc.html +++ /dev/null @@ -1,13 +0,0 @@ -<!-- TOCs need to be declared explicitly in the front matter of content/*.md --> -<aside class="fixed-lTK mw5-l right-0 f6 bl-l b--moon-gray pv4 pv0-ns ph4-l nested-list-reset nested-links nested-copy-line-height"> - {{ if .Params.toc }} - <p class="b">What's on this Page</p> - {{ .TableOfContents }} - {{ end }} - {{- partial "previous-next-links-in-section.html" . -}} - - {{- if .Params.godocref -}} - <a target="_blank" class="tooltip right godoc-link" data-tooltip="See the related Godocs for {{.Title }}" href="{{.Params.godocref}}" > - </a> - {{- end -}} -</aside> |