Move partials under paige directory
This commit is contained in:
5
layouts/partials/paige/article.html
Normal file
5
layouts/partials/paige/article.html
Normal file
@@ -0,0 +1,5 @@
|
||||
<article>
|
||||
{{ partial "paige/metadata.html" . }}
|
||||
{{ partial "paige/toc.html" . }}
|
||||
{{ partial "paige/content.html" . }}
|
||||
</article>
|
120
layouts/partials/paige/comments.html
Normal file
120
layouts/partials/paige/comments.html
Normal file
@@ -0,0 +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_comments_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_comments_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 }}
|
||||
}
|
||||
};
|
||||
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_comments_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_comments_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_comments_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_comments_noscript" }}</noscript>
|
||||
</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_comments_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_comments_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_comments_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_comments_noscript" }}</noscript>
|
||||
</section>
|
||||
{{ end }}
|
17
layouts/partials/paige/content.html
Normal file
17
layouts/partials/paige/content.html
Normal file
@@ -0,0 +1,17 @@
|
||||
{{ if .Content }}
|
||||
<section>
|
||||
<div class="container-fluid">
|
||||
<div class="justify-content-center row">
|
||||
<div class="col col-auto px-0">
|
||||
<article>
|
||||
{{ if .Scratch.Get "paige_show_full_pages" }}
|
||||
{{ .Content }}
|
||||
{{ else }}
|
||||
{{ .Content }}
|
||||
{{ end }}
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{{ end }}
|
3
layouts/partials/paige/description.html
Normal file
3
layouts/partials/paige/description.html
Normal file
@@ -0,0 +1,3 @@
|
||||
{{ with .Description }}
|
||||
<p class="lead text-center">{{ . | markdownify }}</p>
|
||||
{{ end }}
|
11
layouts/partials/paige/footer.html
Normal file
11
layouts/partials/paige/footer.html
Normal file
@@ -0,0 +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-muted">{{ .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-muted">{{ .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 }}
|
17
layouts/partials/paige/func-authors.html
Normal file
17
layouts/partials/paige/func-authors.html
Normal file
@@ -0,0 +1,17 @@
|
||||
{{ $result := "" }}
|
||||
{{ if .Params.authors }}
|
||||
{{ $names := slice }}
|
||||
{{ range .Params.authors }}
|
||||
{{ $names = $names | append (index site.Params.authors . "name" | default .) }}
|
||||
{{ end }}
|
||||
{{ $result = delimit $names ", " }}
|
||||
{{ else if .Site.Params.authors }}
|
||||
{{ $names := slice }}
|
||||
{{ range $k, $v := .Site.Params.authors }}
|
||||
{{ if eq $v.default true }}
|
||||
{{ $names = $names | append $v.name }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ $result = delimit $names ", " }}
|
||||
{{ end }}
|
||||
{{ return $result }}
|
15
layouts/partials/paige/func-title.html
Normal file
15
layouts/partials/paige/func-title.html
Normal file
@@ -0,0 +1,15 @@
|
||||
{{ $title := "" }}
|
||||
{{ $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 }}
|
||||
{{ else if .Title }}
|
||||
{{ $title = $pageTitle }}
|
||||
{{ else if .Site.Title }}
|
||||
{{ $title = $siteTitle }}
|
||||
{{ end }}
|
||||
{{ return $title }}
|
9
layouts/partials/paige/head.html
Normal file
9
layouts/partials/paige/head.html
Normal file
@@ -0,0 +1,9 @@
|
||||
<head>
|
||||
{{ partial "paige/meta.html" . }}
|
||||
<title>{{ partial "paige/func-title.html" . }}</title>
|
||||
{{ partial "paige/link.html" . }}
|
||||
{{ partial "paige/style.html" . }}
|
||||
{{ if templates.Exists "partials/paige-head-last.html" }}
|
||||
{{ partial "paige/head-last.html" . }}
|
||||
{{ end }}
|
||||
</head>
|
5
layouts/partials/paige/header.html
Normal file
5
layouts/partials/paige/header.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{{ if .Site.Menus.main }}
|
||||
<header>
|
||||
{{ partial "paige/menu.html" . }}
|
||||
</header>
|
||||
{{ end }}
|
37
layouts/partials/paige/link.html
Normal file
37
layouts/partials/paige/link.html
Normal file
@@ -0,0 +1,37 @@
|
||||
<link href="{{ relLangURL `apple-touch-icon.png` }}" rel="apple-touch-icon" sizes="180x180">
|
||||
<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">
|
||||
{{ end }}
|
||||
<link href="{{ relLangURL `favicon.png` }}" rel="icon" type="image/png">
|
||||
<link href="{{ relLangURL `favicon.svg` }}" rel="icon" type="image/svg+xml">
|
||||
<link color="{{ .Site.Params.paige.color | default `#0d6efd` }}" href="{{ relLangURL `safari-pinned-tab.svg` }}" rel="mask-icon">
|
||||
<link href="{{ relLangURL `site.webmanifest` }}" rel="manifest">
|
||||
{{ with .Site.Params.paige.bootstrap.styles_path }}
|
||||
{{ with resources.Get (relLangURL .) }}
|
||||
<link href="{{ (. | minify | fingerprint).RelPermalink }}" rel="stylesheet">
|
||||
{{ else }}
|
||||
<link href="{{ relLangURL . }}" rel="stylesheet">
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
<link crossorigin="anonymous" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" rel="stylesheet">
|
||||
{{ end }}
|
||||
{{ with .Site.Params.paige.bootstrap.icons_path }}
|
||||
{{ with resources.Get (relLangURL .) }}
|
||||
<link href="{{ (. | minify | fingerprint).RelPermalink }}" rel="stylesheet">
|
||||
{{ else }}
|
||||
<link href="{{ relLangURL . }}" rel="stylesheet">
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
<link crossorigin="anonymous" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.2/font/bootstrap-icons.css" integrity="sha384-b6lVK+yci+bfDmaY1u0zE8YYJt0TZxLEAFyYSLHId4xoVvsrQu3INevFKo+Xir8e" rel="stylesheet">
|
||||
{{ end }}
|
||||
{{ if or .Params.paige.math (and .Params.paige.show_full_pages (where .Pages "Params.paige.math" "eq" true)) }}
|
||||
<link crossorigin="anonymous" href="https://cdn.jsdelivr.net/npm/katex@0.16.3/dist/katex.min.css" integrity="sha384-Juol1FqnotbkyZUT5Z7gUPjQ9gzlwCENvUZTpQBAPxtusdwFLRy382PSDx5UUJ4/" rel="stylesheet">
|
||||
{{ end }}
|
||||
{{ if .AlternativeOutputFormats }}
|
||||
{{ $title := partial "paige/func-title.html" . }}
|
||||
{{ range .AlternativeOutputFormats }}
|
||||
<link href="{{ .Permalink }}" rel="{{ .Rel }}" title="{{ $title }}" type="{{ .MediaType.Type }}">
|
||||
{{ end }}
|
||||
{{ end }}
|
13
layouts/partials/paige/menu.html
Normal file
13
layouts/partials/paige/menu.html
Normal file
@@ -0,0 +1,13 @@
|
||||
{{ $p := . }}
|
||||
{{ $basePath := path.Clean (urls.Parse .Site.BaseURL).Path }}
|
||||
{{ if eq $basePath "/" }}
|
||||
{{ $basePath = "" }}
|
||||
{{ end }}
|
||||
<nav class="justify-content-center my-3 nav nav-pills">
|
||||
{{ 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="nav-link{{ if $active }} active{{ end }}"{{ if $active }} aria-current="page"{{ end }}>{{ .Name }}</a>
|
||||
{{ end }}
|
||||
</nav>
|
18
layouts/partials/paige/meta.html
Normal file
18
layouts/partials/paige/meta.html
Normal file
@@ -0,0 +1,18 @@
|
||||
<meta charset="utf-8">
|
||||
{{ with partial "paige/func-authors.html" . }}
|
||||
<meta content="{{ . }}" name="author">
|
||||
{{ end }}
|
||||
{{ with .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">
|
||||
{{ 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" >
|
||||
{{ 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" . }}
|
5
layouts/partials/paige/metadata.html
Normal file
5
layouts/partials/paige/metadata.html
Normal file
@@ -0,0 +1,5 @@
|
||||
<section>
|
||||
{{ partial "paige/title.html" . }}
|
||||
{{ partial "paige/description.html" . }}
|
||||
{{ partial "paige/other.html" . }}
|
||||
</section>
|
8
layouts/partials/paige/other.html
Normal file
8
layouts/partials/paige/other.html
Normal file
@@ -0,0 +1,8 @@
|
||||
{{ $authors := partial "paige/func-authors.html" . }}
|
||||
{{ if or $authors .PublishDate}}
|
||||
<p class="text-center text-muted">
|
||||
{{- 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 }}
|
35
layouts/partials/paige/pages.html
Normal file
35
layouts/partials/paige/pages.html
Normal file
@@ -0,0 +1,35 @@
|
||||
{{ if .Pages }}
|
||||
{{ if .Params.paige.show_full_pages }}
|
||||
{{ $p := .Paginate .Pages }}
|
||||
{{ range $p.Pages }}
|
||||
{{ .Scratch.Set "paige_show_full_pages" true }}
|
||||
{{ partial "paige/article.html" . }}
|
||||
{{ end }}
|
||||
{{ 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") }}
|
||||
<article>
|
||||
{{ 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 }}
|
||||
</article>
|
||||
{{ if or $p.HasPrev $p.HasNext }}
|
||||
<section>
|
||||
<div class="d-flex justify-content-center">
|
||||
{{ partial "paige/pagination.html" . }}
|
||||
</div>
|
||||
</section>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
365
layouts/partials/paige/pagination.html
Normal file
365
layouts/partials/paige/pagination.html
Normal file
@@ -0,0 +1,365 @@
|
||||
{{/*
|
||||
Copied from:
|
||||
https://github.com/gohugoio/hugo/blob/133e4bfbeee47bf6843fbcad90f14501f3d3a099/tpl/tplimpl/embedded/templates/pagination.html
|
||||
|
||||
License:
|
||||
https://github.com/gohugoio/hugo/blob/133e4bfbeee47bf6843fbcad90f14501f3d3a099/LICENSE
|
||||
|
||||
License content:
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/}}
|
||||
|
||||
{{- $validFormats := slice "default" "terse" }}
|
||||
|
||||
{{- $msg1 := "When passing a map to the internal pagination template, one of the elements must be named 'page', and it must be set to the context of the current page." }}
|
||||
{{- $msg2 := "The 'format' specified in the map passed to the internal pagination template is invalid. Valid choices are: %s." }}
|
||||
|
||||
{{- $page := . }}
|
||||
{{- $format := "default" }}
|
||||
|
||||
{{- if reflect.IsMap . }}
|
||||
{{- with .page }}
|
||||
{{- $page = . }}
|
||||
{{- else }}
|
||||
{{- errorf $msg1 }}
|
||||
{{- end }}
|
||||
{{- with .format }}
|
||||
{{- $format = lower . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- if in $validFormats $format }}
|
||||
{{- if gt $page.Paginator.TotalPages 1 }}
|
||||
<ul class="pagination pagination-{{ $format }}">
|
||||
{{- partial (printf "partials/inline/pagination/%s" $format) $page }}
|
||||
</ul>
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- errorf $msg2 (delimit $validFormats ", ") }}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Format: default
|
||||
{{/* --------------------------------------------------------------------- */}}
|
||||
{{- define "partials/inline/pagination/default" }}
|
||||
{{- with .Paginator }}
|
||||
{{- $currentPageNumber := .PageNumber }}
|
||||
|
||||
{{- with .First }}
|
||||
{{- if ne $currentPageNumber .PageNumber }}
|
||||
<li class="page-item">
|
||||
<a href="{{ .URL }}" aria-label="First" class="page-link" role="button"><span aria-hidden="true">«</span></a>
|
||||
</li>
|
||||
{{- else }}
|
||||
<li class="page-item disabled">
|
||||
<a aria-disabled="true" aria-label="First" class="page-link" role="button" tabindex="-1"><span aria-hidden="true">«</span></a>
|
||||
</li>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- with .Prev }}
|
||||
<li class="page-item">
|
||||
<a href="{{ .URL }}" aria-label="Previous" class="page-link" role="button"><span aria-hidden="true">‹</span></a>
|
||||
</li>
|
||||
{{- else }}
|
||||
<li class="page-item disabled">
|
||||
<a aria-disabled="true" aria-label="Previous" class="page-link" role="button" tabindex="-1"><span aria-hidden="true">‹</span></a>
|
||||
</li>
|
||||
{{- end }}
|
||||
|
||||
{{- $slots := 5 }}
|
||||
{{- $start := math.Max 1 (sub .PageNumber (math.Floor (div $slots 2))) }}
|
||||
{{- $end := math.Min .TotalPages (sub (add $start $slots) 1) }}
|
||||
{{- if lt (add (sub $end $start) 1) $slots }}
|
||||
{{- $start = math.Max 1 (add (sub $end $slots) 1) }}
|
||||
{{- end }}
|
||||
|
||||
{{- range $k := seq $start $end }}
|
||||
{{- if eq $.Paginator.PageNumber $k }}
|
||||
<li class="page-item active">
|
||||
<a aria-current="page" aria-label="Page {{ $k }}" class="page-link" role="button">{{ $k }}</a>
|
||||
</li>
|
||||
{{- else }}
|
||||
<li class="page-item">
|
||||
<a href="{{ (index $.Paginator.Pagers (sub $k 1)).URL }}" aria-label="Page {{ $k }}" class="page-link" role="button">{{ $k }}</a>
|
||||
</li>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- with .Next }}
|
||||
<li class="page-item">
|
||||
<a href="{{ .URL }}" aria-label="Next" class="page-link" role="button"><span aria-hidden="true">›</span></a>
|
||||
</li>
|
||||
{{- else }}
|
||||
<li class="page-item disabled">
|
||||
<a aria-disabled="true" aria-label="Next" class="page-link" role="button" tabindex="-1"><span aria-hidden="true">›</span></a>
|
||||
</li>
|
||||
{{- end }}
|
||||
|
||||
{{- with .Last }}
|
||||
{{- if ne $currentPageNumber .PageNumber }}
|
||||
<li class="page-item">
|
||||
<a href="{{ .URL }}" aria-label="Last" class="page-link" role="button"><span aria-hidden="true">»</span></a>
|
||||
</li>
|
||||
{{- else }}
|
||||
<li class="page-item disabled">
|
||||
<a aria-disabled="true" aria-label="Last" class="page-link" role="button" tabindex="-1"><span aria-hidden="true">»</span></a>
|
||||
</li>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Format: terse
|
||||
{{/* --------------------------------------------------------------------- */}}
|
||||
{{- define "partials/inline/pagination/terse" }}
|
||||
{{- with .Paginator }}
|
||||
{{- $currentPageNumber := .PageNumber }}
|
||||
|
||||
{{- with .First }}
|
||||
{{- if ne $currentPageNumber .PageNumber }}
|
||||
<li class="page-item">
|
||||
<a href="{{ .URL }}" aria-label="First" class="page-link" role="button"><span aria-hidden="true">«</span></a>
|
||||
</li>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- with .Prev }}
|
||||
<li class="page-item">
|
||||
<a href="{{ .URL }}" aria-label="Previous" class="page-link" role="button"><span aria-hidden="true">‹</span></a>
|
||||
</li>
|
||||
{{- end }}
|
||||
|
||||
{{- $slots := 3 }}
|
||||
{{- $start := math.Max 1 (sub .PageNumber (math.Floor (div $slots 2))) }}
|
||||
{{- $end := math.Min .TotalPages (sub (add $start $slots) 1) }}
|
||||
{{- if lt (add (sub $end $start) 1) $slots }}
|
||||
{{- $start = math.Max 1 (add (sub $end $slots) 1) }}
|
||||
{{- end }}
|
||||
|
||||
{{- range $k := seq $start $end }}
|
||||
{{- if eq $.Paginator.PageNumber $k }}
|
||||
<li class="page-item active">
|
||||
<a aria-current="page" aria-label="Page {{ $k }}" class="page-link" role="button">{{ $k }}</a>
|
||||
</li>
|
||||
{{- else }}
|
||||
<li class="page-item">
|
||||
<a href="{{ (index $.Paginator.Pagers (sub $k 1)).URL }}" aria-label="Page {{ $k }}" class="page-link" role="button">{{ $k }}</a>
|
||||
</li>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- with .Next }}
|
||||
<li class="page-item">
|
||||
<a href="{{ .URL }}" aria-label="Next" class="page-link" role="button"><span aria-hidden="true">›</span></a>
|
||||
</li>
|
||||
{{- end }}
|
||||
|
||||
{{- with .Last }}
|
||||
{{- if ne $currentPageNumber .PageNumber }}
|
||||
<li class="page-item">
|
||||
<a href="{{ .URL }}" aria-label="Last" class="page-link" role="button"><span aria-hidden="true">»</span></a>
|
||||
</li>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
141
layouts/partials/paige/script.html
Normal file
141
layouts/partials/paige/script.html
Normal file
@@ -0,0 +1,141 @@
|
||||
<script>
|
||||
function paigeResize() {
|
||||
var e = document.querySelector("body > div.container > div.row > div.col");
|
||||
var s = getComputedStyle(e);
|
||||
var px = parseFloat(s.paddingLeft) + parseFloat(s.paddingRight);
|
||||
var bx = parseFloat(s.borderLeftWidth) + parseFloat(s.borderRightWidth);
|
||||
var w = e.offsetWidth - px - bx;
|
||||
var es = document.querySelectorAll("article > div");
|
||||
for (var i = 0; i < es.length; i++) {
|
||||
var e = es[i];
|
||||
if (e.offsetWidth !== w) {
|
||||
e.style.width = w + "px";
|
||||
console.log(e.style.width);
|
||||
}
|
||||
}
|
||||
}
|
||||
paigeResize();
|
||||
addEventListener("resize", paigeResize);
|
||||
</script>
|
||||
{{ with .Site.Params.paige.bootstrap.scripts_path }}
|
||||
{{ with resources.Get (relLangURL .) }}
|
||||
<script defer src="{{ (. | minify | fingerprint).RelPermalink }}"></script>
|
||||
{{ else }}
|
||||
<script defer src="{{ relLangURL . }}"></script>
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
<script crossorigin="anonymous" defer integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3" referrerpolicy="no-referrer" src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js"></script>
|
||||
{{ end }}
|
||||
{{ if or .Params.paige.math (and .Params.paige.show_full_pages (where .Pages "Params.paige.math" "eq" true)) }}
|
||||
<script crossorigin="anonymous" defer integrity="sha384-97gW6UIJxnlKemYavrqDHSX3SiygeOwIZhwyOKRfSaf0JWKRVj9hLASHgFTzT+0O" referrerpolicy="no-referrer" src="https://cdn.jsdelivr.net/npm/katex@0.16.3/dist/katex.min.js"></script>
|
||||
<script crossorigin="anonymous" defer integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" onload="renderMathInElement(document.body);" referrerpolicy="no-referrer" src="https://cdn.jsdelivr.net/npm/katex@0.16.3/dist/contrib/auto-render.min.js"></script>
|
||||
{{ end }}
|
||||
{{ if .Site.GoogleAnalytics }}
|
||||
{{ 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_analytics_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_analytics_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_analytics_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_analytics_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_analytics_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_analytics_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_analytics_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_analytics_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_analytics_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_analytics_noscript" }}</noscript>
|
||||
{{ end }}
|
129
layouts/partials/paige/search.html
Normal file
129
layouts/partials/paige/search.html
Normal file
@@ -0,0 +1,129 @@
|
||||
<section>
|
||||
<div class="container-fluid">
|
||||
<form action="{{ .Page.RelPermalink }}" dir="auto" method="get">
|
||||
<div class="justify-content-center mb-3 row">
|
||||
<div class="col col-sm-8 col-md-7 col-lg-6 col-xl-5 col-xxl-4">
|
||||
<input class="form-control" id="query" name="q" placeholder="{{ i18n `paige_search_input` }}" type="search">
|
||||
</div>
|
||||
</div>
|
||||
<div class="justify-content-center mb-3 row">
|
||||
<div class="col col-auto">
|
||||
<button class="btn btn-primary" type="submit">{{ i18n `paige_search_button` }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div id="paige-error" style="display: none">
|
||||
<p class="text-center">
|
||||
<i class="bi bi-exclamation-triangle display-6 text-danger">
|
||||
<span class="visually-hidden">{{ i18n `paige_search_error` }}</span>
|
||||
</i>
|
||||
</p>
|
||||
</div>
|
||||
<div id="paige-nothing" style="display: none">
|
||||
<p class="text-center">
|
||||
<i class="bi bi-x-circle display-6 text-danger">
|
||||
<span class="visually-hidden">{{ i18n `paige_search_nothing` }}</span>
|
||||
</i>
|
||||
</p>
|
||||
</div>
|
||||
<div id="paige-searching" style="display: none">
|
||||
<div class="mb-3 text-center">
|
||||
<div class="spinner-border text-primary" role="status">
|
||||
<span class="visually-hidden">{{ i18n `paige_search_searching` }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="paige-something" style="display: none">
|
||||
<p class="text-center">
|
||||
<i class="bi bi-check-circle display-6 text-success">
|
||||
<span class="visually-hidden">{{ i18n `paige_search_something` }}</span>
|
||||
</i>
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
<article id="paige-results" style="display: none"></article>
|
||||
<script crossorigin="anonymous" defer integrity="sha384-1LalyFI+BycKouEClZE5CoFnlLr+Kx8Wslc45o5NATVo+c2mEh02i8HNaaT7XOdQ" referrerpolicy="no-referrer" src="https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.7.31/dist/flexsearch.bundle.js"></script>
|
||||
<script>
|
||||
var paigeErrorElement = document.getElementById("paige-error");
|
||||
var paigeNothingElement = document.getElementById("paige-nothing");
|
||||
var paigeQueryElement = document.getElementById("query");
|
||||
var paigeSearchingElement = document.getElementById("paige-searching")
|
||||
var paigeSomethingElement = document.getElementById("paige-something");
|
||||
var paigeResultsElement = document.getElementById("paige-results");
|
||||
|
||||
if (paigeQueryElement !== null) {
|
||||
var queryText = decodeURIComponent((location.search.split("q=")[1] || "").split("&")[0]).replace(/\+/g, " ");
|
||||
if (queryText) {
|
||||
paigeQueryElement.value = queryText;
|
||||
paigeSearch(queryText);
|
||||
}
|
||||
}
|
||||
|
||||
function paigeSearch(queryText) {
|
||||
paigeShow(paigeSearchingElement);
|
||||
fetch("/index.json").then(function (response) {
|
||||
if (response.status !== 200) {
|
||||
console.log("Cannot load /index.json", response);
|
||||
paigeHide(paigeSearchingElement);
|
||||
paigeShow(paigeErrorElement);
|
||||
return;
|
||||
}
|
||||
response.json().then(function (pages) {
|
||||
var index = new FlexSearch.Document({
|
||||
document: {
|
||||
id: "link",
|
||||
index: ["categories", "description", "keywords", "tags", "text", "title"]
|
||||
}
|
||||
});
|
||||
var pathPage = {};
|
||||
pages.forEach(function (page) {
|
||||
index.add(page);
|
||||
pathPage[page.link] = page;
|
||||
});
|
||||
var results = index.search(queryText, {limit: 50});
|
||||
paigeHide(paigeSearchingElement);
|
||||
var shown = false;
|
||||
var done = {};
|
||||
results.forEach(function (result) {
|
||||
result.result.forEach(function (path) {
|
||||
if (path === "{{ .RelPermalink }}" || done[path]) {
|
||||
return;
|
||||
}
|
||||
if (!shown) {
|
||||
shown = true;
|
||||
paigeShow(paigeSomethingElement);
|
||||
paigeShow(paigeResultsElement);
|
||||
}
|
||||
done[path] = true;
|
||||
var page = pathPage[path];
|
||||
var link = document.createElement("a");
|
||||
link.href = page.link;
|
||||
link.innerText = page.title;
|
||||
var result = document.createElement("p");
|
||||
result.classList = "text-center";
|
||||
result.appendChild(link);
|
||||
if (page.description) {
|
||||
result.appendChild(document.createElement("br"));
|
||||
result.innerHTML += page.description;
|
||||
}
|
||||
paigeResultsElement.appendChild(result);
|
||||
});
|
||||
});
|
||||
if (!shown) {
|
||||
paigeShow(paigeNothingElement);
|
||||
}
|
||||
}).catch(function (error) {
|
||||
console.log("Cannot search /index.json", error);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function paigeHide(element) {
|
||||
element.style.display = "none";
|
||||
}
|
||||
|
||||
function paigeShow(element) {
|
||||
element.style.display = "block";
|
||||
}
|
||||
</script>
|
15
layouts/partials/paige/social.html
Normal file
15
layouts/partials/paige/social.html
Normal file
@@ -0,0 +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>
|
||||
{{ end }}
|
28
layouts/partials/paige/style.html
Normal file
28
layouts/partials/paige/style.html
Normal file
@@ -0,0 +1,28 @@
|
||||
<style>
|
||||
article > div {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
body, html {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
padding: 0.5rem 1rem;
|
||||
border-left: 0.25rem solid #e9ecef;
|
||||
border-right: 0.25rem solid white;
|
||||
}
|
||||
|
||||
blockquote p:last-of-type {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
h1:hover .paige-header-link, h2:hover .paige-header-link, h3:hover .paige-header-link, h4:hover .paige-header-link, h5:hover .paige-header-link, h6:hover .paige-header-link {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.paige-header-link {
|
||||
display: none;
|
||||
margin-left: 0.3rem;
|
||||
}
|
||||
</style>
|
8
layouts/partials/paige/title.html
Normal file
8
layouts/partials/paige/title.html
Normal file
@@ -0,0 +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="small paige-header-link" href="{{ .RelPermalink }}">#</a>{{ end }}</h1>
|
||||
{{ end }}
|
11
layouts/partials/paige/toc.html
Normal file
11
layouts/partials/paige/toc.html
Normal file
@@ -0,0 +1,11 @@
|
||||
{{ if and .Content .Params.paige.toc (ne .TableOfContents `<nav id="TableOfContents"></nav>`) }}
|
||||
<section>
|
||||
<div class="container-fluid mb-3">
|
||||
<div class="justify-content-center row">
|
||||
<div class="border col col-auto pe-3 ps-3 pt-3 rounded">
|
||||
{{ .TableOfContents }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{{ end }}
|
Reference in New Issue
Block a user