Import theme
This commit is contained in:
parent
51769fa6be
commit
c59ffbfeee
127 changed files with 13611 additions and 1 deletions
8
layouts/404.html
Normal file
8
layouts/404.html
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{{ define "main" }}
|
||||
<div class="page_404">
|
||||
<h1>404</h1>
|
||||
<h2>{{ i18n "page_not_found" }}</h2>
|
||||
<p>{{ i18n "page_does_not_exist" }}</p>
|
||||
<p>{{ i18n "head_back" .Site.BaseURL | safeHTML }}</p>
|
||||
</div>
|
||||
{{ end }}
|
||||
4
layouts/_default/_markup/render-codeblock-mermaid.html
Normal file
4
layouts/_default/_markup/render-codeblock-mermaid.html
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<div class="mermaid">
|
||||
{{- .Inner | safeHTML }}
|
||||
</div>
|
||||
{{ .Page.Store.Set "hasMermaid" true }}
|
||||
9
layouts/_default/_markup/render-passthrough.html
Normal file
9
layouts/_default/_markup/render-passthrough.html
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{{- $opts := dict "output" "htmlAndMathml" "displayMode" (eq .Type "block") }}
|
||||
{{- with try (transform.ToMath .Inner $opts) }}
|
||||
{{- with .Err }}
|
||||
{{ errorf "Unable to render mathematical markup to HTML using the transform.ToMath function. The KaTeX display engine threw the following error: %s: see %s." . $.Position }}
|
||||
{{- else }}
|
||||
{{- .Value }}
|
||||
{{- $.Page.Store.Set "hasMath" true }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
42
layouts/_default/baseof.html
Normal file
42
layouts/_default/baseof.html
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<!doctype html>
|
||||
<html
|
||||
dir="{{ .Site.Language.LanguageDirection | default "ltr" }}"
|
||||
lang="{{- site.Language.Lang -}}"
|
||||
data-theme="{{- .Site.Params.displayMode -}}"
|
||||
{{ if eq .Site.Params.displayMode "dark" }}
|
||||
class="html theme--dark"
|
||||
{{ else }}
|
||||
class="html theme--light"
|
||||
{{ end }}
|
||||
>
|
||||
{{- partial "head.html" . -}}
|
||||
<body class="body">
|
||||
<div class="wrapper">
|
||||
<aside
|
||||
{{ if (and (or (eq .Site.Params.hidesidebar true) (eq .Params.hidesidebar true)) (not .IsHome)) }}
|
||||
class="wrapper__sidebar wrapper__sidebar--hidden"
|
||||
{{ else }}
|
||||
class="wrapper__sidebar"
|
||||
{{ end }}
|
||||
>
|
||||
{{- partial "sidebar.html" . -}}
|
||||
</aside>
|
||||
<main
|
||||
{{ if (and (or (eq .Site.Params.hidesidebar true) (eq .Params.hidesidebar true)) (not .IsHome)) }}
|
||||
class="wrapper__main wrapper__main--fullscreen"
|
||||
{{ else }}
|
||||
class="wrapper__main"
|
||||
{{ end }}
|
||||
>
|
||||
<header class="header">{{ partial "navbar.html" . }}</header>
|
||||
{{- block "main" . }}{{- end }}
|
||||
</main>
|
||||
</div>
|
||||
|
||||
{{- partial "footer.html" (dict "context" . "footerClassModifier" "base") -}}
|
||||
|
||||
{{- if (eq .Site.Params.simpleAnalytics.enable true) -}}
|
||||
{{- partial "analytics/simpleanalytics.html" . -}}
|
||||
{{- end -}}
|
||||
</body>
|
||||
</html>
|
||||
42
layouts/_default/list.html
Normal file
42
layouts/_default/list.html
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{{ define "main" }}
|
||||
<div
|
||||
class="archive {{ with .Site.Params.doNotLoadAnimations }}
|
||||
.
|
||||
{{ else }}
|
||||
animated fadeInDown
|
||||
{{ end }}"
|
||||
>
|
||||
{{ range .Data.Pages.GroupByDate "2006" }}
|
||||
<div class="archive__heading">{{ .Key }}</div>
|
||||
{{ range .Pages }}
|
||||
<ul class="archive__list">
|
||||
<li class="archive__list-item">
|
||||
{{ if (eq .Site.Params.disableArchiveTitleStyling true) }}
|
||||
<a class="archive__list-title" href="{{ .RelPermalink }}" title="{{ .Title }}">{{ .Title }}</a>
|
||||
{{ else }}
|
||||
<a class="archive__list-title" href="{{ .RelPermalink }}" title="{{ .Title }}">{{ upper .Title }}</a>
|
||||
{{ end }}
|
||||
<div class="archive__list-date">
|
||||
{{ if isset .Site.Params "listdateformat" }}
|
||||
{{ if .Site.Params.localizedDates }}
|
||||
{{ time.Format .Site.Params.listDateFormat .Date }}
|
||||
{{ else }}
|
||||
{{ .Date.Format .Site.Params.listDateFormat }}
|
||||
{{ end }}
|
||||
|
||||
{{ else }}
|
||||
{{ if .Site.Params.localizedDates }}
|
||||
{{ time.Format "Jan 2" .Date }}
|
||||
{{ else }}
|
||||
{{ .Date.Format "Jan 2" }}
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
45
layouts/_default/rss.xml
Normal file
45
layouts/_default/rss.xml
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
{{- $pctx := . -}}
|
||||
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
|
||||
{{- $pages := slice -}}
|
||||
{{- if or $.IsHome $.IsSection -}}
|
||||
{{- $pages = $pctx.RegularPages -}}
|
||||
{{- else -}}
|
||||
{{- $pages = $pctx.Pages -}}
|
||||
{{- end -}}
|
||||
{{- $limit := .Site.Config.Services.RSS.Limit -}}
|
||||
{{- if ge $limit 1 -}}
|
||||
{{- $pages = $pages | first $limit -}}
|
||||
{{- end -}}
|
||||
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
|
||||
<link>{{ .Permalink }}</link>
|
||||
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
|
||||
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
|
||||
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
|
||||
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
|
||||
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
|
||||
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
|
||||
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
|
||||
{{- with .OutputFormats.Get "RSS" -}}
|
||||
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
|
||||
{{- end -}}
|
||||
{{ range $pages }}
|
||||
<item>
|
||||
<title>{{ .Title }}</title>
|
||||
<link>{{ .Permalink }}</link>
|
||||
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
||||
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
|
||||
<guid>{{ .Permalink }}</guid>
|
||||
{{ if eq .Site.Params.rssFullContent true }}
|
||||
<description>{{ .Content | html }}</description>
|
||||
{{ else if .Description }}
|
||||
<description>{{ .Description }}</description>
|
||||
{{ else }}
|
||||
<description>{{ .Summary | html }}</description>
|
||||
{{ end }}
|
||||
</item>
|
||||
{{ end }}
|
||||
</channel>
|
||||
</rss>
|
||||
117
layouts/_default/single.html
Normal file
117
layouts/_default/single.html
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
{{ define "main" }}
|
||||
<div
|
||||
class="post {{ with .Site.Params.doNotLoadAnimations }}
|
||||
.
|
||||
{{ else }}
|
||||
animated fadeInDown
|
||||
{{ end }}"
|
||||
>
|
||||
{{ if .Params.thumbnail }}
|
||||
<div class="post__thumbnail-wrapper">
|
||||
<img class="post__thumbnail" src="{{ .Params.thumbnail | relURL }}" alt="Thumbnail image" />
|
||||
</div>
|
||||
{{ end }}
|
||||
<div class="post__content">
|
||||
{{ if (eq .Site.Params.disableTitleCapitalization true) }}
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{ else }}
|
||||
<h1>{{ title .Title }}</h1>
|
||||
{{ end }}
|
||||
{{ if or (eq .Type "post") (eq .Type .Site.Params.postSectionName) }}
|
||||
<ul class="post__meta">
|
||||
<li class="post__meta-item">
|
||||
<em class="fas fa-calendar-day post__meta-icon"></em>
|
||||
<span class="post__meta-text"
|
||||
>{{ if isset .Site.Params "singledateformat" }}
|
||||
{{ if .Site.Params.localizedDates }}
|
||||
{{ time.Format .Site.Params.singleDateFormat .Date }}
|
||||
{{ else }}
|
||||
{{ .Date.Format .Site.Params.singleDateFormat }}
|
||||
{{ end }}
|
||||
|
||||
{{ else }}
|
||||
{{ if .Site.Params.localizedDates }}
|
||||
{{ time.Format "Mon, Jan 2, 2006" .Date }}
|
||||
{{ else }}
|
||||
{{ .Date.Format "Mon, Jan 2, 2006" }}
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
</span>
|
||||
</li>
|
||||
<li class="post__meta-item">
|
||||
<em class="fas fa-stopwatch post__meta-icon"></em>
|
||||
<span class="post__meta-text">{{ i18n "reading_time" .ReadingTime }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
{{ end }}
|
||||
|
||||
{{- partial "expirationnote.html" . -}}
|
||||
|
||||
{{- if (eq .Params.toc true) -}}
|
||||
{{- partial "toc.html" . -}}
|
||||
{{- end -}}
|
||||
|
||||
{{ .Content }}
|
||||
|
||||
{{- if isset .Params "series" -}}
|
||||
{{- partial "series.html" . -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if (eq .Site.Params.relatedPosts true) -}}
|
||||
{{- partial "related.html" . -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if (eq .Params.contact true) -}}
|
||||
{{- partial "contact.html" . -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if (eq .Site.Params.mermaid.enable true) -}}
|
||||
{{- partial "mermaid.html" . -}}
|
||||
{{- end -}}
|
||||
</div>
|
||||
<div class="post__footer">
|
||||
{{ with .Page.Params.Categories }}
|
||||
{{ partial "taxonomy/categories.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ with .Page.Params.Tags }}
|
||||
{{ partial "taxonomy/tags.html" . }}
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
{{ if and (or (eq .Type "post") (eq .Type .Site.Params.postSectionName)) (ne .Page.Params.disableComments true) }}
|
||||
{{- if .Site.Config.Services.Disqus.Shortname -}}
|
||||
<div id="comment">
|
||||
<h2>{{ i18n "comments" }}</h2>
|
||||
{{ template "_internal/disqus.html" . }}
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{- if .Site.Params.utterances.repo -}}
|
||||
<div id="comment">
|
||||
<h2>{{ i18n "comments" }}</h2>
|
||||
{{ partial "comments/utterances.html" . }}
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{- if .Site.Params.giscus.repo -}}
|
||||
<div id="comment">
|
||||
<h2>{{ i18n "comments" }}</h2>
|
||||
{{ partial "comments/giscus.html" . }}
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{- if .Site.Params.CommentoURL -}}
|
||||
<div id="comment">
|
||||
<h2>{{ i18n "comments" }}</h2>
|
||||
{{ partial "comments/commento.html" . }}
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{- if .Site.Params.gitalk.repo -}}
|
||||
<div id="comment">
|
||||
<h2>{{ i18n "comments" }}</h2>
|
||||
{{ partial "comments/gitalk.html" . }}
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
101
layouts/index.html
Normal file
101
layouts/index.html
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
{{ define "main" }}
|
||||
<div
|
||||
class="post {{ with .Site.Params.doNotLoadAnimations }}
|
||||
.
|
||||
{{ else }}
|
||||
animated fadeInDown
|
||||
{{ end }}"
|
||||
>
|
||||
<div class="post__content">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
|
||||
<!-- (Optional) Home
|
||||
-- on top of `mainSections` content (aka posts) ;
|
||||
-- as declared in content/_index.md
|
||||
|
||||
One can set `mainSections = [""]` and have the content/_index.md specified here
|
||||
-->
|
||||
</div>
|
||||
|
||||
{{ if .Params.mainSectionsTitle }}
|
||||
<div
|
||||
class="post {{ with .Site.Params.doNotLoadAnimations }}
|
||||
.
|
||||
{{ else }}
|
||||
animated fadeInDown
|
||||
{{ end }}"
|
||||
>
|
||||
<div class="post__content">
|
||||
<h2>{{ .Params.mainSectionsTitle }}</h2>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ $paginator := .Paginate (where .Site.RegularPages "Type" "in" .Site.Params.mainSections) }}
|
||||
{{ range $paginator.Pages }}
|
||||
<div
|
||||
class="post {{ with .Site.Params.doNotLoadAnimations }}
|
||||
.
|
||||
{{ else }}
|
||||
animated fadeInDown
|
||||
{{ end }}"
|
||||
>
|
||||
{{ if .Params.thumbnail }}
|
||||
<div class="post__thumbnail-wrapper">
|
||||
<a href="{{ .RelPermalink }}">
|
||||
<img class="post__thumbnail" src="{{ .Params.thumbnail | relURL }}" alt="Thumbnail image" loading="lazy" />
|
||||
</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
<div class="post__content">
|
||||
{{ if (eq .Site.Params.disableTitleCapitalization true) }}
|
||||
<h3><a href="{{ .RelPermalink }}">{{ .Title }}</a></h3>
|
||||
{{ else }}
|
||||
<h3><a href="{{ .RelPermalink }}">{{ upper .Title }}</a></h3>
|
||||
{{ end }}
|
||||
{{ if .Site.Params.fullPostContent }}
|
||||
<p>{{ .Content | safeHTML | plainify }}</p>
|
||||
{{ else }}
|
||||
<p>{{ .Summary | safeHTML | plainify }}</p>
|
||||
{{ end }}
|
||||
<!-- add read more -->
|
||||
{{- if and (.Truncated) (.Site.Params.readMore) -}}
|
||||
<a href="{{ .RelPermalink }}">{{ i18n "read_more" }}</a>
|
||||
{{- end -}}
|
||||
</div>
|
||||
|
||||
<!-- -->
|
||||
<div class="post__footer">
|
||||
<em class="fas fa-calendar-day"></em>
|
||||
<span class="post__footer-date"
|
||||
>{{ if isset .Site.Params "indexdateformat" }}
|
||||
{{ if .Site.Params.localizedDates }}
|
||||
{{ time.Format .Site.Params.indexDateFormat .Date }}
|
||||
{{ else }}
|
||||
{{ .Date.Format .Site.Params.indexDateFormat }}
|
||||
{{ end }}
|
||||
|
||||
{{ else }}
|
||||
{{ if .Site.Params.localizedDates }}
|
||||
{{ time.Format "Mon, Jan 2, 2006" .Date }}
|
||||
{{ else }}
|
||||
{{ .Date.Format "Mon, Jan 2, 2006" }}
|
||||
{{ end }}
|
||||
|
||||
{{ end }}</span
|
||||
>
|
||||
{{ with .Page.Params.Categories }}
|
||||
{{ partial "taxonomy/categories.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ with .Page.Params.Tags }}
|
||||
{{ partial "taxonomy/tags.html" . }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
<div class="pagination">
|
||||
{{ partial "pagination.html" . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
17
layouts/partials/analytics/matomo.html
Normal file
17
layouts/partials/analytics/matomo.html
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<!-- Piwik/Matomo -->
|
||||
{{ with .Site.Params.Matomo }}
|
||||
<!-- Matomo -->
|
||||
<script>
|
||||
var _paq = window._paq = window._paq || [];
|
||||
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u="//{{ .instance }}/";
|
||||
_paq.push(['setTrackerUrl', u+'matomo.php']);
|
||||
_paq.push(['setSiteId', '{{ .siteId }}']);
|
||||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
||||
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
|
||||
})();
|
||||
</script>
|
||||
{{ end }}
|
||||
22
layouts/partials/analytics/meta.html
Normal file
22
layouts/partials/analytics/meta.html
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<!-- Meta -->
|
||||
{{ with .Site.Params.meta }}
|
||||
<script>
|
||||
!function(f,b,e,v,n,t,s)
|
||||
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
|
||||
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
|
||||
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
|
||||
n.queue=[];t=b.createElement(e);t.async=!0;
|
||||
t.src=v;s=b.getElementsByTagName(e)[0];
|
||||
s.parentNode.insertBefore(t,s)}(window, document,'script',
|
||||
'https://connect.facebook.net/en_US/fbevents.js');
|
||||
fbq('init', '{{ .pixelId }}');
|
||||
fbq('track', 'PageView');
|
||||
</script>
|
||||
<noscript
|
||||
><img
|
||||
height="1"
|
||||
width="1"
|
||||
style="display:none"
|
||||
src="https://www.facebook.com/tr?id={{ .pixelId }}&ev=PageView&noscript=1"
|
||||
/></noscript>
|
||||
{{ end }}
|
||||
6
layouts/partials/analytics/plausible.html
Normal file
6
layouts/partials/analytics/plausible.html
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<script
|
||||
async
|
||||
defer
|
||||
data-domain="{{ .Site.Params.plausibleAnalytics.domain }}"
|
||||
src="{{ .Site.Params.plausibleAnalytics.serverURL | default "https://plausible.io" }}/js/plausible.js"
|
||||
></script>
|
||||
7
layouts/partials/analytics/simpleanalytics.html
Normal file
7
layouts/partials/analytics/simpleanalytics.html
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{{ with .Site.Params.simpleAnalytics.customUrl }}
|
||||
<script async defer src="{{ . | relURL }}/latest.js"></script>
|
||||
<noscript><img src="{{ . | relURL }}/noscript.gif" alt="" /></noscript>
|
||||
{{ else }}
|
||||
<script async defer src=" https://scripts.simpleanalyticscdn.com/latest.js"></script>
|
||||
<noscript><img src="https://queue.simpleanalyticscdn.com/noscript.gif" alt="" /></noscript>
|
||||
{{ end }}
|
||||
6
layouts/partials/analytics/umami.html
Normal file
6
layouts/partials/analytics/umami.html
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<script
|
||||
async
|
||||
defer
|
||||
src="https://{{ .Site.Params.umami.serverURL }}/{{ .Site.Params.umami.trackerScriptName | default "umami.js" }}"
|
||||
data-website-id="{{ .Site.Params.umami.id }}"
|
||||
></script>
|
||||
3
layouts/partials/comments/commento.html
Normal file
3
layouts/partials/comments/commento.html
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<div id="commento"></div>
|
||||
<script defer src="{{ .Site.Params.CommentoURL }}"></script>
|
||||
<noscript>Please enable JavaScript to load the comments.</noscript>
|
||||
45
layouts/partials/comments/giscus.html
Normal file
45
layouts/partials/comments/giscus.html
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
<script>
|
||||
const getStoredTheme = () => localStorage.getItem("theme") === "dark" ? "dark" : "light";
|
||||
|
||||
const setGiscusTheme = () => {
|
||||
const sendMessage = (message) => {
|
||||
const iframe = document.querySelector('iframe.giscus-frame');
|
||||
if (iframe) {
|
||||
iframe.contentWindow.postMessage({ giscus: message }, 'https://giscus.app');
|
||||
}
|
||||
}
|
||||
sendMessage({ setConfig: { theme: getStoredTheme() } })
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
const giscusAttributes = {
|
||||
"src": "https://giscus.app/client.js",
|
||||
"data-repo": "{{ .Site.Params.giscus.repo }}",
|
||||
"data-repo-id": "{{ .Site.Params.giscus.repoID }}",
|
||||
"data-category": "{{ .Site.Params.giscus.category }}",
|
||||
"data-category-id": "{{ .Site.Params.giscus.categoryID }}",
|
||||
"data-mapping": "{{ .Site.Params.giscus.mapping | default "pathname" }}",
|
||||
"data-strict": "{{ .Site.Params.giscus.strict | default "0" }}",
|
||||
"data-reactions-enabled": "{{ .Site.Params.giscus.reactionsEnabled | default "1" }}",
|
||||
"data-emit-metadata": "{{ .Site.Params.giscus.emitMetadata | default "0" }}",
|
||||
"data-input-position": "{{ .Site.Params.giscus.inputPosition | default "bottom" }}",
|
||||
"data-theme": getStoredTheme(),
|
||||
"data-lang": "{{ .Site.Params.giscus.lang | default "en" }}",
|
||||
"data-loading": "{{ .Site.Params.giscus.loading | default "lazy" }}",
|
||||
"crossorigin": "anonymous",
|
||||
"async": "",
|
||||
};
|
||||
|
||||
// Dynamically create script tag.
|
||||
const giscusScript = document.createElement("script");
|
||||
Object.entries(giscusAttributes).forEach(
|
||||
([key, value]) => giscusScript.setAttribute(key, value));
|
||||
document.getElementById("comment").appendChild(giscusScript);
|
||||
|
||||
// Update giscus theme when the theme switcher is clicked.
|
||||
const themeSwitcher = document.querySelector(".themeswitch");
|
||||
if (themeSwitcher) {
|
||||
themeSwitcher.addEventListener("click", setGiscusTheme);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
33
layouts/partials/comments/gitalk.html
Normal file
33
layouts/partials/comments/gitalk.html
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<div id="gitalk-container"></div>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/gitalk/1.7.2/gitalk.min.css"
|
||||
integrity="sha512-0hsIlRjJbiUWaKMhXXNDmjWI2qPvUlhNBLHMhqeF5jIma+bedec27N5FoT2JEeHz5TUmOGCsm1Y89EsX/P0wOg=="
|
||||
crossorigin="anonymous"
|
||||
referrerpolicy="no-referrer"
|
||||
/>
|
||||
<script
|
||||
src="https://cdnjs.cloudflare.com/ajax/libs/gitalk/1.7.2/gitalk.min.js"
|
||||
integrity="sha512-EcTCcXV46teiNwe0VcnM5A038tcY+BaQYO4nW6Gh2i7v4/HjBVg7xx3+JBLl9WofDds//INJAiEGAtdgr8PWyA=="
|
||||
crossorigin="anonymous"
|
||||
referrerpolicy="no-referrer"
|
||||
></script>
|
||||
<script>
|
||||
const gitalk = new Gitalk({
|
||||
clientID: '{{ .Site.Params.Gitalk.clientID }}',
|
||||
clientSecret: '{{ .Site.Params.Gitalk.clientSecret }}',
|
||||
repo: '{{ .Site.Params.Gitalk.repo }}',
|
||||
owner: '{{ .Site.Params.Gitalk.owner }}',
|
||||
admin: ['{{ .Site.Params.Gitalk.admin }}'],
|
||||
id: location.pathname, // Ensure uniqueness and length less than 50
|
||||
distractionFreeMode: false, // Facebook-like distraction free mode
|
||||
});
|
||||
(function () {
|
||||
if (['localhost', '127.0.0.1'].indexOf(window.location.hostname) != -1) {
|
||||
document.getElementById('gitalk-container').innerHTML =
|
||||
'Gitalk comments not available by default when the website is previewed locally.';
|
||||
return;
|
||||
}
|
||||
gitalk.render('gitalk-container');
|
||||
})();
|
||||
</script>
|
||||
11
layouts/partials/comments/utterances.html
Normal file
11
layouts/partials/comments/utterances.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<script
|
||||
src="https://utteranc.es/client.js"
|
||||
repo="{{ .Site.Params.utterances.repo }}"
|
||||
issue-term="{{ .Site.Params.utterances.issueTerm }}"
|
||||
theme="{{ .Site.Params.utterances.theme }}"
|
||||
{{ with .Site.Params.utterances.label }}
|
||||
label="{{ . }}"
|
||||
{{ end }}
|
||||
crossorigin="anonymous"
|
||||
async
|
||||
></script>
|
||||
28
layouts/partials/contact.html
Normal file
28
layouts/partials/contact.html
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
|
||||
<div class="contact-form">
|
||||
<form class="form-style" method="POST" action="{{ .Site.Params.contactFormAction }}" data-toggle="validator">
|
||||
<ul>
|
||||
<li>
|
||||
<label for="username">{{ i18n "name" }}</label>
|
||||
<input class="field-style field-full" type="text" name="username" id="username" placeholder="{{ i18n "name" }}" required>
|
||||
</li>
|
||||
<li>
|
||||
<label for="email">{{ i18n "email" }}</label>
|
||||
<input class="field-style field-full" type="email" id="email" name="email" placeholder="{{i18n "email" }}" required>
|
||||
</li>
|
||||
<li>
|
||||
<label for="message">{{ i18n "message" }}</label>
|
||||
<textarea class="field-style" name="message" id="message" rows="6" placeholder="{{ i18n "message" }}"></textarea>
|
||||
</li>
|
||||
<li>
|
||||
<div class="g-recaptcha" data-sitekey="{{ .Site.Params.contactFormReCaptcha }}"></div>
|
||||
</li>
|
||||
<li>
|
||||
<input class="field-style" type="submit" value="{{ i18n "send" }}" />
|
||||
</li>
|
||||
<li>
|
||||
<input type="text" name="_gotcha" style="display:none" />
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
</div>
|
||||
20
layouts/partials/expirationnote.html
Normal file
20
layouts/partials/expirationnote.html
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{{- if (eq .Site.Params.oldContentWarning true) -}}
|
||||
{{- $ageDays := div (sub now.Unix .Date.Unix) 86400 -}}
|
||||
{{- $duration := .Site.Params.oldContentDuration -}}
|
||||
|
||||
{{- if and (ne .Type "post") (ne .Type .Site.Params.postSectionName) -}}
|
||||
{{- $duration = 0 -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if (isset .Params "old_content_duration") -}}
|
||||
{{- $duration = .Params.old_content_duration -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if and (gt $ageDays $duration) (ne $duration 0) -}}
|
||||
<div class="alert">
|
||||
<div class="alert__indicator">!</div>
|
||||
{{ i18n "old_content_warning" (dict "Count" $duration) }}
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
{{- end -}}
|
||||
35
layouts/partials/footer.html
Normal file
35
layouts/partials/footer.html
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<footer class="footer footer__{{ .footerClassModifier }}">
|
||||
<ul class="footer__list">
|
||||
<li class="footer__item">
|
||||
©
|
||||
{{ if isset .context.Site.Params "copyright" }}
|
||||
{{ replace .context.Site.Params.copyright "{{ YEAR }}" (now.Format "2006") | markdownify }}
|
||||
{{ else }}
|
||||
{{ .context.Site.Params.author }}
|
||||
{{ now.Format "2006" }}
|
||||
{{ end }}
|
||||
- {{ .context.Site.Params.hosting }}
|
||||
</li>
|
||||
{{ range .context.Site.Menus.footer }}
|
||||
<li class="footer__item">
|
||||
<a
|
||||
class="link"
|
||||
href="{{ .URL }}"
|
||||
{{ if strings.HasPrefix .URL "http" }}
|
||||
target="_blank" rel="noopener noreferrer"
|
||||
{{ end }}
|
||||
title="{{ .Title }}"
|
||||
>
|
||||
{{ .Name }}
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</footer>
|
||||
{{- partial "medium-zoom.html" .context -}}
|
||||
{{- if (hasPrefix .context.Site.Config.Services.GoogleAnalytics.ID "G-") -}}
|
||||
{{- template "_internal/google_analytics.html" .context -}}
|
||||
{{- end -}}
|
||||
{{- if and (hugo.IsProduction) (.context.Site.Params.gtagId) -}}
|
||||
{{ partial "google-analytics-gtag-async.html" .context }}
|
||||
{{- end -}}
|
||||
10
layouts/partials/google-analytics-gtag-async.html
Normal file
10
layouts/partials/google-analytics-gtag-async.html
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id={{ .Site.Params.gtagId }}"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag() {
|
||||
dataLayer.push(arguments);
|
||||
}
|
||||
gtag('js', new Date());
|
||||
gtag('config', '{{ .Site.Params.gtagId }}');
|
||||
</script>
|
||||
255
layouts/partials/head.html
Normal file
255
layouts/partials/head.html
Normal file
|
|
@ -0,0 +1,255 @@
|
|||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>
|
||||
{{ if (eq .Site.Params.reversepagetitle true) }}
|
||||
{{ with .Title }}
|
||||
{{ . }} |
|
||||
{{ end }}
|
||||
{{- .Site.Params.author -}}
|
||||
{{ else }}
|
||||
{{- .Site.Params.author -}}{{ with .Title }}
|
||||
|
|
||||
{{ . }}
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
|
||||
</title>
|
||||
|
||||
<!-- Meta -->
|
||||
{{- hugo.Generator -}}
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover" />
|
||||
<meta name="author" content="{{ .Site.Params.author }}" />
|
||||
<meta
|
||||
name="description"
|
||||
content="{{ if .Params.description }}
|
||||
{{- .Params.description -}}
|
||||
{{ else }}
|
||||
{{- .Site.Params.description -}}
|
||||
{{ end }}"
|
||||
/>
|
||||
{{ if .Params.redirectUrl }}
|
||||
<meta http-equiv="refresh" content="1; url={{ .Params.redirectUrl }}" />
|
||||
{{ end }}
|
||||
{{- if .Site.Params.googleSiteVerify }}
|
||||
<meta name="google-site-verification" content="{{ .Site.Params.googleSiteVerify }}" />
|
||||
{{- end -}}
|
||||
|
||||
|
||||
<!-- CSS -->
|
||||
{{ $contentRatio := or site.Params.contentratio 0.6 -}}
|
||||
{{ $languageDirection := or site.Language.LanguageDirection "ltr" -}}
|
||||
{{ $vars := dict
|
||||
"text_direction" $languageDirection
|
||||
"content_ratio" (printf "%f%%" (mul $contentRatio 100))
|
||||
"sidebar_ratio" (printf "%f%%" (mul (sub 1.0 $contentRatio) 100))
|
||||
"content_ratio_wide" (printf "%f%%" (mul 0.8 (mul $contentRatio 100)))
|
||||
"sidebar_ratio_wide" (printf "%f%%" (mul 0.8 (mul (sub 1.0 $contentRatio) 100)))
|
||||
-}}
|
||||
{{ $options := dict
|
||||
"transpiler" "dartsass"
|
||||
"vars" $vars
|
||||
"targetPath" (printf "css/anatole%s.css" (cond (eq site.Language.LanguageDirection "") "" (printf ".%s" site.Language.LanguageDirection)))
|
||||
-}}
|
||||
{{ with resources.Get "scss/main.scss" -}}
|
||||
{{ if hugo.IsProduction -}}
|
||||
{{ with . | toCSS $options | minify | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous" />
|
||||
{{ end -}}
|
||||
{{ else -}}
|
||||
{{ with . | toCSS $options }}
|
||||
<link rel="stylesheet" href="{{ .RelPermalink }}" />
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
|
||||
{{ $markupHighlightStyle := resources.Get "css/markupHighlight.css" | resources.Minify | resources.Fingerprint }}
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="{{ $markupHighlightStyle.RelPermalink }}"
|
||||
integrity="{{ $markupHighlightStyle.Data.Integrity }}"
|
||||
crossorigin="anonymous"
|
||||
type="text/css"
|
||||
/>
|
||||
{{ range .Site.Params.customCss }}
|
||||
{{ $minstyles := resources.Get . }}
|
||||
{{ $styles := $minstyles | resources.Minify | resources.Fingerprint }}
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="{{ $styles.RelPermalink }}"
|
||||
integrity="{{ $styles.Data.Integrity }}"
|
||||
crossorigin="anonymous"
|
||||
media="screen"
|
||||
/>
|
||||
{{ end }}
|
||||
{{ $style := resources.Get "fontawesome/css/fontawesome.min.css" | resources.Fingerprint }}
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="{{ $style.RelPermalink }}"
|
||||
integrity="{{ $style.Data.Integrity }}"
|
||||
crossorigin="anonymous"
|
||||
type="text/css"
|
||||
/>
|
||||
{{ $style := resources.Get "fontawesome/css/solid.min.css" | resources.Fingerprint }}
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="{{ $style.RelPermalink }}"
|
||||
integrity="{{ $style.Data.Integrity }}"
|
||||
crossorigin="anonymous"
|
||||
type="text/css"
|
||||
/>
|
||||
{{ $style := resources.Get "fontawesome/css/regular.min.css" | resources.Fingerprint }}
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="{{ $style.RelPermalink }}"
|
||||
integrity="{{ $style.Data.Integrity }}"
|
||||
crossorigin="anonymous"
|
||||
type="text/css"
|
||||
/>
|
||||
{{ $style := resources.Get "fontawesome/css/brands.min.css" | resources.Fingerprint }}
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="{{ $style.RelPermalink }}"
|
||||
integrity="{{ $style.Data.Integrity }}"
|
||||
crossorigin="anonymous"
|
||||
type="text/css"
|
||||
/>
|
||||
{{ if .Params.redirectUrl }}
|
||||
{{ $style := resources.Get "css/spinner.css" | resources.Minify | resources.Fingerprint }}
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="{{ $style.RelPermalink }}"
|
||||
integrity="{{ $style.Data.Integrity }}"
|
||||
crossorigin="anonymous"
|
||||
type="text/css"
|
||||
/>
|
||||
{{- end -}}
|
||||
{{ if .Site.Params.googleFonts }}
|
||||
{{ $baseUrl := "https://fonts.googleapis.com/css2?family=" }}
|
||||
{{ $fontParam := delimit .Site.Params.googleFonts "&family=" }}
|
||||
{{ $url := printf "%s" "&display=swap" | printf "%s%s" $fontParam | printf "%s%s" $baseUrl | printf "%s" }}
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link href="{{ $url }}" rel="stylesheet" />
|
||||
{{- end -}}
|
||||
|
||||
|
||||
<!-- Favicons -->
|
||||
<link rel="shortcut icon" href="{{ .Site.Params.favicon | relURL }}favicon.ico" type="image/x-icon" />
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="{{ .Site.Params.favicon | relURL }}apple-touch-icon.png" />
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="{{ .Site.Params.favicon | relURL }}favicon-32x32.png" />
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{{ .Site.Params.favicon | relURL }}favicon-16x16.png" />
|
||||
|
||||
<link rel="canonical" href="{{ .Permalink }}" />
|
||||
<!-- License -->
|
||||
{{- with .Site.Params.license -}}
|
||||
<link rel="license" href="{{ . }}" />
|
||||
{{- end -}}
|
||||
|
||||
|
||||
<!-- RSS -->
|
||||
{{ with .OutputFormats.Get "rss" -}}
|
||||
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }}
|
||||
{{ end -}}
|
||||
|
||||
|
||||
<!-- JavaScript -->
|
||||
{{ $anatoleHeader := resources.Get "js/anatole-header.js" }}
|
||||
{{ $secureHeaderJS := $anatoleHeader | resources.Minify | resources.Fingerprint }}
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="{{ $secureHeaderJS.RelPermalink }}"
|
||||
integrity="{{ $secureHeaderJS.Data.Integrity }}"
|
||||
crossorigin="anonymous"
|
||||
></script>
|
||||
|
||||
{{ if not .Site.Params.disableThemeSwitcher }}
|
||||
{{ $anatoleThemeSwitcher := resources.Get "js/anatole-theme-switcher.js" }}
|
||||
{{ $secureThemeSwitcherJS := $anatoleThemeSwitcher | resources.Minify | resources.Fingerprint }}
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="{{ $secureThemeSwitcherJS.RelPermalink }}"
|
||||
integrity="{{ $secureThemeSwitcherJS.Data.Integrity }}"
|
||||
crossorigin="anonymous"
|
||||
></script>
|
||||
{{ end }}
|
||||
|
||||
{{- $js := "" -}}
|
||||
{{- range .Site.Params.customJs -}}
|
||||
{{- if or (in . "http://") (in . "https://") -}}
|
||||
<script src="{{ . | relURL }}"></script>
|
||||
{{- else -}}
|
||||
{{- $customJS := resources.Get . -}}
|
||||
{{- if $customJS -}}
|
||||
{{- if eq $js "" -}}
|
||||
{{- $js = $customJS -}}
|
||||
{{- else -}}
|
||||
{{- $js = slice $js $customJS | resources.Concat "js/custom.js" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- end -}}
|
||||
|
||||
{{- end -}}
|
||||
|
||||
{{- end -}}
|
||||
|
||||
{{- if ne $js "" -}}
|
||||
{{- $secureJS := $js | resources.Minify | resources.Fingerprint -}}
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="{{ $secureJS.RelPermalink }}"
|
||||
integrity="{{ $secureJS.Data.Integrity }}"
|
||||
crossorigin="anonymous"
|
||||
></script>
|
||||
{{- end -}}
|
||||
|
||||
{{ if and hugo.IsProduction .Site.Params.plausibleAnalytics .Site.Params.plausibleAnalytics.domain }}
|
||||
{{- partial "analytics/plausible" . -}}
|
||||
{{ end }}
|
||||
|
||||
{{ if and hugo.IsProduction .Site.Params.umami.serverURL .Site.Params.umami.id }}
|
||||
{{- partial "analytics/umami" . -}}
|
||||
{{ end }}
|
||||
|
||||
{{ if and hugo.IsProduction .Site.Params.Matomo.instance .Site.Params.Matomo.siteId }}
|
||||
{{- partial "analytics/matomo" . -}}
|
||||
{{ end }}
|
||||
|
||||
{{ if and hugo.IsProduction .Site.Params.meta.pixelId }}
|
||||
{{- partial "analytics/meta.html" . -}}
|
||||
{{ end }}
|
||||
|
||||
|
||||
<!-- Twitter Cards -->
|
||||
{{ template "_internal/twitter_cards.html" . }}
|
||||
|
||||
|
||||
<!-- Open Graph -->
|
||||
{{ template "_internal/opengraph.html" . }}
|
||||
|
||||
|
||||
<!-- Schema.org-->
|
||||
{{ partial "schema.html" . }}
|
||||
|
||||
|
||||
<!-- KaTeX-->
|
||||
{{ $noop := .WordCount }}
|
||||
{{ if .Page.Store.Get "hasMath" }}
|
||||
{{ $katex_css_url := printf "https://cdn.jsdelivr.net/npm/katex@latest/dist/katex%s.css" (cond hugo.IsProduction ".min" "") -}}
|
||||
{{ with try (resources.GetRemote $katex_css_url) -}}
|
||||
{{ with .Err -}}
|
||||
{{ errorf "Could not retrieve KaTeX css file from CDN. Reason: %s." . -}}
|
||||
{{ else with.Value -}}
|
||||
{{ with resources.Copy (printf "css/katex%s.css" (cond hugo.IsProduction ".min" "")) . }}
|
||||
{{ $secureCSS := . | resources.Fingerprint "sha512" -}}
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="{{- .RelPermalink -}}"
|
||||
integrity="{{- $secureCSS.Data.Integrity -}}"
|
||||
crossorigin="anonymous"
|
||||
/>
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ end }}
|
||||
</head>
|
||||
11
layouts/partials/medium-zoom.html
Normal file
11
layouts/partials/medium-zoom.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{{ $enableMediumZoom := default true (.Site.Params.enableMediumZoom) }}
|
||||
{{- if eq $enableMediumZoom true -}}
|
||||
{{ $js := resources.Get "js/medium-zoom.js" }}
|
||||
{{ $secureJS := $js | resources.Minify | resources.Fingerprint }}
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="{{ $secureJS.RelPermalink }}"
|
||||
integrity="{{ $secureJS.Data.Integrity }}"
|
||||
crossorigin="anonymous"
|
||||
></script>
|
||||
{{- end -}}
|
||||
7
layouts/partials/mermaid.html
Normal file
7
layouts/partials/mermaid.html
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{{ if .Page.Store.Get "hasMermaid" }}
|
||||
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
|
||||
<script>
|
||||
const mermaidtheme = getStoredThemeStyle() === 'dark' ? 'dark' : 'base';
|
||||
mermaid.initialize({ startOnLoad: true, theme: mermaidtheme });
|
||||
</script>
|
||||
{{ end }}
|
||||
112
layouts/partials/navbar.html
Normal file
112
layouts/partials/navbar.html
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
<div
|
||||
class="{{ with .Site.Params.doNotLoadAnimations }}
|
||||
.
|
||||
{{ else }}
|
||||
animated fadeInDown
|
||||
{{ end }}"
|
||||
>
|
||||
<a role="button" class="navbar-burger" data-target="navMenu" aria-label="menu" aria-expanded="false">
|
||||
<span aria-hidden="true" class="navbar-burger__line"></span>
|
||||
<span aria-hidden="true" class="navbar-burger__line"></span>
|
||||
<span aria-hidden="true" class="navbar-burger__line"></span>
|
||||
</a>
|
||||
<nav class="nav">
|
||||
<ul class="nav__list" id="navMenu">
|
||||
{{ $url := .RelPermalink }}
|
||||
{{ range $menuId, $menuItem := .Site.Menus.main }}
|
||||
{{ $active := eq $url $menuItem.URL }}
|
||||
{{ if $menuItem.HasChildren }}
|
||||
|
||||
<li class="nav__list-item">
|
||||
<div class="optionswitch">
|
||||
<input class="optionswitch__picker" type="checkbox" id="{{ $menuId }}" hidden />
|
||||
|
||||
{{ $labelClass := "optionswitch__label" }}
|
||||
{{ range $menuItem.Children }}
|
||||
{{ if eq $url .URL }}
|
||||
{{ $labelClass = "optionswitch__label nav__link--active" }}
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
|
||||
|
||||
<label class="{{ $labelClass }}" for="{{ $menuId }}"
|
||||
>{{ $menuItem.Name }} <i class="fa fa-angle-down" aria-hidden="true"></i
|
||||
></label>
|
||||
|
||||
<div class="optionswitch__triangle"></div>
|
||||
<ul class="optionswitch__list">
|
||||
{{ range $menuItem.Children }}
|
||||
<li class="optionswitch__list-item">
|
||||
{{ .Pre }}
|
||||
<a
|
||||
href="{{ .URL }}"
|
||||
{{ if strings.HasPrefix .URL "http" }}
|
||||
target="_blank" rel="noopener noreferrer"
|
||||
{{ end }}
|
||||
title="{{ .Title }}"
|
||||
>{{ .Name }}</a
|
||||
>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
{{ else }}
|
||||
<li class="nav__list-item">
|
||||
{{ .Pre }}
|
||||
<a
|
||||
{{ if $active }}
|
||||
class="nav__link--active"
|
||||
{{ end }}
|
||||
href="{{ .URL }}"
|
||||
{{ if strings.HasPrefix .URL "http" }}
|
||||
target="_blank" rel="noopener noreferrer"
|
||||
{{ end }}
|
||||
title="{{ .Title }}"
|
||||
>{{ $menuItem.Name }}</a
|
||||
>
|
||||
</li>
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
</ul>
|
||||
<ul class="nav__list nav__list--end">
|
||||
{{ if and .IsTranslated hugo.IsMultilingual }}
|
||||
<li class="nav__list-item">
|
||||
<div class="optionswitch">
|
||||
<input class="optionswitch__picker" type="checkbox" id="languagepicker" hidden />
|
||||
<label class="optionswitch__label" for="languagepicker"
|
||||
>{{ .Site.Language.LanguageName }} <i class="fa fa-angle-down" aria-hidden="true"></i
|
||||
></label>
|
||||
<div class="optionswitch__triangle"></div>
|
||||
<ul class="optionswitch__list">
|
||||
{{ range $.Translations }}
|
||||
<li class="optionswitch__list-item">
|
||||
<a href="{{ .RelPermalink }}" title="{{ .Language.LanguageName }}"
|
||||
><span
|
||||
{{ if eq . $.Site.Language }}
|
||||
class="active"
|
||||
{{ end }}
|
||||
aria-label="{{ i18n "ariaLanguage" }}{{ .Language.LanguageName }}"
|
||||
>{{ .Language.LanguageName }}</span
|
||||
>
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ if not .Site.Params.disableThemeSwitcher }}
|
||||
<li class="nav__list-item">
|
||||
<div class="themeswitch">
|
||||
<a title="Switch Theme">
|
||||
<i class="fas fa-adjust fa-fw" aria-hidden="true"></i>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
45
layouts/partials/pagination.html
Normal file
45
layouts/partials/pagination.html
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
{{ if gt .Paginator.TotalPages 1 }}
|
||||
<ul class="pagination__list">
|
||||
{{ $.Scratch.Set "hasPrevDots" false }}
|
||||
{{ $.Scratch.Set "hasNextDots" false }}
|
||||
{{ if .Paginator.HasPrev }}
|
||||
<li class="pagination__list-item">
|
||||
<a class="page-link" href="{{ .Paginator.Prev.URL }}">
|
||||
<i class="fa fa-angle-left" aria-label="Previous"></i>
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ range .Paginator.Pagers }}
|
||||
{{ if eq . $.Paginator }}
|
||||
<li class="pagination__list-item">
|
||||
<span class="page-link current">
|
||||
{{- .PageNumber -}}
|
||||
</span>
|
||||
</li>
|
||||
{{ else if or (or (eq . $.Paginator.First) (eq . $.Paginator.Prev)) (or (eq . $.Paginator.Next) (eq . $.Paginator.Last )) }}
|
||||
<li class="pagination__list-item">
|
||||
<a class="page-link" href="{{ .URL }}">
|
||||
{{- .PageNumber -}}
|
||||
</a>
|
||||
</li>
|
||||
{{ else }}
|
||||
{{ if and (not ($.Scratch.Get "hasPrevDots")) (lt .PageNumber $.Paginator.PageNumber) }}
|
||||
{{ $.Scratch.Set "hasPrevDots" true }}
|
||||
<span class="page-link dots">…</span>
|
||||
{{ else if and (not ($.Scratch.Get "hasNextDots")) (gt .PageNumber $.Paginator.PageNumber) }}
|
||||
{{ $.Scratch.Set "hasNextDots" true }}
|
||||
<span class="page-link dots">…</span>
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
{{ if .Paginator.HasNext }}
|
||||
<li class="pagination__list-item">
|
||||
<a class="page-link" href="{{ .Paginator.Next.URL }}">
|
||||
<i class="fa fa-angle-right" aria-label="Next"></i>
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
9
layouts/partials/related.html
Normal file
9
layouts/partials/related.html
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{{ $related := .Site.RegularPages.Related . | first .Site.Params.numberOfRelatedPosts }}
|
||||
{{ with $related }}
|
||||
<h3>{{- T "related_posts" -}}</h3>
|
||||
<ul>
|
||||
{{ range . }}
|
||||
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
127
layouts/partials/schema.html
Normal file
127
layouts/partials/schema.html
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
{{ if .IsHome -}}
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "http://schema.org",
|
||||
"@type": "WebSite",
|
||||
"name": {{ .Site.Title | jsonify | safeJS }},
|
||||
"url": "{{ .Site.BaseURL }}",
|
||||
"description": "{{ .Site.Params.description }}",
|
||||
"thumbnailUrl": "{{ .Site.Params.Logo | absURL }}",
|
||||
"license": "{{ .Site.Params.license}}"
|
||||
{{ with .Site.Params.copyright }}
|
||||
{{ $copyright := replace . "{{ YEAR }}" (now.Format "2006") }}
|
||||
,"copyrightYear": "{{ index (findRE `^\d{4}` $copyright 1) 0 }}"
|
||||
{{ end }}
|
||||
}
|
||||
</script>
|
||||
{{ else if .IsPage }}
|
||||
{{ $author := or (.Params.author) (.Site.Params.author) }}
|
||||
{{ $favicon := .Site.Params.favicon | absURL }}
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "http://schema.org",
|
||||
"@type": "BlogPosting",
|
||||
"articleSection": "{{ .Section }}",
|
||||
"name": "{{ .Title | safeJS }}",
|
||||
"headline": "{{ .Title | safeJS }}",
|
||||
"alternativeHeadline": "{{ .Params.lead }}",
|
||||
"description": "{{ if .Description }}
|
||||
{{ .Description | safeJS }}
|
||||
|
||||
|
||||
{{ else }}
|
||||
{{ if .IsPage }}
|
||||
{{ .Summary }}
|
||||
|
||||
|
||||
{{ end }}
|
||||
|
||||
|
||||
{{ end }}",
|
||||
"license": "{{ .Site.Params.license}}",
|
||||
{{ with .Site.Params.copyright }}
|
||||
{{ $copyright := replace . "{{ YEAR }}" (now.Format "2006") }}
|
||||
"copyrightYear": "{{ index (findRE `^\d{4}` $copyright 1) 0 }}",
|
||||
{{ end }}
|
||||
"inLanguage": {{ .Site.LanguageCode | default "en-us" }},
|
||||
"isFamilyFriendly": "true",
|
||||
"mainEntityOfPage": {
|
||||
"@type": "WebPage",
|
||||
"@id": "{{ .Permalink }}"
|
||||
},
|
||||
"author" : {
|
||||
"@type": "Person",
|
||||
"name": "{{ $author }}"
|
||||
},
|
||||
"creator" : {
|
||||
"@type": "Person",
|
||||
"name": "{{ $author }}"
|
||||
},
|
||||
"accountablePerson" : {
|
||||
"@type": "Person",
|
||||
"name": "{{ $author }}"
|
||||
},
|
||||
"copyrightHolder" : {
|
||||
"@type": "Person",
|
||||
"name": "{{ $author }}"
|
||||
},
|
||||
"dateCreated": "{{ .Date.Format "2006-01-02T15:04:05.00Z" | safeHTML }}",
|
||||
"datePublished": "{{ .PublishDate.Format "2006-01-02T15:04:05.00Z" | safeHTML }}",
|
||||
"dateModified": "{{ .Lastmod.Format "2006-01-02T15:04:05.00Z" | safeHTML }}",
|
||||
"publisher":{
|
||||
"@type":"Organization",
|
||||
"name": {{ $author }},
|
||||
"url": {{ .Site.BaseURL }},
|
||||
"logo": {
|
||||
"@type": "ImageObject",
|
||||
"url": "{{ (printf "%s%s" $favicon "favicon-32x32.png") }}",
|
||||
"width":"32",
|
||||
"height":"32"
|
||||
}
|
||||
},
|
||||
"image": {{ if .Params.images }}
|
||||
[{{ range $i, $e := .Params.images }}
|
||||
{{ if $i }}
|
||||
,
|
||||
|
||||
{{ end }}
|
||||
{{ $e | absURL }}
|
||||
|
||||
|
||||
{{ end }}
|
||||
]
|
||||
|
||||
{{ else }}
|
||||
[{{ range $i, $e := .Site.Params.images }}
|
||||
{{ if $i }}
|
||||
,
|
||||
|
||||
{{ end }}
|
||||
{{ $e | absURL }}
|
||||
|
||||
|
||||
{{ end }}
|
||||
]
|
||||
|
||||
{{ end }},
|
||||
"url" : "{{ .Permalink }}",
|
||||
"wordCount" : "{{ .WordCount }}",
|
||||
"genre" : [ {{ range $index, $tag := .Params.categories }}
|
||||
{{ if $index }}
|
||||
,
|
||||
|
||||
{{ end }}
|
||||
"{{ $tag }}"
|
||||
|
||||
{{ end }}],
|
||||
"keywords" : [ {{ range $index, $keyword := .Params.tags }}
|
||||
{{ if $index }}
|
||||
,
|
||||
|
||||
{{ end }}
|
||||
"{{ $keyword }}"
|
||||
|
||||
{{ end }}]
|
||||
}
|
||||
</script>
|
||||
{{ end }}
|
||||
9
layouts/partials/series.html
Normal file
9
layouts/partials/series.html
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{{ $related := where .Site.RegularPages ".Params.series" "intersect" .Params.series }}
|
||||
|
||||
|
||||
<h3>{{ i18n "series_posts" }}</h3>
|
||||
<ul>
|
||||
{{ range $related }}
|
||||
<li><a href="{{ .Page.RelPermalink }}">{{ title .Page.Title }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
47
layouts/partials/sidebar.html
Normal file
47
layouts/partials/sidebar.html
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
<div
|
||||
class="sidebar{{ with .Site.Params.doNotLoadAnimations }}
|
||||
.
|
||||
{{ else }}
|
||||
animated fadeInDown
|
||||
{{ end }}"
|
||||
>
|
||||
<div class="sidebar__content">
|
||||
<div class="sidebar__introduction">
|
||||
<img
|
||||
class="-sidebar__introduction-profileimage"
|
||||
src="{{ .Site.Params.profilePicture | relURL }}"
|
||||
alt="profile picture" width="300px"
|
||||
/>
|
||||
{{ if .IsHome }}
|
||||
<div class="sidebar__introduction-title">
|
||||
<h1>
|
||||
<a href="{{ .Site.BaseURL | relLangURL }}">{{ .Site.Params.Title }}</a>
|
||||
</h1>
|
||||
</div>
|
||||
{{ else }}
|
||||
<div class="sidebar__introduction-title">
|
||||
<a href="{{ .Site.BaseURL | relLangURL }}">{{ .Site.Params.Title }}</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
<div class="sidebar__introduction-description">
|
||||
<p>{{ replace .Site.Params.description "\n" "<br />" | safeHTML }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="sidebar__list">
|
||||
{{ range $item := .Site.Params.socialIcons }}
|
||||
<li class="sidebar__list-item">
|
||||
<a
|
||||
href="{{ $item.url }}"
|
||||
target="_blank"
|
||||
rel="noopener me"
|
||||
aria-label="{{ $item.title }}"
|
||||
title="{{ $item.title }}"
|
||||
>
|
||||
<i class="{{ $item.icon }} fa-2x" aria-hidden="true"></i>
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
{{- partial "footer.html" (dict "context" . "footerClassModifier" "sidebar") -}}
|
||||
</div>
|
||||
1
layouts/partials/taxonomy/categories.html
Normal file
1
layouts/partials/taxonomy/categories.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
{{ partial "taxonomy/template.html" (dict "items" . "linkClass" "category" "linkBase" "categories") }}
|
||||
1
layouts/partials/taxonomy/tags.html
Normal file
1
layouts/partials/taxonomy/tags.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
{{ partial "taxonomy/template.html" (dict "items" . "linkClass" "tag" "linkBase" "tags") }}
|
||||
13
layouts/partials/taxonomy/template.html
Normal file
13
layouts/partials/taxonomy/template.html
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{{- $linkClass := .linkClass -}}
|
||||
{{- $linkBase := .linkBase -}}
|
||||
|
||||
|
||||
<span>
|
||||
{{- range $index, $el := .items -}}
|
||||
<!-- Replace certain special characters with their URL encoded counterparts -->
|
||||
{{- $item := replace . "#" "%23" -}}
|
||||
{{- $item = replace $item "." "%2e" -}}
|
||||
{{- $link := ( printf "%s/%s/" $linkBase ( $item | urlize ) ) | relLangURL -}}
|
||||
<a class="{{ $linkClass }}" href="{{ $link }}">{{- . -}}</a>
|
||||
{{- end -}}
|
||||
</span>
|
||||
2
layouts/partials/toc.html
Normal file
2
layouts/partials/toc.html
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
<h3>{{ T "toc" }}</h3>
|
||||
{{ .TableOfContents }}
|
||||
104
layouts/portfolio/list.html
Normal file
104
layouts/portfolio/list.html
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
{{ define "main" }}
|
||||
{{ $data := index .Site.Data .Site.Language.Lang "portfolio" }}
|
||||
{{ if not $data }}{{ $data = .Site.Data.portfolio }}{{ end }}
|
||||
{{ range $index, $elemen:= $data.portfolioitems }}
|
||||
<div
|
||||
class="post {{ with .Site.Params.doNotLoadAnimations }}
|
||||
.
|
||||
{{ else }}
|
||||
animated fadeInDown
|
||||
{{ end }}"
|
||||
>
|
||||
{{ $anchorTitle := delimit (split .title " ") "" }}
|
||||
|
||||
|
||||
<h2 class="portfolio__title" id="{{ $anchorTitle | lower }}">{{ title .title }}</h2>
|
||||
{{ if .description }}
|
||||
<h4>{{ .description }}</h4>
|
||||
{{ end }}
|
||||
{{ range $i, $p := .portfolioitem }}
|
||||
<div class="portfolio">
|
||||
{{ if .image }}
|
||||
<div
|
||||
class="portfolio__image-wrapper {{ if (modBool $i 2) }}
|
||||
portfolio__image-wrapper--right
|
||||
{{ else }}
|
||||
portfolio__image-wrapper--left
|
||||
{{ end }}"
|
||||
>
|
||||
{{ if .link }}
|
||||
<a href="{{ .link | safeURL }}" target="_blank" rel="noopener">
|
||||
<img class="portfolio__image" src="{{ .image | relURL }}" alt="{{ .name | markdownify }}" />
|
||||
</a>
|
||||
{{ else }}
|
||||
<img class="portfolio__image" src="{{ .image | relURL }}" alt="{{ .name | markdownify }}" />
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
<div
|
||||
class="portfolio__description {{ if (modBool $i 2) }}
|
||||
portfolio__description--left
|
||||
{{ else }}
|
||||
portfolio__description--right
|
||||
{{ end }}"
|
||||
>
|
||||
<h2>{{ .name | markdownify }}</h2>
|
||||
<ul class="portfolio__meta">
|
||||
{{ if .status }}
|
||||
<li class="portfolio__meta-item">
|
||||
<em class="fas fa-flag-checkered"></em>
|
||||
<span>{{ .status }}</span>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ if .venue }}
|
||||
<li class="portfolio__meta-item">
|
||||
<em class="fas fa-map-marker-alt"></em>
|
||||
<span>{{ .venue }}</span>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ if .start }}
|
||||
<li class="portfolio__meta-item">
|
||||
<em class="fas fa-arrow-up"></em>
|
||||
<span>{{ .start }}</span>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ if .end }}
|
||||
<li class="portfolio__meta-item">
|
||||
<em class="fas fa-arrow-down"></em>
|
||||
<span>{{ .end }}</span>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ if .authors }}
|
||||
{{ range .authors }}
|
||||
<li class="portfolio__meta-item">
|
||||
<em class="fas fa-at"></em>
|
||||
<span>{{ . }}</span>
|
||||
</li>
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
</ul>
|
||||
<p>{{ .description | markdownify }}</p>
|
||||
{{ if .link }}
|
||||
<div class="portfolio__button-wrapper">
|
||||
<a class="portfolio__button" href="{{ .link | safeURL }}" target="_blank" rel="noopener">
|
||||
{{- if .linktext -}}
|
||||
{{ .linktext | markdownify }}
|
||||
{{- else -}}
|
||||
Visit Site
|
||||
{{- end -}}
|
||||
</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
<div class="separator">
|
||||
{{ range .tags }}
|
||||
<p class="tag">{{ . }}</p>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
9
layouts/shortcodes/loading.html
Normal file
9
layouts/shortcodes/loading.html
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<!-- loading -->
|
||||
<div class="sk-wrapper">
|
||||
<div class="sk-fold">
|
||||
<div class="sk-fold-cube"></div>
|
||||
<div class="sk-fold-cube"></div>
|
||||
<div class="sk-fold-cube"></div>
|
||||
<div class="sk-fold-cube"></div>
|
||||
</div>
|
||||
</div>
|
||||
23
layouts/shortcodes/notice.html
Normal file
23
layouts/shortcodes/notice.html
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{{/* Available notice types: danger, info, update */}}
|
||||
{{- $noticeType := .Get 0 -}}
|
||||
<div
|
||||
class="notice{{ if eq $noticeType "warning" }}
|
||||
notice--warning
|
||||
{{ else if eq $noticeType "update" }}
|
||||
notice--update
|
||||
{{ end }}"
|
||||
>
|
||||
<span
|
||||
class="notice__title{{ if eq $noticeType "warning" }}
|
||||
notice__title--warning
|
||||
{{ else if eq $noticeType "update" }}
|
||||
notice__title--update
|
||||
{{ end }}"
|
||||
>
|
||||
{{- i18n $noticeType -}}
|
||||
</span>
|
||||
{{- $noteContent := (markdownify .Inner | chomp) -}}
|
||||
<div class="notice__content">
|
||||
{{ $noteContent }}
|
||||
</div>
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue