mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 22:17:28 +00:00
Update theme
This commit is contained in:
1 parent
d9e9811474
commit
8657804ba4
55 files changed
+346
-709
No files matched your search
File renamed without changes.
File renamed without changes.
@@ -1,23 +1,30 @@
|
||||
<header class="flex-none w-100">
|
||||
{{ if .Params.categories }}
|
||||
{{ range .Params.categories }}
|
||||
<a href="{{ "/categories/" | relLangURL }}{{ . | urlize }}" class="f6 fw8 mb0 link mid-gray dim mr3">
|
||||
{{ humanize . | upper }}
|
||||
{{ if in (slice "functions" "methods") .Type }}
|
||||
{{ with .FirstSection }}
|
||||
<a href="{{ .RelPermalink }}" class="f6 fw8 mb0 link mid-gray dim mr3">
|
||||
{{ humanize .Title | upper }}
|
||||
</a>
|
||||
{{ end }}
|
||||
{{end}}
|
||||
{{ with .CurrentSection }}
|
||||
<a href="{{ .RelPermalink }}" class="f6 fw8 mb0 link mid-gray dim mr3">
|
||||
{{ humanize .Title | upper }}
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ range .Params.categories }}
|
||||
<a href="{{ "/categories/" | relLangURL }}{{ . | urlize }}" class="f6 fw8 mb0 link mid-gray dim mr3">
|
||||
{{ humanize . | upper }}
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<h1 class="lh-title mb3 mv0 pt3 primary-color-dark">
|
||||
{{- if eq .Section "functions" -}}
|
||||
{{ .LinkTitle }}
|
||||
{{- else -}}
|
||||
{{ .Title }}
|
||||
{{- end -}}
|
||||
{{ .Title }}
|
||||
</h1>
|
||||
</header>
|
||||
|
||||
<aside class="bt bw1 pt3 mt2 mid-gray b--mid-gray fn w-100">
|
||||
{{ with .Params.description }}
|
||||
<div class="f4 fw4 lh-copy">
|
||||
<div class="mb4 f4 fw4 lh-copy">
|
||||
{{ . | markdownify }}
|
||||
</div>
|
||||
{{ end }}
|
||||
@@ -32,6 +39,10 @@
|
||||
{{ end }}
|
||||
|
||||
<div class="prose prose-{{ .Type }}" id="prose">
|
||||
{{- partial "docs/functions-signature.html" . -}}
|
||||
<div class="mb4">
|
||||
{{- partial "docs/functions-signatures.html" . -}}
|
||||
{{- partial "docs/functions-return-type.html" . -}}
|
||||
{{- partial "docs/functions-aliases.html" . -}}
|
||||
</div>
|
||||
{{ .Content }}
|
||||
</div>
|
||||
@@ -2,20 +2,18 @@
|
||||
<article class="w-100 ph4 pb5 pb6-ns pt1 pt5-ns">
|
||||
<div class="flex-l">
|
||||
|
||||
<div class="order-2 w-100 w-20-l ph5-m ph0-l mb4 sticky">
|
||||
{{- partial "toc.html" . -}}
|
||||
<div class="order-0 w-20 dn db-l">
|
||||
{{ partial "nav-links-docs.html" . }}
|
||||
</div>
|
||||
|
||||
<div class="order-1 w-60-l mw7 ph0 ph5-ns mid-gray nested-copy-line-height no-underline nested-links nested-img nested-copy-seperator nested-blockquote mt0-ns" style="flex-grow:1;">
|
||||
<div class="documentation-copy center measure-wide-l">
|
||||
<div id="readout" class="fixed right-0 bottom-0">
|
||||
</div>
|
||||
<div class="order-1 flex-grow-1 ph0 ph5-ns mt0-ns mid-gray nested-copy-line-height no-underline nested-links nested-img nested-copy-seperator nested-blockquote">
|
||||
<div style="max-width: 40rem;" class="documentation-copy">
|
||||
<div id="readout" class="fixed right-0 bottom-0"></div>
|
||||
{{ .Render "page" }}
|
||||
{{ partial "related.html" . }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="order-0 w-20 dn db-l">
|
||||
{{ partial "nav-links-docs.html" . }}
|
||||
<div class="order-2 w-20 dn db-l">
|
||||
{{ partial "right-sidebar" . }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
File renamed without changes.
File renamed without changes.
+48
-19
@@ -10,32 +10,61 @@
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<!-- TODO: May be a good idea in this case to add monthly archives -->
|
||||
|
||||
<div class="flex flex-wrap">
|
||||
{{/* [wip] add archive lists
|
||||
<div class="w-100 w-20-ns dn">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="#">
|
||||
archive section
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div> */}}
|
||||
|
||||
{{ $interior_classes := $.Site.Params.flex_box_interior_classes }}
|
||||
<section class="flex-ns flex-wrap justify-between w-100 w-80-nsTK v-top">
|
||||
{{ $paginator := .Paginate (.Pages | lang.Merge (where .Sites.First.RegularPages "Section" .Section)) -}}
|
||||
{{ range $paginator.Pages }}
|
||||
|
||||
{{ $news_items := slice }}
|
||||
|
||||
{{/* Get releases from GitHub. */}}
|
||||
{{ $u := "https://api.github.com/repos/gohugoio/hugo/releases" }}
|
||||
{{ $releases := partial "inline/get-remote-data.html" $u }}
|
||||
{{ $releases = where $releases "draft" false }}
|
||||
{{ $releases = where $releases "prerelease" false }}
|
||||
{{ range $releases | first 20 }}
|
||||
{{ $ctx := dict
|
||||
"Date" (.published_at | time.AsTime)
|
||||
"Title" (printf "Release %s" .name)
|
||||
"Permalink" .html_url
|
||||
"Section" "news"
|
||||
"Summary" ""
|
||||
}}
|
||||
{{ $news_items = $news_items | append $ctx }}
|
||||
{{ end }}
|
||||
|
||||
{{/* Get content pages from news section. */}}
|
||||
{{ range .Pages }}
|
||||
{{ $ctx := dict
|
||||
"Date" .Date
|
||||
"Title" .Title
|
||||
"RelPermalink" .RelPermalink
|
||||
"Section" "news"
|
||||
"Summary" .Summary
|
||||
"Params" (dict "description" .Description)
|
||||
}}
|
||||
{{ $news_items = $news_items | append $ctx }}
|
||||
{{ end }}
|
||||
|
||||
{{/* Sort by date (descending) and render. */}}
|
||||
{{ range sort $news_items "Date" "desc" }}
|
||||
{{ partial "boxes-section-summaries" (dict "context" . "classes" $interior_classes "fullcontent" false) }}
|
||||
{{ end }}
|
||||
|
||||
</section>
|
||||
</div>
|
||||
<div class="nested-list-reset nested-links">
|
||||
{{/* pagination.html: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/template_embedded.go#L117 */}}
|
||||
{{ template "_internal/pagination.html" . }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ define "partials/inline/get-remote-data.html" }}
|
||||
{{ $u := . }}
|
||||
{{ $r := "" }}
|
||||
{{ with $r = resources.GetRemote $u }}
|
||||
{{ with .Err }}
|
||||
{{ errorf "%s" . }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ errorf "Unable to get remote resource %q" $u }}
|
||||
{{ end }}
|
||||
{{ return ($r | transform.Unmarshal) }}
|
||||
{{ end }}
|
||||
+27
-16
@@ -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 }}
|
||||
|
||||
{{ end }}
|
||||
|
||||
<a href="{{ .context.RelPermalink }}" class="f6 mt2 db link primary-color dim">
|
||||
Read More »
|
||||
</a>
|
||||
|
||||
<a href="{{ $href }}" class="f6 mt2 db link primary-color dim">
|
||||
Read More »
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
+1
-18
@@ -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. */}}
|
||||
File renamed without changes.
File renamed without changes.
-11
@@ -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 */}}
|
||||
File renamed without changes.
@@ -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 || [];
|
||||
|
||||
+7
-1
@@ -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 }}
|
||||
File renamed without changes.
+1
-1
@@ -39,4 +39,4 @@
|
||||
{{ end }}{{ end }}
|
||||
|
||||
{{- /* Facebook Page Admin ID for Domain Insights */}}
|
||||
{{- with .Site.Social.facebook_admin }}<meta property="fb:admins" content="{{ . }}" />{{ end }}
|
||||
{{- with site.Params.social.facebook_admin }}<meta property="fb:admins" content="{{ . }}" />{{ end }}
|
||||
+2
-2
@@ -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 -}}
|
||||
{{ end -}}
|
||||
+5
-3
@@ -16,12 +16,14 @@
|
||||
</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 }}
|
||||
{{ $pages := $section_to_display }}
|
||||
{{ if in (slice "functions" "methods") $.context.Type }}
|
||||
{{ $pages = $.context.Pages }}
|
||||
{{ end }}
|
||||
{{ range $pages }}
|
||||
{{ partial "boxes-section-summaries" (dict "context" . "classes" $interior_classes "fullcontent" true) }}
|
||||
{{ end }}
|
||||
</section>
|
||||
|
||||
@@ -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 }}
|
||||
{{- $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 }}
|
||||
File renamed without changes.
+1
-1
@@ -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>
|
||||
|
||||
File renamed without changes.
+99
-22
@@ -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=true] 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>
|
||||
@@ -1,15 +1,39 @@
|
||||
<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 -}}
|
||||
{{- /*
|
||||
Renders syntax highlighted code.
|
||||
|
||||
{{ 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>
|
||||
@param {bool} [copy=true] 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" }}
|
||||
{{- if in (slice "false" false 0) (.Get "copy") }}
|
||||
{{- $copy = false }}
|
||||
{{- else if in (slice "true" true 1) (.Get "copy")}}
|
||||
{{- $copy = true }}
|
||||
{{- end }}
|
||||
|
||||
{{- /* 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">{{ or $file "nbsp;" }}</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>
|
||||
File renamed without changes.
+33
-18
@@ -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>
|
||||
{{ $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>
|
||||
File renamed without changes.
File renamed without changes.
Generated
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+29
-6
@@ -1,6 +1,29 @@
|
||||
{{$file := .Get "file"}}
|
||||
{{- if eq (.Get "markdown") "true" -}}
|
||||
{{- $file | readFile | markdownify -}}
|
||||
{{- else -}}
|
||||
{{ $file | readFile | safeHTML }}
|
||||
{{- end -}}
|
||||
{{- $highlight := or (.Get "highlight") "" }}
|
||||
|
||||
{{- $markdown := false }}
|
||||
{{- if in (slice "false" false 0) (.Get "markdown") }}
|
||||
{{- $markdown = false }}
|
||||
{{- else if in (slice "true" true 1) (.Get "markdown") }}
|
||||
{{- $markdown = true }}
|
||||
{{- end }}
|
||||
|
||||
{{- with .Get "file" }}
|
||||
{{- if os.FileExists . }}
|
||||
{{- with os.ReadFile . }}
|
||||
{{- $content := trim . "\n\r" }}
|
||||
{{- if $markdown }}
|
||||
{{- $content | markdownify }}
|
||||
{{- else if $highlight }}
|
||||
{{- highlight $content $highlight }}
|
||||
{{- else }}
|
||||
{{- $content | safeHTML }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- errorf "The %q shortcode was unable to read %q. 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 'file' parameter. See %s" $.Name $.Position }}
|
||||
{{- end }}
|
||||
File renamed without changes.
File renamed without changes.
+1
-1
@@ -1 +1 @@
|
||||
# github.com/gohugoio/gohugoioTheme v0.0.0-20230927165800-342e2c850f18
|
||||
# github.com/gohugoio/gohugoioTheme v0.0.0-20231106011748-17e5fb5db5f3
|
||||
@@ -2,4 +2,4 @@ module github.com/gohugoio/hugoDocs
|
||||
|
||||
go 1.16
|
||||
|
||||
require github.com/gohugoio/gohugoioTheme v0.0.0-20230927165800-342e2c850f18 // indirect
|
||||
require github.com/gohugoio/gohugoioTheme v0.0.0-20231106011748-17e5fb5db5f3 // indirect
|
||||
@@ -1,79 +1,2 @@
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20190808163145-07b3c0f73b02/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20191014144142-1f3a01deed7b h1:PWNjl46fvtz54PKO0BdiXOF6/4L/uCP0F3gtcCxGrJs=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20191014144142-1f3a01deed7b/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20191021162625-2e7250ca437d h1:D3DcaYkuJbotdWNNAQpQl37txX4HQ6R5uMHoxVmTw0w=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20191021162625-2e7250ca437d/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20200123151337-9475fd449324 h1:UZwHDYtGY0uOKIvcm2LWd+xfFxD3X5L222LIJdI5RE4=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20200123151337-9475fd449324/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20200123204146-589b4c309025 h1:ScYFARz+bHX1rEr1donVknhRdxGY/cwqK1hHvWEfrlc=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20200123204146-589b4c309025/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20200123205007-5d6620a0db26 h1:acXfduibbWxji9tW0WkLHbjcXFsnd5uIwXe0WfwOazg=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20200123205007-5d6620a0db26/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20200128164921-1d0bc5482051 h1:cS14MnUGS6xwWYfPNshimm8HdMCZiYBxWkCD0VnvgVw=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20200128164921-1d0bc5482051/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20200327225449-368f4cbef8d7 h1:cZ+ahAjSetbFv3aDJ9ipDbKyqaVlmkbSZ5cULgBTh+w=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20200327225449-368f4cbef8d7/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20200327231942-7f80b3d02bfa h1:kG+O/wT9UXomzp5eQiUuFVZ0l7YylAW6EVPLyjMxi/c=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20200327231942-7f80b3d02bfa/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20200328100657-2bfd5f8c6aee h1:PJZhCwnuVLyafDWNPSHk9iJvk6gEIvPRnycy7Pq3peA=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20200328100657-2bfd5f8c6aee/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20200518164958-62cbad03c40f h1:Ge3JACszSUyJW2Az9cJzWdo4PUqdijJA1RxoQSVMBSI=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20200518164958-62cbad03c40f/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20200518165806-0095b7b902a7 h1:Sy0hlWyZmFtdSY0Cobvw1ZYm3G1aR5+4DuFNRbMkh48=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20200518165806-0095b7b902a7/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20200711112515-b0dfe471654f h1:BWJyycs4HD7tUbaU8RIGeMay84bIBWRVVLE3yajPas4=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20200711112515-b0dfe471654f/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20210301124928-2c15837dfec3 h1:ShqzOFeeg54FPSuS6q8HSeTVgj2xNZRe/YS0jNbi21g=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20210301124928-2c15837dfec3/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20210409065807-6383d8cbaf65 h1:EJzierSWKqwsrUXU6MaFe0J97c0e5pzl5dBNRRrV2Nc=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20210409065807-6383d8cbaf65/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20210409071416-c88da48134b7 h1:uRCgPslaBgLYy4ANXBoPbBQVM8aNiHoxIZTKUXpkuUA=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20210409071416-c88da48134b7/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20211211125852-b85e21c1f3d6 h1:lAgdWrn8VEg0PrNCPX4DflCg2msDKpSYV6E8RTNV3N0=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20211211125852-b85e21c1f3d6/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20220228085601-7cfbda06d135 h1:6hVzfE9YhSsZP5t6jWjvVp7MoPm7Y5fEhH/ls4ahhKk=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20220228085601-7cfbda06d135/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20220905093719-cb8b64046950 h1:Ovlh3nuy/aNptYZHmIra2MP+ZUEqiihY0HxvhdaMqGg=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20220905093719-cb8b64046950/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20220912070954-88dcaf003b4d h1:UYJL6RmEepprvlgHvDnFCWtPOvjmqzFCQ90cRDRBO7U=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20220912070954-88dcaf003b4d/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20220914071648-0ef1c51685bf h1:A8Ksnvp8reNt2Ap0mUK7gFkJkCjt9R60yopGsezcOBA=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20220914071648-0ef1c51685bf/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20221116211530-5ae8dcdd68d6 h1:eG53kL1LkQuKmrDdzbvvx6d60qM07zp2Wjo/tYxkDOY=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20221116211530-5ae8dcdd68d6/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20221118083537-967e29e21382 h1:e30rl1dxWkYOcgdl0omeOK0HBzgDLI/b9MfYHrINjzU=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20221118083537-967e29e21382/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20221124154621-1451a01f406b h1:TRrIisSY7ckt9FVHOOQtmKG4jsnORCYn72UMvMu+IQ0=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20221124154621-1451a01f406b/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20221206093948-1408550ab675 h1:wjpYa1cTELeceWndBDV7IG2vRxRWICBBO79HObOfTtk=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20221206093948-1408550ab675/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20221217122332-1c1752ad8f14 h1:K6tPFpi7W0zb89QIf+lNdgdTXfDFemU6NKk46MlX9lQ=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20221217122332-1c1752ad8f14/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20221220160735-8ffa1ef883b6 h1:yEoQecRBoLGfc7yTybMD3Mhm03bTScZFYPvwe0p75vA=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20221220160735-8ffa1ef883b6/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20230109120406-12694c4a9456 h1:RSLItaapVjWkqSdQhumAmJkodFDbWMGNZmkVW/AFx0c=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20230109120406-12694c4a9456/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20230119103504-3bcd960d6f1b h1:i/iaEOOuR1mKRR0qUOET587ooVhG8c2tllpA5HsrWNU=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20230119103504-3bcd960d6f1b/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20230120185049-2c3c4d0ba232 h1:bEojKgKInbsLkID5Arh95vP4+0xydtn/+ayT6I8vkiU=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20230120185049-2c3c4d0ba232/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20230124135550-462d5fe4a87f h1:8wI3zOTWQG15aKkbAZQaoGnUQff46hO95opQndBHRE4=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20230124135550-462d5fe4a87f/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20230330081257-7a8c9614432c h1:TyHgmowfiMyxKrqTdRxm/yWIFeN7XRh7Hm6/dOG6yDA=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20230330081257-7a8c9614432c/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20230418063032-99f9185b8e11 h1:mDcricMewd66x8QjKqNun7Div7iYVLtl8s1dVs9VnB8=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20230418063032-99f9185b8e11/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20230527124826-78bc315d7b8a h1:ruyA3QZ4Ym0fBLhTW2eoUSvHUaj2xWqaPHIbaI+tbZo=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20230527124826-78bc315d7b8a/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20230615111426-c3725d921127 h1:LaOUdx1uo/Pr8Vr9KbqTwioia9OhNSiZDOHQGNHZiOs=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20230615111426-c3725d921127/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20230615131407-b3235557d2e6 h1:x/1M3CJRXCNfThsT+EeWrC2B1qFQZSCeOgA44RJJ5ds=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20230615131407-b3235557d2e6/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20230624091215-084560177ddc h1:BX7s0bvHFjx5Dll+9CBEiphSjWCDmZ1S+vOrB2wjpOg=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20230624091215-084560177ddc/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20230630055807-9874cd863bc5 h1:5QDXCq7G6Ak13EKF69QIJtH2YhidilBetNDgdoBYsWM=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20230630055807-9874cd863bc5/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20230812102551-06f8256e7ee5 h1:QoImGtz9EWmovn3d0vfREKf1ybroA+oO/yFCW/BmWSE=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20230812102551-06f8256e7ee5/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20230927165800-342e2c850f18 h1:fwC86MGMw2yX2tIR+hc+58jlU4pjvc3HUDJ/mTB07Ig=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20230927165800-342e2c850f18/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20231106011748-17e5fb5db5f3 h1:8VVvz832OTqCk/2pHUWXF+A+Usyf3V4JbmcDlWhSINI=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20231106011748-17e5fb5db5f3/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
|
||||
@@ -82,12 +82,6 @@ ID = 'G-MBZGKNMDWC'
|
||||
weight = 60
|
||||
cardinalityThreshold = 50
|
||||
|
||||
# TODO delete when (a) Netlify is building the site with v0.120.0 or later,
|
||||
# and (b) the changes from gohugoioTheme/commit/af97b8e61638ddf043b87590cd567d76045bf9be
|
||||
# have been pulled into this repo.
|
||||
[social]
|
||||
twitter = "GoHugoIO"
|
||||
|
||||
[imaging]
|
||||
# See https://github.com/disintegration/imaging
|
||||
# CatmullRom is a sharp bicubic filter which should fit the docs site well with its many screenshots.
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
<header class="flex-none w-100">
|
||||
{{ if in (slice "functions" "methods") .Type }}
|
||||
{{ with .FirstSection }}
|
||||
<a href="{{ .RelPermalink }}" class="f6 fw8 mb0 link mid-gray dim mr3">
|
||||
{{ humanize .Title | upper }}
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ with .CurrentSection }}
|
||||
<a href="{{ .RelPermalink }}" class="f6 fw8 mb0 link mid-gray dim mr3">
|
||||
{{ humanize .Title | upper }}
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ range .Params.categories }}
|
||||
<a href="{{ "/categories/" | relLangURL }}{{ . | urlize }}" class="f6 fw8 mb0 link mid-gray dim mr3">
|
||||
{{ humanize . | upper }}
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<h1 class="lh-title mb3 mv0 pt3 primary-color-dark">
|
||||
{{ .Title }}
|
||||
</h1>
|
||||
</header>
|
||||
|
||||
<aside class="bt bw1 pt3 mt2 mid-gray b--mid-gray fn w-100">
|
||||
{{ with .Params.description }}
|
||||
<div class="mb4 f4 fw4 lh-copy">
|
||||
{{ . | markdownify }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<!--
|
||||
NOTE: Removed to test builds without it.
|
||||
partial "components/author-github-data" (dict "context" . "size" "110") -->
|
||||
</aside>
|
||||
|
||||
{{ with .Params.featured_image_path }}
|
||||
<img src="{{ . }}" alt="Featured Image for {{ $.Title }}" class="mw-100">
|
||||
{{ end }}
|
||||
|
||||
<div class="prose prose-{{ .Type }}" id="prose">
|
||||
<div class="mb4">
|
||||
{{- partial "docs/functions-signatures.html" . -}}
|
||||
{{- partial "docs/functions-return-type.html" . -}}
|
||||
{{- partial "docs/functions-aliases.html" . -}}
|
||||
</div>
|
||||
{{ .Content }}
|
||||
</div>
|
||||
@@ -1,29 +0,0 @@
|
||||
{{ define "main" }}
|
||||
<article class="w-100 ph4 pb5 pb6-ns pt1 pt5-ns">
|
||||
<div class="flex-l">
|
||||
|
||||
<div class="order-0 w-20 dn db-l">
|
||||
{{ partial "nav-links-docs.html" . }}
|
||||
</div>
|
||||
<div class="order-1 flex-grow-1 ph0 ph5-ns mt0-ns mid-gray nested-copy-line-height no-underline nested-links nested-img nested-copy-seperator nested-blockquote">
|
||||
<div style="max-width: 40rem;" class="documentation-copy">
|
||||
<div id="readout" class="fixed right-0 bottom-0"></div>
|
||||
{{ .Render "page" }}
|
||||
{{ partial "related.html" . }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="order-2 w-20 dn db-l">
|
||||
{{ partial "right-sidebar" . }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<div class="w-100 bg-light-gray">
|
||||
<div class="mw7 pa4 center nested-lh-copy lh-copy">
|
||||
{{ partial "docs/page-meta-data.html" . }}
|
||||
{{ partial "page-edit.html" . }}
|
||||
{{ partial "tags.html" . }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
@@ -1,70 +0,0 @@
|
||||
{{ define "main" }}
|
||||
<div class="w-100 ph4 ph5-ns pb5 pb6-ns pt1 pt3-ns ">
|
||||
|
||||
<article class="cf pa3 pa4-m pa4-l nested-copy-line-height nested-img">
|
||||
<h1 class="primary-color-dark">
|
||||
{{ .Title }}
|
||||
</h1>
|
||||
<div class="nested-copy-line-height">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<div class="flex flex-wrap">
|
||||
{{ $interior_classes := $.Site.Params.flex_box_interior_classes }}
|
||||
<section class="flex-ns flex-wrap justify-between w-100 w-80-nsTK v-top">
|
||||
|
||||
{{ $news_items := slice }}
|
||||
|
||||
{{/* Get releases from GitHub. */}}
|
||||
{{ $u := "https://api.github.com/repos/gohugoio/hugo/releases" }}
|
||||
{{ $releases := partial "inline/get-remote-data.html" $u }}
|
||||
{{ $releases = where $releases "draft" false }}
|
||||
{{ $releases = where $releases "prerelease" false }}
|
||||
{{ range $releases | first 20 }}
|
||||
{{ $ctx := dict
|
||||
"Date" (.published_at | time.AsTime)
|
||||
"Title" (printf "Release %s" .name)
|
||||
"Permalink" .html_url
|
||||
"Section" "news"
|
||||
"Summary" ""
|
||||
}}
|
||||
{{ $news_items = $news_items | append $ctx }}
|
||||
{{ end }}
|
||||
|
||||
{{/* Get content pages from news section. */}}
|
||||
{{ range .Pages }}
|
||||
{{ $ctx := dict
|
||||
"Date" .Date
|
||||
"Title" .Title
|
||||
"RelPermalink" .RelPermalink
|
||||
"Section" "news"
|
||||
"Summary" .Summary
|
||||
"Params" (dict "description" .Description)
|
||||
}}
|
||||
{{ $news_items = $news_items | append $ctx }}
|
||||
{{ end }}
|
||||
|
||||
{{/* Sort by date (descending) and render. */}}
|
||||
{{ range sort $news_items "Date" "desc" }}
|
||||
{{ partial "boxes-section-summaries" (dict "context" . "classes" $interior_classes "fullcontent" false) }}
|
||||
{{ end }}
|
||||
|
||||
</section>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ define "partials/inline/get-remote-data.html" }}
|
||||
{{ $u := . }}
|
||||
{{ $r := "" }}
|
||||
{{ with $r = resources.GetRemote $u }}
|
||||
{{ with .Err }}
|
||||
{{ errorf "%s" . }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ errorf "Unable to get remote resource %q" $u }}
|
||||
{{ end }}
|
||||
{{ return ($r | transform.Unmarshal) }}
|
||||
{{ end }}
|
||||
@@ -1,46 +0,0 @@
|
||||
<div class="relative {{ .classes }} weight-{{ .context.Weight }}">
|
||||
<div class="bg-white mb2 pa3 pa4-l gray">
|
||||
|
||||
{{ $href := .context.RelPermalink }}
|
||||
{{ if eq .context.Section "news" }}
|
||||
{{ $href = .context.Permalink }}
|
||||
<time class="f6 db" datetime="{{ .context.Date.Format `2006-01-02T15:04:05Z07:00` }}">
|
||||
{{ .context.Date.Format "January 2, 2006" }}
|
||||
</time>
|
||||
{{ end }}
|
||||
|
||||
<h1 class="near-black f3">
|
||||
<a href="{{ $href }}" class="link primary-color dim">
|
||||
{{ .context.Title }}
|
||||
</a>
|
||||
</h1>
|
||||
<div class="lh-copy links">
|
||||
{{ 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 }}
|
||||
|
||||
{{ end }}
|
||||
<a href="{{ $href }}" class="f6 mt2 db link primary-color dim">
|
||||
Read More »
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -1 +0,0 @@
|
||||
{{/* Empty for now. */}}
|
||||
@@ -1,7 +0,0 @@
|
||||
{{ 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 }}
|
||||
@@ -1,36 +0,0 @@
|
||||
{{ $section_to_display := .section_to_display }}
|
||||
<div class="w-100 ph4 pb5 pb6-ns pt1 mt4 pt3-ns">
|
||||
|
||||
<div class="flex">
|
||||
<div class="dn db-l w-20">
|
||||
{{ partial "nav-links-docs.html" .context }}
|
||||
</div>
|
||||
|
||||
<div class="w-100 w-80-l ph0 ph4-l">
|
||||
<article class="w-100 nested-copy-line-height nested-links nested-img">
|
||||
<h1 class="primary-color-dark f2">
|
||||
{{ with $.context.Data.Singular }}{{ . | humanize }}: {{ end }}{{ .context.Title }}
|
||||
</h1>
|
||||
<div class="{{ .Site.Params.copyClass }} mid-gray f5 f4-l">
|
||||
{{ .context.Content }}
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<div class="flex flex-wrap">
|
||||
{{ $interior_classes := .context.Site.Params.flex_box_interior_classes }}
|
||||
<section class="flex-ns flex-wrap justify-between w-100">
|
||||
{{ $pages := $section_to_display }}
|
||||
{{ if in (slice "functions" "methods") $.context.Type }}
|
||||
{{ $pages = $.context.Pages }}
|
||||
{{ end }}
|
||||
{{ range $pages }}
|
||||
{{ partial "boxes-section-summaries" (dict "context" . "classes" $interior_classes "fullcontent" true) }}
|
||||
{{ end }}
|
||||
</section>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -1,22 +0,0 @@
|
||||
{{- $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 }}
|
||||
@@ -1,101 +0,0 @@
|
||||
{{- /*
|
||||
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 {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>
|
||||
@@ -1,39 +0,0 @@
|
||||
{{- /*
|
||||
Renders syntax highlighted code.
|
||||
|
||||
@param {bool} [copy=true] 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" }}
|
||||
{{- if in (slice "false" false 0) (.Get "copy") }}
|
||||
{{- $copy = false }}
|
||||
{{- else if in (slice "true" true 1) (.Get "copy")}}
|
||||
{{- $copy = true }}
|
||||
{{- end }}
|
||||
|
||||
{{- /* 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">{{ or $file "nbsp;" }}</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>
|
||||
@@ -1,33 +0,0 @@
|
||||
{{ $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>
|
||||
@@ -1,29 +0,0 @@
|
||||
{{- $highlight := or (.Get "highlight") "" }}
|
||||
|
||||
{{- $markdown := false }}
|
||||
{{- if in (slice "false" false 0) (.Get "markdown") }}
|
||||
{{- $markdown = false }}
|
||||
{{- else if in (slice "true" true 1) (.Get "markdown") }}
|
||||
{{- $markdown = true }}
|
||||
{{- end }}
|
||||
|
||||
{{- with .Get "file" }}
|
||||
{{- if os.FileExists . }}
|
||||
{{- with os.ReadFile . }}
|
||||
{{- $content := trim . "\n\r" }}
|
||||
{{- if $markdown }}
|
||||
{{- $content | markdownify }}
|
||||
{{- else if $highlight }}
|
||||
{{- highlight $content $highlight }}
|
||||
{{- else }}
|
||||
{{- $content | safeHTML }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- errorf "The %q shortcode was unable to read %q. 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 'file' parameter. See %s" $.Name $.Position }}
|
||||
{{- end }}
|
||||
Reference in new issue
Block a user