Assign template context to var
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
{{ $class := .class }}
|
||||
{{ $content := .content }}
|
||||
{{ $href := .href }}
|
||||
{{ $style := .style }}
|
||||
{{ $params := . }}
|
||||
|
||||
{{ $class := $params.class }}
|
||||
{{ $content := $params.content }}
|
||||
{{ $href := $params.href }}
|
||||
{{ $style := $params.style }}
|
||||
|
||||
<a {{ with $class }} class="{{ . }}" {{ end }} {{ with $href }} href="{{ . | safeURL }}" {{ end }} {{ with $style }} style="{{ . | safeCSS }}" {{ end }}>{{ $content }}</a>
|
||||
|
@@ -1,14 +1,16 @@
|
||||
{{ $authors := cond (.Param "paige.page.authors.hide" | not) (partial "paige/func-authors.html" .) "" }}
|
||||
{{ $authorsclass := .Param "paige.page.authors.class" | default "text-center text-secondary" }}
|
||||
{{ $page := . }}
|
||||
|
||||
{{ $authors := cond ($page.Param "paige.page.authors.hide" | not) (partial "paige/func-authors.html" $page) "" }}
|
||||
{{ $authorsclass := $page.Param "paige.page.authors.class" | default "text-center text-secondary" }}
|
||||
{{ $gap := "mb-0" }}
|
||||
{{ $date := cond (.Param "paige.page.date.hide" | not) .PublishDate "" }}
|
||||
{{ $dateclass := .Param "paige.page.date.class" | default "text-center text-secondary" }}
|
||||
{{ $date := cond ($page.Param "paige.page.date.hide" | not) $page.PublishDate "" }}
|
||||
{{ $dateclass := $page.Param "paige.page.date.class" | default "text-center text-secondary" }}
|
||||
|
||||
{{ with $authors }}
|
||||
<p class="{{ if $date }} {{ $gap }} {{ end }} {{ $authorsclass }}">{{ . }}</p>
|
||||
{{ end }}
|
||||
{{ if $date }}
|
||||
{{ with $date }}
|
||||
<p class="{{ $dateclass }}">
|
||||
<time datetime="{{ $date.Format `2006-01-02` }}">{{ time.Format (.Param "paige.page.date.format" | default ":date_long") $date }}</time>
|
||||
<time datetime="{{ .Format `2006-01-02` }}">{{ time.Format ($page.Param "paige.page.date.format" | default ":date_long") . }}</time>
|
||||
</p>
|
||||
{{ end }}
|
||||
|
@@ -1,7 +1,9 @@
|
||||
{{ $page := . }}
|
||||
|
||||
<article>
|
||||
<div class="align-items-center d-flex flex-column mb-0">
|
||||
{{ partial "paige/metadata.html" . }}
|
||||
{{ partial "paige/toc.html" . }}
|
||||
{{ partial "paige/content.html" . }}
|
||||
{{ partial "paige/metadata.html" $page }}
|
||||
{{ partial "paige/toc.html" $page }}
|
||||
{{ partial "paige/content.html" $page }}
|
||||
</div>
|
||||
</article>
|
||||
|
@@ -1,3 +1,5 @@
|
||||
{{ $page := . }}
|
||||
|
||||
{{ template "_internal/disqus.html" . }}
|
||||
{{ if site.Params.paige.comments.cactus }}
|
||||
<section class="mb-3">
|
||||
@@ -10,7 +12,7 @@
|
||||
defaultHomeserverUrl: "https://matrix.cactus.chat:8448",
|
||||
serverName: "cactus.chat",
|
||||
siteName: {{ site.Params.paige.comments.cactus.account_id }},
|
||||
commentSectionId: {{ .RelPermalink }}
|
||||
commentSectionId: {{ $page.RelPermalink }}
|
||||
})
|
||||
</script>
|
||||
<noscript>{{ i18n "paige_noscript" }}</noscript>
|
||||
@@ -30,7 +32,7 @@
|
||||
var __semio__params = {
|
||||
graphcommentId: {{ site.Params.paige.comments.graphcomment.account_id }},
|
||||
behaviour: {
|
||||
uid: {{ .RelPermalink }}
|
||||
uid: {{ $page.RelPermalink }}
|
||||
}
|
||||
};
|
||||
function __semio__onload() {
|
||||
@@ -52,7 +54,7 @@
|
||||
var HYVOR_TALK_WEBSITE = {{ site.Params.paige.comments.hyvor.account_id }};
|
||||
var HYVOR_TALK_CONFIG = {
|
||||
url: false,
|
||||
id: {{ .RelPermalink }}
|
||||
id: {{ $page.RelPermalink }}
|
||||
};
|
||||
</script>
|
||||
<script async type="text/javascript" src="//talk.hyvor.com/web-api/embed"></script>
|
||||
@@ -63,8 +65,8 @@
|
||||
<section class="mb-3">
|
||||
<script>
|
||||
var idcomments_acct = {{ site.Params.paige.comments.intensedebate.account_id }};
|
||||
var idcomments_post_id = {{ .RelPermalink }};
|
||||
var idcomments_post_url = {{ .Permalink }};
|
||||
var idcomments_post_id = {{ $page.RelPermalink }};
|
||||
var idcomments_post_url = {{ $page.Permalink }};
|
||||
</script>
|
||||
<span id="IDCommentsPostTitle" style="display:none"></span>
|
||||
<script type="text/javascript" src="http://www.intensedebate.com/js/genericCommentWrapperV2.js"></script>
|
||||
@@ -105,7 +107,7 @@
|
||||
<script>
|
||||
window.replybox = {
|
||||
site: {{ site.Params.paige.comments.replybox.account_id }},
|
||||
identifier: {{ .RelPermalink }}
|
||||
identifier: {{ $page.RelPermalink }}
|
||||
};
|
||||
</script>
|
||||
<script src="https://cdn.getreplybox.com/js/embed.js"></script>
|
||||
|
@@ -1,8 +1,10 @@
|
||||
{{ $class := .Param "paige.page.content.class" }}
|
||||
{{ $page := . }}
|
||||
|
||||
{{ $class := $page.Param "paige.page.content.class" }}
|
||||
{{ $content := "" }}
|
||||
|
||||
{{ if .Param "paige.page.title.hide" | not }}
|
||||
{{ $content = cond (.Scratch.Get "paige_show_full_pages" | not | not) .Content (.Content | replaceRE `(<h[1-6] id="([^"]+)".+)(</h[1-6]+>)` `${1}<a aria-label="Link to this section" class="paige-header-link" href="#${2}">#</a>${3}` | safeHTML) }}
|
||||
{{ if $page.Param "paige.page.title.hide" | not }}
|
||||
{{ $content = cond ($page.Scratch.Get "paige_show_full_pages" | not | not) $page.Content ($page.Content | replaceRE `(<h[1-6] id="([^"]+)".+)(</h[1-6]+>)` `${1}<a aria-label="Link to this section" class="paige-header-link" href="#${2}">#</a>${3}` | safeHTML) }}
|
||||
{{ end }}
|
||||
|
||||
{{ with $content }}
|
||||
|
@@ -1,5 +1,7 @@
|
||||
{{ $class := .Param "paige.page.description.class" | default "lead text-center" }}
|
||||
{{ $description := cond (.Param "paige.page.description.hide" | not) (.Description | markdownify) "" }}
|
||||
{{ $page := . }}
|
||||
|
||||
{{ $class := $page.Param "paige.page.description.class" | default "lead text-center" }}
|
||||
{{ $description := cond ($page.Param "paige.page.description.hide" | not) ($page.Description | markdownify) "" }}
|
||||
|
||||
{{ with $description }}
|
||||
<p class="{{ $class }}">{{ . }}</p>
|
||||
|
@@ -1,16 +1,18 @@
|
||||
{{ $caption := .caption | markdownify }}
|
||||
{{ $compact := .compact }}
|
||||
{{ $content := .content | markdownify }}
|
||||
{{ $float := .float }}
|
||||
{{ $gap := .gap }}
|
||||
{{ $height := .height }}
|
||||
{{ $horizontal := .horizontal | default "center" }}
|
||||
{{ $maxheight := .maxheight }}
|
||||
{{ $maxwidth := .maxwidth }}
|
||||
{{ $number := .number }}
|
||||
{{ $numbered := .numbered }}
|
||||
{{ $vertical := .vertical | default "center" }}
|
||||
{{ $width := .width }}
|
||||
{{ $params := . }}
|
||||
|
||||
{{ $caption := $params.caption | markdownify }}
|
||||
{{ $compact := $params.compact }}
|
||||
{{ $content := $params.content | markdownify }}
|
||||
{{ $float := $params.float }}
|
||||
{{ $gap := $params.gap }}
|
||||
{{ $height := $params.height }}
|
||||
{{ $horizontal := $params.horizontal | default "center" }}
|
||||
{{ $maxheight := $params.maxheight }}
|
||||
{{ $maxwidth := $params.maxwidth }}
|
||||
{{ $number := $params.number }}
|
||||
{{ $numbered := $params.numbered }}
|
||||
{{ $vertical := $params.vertical | default "center" }}
|
||||
{{ $width := $params.width }}
|
||||
|
||||
{{ $heightish := or $maxheight $height }}
|
||||
{{ $showcaption := $caption }}
|
||||
|
@@ -1,3 +1,5 @@
|
||||
{{ $page := . }}
|
||||
|
||||
{{ $copyright := site.Copyright }}
|
||||
{{ $first := templates.Exists "partials/paige/footer-first.html" }}
|
||||
{{ $last := templates.Exists "partials/paige/footer-last.html" }}
|
||||
|
@@ -1,9 +1,11 @@
|
||||
{{ $page := . }}
|
||||
|
||||
{{ $result := "" }}
|
||||
|
||||
{{ if .Params.authors }}
|
||||
{{ if $page.Params.authors }}
|
||||
{{ $names := slice }}
|
||||
|
||||
{{ range .Params.authors }}
|
||||
{{ range $page.Params.authors }}
|
||||
{{ if eq (printf "%T" .) "string" }}
|
||||
{{ $names = $names | append (index site.Params.authors .).name }}
|
||||
{{ else }}
|
||||
|
@@ -1,7 +1,8 @@
|
||||
{{ $page := .page }}
|
||||
{{ $url := .url }}
|
||||
{{ $params := . }}
|
||||
|
||||
{{ $page := $params.page }}
|
||||
{{ $resource := "" }}
|
||||
{{ $url := $params.url }}
|
||||
|
||||
{{ with $page.Resources.GetMatch $url }}
|
||||
{{ $resource = . }}
|
||||
|
@@ -1,17 +1,19 @@
|
||||
{{ $pagetitle := .Title | markdownify | plainify | htmlUnescape }}
|
||||
{{ $sitetitle := .Site.Title | markdownify | plainify | htmlUnescape }}
|
||||
{{ $title := "" }}
|
||||
{{ $page := . }}
|
||||
|
||||
{{ if and .Title .Site.Title }}
|
||||
{{ $pagetitle := $page.Title | markdownify | plainify | htmlUnescape }}
|
||||
{{ $result := "" }}
|
||||
{{ $sitetitle := site.Title | markdownify | plainify | htmlUnescape }}
|
||||
|
||||
{{ if and $pagetitle $sitetitle }}
|
||||
{{ if .IsHome }}
|
||||
{{ $title = $pagetitle }}
|
||||
{{ $result = $pagetitle }}
|
||||
{{ else }}
|
||||
{{ $title = printf "%s · %s" $pagetitle $sitetitle }}
|
||||
{{ $result = printf "%s · %s" $pagetitle $sitetitle }}
|
||||
{{ end }}
|
||||
{{ else if .Title }}
|
||||
{{ $title = $pagetitle }}
|
||||
{{ else if .Site.Title }}
|
||||
{{ $title = $sitetitle }}
|
||||
{{ else if $pagetitle }}
|
||||
{{ $result = $pagetitle }}
|
||||
{{ else if $sitetitle }}
|
||||
{{ $result = $sitetitle }}
|
||||
{{ end }}
|
||||
|
||||
{{ return $title }}
|
||||
{{ return $result }}
|
||||
|
@@ -1,12 +1,14 @@
|
||||
{{ $page := . }}
|
||||
|
||||
<head>
|
||||
{{ if templates.Exists "partials/paige/head-first.html" }}
|
||||
{{ partial "paige/head-first.html" . }}
|
||||
{{ partial "paige/head-first.html" $page }}
|
||||
{{ end }}
|
||||
{{ partial "paige/metas.html" . }}
|
||||
<title>{{ partial "paige/func-title.html" . }}</title>
|
||||
{{ partial "paige/links.html" . }}
|
||||
{{ partial "paige/style.html" . }}
|
||||
{{ partial "paige/metas.html" $page }}
|
||||
<title>{{ partial "paige/func-title.html" $page }}</title>
|
||||
{{ partial "paige/links.html" $page }}
|
||||
{{ partial "paige/style.html" $page }}
|
||||
{{ if templates.Exists "partials/paige/head-last.html" }}
|
||||
{{ partial "paige/head-last.html" . }}
|
||||
{{ partial "paige/head-last.html" $page }}
|
||||
{{ end }}
|
||||
</head>
|
||||
|
@@ -1,3 +1,5 @@
|
||||
{{ $page := . }}
|
||||
|
||||
{{ $first := templates.Exists "partials/paige/header-first.html" }}
|
||||
{{ $last := templates.Exists "partials/paige/header-last.html" }}
|
||||
{{ $menu := site.Menus.main }}
|
||||
@@ -5,13 +7,13 @@
|
||||
{{ if or $first $last $menu }}
|
||||
<header>
|
||||
{{ if $first }}
|
||||
{{ partial "paige/header-first.html" . }}
|
||||
{{ partial "paige/header-first.html" $page }}
|
||||
{{ end }}
|
||||
{{ if $menu }}
|
||||
{{ partial "paige/menu.html" . }}
|
||||
{{ partial "paige/menu.html" $page }}
|
||||
{{ end }}
|
||||
{{ if $last }}
|
||||
{{ partial "paige/header-last.html" . }}
|
||||
{{ partial "paige/header-last.html" $page }}
|
||||
{{ end }}
|
||||
</header>
|
||||
{{ end }}
|
||||
|
@@ -1,23 +1,25 @@
|
||||
{{ $alt := .alt }}
|
||||
{{ $caption := .caption }}
|
||||
{{ $compact := .compact }}
|
||||
{{ $float := .float }}
|
||||
{{ $height := .height }}
|
||||
{{ $horizontal := .horizontal }}
|
||||
{{ $link := .link }}
|
||||
{{ $maxheight := .maxheight }}
|
||||
{{ $maxwidth := .maxwidth }}
|
||||
{{ $method := .method }}
|
||||
{{ $number := .number }}
|
||||
{{ $numbered := .numbered }}
|
||||
{{ $options := .options }}
|
||||
{{ $page := .page }}
|
||||
{{ $raw := .raw }}
|
||||
{{ $resource := .resource }}
|
||||
{{ $src := .src }}
|
||||
{{ $title := .title }}
|
||||
{{ $vertical := .vertical }}
|
||||
{{ $width := .width }}
|
||||
{{ $params := . }}
|
||||
|
||||
{{ $alt := $params.alt }}
|
||||
{{ $caption := $params.caption }}
|
||||
{{ $compact := $params.compact }}
|
||||
{{ $float := $params.float }}
|
||||
{{ $height := $params.height }}
|
||||
{{ $horizontal := $params.horizontal }}
|
||||
{{ $link := $params.link }}
|
||||
{{ $maxheight := $params.maxheight }}
|
||||
{{ $maxwidth := $params.maxwidth }}
|
||||
{{ $method := $params.method }}
|
||||
{{ $number := $params.number }}
|
||||
{{ $numbered := $params.numbered }}
|
||||
{{ $options := $params.options }}
|
||||
{{ $page := $params.page }}
|
||||
{{ $raw := $params.raw }}
|
||||
{{ $resource := $params.resource }}
|
||||
{{ $src := $params.src }}
|
||||
{{ $title := $params.title }}
|
||||
{{ $vertical := $params.vertical }}
|
||||
{{ $width := $params.width }}
|
||||
|
||||
{{ $content := partial "paige/img.html" (dict
|
||||
"alt" $alt
|
||||
|
@@ -1,22 +1,24 @@
|
||||
{{ $alt := .alt }}
|
||||
{{ $class := .class }}
|
||||
{{ $crossorigin := .crossorigin | default "anonymous" }}
|
||||
{{ $fetchpriority := .fetchpriority }}
|
||||
{{ $fingerprint := .fingerprint | default true }}
|
||||
{{ $height := .height }}
|
||||
{{ $loading := .loading | default "lazy" }}
|
||||
{{ $maxheight := .maxheight }}
|
||||
{{ $maxwidth := .maxwidth }}
|
||||
{{ $method := .method }}
|
||||
{{ $options := .options }}
|
||||
{{ $page := .page }}
|
||||
{{ $raw := .raw }}
|
||||
{{ $referrerpolicy := .referrerpolicy | default "no-referrer" }}
|
||||
{{ $resource := .resource }}
|
||||
{{ $src := .src }}
|
||||
{{ $style := .style }}
|
||||
{{ $title := .title }}
|
||||
{{ $width := .width }}
|
||||
{{ $params := . }}
|
||||
|
||||
{{ $alt := $params.alt }}
|
||||
{{ $class := $params.class }}
|
||||
{{ $crossorigin := $params.crossorigin | default "anonymous" }}
|
||||
{{ $fetchpriority := $params.fetchpriority }}
|
||||
{{ $fingerprint := $params.fingerprint | default true }}
|
||||
{{ $height := $params.height }}
|
||||
{{ $loading := $params.loading | default "lazy" }}
|
||||
{{ $maxheight := $params.maxheight }}
|
||||
{{ $maxwidth := $params.maxwidth }}
|
||||
{{ $method := $params.method }}
|
||||
{{ $options := $params.options }}
|
||||
{{ $page := $params.page }}
|
||||
{{ $raw := $params.raw }}
|
||||
{{ $referrerpolicy := $params.referrerpolicy | default "no-referrer" }}
|
||||
{{ $resource := $params.resource }}
|
||||
{{ $src := $params.src }}
|
||||
{{ $style := $params.style }}
|
||||
{{ $title := $params.title }}
|
||||
{{ $width := $params.width }}
|
||||
|
||||
{{ $intrinsicheight := $height }}
|
||||
{{ $intrinsicwidth := $width }}
|
||||
|
@@ -1,9 +1,11 @@
|
||||
{{ $crossorigin := .crossorigin | default "anonymous" }}
|
||||
{{ $href := .href }}
|
||||
{{ $integrity := .integrity }}
|
||||
{{ $page := .page }}
|
||||
{{ $raw := .raw }}
|
||||
{{ $referrerpolicy := .referrerpolicy | default "no-referrer" }}
|
||||
{{ $params := . }}
|
||||
|
||||
{{ $crossorigin := $params.crossorigin | default "anonymous" }}
|
||||
{{ $href := $params.href }}
|
||||
{{ $integrity := $params.integrity }}
|
||||
{{ $page := $params.page }}
|
||||
{{ $raw := $params.raw }}
|
||||
{{ $referrerpolicy := $params.referrerpolicy | default "no-referrer" }}
|
||||
|
||||
{{ if $raw }}
|
||||
{{ $href = relLangURL $href }}
|
||||
|
@@ -1,3 +1,5 @@
|
||||
{{ $page := . }}
|
||||
|
||||
<link href="{{ relLangURL `apple-touch-icon.png` | safeURL }}" rel="apple-touch-icon" sizes="180x180">
|
||||
<link href="{{ relLangURL `favicon-16x16.png` | safeURL }}" rel="icon" sizes="16x16" type="image/png">
|
||||
<link href="{{ relLangURL `favicon-32x32.png` | safeURL }}" rel="icon" sizes="32x32" type="image/png">
|
||||
@@ -18,7 +20,7 @@
|
||||
"integrity" site.Params.paige.bootstrap.style.link_integrity
|
||||
"raw" site.Params.paige.bootstrap.style.raw
|
||||
) }}
|
||||
{{ if or .Params.paige.math (and .Params.paige.show_full_pages (where .Pages "Params.paige.math" "eq" true)) }}
|
||||
{{ if or $page.Params.paige.math (and $page.Params.paige.show_full_pages (where $page.Pages "Params.paige.math" "eq" true)) }}
|
||||
{{ partial "paige/link.html" (dict
|
||||
"href" (site.Params.paige.math.style.link_href | default "https://cdn.jsdelivr.net/npm/katex@0.16.3/dist/katex.min.css")
|
||||
"integrity" (site.Params.paige.math.style.link_integrity | default "sha256-NJNVfEC6jfEt62wQMafLNT2eI6BaWONXbpkSEVAs3+8=")
|
||||
@@ -26,7 +28,7 @@
|
||||
) }}
|
||||
{{ end }}
|
||||
{{ if .AlternativeOutputFormats }}
|
||||
{{ $title := partial "paige/func-title.html" . }}
|
||||
{{ $title := partial "paige/func-title.html" $page }}
|
||||
{{ range .AlternativeOutputFormats }}
|
||||
<link href="{{ .Permalink | safeURL }}" rel="{{ .Rel }}" title="{{ $title }}" type="{{ .MediaType.Type }}">
|
||||
{{ end }}
|
||||
|
@@ -1,5 +1,7 @@
|
||||
{{ $page := . }}
|
||||
|
||||
<section class="paige-metadata w-100">
|
||||
{{ partial "paige/title.html" . }}
|
||||
{{ partial "paige/description.html" . }}
|
||||
{{ partial "paige/about.html" . }}
|
||||
{{ partial "paige/title.html" $page }}
|
||||
{{ partial "paige/description.html" $page }}
|
||||
{{ partial "paige/about.html" $page }}
|
||||
</section>
|
||||
|
@@ -1,11 +1,13 @@
|
||||
{{ $page := . }}
|
||||
|
||||
<meta charset="utf-8">
|
||||
{{ with partial "paige/func-authors.html" . }}
|
||||
{{ with partial "paige/func-authors.html" $page }}
|
||||
<meta content="{{ . }}" name="author">
|
||||
{{ end }}
|
||||
{{ with .Description }}
|
||||
{{ with $page.Description }}
|
||||
<meta content="{{ . }}" name="description">
|
||||
{{ end }}
|
||||
{{ if or .Keywords .Params.tags .Params.categories }}
|
||||
{{ if or $page.Keywords $page.Params.tags $page.Params.categories }}
|
||||
<meta content="{{ delimit (sort (union (union .Keywords .Params.tags) .Params.categories)) `, ` }}" name="keywords">
|
||||
{{ end }}
|
||||
<meta content="{{ site.Params.paige.color | default `#0d6efd` }}" name="msapplication-TileColor">
|
||||
@@ -14,5 +16,5 @@
|
||||
{{ end }}
|
||||
<meta content="{{ site.Params.paige.color | default `#0d6efd` }}" name="theme-color">
|
||||
<meta content="width=device-width, initial-scale=1" name="viewport">
|
||||
{{ template "_internal/opengraph.html" . }}
|
||||
{{ template "_internal/twitter_cards.html" . }}
|
||||
{{ template "_internal/opengraph.html" $page }}
|
||||
{{ template "_internal/twitter_cards.html" $page }}
|
||||
|
@@ -1,41 +1,43 @@
|
||||
{{ if .Pages }}
|
||||
{{ if .Params.paige.show_full_pages }}
|
||||
{{ $p := .Paginate .Pages }}
|
||||
{{ $page := . }}
|
||||
|
||||
{{ if $page.Pages }}
|
||||
{{ if $page.Params.paige.show_full_pages }}
|
||||
{{ $p := $page.Paginate $page.Pages }}
|
||||
<section>
|
||||
{{ range $p.Pages }}
|
||||
{{ .Scratch.Set "paige_show_full_pages" true }}
|
||||
{{ partial "paige/article.html" . }}
|
||||
{{ $page.Scratch.Set "paige_show_full_pages" true }}
|
||||
{{ partial "paige/article.html" $page }}
|
||||
{{ end }}
|
||||
</section>
|
||||
{{ if or $p.HasPrev $p.HasNext }}
|
||||
<section>
|
||||
<div class="d-flex justify-content-center">
|
||||
{{ partial "paige/pagination.html" . }}
|
||||
{{ partial "paige/pagination.html" $page }}
|
||||
</div>
|
||||
</section>
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ $p := .Paginate (.Pages.ByDate.Reverse.GroupByDate "January 2006") }}
|
||||
{{ $p := $page.Paginate ($page.Pages.ByDate.Reverse.GroupByDate "January 2006") }}
|
||||
<section>
|
||||
{{ range $p.PageGroups }}
|
||||
{{ if $.Param "paige.page_list.date_header.hide" | not }}
|
||||
{{ if $page.Param "paige.page_list.date_header.hide" | not }}
|
||||
<h2 class="{{ $.Param `paige.page_list.date_header.class` | default `h5 text-center` }}">{{ .Key }}</h2>
|
||||
{{ end }}
|
||||
{{ range .Pages }}
|
||||
{{ $class := "text-center" }}
|
||||
|
||||
{{ $authors := cond ($.Param "paige.page_list.authors.show" | not) "" (partial "paige/func-authors.html" .) }}
|
||||
{{ $authorsclass := $.Param "paige.page_list.authors.class" | default (print $class " text-secondary") }}
|
||||
{{ $date := cond ($.Param "paige.page_list.date.show" | not) "" .PublishDate }}
|
||||
{{ $dateclass := $.Param "paige.page_list.date.class" | default (print $class " text-secondary") }}
|
||||
{{ $description := cond ($.Param "paige.page_list.description.hide" | not) (.Description | markdownify) "" }}
|
||||
{{ $descriptionclass := $.Param "paige.page_list.description.class" | default $class }}
|
||||
{{ $authors := cond ($page.Param "paige.page_list.authors.show" | not) "" (partial "paige/func-authors.html" .) }}
|
||||
{{ $authorsclass := $page.Param "paige.page_list.authors.class" | default (print $class " text-secondary") }}
|
||||
{{ $date := cond ($page.Param "paige.page_list.date.show" | not) "" .PublishDate }}
|
||||
{{ $dateclass := $page.Param "paige.page_list.date.class" | default (print $class " text-secondary") }}
|
||||
{{ $description := cond ($page.Param "paige.page_list.description.hide" | not) (.Description | markdownify) "" }}
|
||||
{{ $descriptionclass := $page.Param "paige.page_list.description.class" | default $class }}
|
||||
{{ $flags := slice }}
|
||||
{{ $gap := "mb-0" }}
|
||||
{{ $summary := cond ($.Param "paige.page_list.summary.show" | not) "" (.Summary | strings.TrimPrefix "<p>" | strings.TrimSuffix "</p>") }}
|
||||
{{ $summaryclass := $.Param "paige.page_list.summary.class" | default $class }}
|
||||
{{ $title := cond ($.Param "paige.page_list.title.hide" | not) (.Title | markdownify) "" }}
|
||||
{{ $titleclass := $.Param "paige.page_list.title_class" | default $class }}
|
||||
{{ $summary := cond ($page.Param "paige.page_list.summary.show" | not) "" (.Summary | strings.TrimPrefix "<p>" | strings.TrimSuffix "</p>") }}
|
||||
{{ $summaryclass := $page.Param "paige.page_list.summary.class" | default $class }}
|
||||
{{ $title := cond ($page.Param "paige.page_list.title.hide" | not) (.Title | markdownify) "" }}
|
||||
{{ $titleclass := $page.Param "paige.page_list.title.class" | default $class }}
|
||||
|
||||
{{ if .Draft }}
|
||||
{{ $flags = $flags | append "paige-draft" "paige-unpublished" }}
|
||||
@@ -78,7 +80,7 @@
|
||||
{{ if or $p.HasPrev $p.HasNext }}
|
||||
<section>
|
||||
<div class="d-flex justify-content-center">
|
||||
{{ partial "paige/pagination.html" . }}
|
||||
{{ partial "paige/pagination.html" $page }}
|
||||
</div>
|
||||
</section>
|
||||
{{ end }}
|
||||
|
@@ -1,11 +1,13 @@
|
||||
{{ $crossorigin := .crossorigin | default "anonymous" }}
|
||||
{{ $defer := .defer | default "defer" }}
|
||||
{{ $integrity := .integrity }}
|
||||
{{ $onload := .onload | safeJS }}
|
||||
{{ $page := .page }}
|
||||
{{ $referrerpolicy := .referrerpolicy | default "no-referrer" }}
|
||||
{{ $raw := .raw }}
|
||||
{{ $src := .src }}
|
||||
{{ $params := . }}
|
||||
|
||||
{{ $crossorigin := $params.crossorigin | default "anonymous" }}
|
||||
{{ $defer := $params.defer | default "defer" }}
|
||||
{{ $integrity := $params.integrity }}
|
||||
{{ $onload := $params.onload | safeJS }}
|
||||
{{ $page := $params.page }}
|
||||
{{ $referrerpolicy := $params.referrerpolicy | default "no-referrer" }}
|
||||
{{ $raw := $params.raw }}
|
||||
{{ $src := $params.src }}
|
||||
|
||||
{{ if $raw }}
|
||||
{{ $src = relLangURL $src }}
|
||||
|
@@ -1,3 +1,5 @@
|
||||
{{ $page := . }}
|
||||
|
||||
<section>
|
||||
<div class="container-fluid">
|
||||
<form action="{{ .Page.RelPermalink }}" dir="auto" method="get">
|
||||
@@ -87,7 +89,7 @@ function paigeSearch(queryText) {
|
||||
var done = {};
|
||||
results.forEach(function (result) {
|
||||
result.result.forEach(function (path) {
|
||||
if (path === "{{ .RelPermalink }}" || done[path]) {
|
||||
if (path === "{{ $page.RelPermalink }}" || done[path]) {
|
||||
return;
|
||||
}
|
||||
if (!shown) {
|
||||
|
@@ -1,6 +1,8 @@
|
||||
{{ $class := .Param "paige.page.title.class" | default "display-5 fw-bold text-center" }}
|
||||
{{ $title := cond (.Param "paige.page.title.hide" | not) (.Title | markdownify) "" }}
|
||||
{{ $page := . }}
|
||||
|
||||
{{ $class := $page.Param "paige.page.title.class" | default "display-5 fw-bold text-center" }}
|
||||
{{ $title := cond ($page.Param "paige.page.title.hide" | not) ($page.Title | markdownify) "" }}
|
||||
|
||||
{{ if $title }}
|
||||
<h1 class="{{ $class }}">{{ if .Params.link }}<a href="{{ .Params.link }}">{{ $title }}</a>{{ else }}{{ $title }}{{ end }}{{ if .Scratch.Get "paige_show_full_pages" }}<a aria-label="Link to this section" class="paige-header-link" href="{{ .RelPermalink }}">#</a>{{ end }}</h1>
|
||||
<h1 class="{{ $class }}">{{ if $page.Params.link }}<a href="{{ .Params.link }}">{{ $title }}</a>{{ else }}{{ $title }}{{ end }}{{ if $page.Scratch.Get "paige_show_full_pages" }}<a aria-label="Link to this section" class="paige-header-link" href="{{ $page.RelPermalink }}">#</a>{{ end }}</h1>
|
||||
{{ end }}
|
||||
|
@@ -1,7 +1,9 @@
|
||||
{{ if and .Content .Params.paige.toc (not (eq (.Scratch.Get "paige_show_full_pages") true)) (ne .TableOfContents `<nav id="TableOfContents"></nav>`) }}
|
||||
{{ $page := . }}
|
||||
|
||||
{{ if and $page.Content $page.Params.paige.toc (not (eq ($page.Scratch.Get "paige_show_full_pages") true)) (ne $page.TableOfContents `<nav id="TableOfContents"></nav>`) }}
|
||||
<section class="paige-toc">
|
||||
<div class="border mb-3 pe-3 ps-3 pt-3 rounded">
|
||||
{{ .TableOfContents }}
|
||||
{{ $page.TableOfContents }}
|
||||
</div>
|
||||
</section>
|
||||
{{ end }}
|
||||
|
Reference in New Issue
Block a user