Indent template logic

master
Will Faught 3 years ago
parent 9848a64ff3
commit 994591f932

@ -1,120 +1,120 @@
{{ template "_internal/disqus.html" . }}
{{ if .Site.Params.paige.comments.cactus }}
<section class="mb-3">
<script type="text/javascript" src="https://latest.cactus.chat/cactus.js"></script>
<link rel="stylesheet" href="https://latest.cactus.chat/style.css" type="text/css">
<div id="comment-section"></div>
<script>
initComments({
node: document.getElementById("comment-section"),
defaultHomeserverUrl: "https://matrix.cactus.chat:8448",
serverName: "cactus.chat",
siteName: {{ .Site.Params.paige.comments.cactus.account_id }},
commentSectionId: {{ .RelPermalink }}
})
</script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
</section>
<section class="mb-3">
<script type="text/javascript" src="https://latest.cactus.chat/cactus.js"></script>
<link rel="stylesheet" href="https://latest.cactus.chat/style.css" type="text/css">
<div id="comment-section"></div>
<script>
initComments({
node: document.getElementById("comment-section"),
defaultHomeserverUrl: "https://matrix.cactus.chat:8448",
serverName: "cactus.chat",
siteName: {{ .Site.Params.paige.comments.cactus.account_id }},
commentSectionId: {{ .RelPermalink }}
})
</script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
</section>
{{ end }}
{{ with .Site.Params.paige.comments.commento }}
<section class="mb-3">
<div id="commento"></div>
<script defer src="{{ .script_url }}"></script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
</section>
<section class="mb-3">
<div id="commento"></div>
<script defer src="{{ .script_url }}"></script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
</section>
{{ end }}
{{ if .Site.Params.paige.comments.graphcomment }}
<section class="mb-3">
<div id="graphcomment"></div>
<script type="text/javascript">
var __semio__params = {
graphcommentId: {{ .Site.Params.paige.comments.graphcomment.account_id }},
behaviour: {
uid: {{ .RelPermalink }}
<section class="mb-3">
<div id="graphcomment"></div>
<script type="text/javascript">
var __semio__params = {
graphcommentId: {{ .Site.Params.paige.comments.graphcomment.account_id }},
behaviour: {
uid: {{ .RelPermalink }}
}
};
function __semio__onload() {
__semio__gc_graphlogin(__semio__params)
}
};
function __semio__onload() {
__semio__gc_graphlogin(__semio__params)
}
(function() {
var gc = document.createElement('script'); gc.type = 'text/javascript'; gc.async = true;
gc.onload = __semio__onload; gc.defer = true; gc.src = 'https://integration.graphcomment.com/gc_graphlogin.js?' + Date.now();
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(gc);
})();
</script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
</section>
(function() {
var gc = document.createElement('script'); gc.type = 'text/javascript'; gc.async = true;
gc.onload = __semio__onload; gc.defer = true; gc.src = 'https://integration.graphcomment.com/gc_graphlogin.js?' + Date.now();
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(gc);
})();
</script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
</section>
{{ end }}
{{ if .Site.Params.paige.comments.hyvor }}
<section class="mb-3">
<div id="hyvor-talk-view"></div>
<script type="text/javascript">
var HYVOR_TALK_WEBSITE = {{ .Site.Params.paige.comments.hyvor.account_id }};
var HYVOR_TALK_CONFIG = {
url: false,
id: {{ .RelPermalink }}
};
</script>
<script async type="text/javascript" src="//talk.hyvor.com/web-api/embed"></script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
</section>
<section class="mb-3">
<div id="hyvor-talk-view"></div>
<script type="text/javascript">
var HYVOR_TALK_WEBSITE = {{ .Site.Params.paige.comments.hyvor.account_id }};
var HYVOR_TALK_CONFIG = {
url: false,
id: {{ .RelPermalink }}
};
</script>
<script async type="text/javascript" src="//talk.hyvor.com/web-api/embed"></script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
</section>
{{ end }}
{{ if .Site.Params.paige.comments.intensedebate }}
<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 }};
</script>
<span id="IDCommentsPostTitle" style="display:none"></span>
<script type="text/javascript" src="http://www.intensedebate.com/js/genericCommentWrapperV2.js"></script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
</section>
<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 }};
</script>
<span id="IDCommentsPostTitle" style="display:none"></span>
<script type="text/javascript" src="http://www.intensedebate.com/js/genericCommentWrapperV2.js"></script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
</section>
{{ end }}
{{ with .Site.Params.paige.comments.isso }}
<section class="mb-3">
<script src="{{ .script_url }}"></script>
<section id="isso-thread">
<noscript>{{ i18n "paige_noscript" }}</noscript>
<section class="mb-3">
<script src="{{ .script_url }}"></script>
<section id="isso-thread">
<noscript>{{ i18n "paige_noscript" }}</noscript>
</section>
</section>
</section>
{{ end }}
{{ with .Site.Params.paige.comments.muut }}
<section class="mb-3">
<a href="https://muut.com/i/{{ .account_id }}/comments" class="muut" type="dynamic">Comments</a>
<script src="https://cdn.muut.com/1/moot.min.js"></script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
</section>
<section class="mb-3">
<a href="https://muut.com/i/{{ .account_id }}/comments" class="muut" type="dynamic">Comments</a>
<script src="https://cdn.muut.com/1/moot.min.js"></script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
</section>
{{ end }}
{{ if .Site.Params.paige.comments.remark42 }}
<section class="mb-3">
<div id="remark42"></div>
<script>
var remark_config = {
host: {{ .Site.Params.paige.comments.remark42.host_url }},
site_id: {{ .Site.Params.paige.comments.remark42.site_id | default "remark" }}
}
</script>
<script>!function(e,n){for(var o=0;o<e.length;o++){var r=n.createElement("script"),c=".js",d=n.head||n.body;"noModule"in r?(r.type="module",c=".mjs"):r.async=!0,r.defer=!0,r.src=remark_config.host+"/web/"+e[o]+c,d.appendChild(r)}}(remark_config.components||["embed"],document);</script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
</section>
<section class="mb-3">
<div id="remark42"></div>
<script>
var remark_config = {
host: {{ .Site.Params.paige.comments.remark42.host_url }},
site_id: {{ .Site.Params.paige.comments.remark42.site_id | default "remark" }}
}
</script>
<script>!function(e,n){for(var o=0;o<e.length;o++){var r=n.createElement("script"),c=".js",d=n.head||n.body;"noModule"in r?(r.type="module",c=".mjs"):r.async=!0,r.defer=!0,r.src=remark_config.host+"/web/"+e[o]+c,d.appendChild(r)}}(remark_config.components||["embed"],document);</script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
</section>
{{ end }}
{{ if .Site.Params.paige.comments.replybox }}
<section class="mb-3">
<div id="replybox"></div>
<script>
window.replybox = {
site: {{ .Site.Params.paige.comments.replybox.account_id }},
identifier: {{ .RelPermalink }}
};
</script>
<script src="https://cdn.getreplybox.com/js/embed.js"></script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
</section>
<section class="mb-3">
<div id="replybox"></div>
<script>
window.replybox = {
site: {{ .Site.Params.paige.comments.replybox.account_id }},
identifier: {{ .RelPermalink }}
};
</script>
<script src="https://cdn.getreplybox.com/js/embed.js"></script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
</section>
{{ end }}
{{ with .Site.Params.paige.comments.utterances }}
<section class="mb-3">
<script src="https://utteranc.es/client.js" repo="{{ .github_repo }}" issue-term="pathname" theme="preferred-color-scheme" crossorigin="anonymous" async></script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
</section>
<section class="mb-3">
<script src="https://utteranc.es/client.js" repo="{{ .github_repo }}" issue-term="pathname" theme="preferred-color-scheme" crossorigin="anonymous" async></script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
</section>
{{ end }}

@ -1,9 +1,9 @@
{{ if .Content }}
<section class="paige-content">
{{ if .Scratch.Get "paige_show_full_pages" }}
{{ .Content }}
{{ else }}
{{ .Content | replaceRE `(<h[1-6] id="([^"]+)".+)(</h[1-6]+>)` `${1}<a class="paige-header-link" href="#${2}">#</a>${3}` | safeHTML }}
{{ end }}
</section>
<section class="paige-content">
{{ if .Scratch.Get "paige_show_full_pages" }}
{{ .Content }}
{{ else }}
{{ .Content | replaceRE `(<h[1-6] id="([^"]+)".+)(</h[1-6]+>)` `${1}<a class="paige-header-link" href="#${2}">#</a>${3}` | safeHTML }}
{{ end }}
</section>
{{ end }}

@ -1,3 +1,3 @@
{{ with .Description }}
<p class="lead text-center">{{ . | markdownify }}</p>
<p class="lead text-center">{{ . | markdownify }}</p>
{{ end }}

@ -1,11 +1,11 @@
{{ if or .Site.Copyright (not .Site.Params.paige.hide_theme_link) }}
<footer>
{{ if and .Site.Copyright (not .Site.Params.paige.hide_theme_link) }}
<p class="text-center text-secondary">{{ .Site.Copyright | markdownify }} · <a class="link-secondary text-decoration-none" href="https://github.com/willfaught/paige">Paige Theme</a></p>
{{ else if .Site.Copyright }}
<p class="text-center text-secondary">{{ .Site.Copyright | markdownify }}</p>
{{ else if not .Site.Params.paige.hide_theme_link }}
<p class="text-center"><a class="link-secondary text-decoration-none" href="https://github.com/willfaught/paige">Paige Theme</a></p>
{{ end }}
</footer>
<footer>
{{ if and .Site.Copyright (not .Site.Params.paige.hide_theme_link) }}
<p class="text-center text-secondary">{{ .Site.Copyright | markdownify }} · <a class="link-secondary text-decoration-none" href="https://github.com/willfaught/paige">Paige Theme</a></p>
{{ else if .Site.Copyright }}
<p class="text-center text-secondary">{{ .Site.Copyright | markdownify }}</p>
{{ else if not .Site.Params.paige.hide_theme_link }}
<p class="text-center"><a class="link-secondary text-decoration-none" href="https://github.com/willfaught/paige">Paige Theme</a></p>
{{ end }}
</footer>
{{ end }}

@ -2,14 +2,14 @@
{{ $pageTitle := .Title | markdownify | plainify | htmlUnescape }}
{{ $siteTitle := .Site.Title | markdownify | plainify | htmlUnescape }}
{{ if and .Title .Site.Title }}
{{ if .IsHome }}
{{ $title = $pageTitle }}
{{ else }}
{{ $title = printf "%s · %s" $pageTitle $siteTitle }}
{{ end }}
{{ if .IsHome }}
{{ $title = $pageTitle }}
{{ else }}
{{ $title = printf "%s · %s" $pageTitle $siteTitle }}
{{ end }}
{{ else if .Title }}
{{ $title = $pageTitle }}
{{ $title = $pageTitle }}
{{ else if .Site.Title }}
{{ $title = $siteTitle }}
{{ $title = $siteTitle }}
{{ end }}
{{ return $title }}

@ -4,6 +4,6 @@
{{ partial "paige/links.html" . }}
{{ partial "paige/style.html" . }}
{{ if templates.Exists "partials/paige-head-last.html" }}
{{ partial "paige/head-last.html" . }}
{{ partial "paige/head-last.html" . }}
{{ end }}
</head>

@ -1,5 +1,5 @@
{{ if .Site.Menus.main }}
<header>
{{ partial "paige/menu.html" . }}
</header>
<header>
{{ partial "paige/menu.html" . }}
</header>
{{ end }}

@ -2,7 +2,7 @@
<link href="{{ relLangURL `favicon-16x16.png` }}" rel="icon" sizes="16x16" type="image/png">
<link href="{{ relLangURL `favicon-32x32.png` }}" rel="icon" sizes="32x32" type="image/png">
{{ if ne (relLangURL "favicon.ico") "/favicon.ico" }}
<link href="{{ relLangURL `favicon.ico` }}" rel="shortcut icon">
<link href="{{ relLangURL `favicon.ico` }}" rel="shortcut icon">
{{ end }}
<link href="{{ relLangURL `favicon.png` }}" rel="icon" type="image/png">
<link href="{{ relLangURL `favicon.svg` }}" rel="icon" type="image/svg+xml">
@ -19,15 +19,15 @@
"remote" .Site.Params.paige.bootstrap.style.remote
) }}
{{ if or .Params.paige.math (and .Params.paige.show_full_pages (where .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=")
"remote" 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=")
"remote" true
) }}
{{ end }}
{{ if .AlternativeOutputFormats }}
{{ $title := partial "paige/func-title.html" . }}
{{ range .AlternativeOutputFormats }}
<link href="{{ .Permalink }}" rel="{{ .Rel }}" title="{{ $title }}" type="{{ .MediaType.Type }}">
{{ end }}
{{ $title := partial "paige/func-title.html" . }}
{{ range .AlternativeOutputFormats }}
<link href="{{ .Permalink }}" rel="{{ .Rel }}" title="{{ $title }}" type="{{ .MediaType.Type }}">
{{ end }}
{{ end }}

@ -1,27 +1,27 @@
{{ $p := . }}
{{ $basePath := path.Clean (urls.Parse .Site.BaseURL).Path }}
{{ if eq $basePath "/" }}
{{ $basePath = "" }}
{{ $basePath = "" }}
{{ end }}
{{ $links := false }}
{{ $pills := false }}
{{ $tabs := false }}
{{ with .Site.Params.paige.menu_style }}
{{ if eq . `links` }}
{{ $links = true }}
{{ else if eq . `tabs` }}
{{ $tabs = true }}
{{ else }}
{{ $pills = true }}
{{ end }}
{{ if eq . `links` }}
{{ $links = true }}
{{ else if eq . `tabs` }}
{{ $tabs = true }}
{{ else }}
{{ $pills = true }}
{{ end }}
{{ else }}
{{ $pills = true }}
{{ $pills = true }}
{{ end }}
<nav class="justify-content-center my-3 nav{{ if $pills }} nav-pills{{ else if $tabs }} nav-tabs{{ end }}">
{{ range .Site.Menus.main }}
{{ $pagePath := strings.TrimPrefix $basePath $p.RelPermalink }}
{{ $menuPath := strings.TrimPrefix $basePath .URL }}
{{ $active := or (and (eq $menuPath `/`) (eq $pagePath `/`)) (and (ne $menuPath `/`) (hasPrefix $pagePath $menuPath)) }}
<a href="{{ .URL }}" class="{{ if $active }}active {{ if $links }}link-secondary {{ end }}{{ end }}nav-link"{{ if $active }} aria-current="page"{{ end }}>{{ .Name }}</a>
{{ $pagePath := strings.TrimPrefix $basePath $p.RelPermalink }}
{{ $menuPath := strings.TrimPrefix $basePath .URL }}
{{ $active := or (and (eq $menuPath `/`) (eq $pagePath `/`)) (and (ne $menuPath `/`) (hasPrefix $pagePath $menuPath)) }}
<a href="{{ .URL }}" class="{{ if $active }}active {{ if $links }}link-secondary {{ end }}{{ end }}nav-link"{{ if $active }} aria-current="page"{{ end }}>{{ .Name }}</a>
{{ end }}
</nav>

@ -1,16 +1,16 @@
<meta charset="utf-8">
{{ with partial "paige/func-authors.html" . }}
<meta content="{{ . }}" name="author">
<meta content="{{ . }}" name="author">
{{ end }}
{{ with .Description }}
<meta content="{{ . }}" name="description">
<meta content="{{ . }}" name="description">
{{ end }}
{{ if or .Keywords .Params.tags .Params.categories }}
<meta content="{{ delimit (sort (union (union .Keywords .Params.tags) .Params.categories)) `, ` }}" name="keywords">
<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">
{{ if ne (relLangURL "browserconfig.xml") "/browserconfig.xml" }}
<meta content="{{ relLangURL `browserconfig.xml` }}" name="msapplication-config" >
<meta content="{{ relLangURL `browserconfig.xml` }}" name="msapplication-config" >
{{ end }}
<meta content="{{ .Site.Params.paige.color | default `#0d6efd` }}" name="theme-color">
<meta content="width=device-width, initial-scale=1" name="viewport">

@ -1,8 +1,8 @@
{{ $authors := partial "paige/func-authors.html" . }}
{{ if or $authors .PublishDate}}
<p class="text-center text-secondary">
{{- with $authors }}{{ . }}{{ end -}}
{{- if and $authors .PublishDate }}<br>{{ end -}}
{{- with .PublishDate }}<time datetime="{{ .Format `2006-01-02` }}">{{ time.Format (site.Params.paige.date_format | default ":date_long") . }}</time>{{ end -}}
</p>
<p class="text-center text-secondary">
{{- with $authors }}{{ . }}{{ end -}}
{{- if and $authors .PublishDate }}<br>{{ end -}}
{{- with .PublishDate }}<time datetime="{{ .Format `2006-01-02` }}">{{ time.Format (site.Params.paige.date_format | default ":date_long") . }}</time>{{ end -}}
</p>
{{ end }}

@ -1,37 +1,37 @@
{{ if .Pages }}
{{ if .Params.paige.show_full_pages }}
{{ $p := .Paginate .Pages }}
<section>
{{ range $p.Pages }}
{{ .Scratch.Set "paige_show_full_pages" true }}
{{ partial "paige/article.html" . }}
{{ if .Params.paige.show_full_pages }}
{{ $p := .Paginate .Pages }}
<section>
{{ range $p.Pages }}
{{ .Scratch.Set "paige_show_full_pages" true }}
{{ partial "paige/article.html" . }}
{{ end }}
</section>
{{ if or $p.HasPrev $p.HasNext }}
<section>
<div class="d-flex justify-content-center">
{{ partial "paige/pagination.html" . }}
</div>
</section>
{{ end }}
{{ else }}
{{ $p := .Paginate (.Pages.ByDate.Reverse.GroupByDate "January 2006") }}
<section>
{{ range $p.PageGroups }}
<h5 class="text-center">{{ .Key }}</h5>
{{ range .Pages }}
<p class="text-center">
<a href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a>{{ with .Description }}<br>{{ . | markdownify }}{{ end }}
</p>
{{ end }}
{{ end }}
</section>
{{ if or $p.HasPrev $p.HasNext }}
<section>
<div class="d-flex justify-content-center">
{{ partial "paige/pagination.html" . }}
</div>
</section>
{{ end }}
{{ end }}
</section>
{{ if or $p.HasPrev $p.HasNext }}
<section>
<div class="d-flex justify-content-center">
{{ partial "paige/pagination.html" . }}
</div>
</section>
{{ end }}
{{ else }}
{{ $p := .Paginate (.Pages.ByDate.Reverse.GroupByDate "January 2006") }}
<section>
{{ range $p.PageGroups }}
<h5 class="text-center">{{ .Key }}</h5>
{{ range .Pages }}
<p class="text-center">
<a href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a>{{ with .Description }}<br>{{ . | markdownify }}{{ end }}
</p>
{{ end }}
{{ end }}
</section>
{{ if or $p.HasPrev $p.HasNext }}
<section>
<div class="d-flex justify-content-center">
{{ partial "paige/pagination.html" . }}
</div>
</section>
{{ end }}
{{ end }}
{{ end }}

@ -53,124 +53,124 @@ paigeQuery.addEventListener("change", function (e) {
"src" (.Site.Params.paige.bootstrap.script.script_src | default "https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js")
) }}
{{ if or .Params.paige.math (and .Params.paige.show_full_pages (where .Pages "Params.paige.math" "eq" true)) }}
{{ partial "paige/script.html" (dict
"integrity" .Site.Params.paige.math.script.script_integrity
"remote" .Site.Params.paige.math.script.remote
"src" (.Site.Params.paige.math.script.script_src | default "https://cdn.jsdelivr.net/npm/katex@0.16.3/dist/katex.min.js")
) }}
{{ partial "paige/script.html" (dict
"integrity" .Site.Params.paige.math.autorender.script_integrity
"onload" "renderMathInElement(document.body);"
"remote" .Site.Params.paige.math.autorender.remote
"src" (.Site.Params.paige.math.autorender.script_src | default "https://cdn.jsdelivr.net/npm/katex@0.16.3/dist/contrib/auto-render.min.js")
) }}
{{ partial "paige/script.html" (dict
"integrity" .Site.Params.paige.math.script.script_integrity
"remote" .Site.Params.paige.math.script.remote
"src" (.Site.Params.paige.math.script.script_src | default "https://cdn.jsdelivr.net/npm/katex@0.16.3/dist/katex.min.js")
) }}
{{ partial "paige/script.html" (dict
"integrity" .Site.Params.paige.math.autorender.script_integrity
"onload" "renderMathInElement(document.body);"
"remote" .Site.Params.paige.math.autorender.remote
"src" (.Site.Params.paige.math.autorender.script_src | default "https://cdn.jsdelivr.net/npm/katex@0.16.3/dist/contrib/auto-render.min.js")
) }}
{{ end }}
{{ if .Site.GoogleAnalytics }}
{{ template "_internal/google_analytics.html" . }}
{{ template "_internal/google_analytics.html" . }}
{{ end }}
{{ with .Site.Params.paige.analytics.chartbeat }}
<script type='text/javascript'>
(function() {
var _sf_async_config = window._sf_async_config = (window._sf_async_config || {});
_sf_async_config.uid = {{ .account_id }};
_sf_async_config.domain = {{ .domain }};
_sf_async_config.useCanonical = true;
_sf_async_config.useCanonicalDomain = true;
function loadChartbeat() {
var e = document.createElement('script');
var n = document.getElementsByTagName('script')[0];
e.type = 'text/javascript';
e.async = true;
e.src = 'https://static.chartbeat.com/js/chartbeat.js';
n.parentNode.insertBefore(e, n);
}
loadChartbeat();
})();
</script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
<script type='text/javascript'>
(function() {
var _sf_async_config = window._sf_async_config = (window._sf_async_config || {});
_sf_async_config.uid = {{ .account_id }};
_sf_async_config.domain = {{ .domain }};
_sf_async_config.useCanonical = true;
_sf_async_config.useCanonicalDomain = true;
function loadChartbeat() {
var e = document.createElement('script');
var n = document.getElementsByTagName('script')[0];
e.type = 'text/javascript';
e.async = true;
e.src = 'https://static.chartbeat.com/js/chartbeat.js';
n.parentNode.insertBefore(e, n);
}
loadChartbeat();
})();
</script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
{{ end }}
{{ with .Site.Params.paige.analytics.clicky }}
<script type="text/javascript">
var clicky_site_ids = clicky_site_ids || [];
clicky_site_ids.push({{ .account_id }});
(function() {
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = 'https://static.getclicky.com/js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(s);
})();
</script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
<script type="text/javascript">
var clicky_site_ids = clicky_site_ids || [];
clicky_site_ids.push({{ .account_id }});
(function() {
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = 'https://static.getclicky.com/js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(s);
})();
</script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
{{ end }}
{{ with .Site.Params.paige.analytics.fathom }}
<script data-site="{{ .account_id }}" defer src="https://cdn.usefathom.com/script.js"></script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
<script data-site="{{ .account_id }}" defer src="https://cdn.usefathom.com/script.js"></script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
{{ end }}
{{ with .Site.Params.paige.analytics.finteza }}
<script type="text/javascript">
(function(a,e,f,g,b,c,d){a[b]||(a.FintezaCoreObject=b,a[b]=a[b]||function(){(a[b].q=a[b].q||[]).push(arguments)},a[b].l=1*new Date,c=e.createElement(f),d=e.getElementsByTagName(f)[0],c.async=!0,c.defer=!0,c.src=g,d&&d.parentNode&&d.parentNode.insertBefore(c,d))})(window,document,"script","{{ .script_url }}","fz");
fz("register","website","{{ .account_id }}");
</script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
<script type="text/javascript">
(function(a,e,f,g,b,c,d){a[b]||(a.FintezaCoreObject=b,a[b]=a[b]||function(){(a[b].q=a[b].q||[]).push(arguments)},a[b].l=1*new Date,c=e.createElement(f),d=e.getElementsByTagName(f)[0],c.async=!0,c.defer=!0,c.src=g,d&&d.parentNode&&d.parentNode.insertBefore(c,d))})(window,document,"script","{{ .script_url }}","fz");
fz("register","website","{{ .account_id }}");
</script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
{{ end }}
{{ with .Site.Params.paige.analytics.hotjar }}
<script type="application/javascript">
(function(h,o,t,j,a,r){
h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
h._hjSettings={hjid:{{ .account_id }},hjsv:6};
a=o.getElementsByTagName('head')[0];
r=o.createElement('script');r.async=1;
r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
a.appendChild(r);
})(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');
</script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
<script type="application/javascript">
(function(h,o,t,j,a,r){
h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
h._hjSettings={hjid:{{ .account_id }},hjsv:6};
a=o.getElementsByTagName('head')[0];
r=o.createElement('script');r.async=1;
r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
a.appendChild(r);
})(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');
</script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
{{ end }}
{{ with .Site.Params.paige.analytics.matomo }}
<script type="text/javascript">
var _paq = window._paq = window._paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://{{ .host_url }}/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '{{ .account_id }}']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
<script type="text/javascript">
var _paq = window._paq = window._paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://{{ .host_url }}/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '{{ .account_id }}']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
{{ end }}
{{ with .Site.Params.paige.analytics.mixpanel }}
<script type="text/javascript">
(function(f,b){if(!b.__SV){var e,g,i,h;window.mixpanel=b;b._i=[];b.init=function(e,f,c){function g(a,d){var b=d.split(".");2==b.length&&(a=a[b[0]],d=b[1]);a[d]=function(){a.push([d].concat(Array.prototype.slice.call(arguments,0)))}}var a=b;"undefined"!==typeof c?a=b[c]=[]:c="mixpanel";a.people=a.people||[];a.toString=function(a){var d="mixpanel";"mixpanel"!==c&&(d+="."+c);a||(d+=" (stub)");return d};a.people.toString=function(){return a.toString(1)+".people (stub)"};i="disable time_event track track_pageview track_links track_forms track_with_groups add_group set_group remove_group register register_once alias unregister identify name_tag set_config reset opt_in_tracking opt_out_tracking has_opted_in_tracking has_opted_out_tracking clear_opt_in_out_tracking start_batch_senders people.set people.set_once people.unset people.increment people.append people.union people.track_charge people.clear_charges people.delete_user people.remove".split(" ");
for(h=0;h<i.length;h++)g(a,i[h]);var j="set set_once union unset remove delete".split(" ");a.get_group=function(){function b(c){d[c]=function(){call2_args=arguments;call2=[c].concat(Array.prototype.slice.call(call2_args,0));a.push([e,call2])}}for(var d={},e=["get_group"].concat(Array.prototype.slice.call(arguments,0)),c=0;c<j.length;c++)b(j[c]);return d};b._i.push([e,f,c])};b.__SV=1.2;e=f.createElement("script");e.type="text/javascript";e.async=!0;e.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?
MIXPANEL_CUSTOM_LIB_URL:"file:"===f.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";g=f.getElementsByTagName("script")[0];g.parentNode.insertBefore(e,g)}})(document,window.mixpanel||[]);
mixpanel.init({{ .token }}, {});
mixpanel.track('page view');
</script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
<script type="text/javascript">
(function(f,b){if(!b.__SV){var e,g,i,h;window.mixpanel=b;b._i=[];b.init=function(e,f,c){function g(a,d){var b=d.split(".");2==b.length&&(a=a[b[0]],d=b[1]);a[d]=function(){a.push([d].concat(Array.prototype.slice.call(arguments,0)))}}var a=b;"undefined"!==typeof c?a=b[c]=[]:c="mixpanel";a.people=a.people||[];a.toString=function(a){var d="mixpanel";"mixpanel"!==c&&(d+="."+c);a||(d+=" (stub)");return d};a.people.toString=function(){return a.toString(1)+".people (stub)"};i="disable time_event track track_pageview track_links track_forms track_with_groups add_group set_group remove_group register register_once alias unregister identify name_tag set_config reset opt_in_tracking opt_out_tracking has_opted_in_tracking has_opted_out_tracking clear_opt_in_out_tracking start_batch_senders people.set people.set_once people.unset people.increment people.append people.union people.track_charge people.clear_charges people.delete_user people.remove".split(" ");
for(h=0;h<i.length;h++)g(a,i[h]);var j="set set_once union unset remove delete".split(" ");a.get_group=function(){function b(c){d[c]=function(){call2_args=arguments;call2=[c].concat(Array.prototype.slice.call(call2_args,0));a.push([e,call2])}}for(var d={},e=["get_group"].concat(Array.prototype.slice.call(arguments,0)),c=0;c<j.length;c++)b(j[c]);return d};b._i.push([e,f,c])};b.__SV=1.2;e=f.createElement("script");e.type="text/javascript";e.async=!0;e.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?
MIXPANEL_CUSTOM_LIB_URL:"file:"===f.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";g=f.getElementsByTagName("script")[0];g.parentNode.insertBefore(e,g)}})(document,window.mixpanel||[]);
mixpanel.init({{ .token }}, {});
mixpanel.track('page view');
</script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
{{ end }}
{{ with .Site.Params.paige.analytics.plausible }}
<script data-domain="{{ .account_id }}" defer src="https://plausible.io/js/script.js"></script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
<script data-domain="{{ .account_id }}" defer src="https://plausible.io/js/script.js"></script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
{{ end }}
{{ with .Site.Params.paige.analytics.woopra }}
<script>
!function(){var t,o,c,e=window,n=document,r=arguments,a="script",i=["call","cancelAction","config","identify","push","track","trackClick","trackForm","update","visit"],s=function(){var t,o=this,c=function(t){o[t]=function(){return o._e.push([t].concat(Array.prototype.slice.call(arguments,0))),o}};for(o._e=[],t=0;t<i.length;t++)c(i[t])};for(e.__woo=e.__woo||{},t=0;t<r.length;t++)e.__woo[r[t]]=e[r[t]]=e[r[t]]||new s;(o=n.createElement(a)).async=1,o.src="https://static.woopra.com/w.js",(c=n.getElementsByTagName(a)[0]).parentNode.insertBefore(o,c)}("woopra");
woopra.config({
domain: {{ .domain }}
});
woopra.track();
</script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
<script>
!function(){var t,o,c,e=window,n=document,r=arguments,a="script",i=["call","cancelAction","config","identify","push","track","trackClick","trackForm","update","visit"],s=function(){var t,o=this,c=function(t){o[t]=function(){return o._e.push([t].concat(Array.prototype.slice.call(arguments,0))),o}};for(o._e=[],t=0;t<i.length;t++)c(i[t])};for(e.__woo=e.__woo||{},t=0;t<r.length;t++)e.__woo[r[t]]=e[r[t]]=e[r[t]]||new s;(o=n.createElement(a)).async=1,o.src="https://static.woopra.com/w.js",(c=n.getElementsByTagName(a)[0]).parentNode.insertBefore(o,c)}("woopra");
woopra.config({
domain: {{ .domain }}
});
woopra.track();
</script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
{{ end }}
{{ with .Site.Params.paige.analytics.yandex }}
<script>
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};m[i].l=1*new Date();k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
(window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");
ym("{{ .account_id }}", "init", {});
</script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
<script>
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};m[i].l=1*new Date();k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
(window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");
ym("{{ .account_id }}", "init", {});
</script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
{{ end }}

@ -1,15 +1,15 @@
{{ with .Site.Params.paige.social }}
<section>
<nav>
<div class="mb-3 text-center">
{{ range $k, $v := . }}
{{ if hasPrefix $v.link "mailto:" }}
<a href="#" data-a="{{ base64Encode (index (split $v.link `@`) 0) }}" data-b="{{ base64Encode `@` }}" data-c="{{ base64Encode (index (split $v.link `@`) 1) }}" onclick="this.href = atob(this.dataset.a) + atob(this.dataset.b) + atob(this.dataset.c)"><i class="bi bi-{{ $v.icon }} display-6 mx-2"><span class="visually-hidden">{{ $v.name }}</span></i></a>
{{ else }}
<a href="{{ $v.link }}"><i class="bi bi-{{ $v.icon }} display-6 mx-2"><span class="visually-hidden">{{ $v.name }}</span></i></a>
{{ end }}
{{ end }}
</div>
</nav>
</section>
<section>
<nav>
<div class="mb-3 text-center">
{{ range $k, $v := . }}
{{ if hasPrefix $v.link "mailto:" }}
<a href="#" data-a="{{ base64Encode (index (split $v.link `@`) 0) }}" data-b="{{ base64Encode `@` }}" data-c="{{ base64Encode (index (split $v.link `@`) 1) }}" onclick="this.href = atob(this.dataset.a) + atob(this.dataset.b) + atob(this.dataset.c)"><i class="bi bi-{{ $v.icon }} display-6 mx-2"><span class="visually-hidden">{{ $v.name }}</span></i></a>
{{ else }}
<a href="{{ $v.link }}"><i class="bi bi-{{ $v.icon }} display-6 mx-2"><span class="visually-hidden">{{ $v.name }}</span></i></a>
{{ end }}
{{ end }}
</div>
</nav>
</section>
{{ end }}

@ -22,15 +22,15 @@ section[class="paige-content"] > div {
}
{{ with .Site.Params.paige.content_max_width }}
section[class="paige-content"], section[class="paige-toc"] {
max-width: {{ . }};
}
section[class="paige-content"], section[class="paige-toc"] {
max-width: {{ . }};
}
{{ end }}
{{ with .Site.Params.paige.metadata_max_width }}
section[class="paige-metadata"] {
max-width: {{ . }};
}
section[class="paige-metadata"] {
max-width: {{ . }};
}
{{ end }}
.paige-figure > div > div[class="highlight"] > pre, .paige-figure > div > :last-child {
@ -49,18 +49,18 @@ section[class="paige-metadata"] {
}
{{ with .Site.Params.paige.color_scheme }}
{{ if eq . "dark" }}
{{ partial "paige/dark.css" . | safeCSS }}
{{ else if eq . "light" }}
{{ partial "paige/light.css" . | safeCSS }}
{{ end }}
{{ if eq . "dark" }}
{{ partial "paige/dark.css" . | safeCSS }}
{{ else if eq . "light" }}
{{ partial "paige/light.css" . | safeCSS }}
{{ end }}
{{ else }}
@media (prefers-color-scheme: dark) {
{{ partial "paige/dark.css" . | safeCSS }}
}
@media (prefers-color-scheme: dark) {
{{ partial "paige/dark.css" . | safeCSS }}
}
@media (prefers-color-scheme: light) {
{{ partial "paige/light.css" . | safeCSS }}
}
@media (prefers-color-scheme: light) {
{{ partial "paige/light.css" . | safeCSS }}
}
{{ end }}
</style>

@ -1,8 +1,8 @@
{{ if .Title }}
{{ $class := "display-5" }}
{{ if .IsHome }}
{{ $class = "display-1" }}
{{ end }}
{{ $title := .Title | markdownify }}
<h1 class="{{ $class }} fw-bold text-center">{{ if .Params.link }}<a href="{{ .Params.link }}">{{ $title }}</a>{{ else }}{{ $title }}{{ end }}{{ if .Scratch.Get "paige_show_full_pages" }}<a class="paige-header-link" href="{{ .RelPermalink }}">#</a>{{ end }}</h1>
{{ $class := "display-5" }}
{{ if .IsHome }}
{{ $class = "display-1" }}
{{ end }}
{{ $title := .Title | markdownify }}
<h1 class="{{ $class }} fw-bold text-center">{{ if .Params.link }}<a href="{{ .Params.link }}">{{ $title }}</a>{{ else }}{{ $title }}{{ end }}{{ if .Scratch.Get "paige_show_full_pages" }}<a class="paige-header-link" href="{{ .RelPermalink }}">#</a>{{ end }}</h1>
{{ end }}

@ -1,7 +1,7 @@
{{ if and .Content .Params.paige.toc (not (eq (.Scratch.Get "paige_show_full_pages") true)) (ne .TableOfContents `<nav id="TableOfContents"></nav>`) }}
<section class="paige-toc">
<div class="border mb-3 pe-3 ps-3 pt-3 rounded">
{{ .TableOfContents }}
</div>
</section>
<section class="paige-toc">
<div class="border mb-3 pe-3 ps-3 pt-3 rounded">
{{ .TableOfContents }}
</div>
</section>
{{ end }}

Loading…
Cancel
Save