aboutsummaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
Diffstat (limited to 'layouts')
-rw-r--r--layouts/.gitkeep0
-rw-r--r--layouts/404.html7
-rw-r--r--layouts/partials/extend_head.html8
-rw-r--r--layouts/partials/footer.html150
-rw-r--r--layouts/partials/svg.html16
5 files changed, 181 insertions, 0 deletions
diff --git a/layouts/.gitkeep b/layouts/.gitkeep
deleted file mode 100644
index e69de29..0000000
--- a/layouts/.gitkeep
+++ /dev/null
diff --git a/layouts/404.html b/layouts/404.html
new file mode 100644
index 0000000..caa0c39
--- /dev/null
+++ b/layouts/404.html
@@ -0,0 +1,7 @@
+{{- define "main" }}
+<div class="not-found">
+ <span class="httpcode">404</span>
+ <span>Seite nicht gefunden</span>
+ <span>Page not found</span>
+</div>
+{{- end }}{{/* end main */ -}}
diff --git a/layouts/partials/extend_head.html b/layouts/partials/extend_head.html
new file mode 100644
index 0000000..a3af417
--- /dev/null
+++ b/layouts/partials/extend_head.html
@@ -0,0 +1,8 @@
+{{- /* Head custom content area start */ -}}
+{{- /* Insert any custom code (web-analytics, resources, etc.) - it will appear in the <head></head> section of every page. */ -}}
+{{- /* Can be overwritten by partial with the same name in the global layouts. */ -}}
+{{- /* Head custom content area end */ -}}
+
+{{ range .Site.Params.custom_css -}}
+ <link rel="stylesheet" href="{{ . | absURL }}">
+{{- end }}
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
new file mode 100644
index 0000000..6a215c2
--- /dev/null
+++ b/layouts/partials/footer.html
@@ -0,0 +1,150 @@
+{{- if not (.Param "hideFooter") }}
+<footer class="footer">
+ {{- if not site.Params.footer.hideCopyright }}
+ {{- if site.Copyright }}
+ <span>{{ site.Copyright | markdownify }}</span>
+ {{- else }}
+ <span>&copy; {{ now.Year }} <a href="{{ "" | absLangURL }}">{{ site.Title }}</a></span>
+ {{- end }}
+ {{- print " · "}}
+ {{- end }}
+
+ {{- with site.Params.footer.text }}
+ {{ . | markdownify }}
+ {{- print " · "}}
+ {{- end }}
+
+ <span>
+ Powered by
+ <a href="https://gohugo.io/" rel="noopener noreferrer" target="_blank">Hugo</a> &
+ <a href="https://github.com/adityatelange/hugo-PaperMod/" rel="noopener" target="_blank">PaperMod</a>
+ </span>
+
+ <!-- start custom footer extension -->
+ <span>&middot;</span>
+ <span><a href="{{ .Site.Params.xCustomLegalLink }}">{{ .Site.Params.xCustomLegalText }}</a></span>
+ <!-- end custom footer extension -->
+
+</footer>
+{{- end }}
+
+{{- if (not site.Params.disableScrollToTop) }}
+<a href="#top" aria-label="go to top" title="Go to Top (Alt + G)" class="top-link" id="top-link" accesskey="g">
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 6" fill="currentColor">
+ <path d="M12 6H0l6-6z" />
+ </svg>
+</a>
+{{- end }}
+
+{{- partial "extend_footer.html" . }}
+
+<script>
+ let menu = document.getElementById('menu')
+ if (menu) {
+ menu.scrollLeft = localStorage.getItem("menu-scroll-position");
+ menu.onscroll = function () {
+ localStorage.setItem("menu-scroll-position", menu.scrollLeft);
+ }
+ }
+
+ document.querySelectorAll('a[href^="#"]').forEach(anchor => {
+ anchor.addEventListener("click", function (e) {
+ e.preventDefault();
+ var id = this.getAttribute("href").substr(1);
+ if (!window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
+ document.querySelector(`[id='${decodeURIComponent(id)}']`).scrollIntoView({
+ behavior: "smooth"
+ });
+ } else {
+ document.querySelector(`[id='${decodeURIComponent(id)}']`).scrollIntoView();
+ }
+ if (id === "top") {
+ history.replaceState(null, null, " ");
+ } else {
+ history.pushState(null, null, `#${id}`);
+ }
+ });
+ });
+
+</script>
+
+{{- if (not site.Params.disableScrollToTop) }}
+<script>
+ var mybutton = document.getElementById("top-link");
+ window.onscroll = function () {
+ if (document.body.scrollTop > 800 || document.documentElement.scrollTop > 800) {
+ mybutton.style.visibility = "visible";
+ mybutton.style.opacity = "1";
+ } else {
+ mybutton.style.visibility = "hidden";
+ mybutton.style.opacity = "0";
+ }
+ };
+
+</script>
+{{- end }}
+
+{{- if (not site.Params.disableThemeToggle) }}
+<script>
+ document.getElementById("theme-toggle").addEventListener("click", () => {
+ if (document.body.className.includes("dark")) {
+ document.body.classList.remove('dark');
+ localStorage.setItem("pref-theme", 'light');
+ } else {
+ document.body.classList.add('dark');
+ localStorage.setItem("pref-theme", 'dark');
+ }
+ })
+
+</script>
+{{- end }}
+
+{{- if (and (eq .Kind "page") (ne .Layout "archives") (ne .Layout "search") (.Param "ShowCodeCopyButtons")) }}
+<script>
+ document.querySelectorAll('pre > code').forEach((codeblock) => {
+ const container = codeblock.parentNode.parentNode;
+
+ const copybutton = document.createElement('button');
+ copybutton.classList.add('copy-code');
+ copybutton.innerHTML = '{{- i18n "code_copy" | default "copy" }}';
+
+ function copyingDone() {
+ copybutton.innerHTML = '{{- i18n "code_copied" | default "copied!" }}';
+ setTimeout(() => {
+ copybutton.innerHTML = '{{- i18n "code_copy" | default "copy" }}';
+ }, 2000);
+ }
+
+ copybutton.addEventListener('click', (cb) => {
+ if ('clipboard' in navigator) {
+ navigator.clipboard.writeText(codeblock.textContent);
+ copyingDone();
+ return;
+ }
+
+ const range = document.createRange();
+ range.selectNodeContents(codeblock);
+ const selection = window.getSelection();
+ selection.removeAllRanges();
+ selection.addRange(range);
+ try {
+ document.execCommand('copy');
+ copyingDone();
+ } catch (e) { };
+ selection.removeRange(range);
+ });
+
+ if (container.classList.contains("highlight")) {
+ container.appendChild(copybutton);
+ } else if (container.parentNode.firstChild == container) {
+ // td containing LineNos
+ } else if (codeblock.parentNode.parentNode.parentNode.parentNode.parentNode.nodeName == "TABLE") {
+ // table containing LineNos and code
+ codeblock.parentNode.parentNode.parentNode.parentNode.parentNode.appendChild(copybutton);
+ } else {
+ // code blocks not having highlight as parent class
+ codeblock.parentNode.appendChild(copybutton);
+ }
+ });
+</script>
+{{- end }}
diff --git a/layouts/partials/svg.html b/layouts/partials/svg.html
new file mode 100644
index 0000000..f535408
--- /dev/null
+++ b/layouts/partials/svg.html
@@ -0,0 +1,16 @@
+{{ $icon_name := ( trim .name " " | lower )}}
+{{- if (eq $icon_name "git") -}}
+<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" class="linkicon"><path style="fill:var(--primary)" d="M23.546 10.93L13.067.452c-.604-.603-1.582-.603-2.188 0L8.708 2.627l2.76 2.76c.645-.215 1.379-.07 1.889.441.516.515.658 1.258.438 1.9l2.658 2.66c.645-.223 1.387-.078 1.9.435.721.72.721 1.884 0 2.604-.719.719-1.881.719-2.6 0-.539-.541-.674-1.337-.404-1.996L12.86 8.955v6.525c.176.086.342.203.488.348.713.721.713 1.883 0 2.6-.719.721-1.889.721-2.609 0-.719-.719-.719-1.879 0-2.598.182-.18.387-.316.605-.406V8.835c-.217-.091-.424-.222-.6-.401-.545-.545-.676-1.342-.396-2.009L7.636 3.7.45 10.881c-.6.605-.6 1.584 0 2.189l10.48 10.477c.604.604 1.582.604 2.186 0l10.43-10.43c.605-.603.605-1.582 0-2.187"/></svg>
+{{- else if (eq $icon_name "xing") -}}
+<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" class="linkicon"><path style="fill:var(--primary)" d="M18.188 0c-.517 0-.741.325-.927.66 0 0-7.455 13.224-7.702 13.657.015.024 4.919 9.023 4.919 9.023.17.308.436.66.967.66h3.454c.211 0 .375-.078.463-.22.089-.151.089-.346-.009-.536l-4.879-8.916c-.004-.006-.004-.016 0-.022L22.139.756c.095-.191.097-.387.006-.535C22.056.078 21.894 0 21.686 0h-3.498zM3.648 4.74c-.211 0-.385.074-.473.216-.09.149-.078.339.02.531l2.34 4.05c.004.01.004.016 0 .021L1.86 16.051c-.099.188-.093.381 0 .529.085.142.239.234.45.234h3.461c.518 0 .766-.348.945-.667l3.734-6.609-2.378-4.155c-.172-.315-.434-.659-.962-.659H3.648v.016z"/></svg>
+{{- else if (eq $icon_name "sourdough") -}}
+<svg width="24" height="24" viewBox="0 0 800 800" xmlns="http://www.w3.org/2000/svg"><path style="fill:var(--primary);stroke-width:1.59876" d="m 151.16225,463.42869 v -283.0832 h 236.54093 236.54094 v 283.0832 283.08322 H 387.70318 151.16225 Z" /><path style="fill:var(--primary);stroke-width:1.63476" d="M 115.45298,107.68278 V 70.011381 H 388.044 660.63503 v 37.671399 37.67139 H 388.044 115.45298 Z" /><path style="fill:none;stroke:var(--code-bg);stroke-width:55.3134;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" d="m 141.1938,403.48217 c 22.73781,-19.37181 45.47602,-38.74398 79.31398,-39.08689 33.83796,-0.34292 78.75982,18.33739 129.78124,31.13448 51.02142,12.79709 108.14429,19.71572 156.11084,11.75778 47.96655,-7.95793 86.78793,-30.78943 125.60694,-53.61953" /><ellipse style="fill:var(--code-bg);fill-opacity:1;stroke:var(--code-bg);stroke-width:26.1315;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" cx="372.30701" cy="646.63855" rx="30.464792" ry="27.665491" /><ellipse style="fill:var(--code-bg);fill-opacity:1;stroke:var(--code-bg);stroke-width:24.1886;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" cx="516.47101" cy="556.36115" rx="31.4363" ry="33.535778" /><ellipse style="fill:var(--code-bg);fill-opacity:1;stroke:var(--code-bg);stroke-width:30.919;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" cx="277.13077" cy="512.97192" rx="30.870377" ry="30.170551" /></svg>
+{{- else if (eq $icon_name "sauerteig") -}}
+<svg width="24" height="24" viewBox="0 0 800 800" xmlns="http://www.w3.org/2000/svg"><path style="fill:var(--primary);stroke-width:1.59876" d="m 151.16225,463.42869 v -283.0832 h 236.54093 236.54094 v 283.0832 283.08322 H 387.70318 151.16225 Z" /><path style="fill:var(--primary);stroke-width:1.63476" d="M 115.45298,107.68278 V 70.011381 H 388.044 660.63503 v 37.671399 37.67139 H 388.044 115.45298 Z" /><path style="fill:none;stroke:var(--code-bg);stroke-width:55.3134;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" d="m 141.1938,403.48217 c 22.73781,-19.37181 45.47602,-38.74398 79.31398,-39.08689 33.83796,-0.34292 78.75982,18.33739 129.78124,31.13448 51.02142,12.79709 108.14429,19.71572 156.11084,11.75778 47.96655,-7.95793 86.78793,-30.78943 125.60694,-53.61953" /><ellipse style="fill:var(--code-bg);fill-opacity:1;stroke:var(--code-bg);stroke-width:26.1315;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" cx="372.30701" cy="646.63855" rx="30.464792" ry="27.665491" /><ellipse style="fill:var(--code-bg);fill-opacity:1;stroke:var(--code-bg);stroke-width:24.1886;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" cx="516.47101" cy="556.36115" rx="31.4363" ry="33.535778" /><ellipse style="fill:var(--code-bg);fill-opacity:1;stroke:var(--code-bg);stroke-width:30.919;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" cx="277.13077" cy="512.97192" rx="30.870377" ry="30.170551" /></svg>
+{{- else if $icon_name -}}
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
+ stroke-linecap="round" stroke-linejoin="round">
+ <path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path>
+ <path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path>
+</svg>
+{{- end -}}