Initial Release

This commit is contained in:
2023-03-26 15:44:45 +02:00
commit 2b7528e89a
66 changed files with 6603 additions and 0 deletions

0
layouts/.gitkeep Normal file
View File

26
layouts/404.html Normal file
View File

@ -0,0 +1,26 @@
{{ define "main" }}
<section class="grid place-items-center py-32 relative">
<svg class="w-1/2 transform rotate-6" viewbox="0 0 190 75" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd"
d="M31.6 60.001h-26c-1.533 0-2.85-.567-3.95-1.7S0 55.834 0 54.301v-1.9c0-3.733 1.1-7.167 3.3-10.3l25.9-36.5c2.122-2.957 4.957-4.489 8.504-4.594.132-.004.264-.006.396-.006h5c1.533 0 2.85.567 3.95 1.7s1.65 2.467 1.65 4v39.2c0 .533.3.8.9.8h4a5.46 5.46 0 0 1 3.947 1.648l.053.052c1.133 1.133 1.7 2.467 1.7 4v1.9a5.46 5.46 0 0 1-1.647 3.947l-.053.053c-1.133 1.133-2.467 1.7-4 1.7h-4c-.12-.002-.24.014-.356.045a.687.687 0 0 0-.505.522 1.33 1.33 0 0 0-.039.333v7.4c0 1.533-.55 2.867-1.65 4a5.585 5.585 0 0 1-1.905 1.314c-.65.26-1.345.392-2.045.386h-5c-1.533 0-2.85-.567-3.95-1.7s-1.65-2.467-1.65-4v-7.4c.002-.12-.013-.24-.044-.356a.69.69 0 0 0-.522-.505 1.324 1.324 0 0 0-.334-.039Zm130 0h-26c-1.533 0-2.85-.567-3.95-1.7s-1.65-2.467-1.65-4v-1.9c0-3.733 1.1-7.167 3.3-10.3l25.9-36.5c2.122-2.957 4.957-4.489 8.504-4.594.132-.004.264-.006.396-.006h5c1.533 0 2.85.567 3.95 1.7s1.65 2.467 1.65 4v39.2c0 .533.3.8.9.8h4a5.464 5.464 0 0 1 3.947 1.648l.053.052c1.133 1.133 1.7 2.467 1.7 4v1.9a5.464 5.464 0 0 1-1.647 3.947l-.053.053c-1.133 1.133-2.467 1.7-4 1.7h-4c-.12-.002-.24.014-.356.045a.688.688 0 0 0-.505.522c-.027.109-.04.22-.039.333v7.4c0 1.533-.55 2.867-1.65 4a5.58 5.58 0 0 1-1.905 1.314c-.65.26-1.345.392-2.045.386h-5c-1.533 0-2.85-.567-3.95-1.7s-1.65-2.467-1.65-4v-7.4c.002-.12-.013-.24-.044-.356a.69.69 0 0 0-.522-.505 1.32 1.32 0 0 0-.334-.039Zm-55.337 13.763a22.683 22.683 0 0 0 11.887-7.563c3.463-4.262 5.669-10.478 6.616-18.647a87.47 87.47 0 0 0 .534-10.053c0-1.125-.018-2.25-.054-3.373-.378-11.527-2.743-19.97-7.096-25.327-4.767-5.867-12.05-8.8-21.85-8.8-.51 0-1.02.008-1.529.025-3.073.1-5.884.504-8.434 1.213A22.685 22.685 0 0 0 74.45 8.801c-3.463 4.263-5.668 10.478-6.615 18.647a87.606 87.606 0 0 0-.535 10.053c0 1.125.018 2.25.054 3.374.378 11.527 2.743 19.97 7.096 25.326 4.767 5.867 12.05 8.8 21.85 8.8.51 0 1.02-.008 1.53-.024 3.073-.1 5.884-.504 8.433-1.213Zm-1.113-55.363a11.187 11.187 0 0 0-2.301-3.103c-1.725-1.598-3.908-2.397-6.549-2.397a10.213 10.213 0 0 0-4.057.774c-1.6.685-2.94 1.824-4.018 3.418a13 13 0 0 0-.775 1.308 18.21 18.21 0 0 0-1.369 3.704c-.671 2.535-1.114 5.718-1.329 9.549a104.891 104.891 0 0 0-.152 5.847c0 9.067.95 15.433 2.85 19.1.581 1.16 1.36 2.21 2.301 3.103 1.725 1.598 3.908 2.397 6.549 2.397 1.39.021 2.771-.242 4.057-.773 1.6-.685 2.94-1.824 4.019-3.419.283-.42.542-.857.774-1.308a18.184 18.184 0 0 0 1.37-3.704c.671-2.535 1.113-5.717 1.328-9.548.105-1.948.156-3.898.152-5.848 0-9.067-.95-15.433-2.85-19.1Zm57.05 3.3-17.2 24.8v.1c0 .014.001.027.005.04.009.03.028.048.058.056a.15.15 0 0 0 .037.004h16.5c.114.002.228-.01.34-.035.373-.089.56-.344.56-.765v-24.2a.17.17 0 0 0-.005-.039.073.073 0 0 0-.058-.056.147.147 0 0 0-.037-.005.584.584 0 0 0-.066.004.206.206 0 0 0-.101.032.084.084 0 0 0-.025.028.09.09 0 0 0-.008.036Zm-130 0L15 46.501v.1c0 .014.002.027.005.04.009.03.028.048.058.056a.148.148 0 0 0 .037.004h16.5c.114.002.228-.01.34-.035.373-.089.56-.344.56-.765v-24.2a.146.146 0 0 0-.005-.039.074.074 0 0 0-.058-.056.145.145 0 0 0-.037-.005.582.582 0 0 0-.066.004.206.206 0 0 0-.101.032.076.076 0 0 0-.033.064Z"
fill="url(#a)" />
<defs>
<linearGradient id="a" x1="0" y1="37.501" x2="189.3" y2="37.501" gradientUnits="userSpaceOnUse">
<stop stop-color="#EC008C" />
<stop offset="1" stop-color="#FC6767" />
</linearGradient>
</defs>
</svg>
<svg class="absolute w-1/2 bottom-44 text-white dark:text-gray-800" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320">
<path fill="currentColor" fill-opacity="1"
d="M0,288L48,250.7C96,213,192,139,288,96C384,53,480,43,576,74.7C672,107,768,181,864,186.7C960,192,1056,128,1152,138.7C1248,149,1344,235,1392,277.3L1440,320L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z">
</path>
</svg>
<div class="mt-16 z-10">
<a class="px-6 py-4 rounded-lg bg-gray-100 text-gray-800 hover:text-gray-900 hover:bg-gray-200 transition-colors"
href="{{ .Site.BaseURL }}">Go to home</a>
</div>
</section>
{{ end }}

View File

@ -0,0 +1 @@
<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank" rel="noopener"{{ end }}>{{ .Text }}</a>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="{{ .Lang }}" itemscope itemtype="http://schema.org/WebPage">
{{- partial "head.html" . -}}
<body class="dark:bg-gray-800 dark:text-white relative flex flex-col min-h-screen">
{{- partial "header.html" . -}}
<main class="flex-1">
{{- block "main" . }}{{- end }}
</main>
{{- partial "footer.html" . -}}
</body>
</html>

View File

@ -0,0 +1,36 @@
{{- $.Scratch.Add "index" slice -}}
{{- range .Site.RegularPages -}}
{{- if .Site.Params.searchKeys -}}
{{ $page := . }}
{{ $dict := dict "title" $page.Title }}
{{- range .Site.Params.searchKeys -}}
{{- if (eq . "tags") -}}
{{ $dict = merge $dict (dict "tags" $page.Params.tags) }}
{{- end -}}
{{- if (eq . "date") -}}
{{ $dict = merge $dict (dict "date" $page.Params.Lastmod) }}
{{- end -}}
{{- if (eq . "categories") -}}
{{ $dict = merge $dict (dict "categories" $page.Params.categories) }}
{{- end -}}
{{- if (eq . "author") -}}
{{ $dict = merge $dict (dict "author" $page.Params.author) }}
{{- end -}}
{{- if (eq . "summary") -}}
{{ $dict = merge $dict (dict "contents" $page.Summary) }}
{{- end -}}
{{- if (eq . "contents") -}}
{{ $dict = merge $dict (dict "contents" $page.Content) }}
{{- end -}}
{{- if (eq . "link") -}}
{{ $dict = merge $dict (dict "permalink" $page.Permalink) }}
{{- end -}}
{{- end -}}
{{- $.Scratch.Add "index" $dict -}}
{{- else -}}
{{- $.Scratch.Add "index" (dict "title" .Title "tags" .Params.tags "date" .Params.Lastmod "categories" .Params.categories "contents" .Summary "permalink" .Permalink) -}}
{{- end -}}
{{- end -}}
{{- $.Scratch.Get "index" | jsonify -}}

View File

@ -0,0 +1,15 @@
{{ define "main" }}
<h1 class="container px-6 pt-6 mx-auto text-3xl font-bold">{{ .Title }}</h1>
{{ $paginator := .Paginate .Pages.ByDate.Reverse 6 }}
<div class="container p-6 mx-auto grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 lg:gap-8">
{{ range $paginator.Pages }}
{{- partial "blog-card.html" . -}}
{{ end }}
</div>
{{- partial "pagination.html" . -}}
{{- partial "social.html" . -}}
{{ end }}

View File

@ -0,0 +1,73 @@
{{ define "main" }}
{{ $lastmodstr := (partial "date.html" (dict "date" .Lastmod "language" $.Page.Language "format" "long")) }}
{{ $datestr := (partial "date.html" (dict "date" .Date "language" $.Page.Language "format" "long")) }}
{{ if (and .Params.thumbnail (not (or .Site.Params.hidePageThumbnail .Params.hidePageThumbnail)) ) }}
<div class="relative max-w-5xl mx-auto px-4">
<img src="{{ .Params.thumbnail }}" class="rounded-lg shadow-sm w-full object-contain" />
{{ if not (or (or .Site.Params.hideMeta .Params.hideMeta) false) }}
<div class="absolute top-4 right-8 rounded shadow bg-white text-gray-900 dark:bg-gray-900 dark:text-white px-2 py-0.5">
{{ $datestr }}
</div>
{{ end }}
</div>
{{ end }}
<article class="prose lg:prose-lg mx-auto my-8 dark:prose-dark px-4">
<h1 class="text-2xl font-bold mb-2">{{ .Title }}</h1>
{{ if not (or (or .Site.Params.hideMeta .Params.hideMeta) false) }}
<h5 class="text-sm flex items-center flex-wrap">
<svg xmlns="http://www.w3.org/2000/svg" class="mr-1" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<rect x="4" y="5" width="16" height="16" rx="2" />
<line x1="16" y1="3" x2="16" y2="7" />
<line x1="8" y1="3" x2="8" y2="7" />
<line x1="4" y1="11" x2="20" y2="11" />
<rect x="8" y="15" width="2" height="2" />
</svg>
{{ $datestr | i18n "postedOnDate" }}
{{ if ne $datestr $lastmodstr }}
&nbsp{{ $lastmodstr | i18n "lastModified" }}</h5><h5 class="text-sm flex items-center flex-wrap">
{{ else }}
&nbsp;&bull;&nbsp;
{{ end }}
<svg xmlns="http://www.w3.org/2000/svg" class="mr-1" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<circle cx="12" cy="12" r="9" />
<polyline points="12 7 12 12 15 15" />
</svg>
{{ i18n "readingTime"}}{{ .ReadingTime }}&nbsp;{{ i18n "readTime" }}
&nbsp;&bull;
<svg xmlns="http://www.w3.org/2000/svg" class="mx-1" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<path d="M3 19a9 9 0 0 1 9 0a9 9 0 0 1 9 0" />
<path d="M3 6a9 9 0 0 1 9 0a9 9 0 0 1 9 0" />
<line x1="3" y1="6" x2="3" y2="19" />
<line x1="12" y1="6" x2="12" y2="19" />
<line x1="21" y1="6" x2="21" y2="19" />
</svg>
{{ .WordCount }}&nbsp;{{ i18n "words" }}
{{ if not (or (or .Site.Params.hideOtherLanguages .Params.hideOtherLanguages) false) }}
{{ if .IsTranslated -}}
{{- $sortedTranslations := sort .Translations "Site.Language.Weight" -}}
{{- $links := apply $sortedTranslations "partial" "translation_link.html" "." -}}
{{- $cleanLinks := apply $links "chomp" "." -}}
{{- $linksOutput := delimit $cleanLinks (i18n "translationsSeparator") -}}
&nbsp;&bull;&nbsp;{{ i18n "translationsLabel" }}&nbsp;{{ $linksOutput }}
{{- end }}
{{ end }}
</h5>
{{ end }}
{{ if (or .Site.Params.toc .Params.toc) }}
{{- partial "toc.html" . -}}
{{ end }}
{{ .Content }}
</article>
{{- partial "comments.html" . -}}
{{- partial "social.html" . -}}
{{ end }}

21
layouts/index.html Normal file
View File

@ -0,0 +1,21 @@
{{ define "main" }}
{{- partial "intro.html" . -}}
{{ $frontBundle := .Site.Params.frontBundle | default "blog" }}
<div class="container p-6 mx-auto grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 lg:gap-8">
{{ range first 6 (where .Site.RegularPages.ByDate.Reverse "Type" $frontBundle) }}
{{- partial "blog-card.html" . -}}
{{ end }}
</div>
{{ if gt (len (where .Site.RegularPages.ByDate.Reverse "Type" $frontBundle)) 6 }}
<div class="text-center mb-8">
<a class="px-8 py-3 rounded transition-colors {{ .Site.Params.ascentColor | default "bg-pink-50" }}
text-gray-500 hover:text-gray-800 dark:bg-gray-900 dark:text-gray-400 dark:hover:text-white"
href="{{ (index (.Site.Menus.main) 0).URL | absLangURL }}" lang="{{ .Lang }}">
{{ i18n "morePosts" }}
</a>
</div>
{{ end }}
{{- partial "social.html" . -}}
{{ end }}

View File

@ -0,0 +1,27 @@
<div class="p-2">
<a href="{{ .Permalink }}">
{{ if .Params.thumbnail }}
<div class="relative">
<img src="{{ .Params.thumbnail }}" alt="{{ .Params.title }}" class="rounded-lg shadow-sm w-full h-52 object-cover" />
{{ if not (or (or .Site.Params.hideMeta .Params.hideMeta) false) }}
<div class="absolute top-4 right-4 rounded shadow bg-white text-gray-900 dark:bg-gray-900 dark:text-white text-sm px-2 py-0.5">
{{ partial "date.html" (dict "date" .Date "language" $.Page.Language "format" "short") }}
</div>
{{ end }}
</div>
{{ end }}
<div class="my-2 text-xl font-semibold">{{ .Params.title }}</div>
<div>{{ .Params.description }}</div>
</a>
{{ if not (or (or .Site.Params.hideOtherLanguages .Params.hideOtherLanguages) false) }}
{{ if .IsTranslated -}}
<div style="font-style: italic;font-size: smaller;">
{{- $sortedTranslations := sort .Translations "Site.Language.Weight" -}}
{{- $links := apply $sortedTranslations "partial" "translation_link.html" "." -}}
{{- $cleanLinks := apply $links "chomp" "." -}}
{{- $linksOutput := delimit $cleanLinks (i18n "translationsSeparator") -}}
{{ i18n "translationsLabel" }}{{ $linksOutput }}
</div>
{{- end }}
{{ end }}
</div>

View File

@ -0,0 +1,38 @@
{{ if .Site.Params.comments.system }}
<div class="px-2 mb-2 max-w-5xl mx-auto">
{{ if eq .Site.Params.comments.system "cactus.chat" }}
<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">
<style>
:root {
--cactus-button-color: #647eff;
}
:root.dark {
--cactus-button-color: #647eff;
--cactus-border-color: darkgrey;
--cactus-text-color: white;
--cactus-text-color--soft: lightgray;
--cactus-button-text-color: white;
}
.cactus-comment-displayname {
font-weight: bold;
cursor: pointer;
/* todo: remove after using all: unset */
text-decoration: none;
color: inherit !important;
}
</style>
<div id="comment-section"></div>
<script>
initComments({
node: document.getElementById("comment-section"),
defaultHomeserverUrl: "https://matrix.cactus.chat:8448",
serverName: "cactus.chat",
siteName: "{{ .Site.Params.comments.siteName }}",
commentSectionId: "{{ .Permalink | md5 }}"
})
</script>
{{ end }}
</div>
{{ end }}

View File

@ -0,0 +1,13 @@
{{ if or (eq "de" .language.Lang) (eq "fr" .language.Lang) }}
{{ if eq "long" .format }}
{{ .date.Format "02" }}. {{ i18n (.date.Format "January")}} {{ .date.Format "2006"}}
{{ else }}
{{ .date.Format "02" }}. {{ substr (i18n (.date.Format "January")) 0 3 }} {{ .date.Format "06"}}
{{ end }}
{{ else }}
{{ if eq "long" .format }}
{{ .date.Format "January 2, 2006" }}
{{ else }}
{{ .date.Format "Jan 2, 06" }}
{{ end }}
{{ end }}

View File

@ -0,0 +1,81 @@
<footer class="container p-6 mx-auto flex justify-between items-center">
<span class="text-sm font-light">
{{ if (isset .Site.Params "copyright") }}
{{ .Site.Params.copyright | markdownify | emojify }}
{{ else }}
{{ dateFormat "2006" now }} © {{ .Site.Title }}
{{ end }}
</span>
<span onclick="window.scrollTo({top: 0, behavior: 'smooth'})" class="p-1 cursor-pointer">
<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M18 15l-6 -6l-6 6h12" />
</svg>
</span>
</footer>
{{ if .Site.Params.enableSearch }}
{{- partial "search-ui.html" . -}}
{{ end }}
{{ template "_internal/google_analytics.html" . }}
{{ if ge (len .Site.Languages) 3 }}
<script>
const languageMenuButton = document.querySelector('.language-switcher');
const languageDropdown = document.querySelector('.language-dropdown');
languageMenuButton.addEventListener('click', (evt) => {
evt.preventDefault()
if (languageDropdown.classList.contains('hidden')) {
languageDropdown.classList.remove('hidden')
languageDropdown.classList.add('flex')
} else {
languageDropdown.classList.add('hidden');
languageDropdown.classList.remove('flex');
}
})
</script>
{{ end }}
{{ if .Site.Params.darkModeToggle }}
<script>
// On page load or when changing themes
const darkmode = document.querySelector('.toggle-dark-mode');
function toggleDarkMode() {
if (document.documentElement.classList.contains('dark')) {
document.documentElement.classList.remove('dark')
localStorage.setItem('darkmode', 'light')
} else {
document.documentElement.classList.add('dark')
localStorage.setItem('darkmode', 'dark')
}
}
if (darkmode) {
darkmode.addEventListener('click', toggleDarkMode);
}
const darkStorage = localStorage.getItem('darkmode');
const isBrowserDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
if (!darkStorage && isBrowserDark) {
document.documentElement.classList.add('dark');
}
if (darkStorage && darkStorage === 'dark') {
toggleDarkMode();
}
</script>
{{ end }}
<script>
const mobileMenuButton = document.querySelector('.mobile-menu-button')
const mobileMenu = document.querySelector('.mobile-menu')
function toggleMenu() {
mobileMenu.classList.toggle('hidden');
mobileMenu.classList.toggle('flex');
}
if(mobileMenu && mobileMenuButton){
mobileMenuButton.addEventListener('click', toggleMenu)
}
</script>

View File

@ -0,0 +1,66 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="{{ if (isset .Site.Params "favicon") }}{{ .Site.Params.favicon }}{{ else }}/favicon.ico{{ end }}">
<title>
{{ if not .IsHome }}{{ .Title }} - {{ end }}{{ site.Title }}
</title>
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}" />
{{- if .Keywords }}
<meta name="keywords" content="{{ delimit .Keywords "," }}" />
{{ end -}}
{{- if .Params.Author }}
<meta name="author" content="{{ .Params.Author}}" />
{{ end -}}
{{ hugo.Generator }}
{{- $styles := resources.Get "css/styles.css" | postCSS (dict "config" "./assets/css/postcss.config.js") -}}
{{- if .Site.IsServer }}
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" />
{{ else }}
{{- $styles := $styles| minify | fingerprint | resources.PostProcess -}}
<link
rel="stylesheet"
href="{{ $styles.Permalink }}"
integrity="{{ $styles.Data.Integrity }}"
/>
{{ end -}}
<!-- Katex support -->
{{ if .Params.math }}
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/katex@0.10.0-rc.1/dist/katex.min.css"
integrity="sha384-D+9gmBxUQogRLqvARvNLmA9hS2x//eK1FhVb9PiU86gmcrBrJAQT8okdJ4LMp2uv"
crossorigin="anonymous"
>
<script defer
src="https://cdn.jsdelivr.net/npm/katex@0.10.0-rc.1/dist/katex.min.js"
integrity="sha384-483A6DwYfKeDa0Q52fJmxFXkcPCFfnXMoXblOkJ4JcA8zATN6Tm78UNL72AKk+0O"
crossorigin="anonymous"
></script>
<script defer
src="https://cdn.jsdelivr.net/npm/katex@0.10.0-rc.1/dist/contrib/auto-render.min.js"
integrity="sha384-yACMu8JWxKzSp/C1YV86pzGiQ/l1YUfE8oPuahJQxzehAjEt2GiQuy/BIvl9KyeF"
crossorigin="anonymous"
onload="renderMathInElement(document.body);"
></script>
{{ end }}
{{ range .AlternativeOutputFormats -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end -}}
{{ template "_internal/opengraph.html" . }}
{{ template "_internal/twitter_cards.html" . }}
{{ template "_internal/schema.html" . }}
{{ if gt (len .Site.Languages) 1}}
<meta name="lang" content="{{ .Site.Language }}" />
{{ end }}
</head>

View File

@ -0,0 +1,105 @@
<header class="container flex justify-between md:justify-between gap-4 flex-wrap p-6 mx-auto relative">
<a href="{{ .Site.Home.Permalink }}" class="capitalize font-extrabold text-2xl">
{{ if .Site.Params.logo }}
<img src="{{ .Site.Params.logo }}" alt="{{ .Site.Title }}" class="h-8 max-w-full" />
{{ else }}
{{ .Site.Title }}
{{ end }}
</a>
<button class="mobile-menu-button md:hidden">
<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<line x1="4" y1="8" x2="20" y2="8" />
<line x1="4" y1="16" x2="20" y2="16" />
</svg>
</button>
<ul class="mobile-menu absolute z-10 px-6 pb-6 md:p-0 top-full left-0 w-full md:w-auto md:relative hidden md:flex flex-col md:flex-row items-end md:items-center gap-4 lg:gap-6 bg-white dark:bg-gray-800">
{{ range .Site.Menus.main }}
<li><a href="{{ .URL | relLangURL }}">{{ .Name }}</a></li>
{{ end }}
{{ if .Site.IsMultiLingual }}
{{ if ge (len .Site.Languages) 3 }}
<li class="relative cursor-pointer">
<span class="language-switcher flex items-center gap-2">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<circle cx="12" cy="12" r="9" />
<line x1="3.6" y1="9" x2="20.4" y2="9" />
<line x1="3.6" y1="15" x2="20.4" y2="15" />
<path d="M11.5 3a17 17 0 0 0 0 18" />
<path d="M12.5 3a17 17 0 0 1 0 18" />
</svg>
<a>{{ i18n "languageSwitcherLabel" }}</a>
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14"
viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round"
stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M18 15l-6 -6l-6 6h12" transform="rotate(180 12 12)" />
</svg>
</span>
<div
class="language-dropdown absolute top-full mt-2 left-0 flex-col gap-2 bg-gray-100 dark:bg-gray-900 dark:text-white z-10 hidden">
{{ range .Site.Languages }}
{{ if not (eq .Lang $.Site.Language.Lang) }}
<a class="px-3 py-2 hover:bg-gray-200 dark:hover:bg-gray-700" href="/{{ .Lang }}" lang="{{ .Lang }}">{{ default .Lang .LanguageName }}</a>
{{ end }}
{{ end }}
</div>
</li>
{{ else }}
<li class="flex items-center">
{{ range .Site.Languages }}
{{ if not (eq .Lang $.Site.Language.Lang) }}
<svg xmlns="http://www.w3.org/2000/svg" class="mr-2" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<circle cx="12" cy="12" r="9" />
<line x1="3.6" y1="9" x2="20.4" y2="9" />
<line x1="3.6" y1="15" x2="20.4" y2="15" />
<path d="M11.5 3a17 17 0 0 0 0 18" />
<path d="M12.5 3a17 17 0 0 1 0 18" />
</svg>
<a href="/{{ .Lang }}" lang="{{ .Lang }}">{{ default .Lang .LanguageName }}</a>
{{ end }}
{{ end }}
</li>
{{ end }}
{{ end }}
{{ if .Site.Params.enableSearch }}
<li class="grid place-items-center">
<span class="open-search inline-block cursor-pointer">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<circle cx="10" cy="10" r="7" />
<line x1="21" y1="21" x2="15" y2="15" />
</svg>
</span>
</li>
{{ end }}
{{ if .Site.Params.darkModeToggle }}
<li class="grid place-items-center">
<span class="toggle-dark-mode inline-block cursor-pointer">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<circle cx="12" cy="12" r="3" />
<line x1="12" y1="5" x2="12" y2="5.01" />
<line x1="17" y1="7" x2="17" y2="7.01" />
<line x1="19" y1="12" x2="19" y2="12.01" />
<line x1="17" y1="17" x2="17" y2="17.01" />
<line x1="12" y1="19" x2="12" y2="19.01" />
<line x1="7" y1="17" x2="7" y2="17.01" />
<line x1="5" y1="12" x2="5" y2="12.01" />
<line x1="7" y1="7" x2="7" y2="7.01" />
</svg>
</span>
</li>
{{ end }}
</ul>
</header>

View File

@ -0,0 +1,9 @@
<section class="{{ .Site.Params.ascentColor | default "bg-pink-50" }} dark:bg-gray-900">
<div class="container max-w-screen-lg mx-auto px-6 py-12 grid md:grid-cols-2 gap-4 lg:gap-16 items-center">
<div>
<h1 class="text-4xl font-bold mb-4">{{ .Site.Params.introTitle | safeHTML}}</h1>
<p class="font-light text-lg">{{ .Site.Params.introSubtitle | safeHTML}}</p>
</div>
<img class="rounded-lg shadow-sm" src="{{ .Site.Params.introPhoto }}" alt="{{ .Site.Title }}" />
</div>
</section>

View File

@ -0,0 +1,3 @@
<div class="grid place-items-center mb-8">
{{ template "_internal/pagination.html" . }}
</div>

View File

@ -0,0 +1,35 @@
<div class="search-ui absolute top-0 left-0 w-full h-full bg-white dark:bg-gray-800 hidden">
<div class="container max-w-3xl mx-auto p-12">
<div class="relative">
<div class="my-4 text-center text-2xl font-bold">Search</div>
<span class="p-2 absolute right-0 top-0 cursor-pointer close-search">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<line x1="18" y1="6" x2="6" y2="18" />
<line x1="6" y1="6" x2="18" y2="18" />
</svg>
</span>
</div>
<input type="search" class="py-2 px-3 w-full dark:text-black border dark:border-transparent"
placeholder="Suchen..." />
<div class="search-results text-lg font-medium my-4 hidden">Suchergebnisse</div>
<ul class="search-list my-2">
</ul>
<div class="no-results text-center my-8 hidden">
<div class="text-xl font-semibold mb-2">Keine Suchergebnisse</div>
<p class="font-light text-sm">Versuche deine Anfrage anzupassen</p>
</div>
</div>
</div>
{{ $fuse := resources.Get "js/fuse.min.js" }}
{{ $search := resources.Get "js/search.js" }}
{{ $concatjs := slice $fuse $search | resources.Concat "js/scripts.js" | resources.Minify }}
<script src="{{ $concatjs.Permalink }}"></script>

View File

@ -0,0 +1,488 @@
<div class="{{ .Site.Params.ascentColor | default "bg-pink-50" }} dark:bg-gray-900">
<div class="container px-4 py-12 mx-auto max-w-4xl grid grid-cols-1 md:grid-cols-2 gap-4 items-center">
<div>
<div class="text-2xl font-bold mb-2">{{ .Site.Params.homepage.social.title }}</div>
<p class="opacity-60">{{ .Site.Params.homepage.social.description }}</p>
</div>
<ul class="flex justify-center gap-x-3 flex-wrap gap-y-2">
{{range .Site.Params.homepage.social.icons}}
{{ if eq .website "twitter" }}
<li>
<a
href="{{ .url }}"
target="_blank"
rel="noopener"
aria-label="Twitter"
class="p-1 inline-block rounded-full border border-transparent text-gray-500 hover:text-gray-800 hover:border-gray-800 cursor-pointer transition-colors dark:text-gray-600 dark:hover:border-gray-300 dark:hover:text-gray-300"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
>
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path
d="M22 4.01c-1 .49 -1.98 .689 -3 .99c-1.121 -1.265 -2.783 -1.335 -4.38 -.737s-2.643 2.06 -2.62 3.737v1c-3.245 .083 -6.135 -1.395 -8 -4c0 0 -4.182 7.433 4 11c-1.872 1.247 -3.739 2.088 -6 2c3.308 1.803 6.913 2.423 10.034 1.517c3.58 -1.04 6.522 -3.723 7.651 -7.742a13.84 13.84 0 0 0 .497 -3.753c-.002 -.249 1.51 -2.772 1.818 -4.013z"
/>
</svg>
</a>
</li>
{{ end }}
{{ if eq .website "mastodon" }}
<li>
<a
href="{{ .url }}"
target="_blank"
rel="noopener"
aria-label="Mastodon"
class="p-1 inline-block rounded-full border border-transparent text-gray-500 hover:text-gray-800 hover:border-gray-800 cursor-pointer transition-colors dark:text-gray-600 dark:hover:border-gray-300 dark:hover:text-gray-300"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
>
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M18.648 15.254c-1.816 1.763 -6.648 1.626 -6.648 1.626a18.262 18.262 0 0 1 -3.288 -.256c1.127 1.985 4.12 2.81 8.982 2.475c-1.945 2.013 -13.598 5.257 -13.668 -7.636l-.026 -1.154c0 -3.036 .023 -4.115 1.352 -5.633c1.671 -1.91 6.648 -1.666 6.648 -1.666s4.977 -.243 6.648 1.667c1.329 1.518 1.352 2.597 1.352 5.633s-.456 4.074 -1.352 4.944z"></path>
<path d="M12 11.204v-2.926c0 -1.258 -.895 -2.278 -2 -2.278s-2 1.02 -2 2.278v4.722m4 -4.722c0 -1.258 .895 -2.278 2 -2.278s2 1.02 2 2.278v4.722"></path>
</svg>
</a>
</li>
{{ end }}
{{ if eq .website "linkedin" }}
<li>
<a
href="{{ .url }}"
target="_blank"
rel="noopener"
aria-label="LinkedIn"
class="p-1 inline-block rounded-full border border-transparent text-gray-500 hover:text-gray-800 hover:border-gray-800 cursor-pointer transition-colors dark:text-gray-600 dark:hover:border-gray-300 dark:hover:text-gray-300"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
>
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<rect x="4" y="4" width="16" height="16" rx="2" />
<line x1="8" y1="11" x2="8" y2="16" />
<line x1="8" y1="8" x2="8" y2="8.01" />
<line x1="12" y1="16" x2="12" y2="11" />
<path d="M16 16v-3a2 2 0 0 0 -4 0" />
</svg>
</a>
</li>
{{ end }}
{{ if eq .website "xing" }}
<li>
<a
href="{{ .url }}"
target="_blank"
rel="noopener"
aria-label="xing"
class="p-1 inline-block rounded-full border border-transparent text-gray-500 hover:text-gray-800 hover:border-gray-800 cursor-pointer transition-colors dark:text-gray-600 dark:hover:border-gray-300 dark:hover:text-gray-300"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
>
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M14.48736,22.8L9.65664,14.33208L17.154,1.2H22.2L14.70288,14.33208L19.53384,22.8H14.48736z M6.55728,16.26888l3.74808-6.17064l-2.81088-4.9512 H2.73696l2.81112,4.9512L1.8,16.26888H6.55728z"/>
</svg>
</a>
</li>
{{ end }}
{{ if eq .website "github" }}
<li>
<a
href="{{ .url }}"
target="_blank"
rel="noopener"
aria-label="GitHub"
class="p-1 inline-block rounded-full border border-transparent text-gray-500 hover:text-gray-800 hover:border-gray-800 cursor-pointer transition-colors dark:text-gray-600 dark:hover:border-gray-300 dark:hover:text-gray-300"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
>
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path
d="M9 19c-4.3 1.4 -4.3 -2.5 -6 -3m12 5v-3.5c0 -1 .1 -1.4 -.5 -2c2.8 -.3 5.5 -1.4 5.5 -6a4.6 4.6 0 0 0 -1.3 -3.2a4.2 4.2 0 0 0 -.1 -3.2s-1.1 -.3 -3.5 1.3a12.3 12.3 0 0 0 -6.2 0c-2.4 -1.6 -3.5 -1.3 -3.5 -1.3a4.2 4.2 0 0 0 -.1 3.2a4.6 4.6 0 0 0 -1.3 3.2c0 4.6 2.7 5.7 5.5 6c-.6 .6 -.6 1.2 -.5 2v3.5"
/>
</svg>
</a>
</li>
{{ end }}
{{ if eq .website "telegram" }}
<li>
<a
href="{{ .url }}"
target="_blank"
rel="noopener"
aria-label="Telegram"
class="p-1 inline-block rounded-full border border-transparent text-gray-500 hover:text-gray-800 hover:border-gray-800 cursor-pointer transition-colors dark:text-gray-600 dark:hover:border-gray-300 dark:hover:text-gray-300"
>
<svg
xmlns="http://www.w3.org/2000/svg"
class="icon icon-tabler icon-tabler-brand-telegram"
width="24"
height="24"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"/> </svg>
</a>
</li>
{{ end }}
{{ if eq .website "buymeacoffee" }}
<li>
<a
href="{{ .url }}"
target="_blank"
rel="noopener"
aria-label="Buy Me A Coffee"
class="p-1 inline-block rounded-full border border-transparent text-gray-500 hover:text-gray-800 hover:border-gray-800 cursor-pointer transition-colors dark:text-gray-600 dark:hover:border-gray-300 dark:hover:text-gray-300"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
>
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M20.216 6.415l-.132-.666c-.119-.598-.388-1.163-1.001-1.379-.197-.069-.42-.098-.57-.241-.152-.143-.196-.366-.231-.572-.065-.378-.125-.756-.192-1.133-.057-.325-.102-.69-.25-.987-.195-.4-.597-.634-.996-.788a5.723 5.723 0 00-.626-.194c-1-.263-2.05-.36-3.077-.416a25.834 25.834 0 00-3.7.062c-.915.083-1.88.184-2.75.5-.318.116-.646.256-.888.501-.297.302-.393.77-.177 1.146.154.267.415.456.692.58.36.162.737.284 1.123.366 1.075.238 2.189.331 3.287.37 1.218.05 2.437.01 3.65-.118.299-.033.598-.073.896-.119.352-.054.578-.513.474-.834-.124-.383-.457-.531-.834-.473-.466.074-.96.108-1.382.146-1.177.08-2.358.082-3.536.006a22.228 22.228 0 01-1.157-.107c-.086-.01-.18-.025-.258-.036-.243-.036-.484-.08-.724-.13-.111-.027-.111-.185 0-.212h.005c.277-.06.557-.108.838-.147h.002c.131-.009.263-.032.394-.048a25.076 25.076 0 013.426-.12c.674.019 1.347.067 2.017.144l.228.031c.267.04.533.088.798.145.392.085.895.113 1.07.542.055.137.08.288.111.431l.319 1.484a.237.237 0 01-.199.284h-.003c-.037.006-.075.01-.112.015a36.704 36.704 0 01-4.743.295 37.059 37.059 0 01-4.699-.304c-.14-.017-.293-.042-.417-.06-.326-.048-.649-.108-.973-.161-.393-.065-.768-.032-1.123.161-.29.16-.527.404-.675.701-.154.316-.199.66-.267 1-.069.34-.176.707-.135 1.056.087.753.613 1.365 1.37 1.502a39.69 39.69 0 0011.343.376.483.483 0 01.535.53l-.071.697-1.018 9.907c-.041.41-.047.832-.125 1.237-.122.637-.553 1.028-1.182 1.171-.577.131-1.165.2-1.756.205-.656.004-1.31-.025-1.966-.022-.699.004-1.556-.06-2.095-.58-.475-.458-.54-1.174-.605-1.793l-.731-7.013-.322-3.094c-.037-.351-.286-.695-.678-.678-.336.015-.718.3-.678.679l.228 2.185.949 9.112c.147 1.344 1.174 2.068 2.446 2.272.742.12 1.503.144 2.257.156.966.016 1.942.053 2.892-.122 1.408-.258 2.465-1.198 2.616-2.657.34-3.332.683-6.663 1.024-9.995l.215-2.087a.484.484 0 01.39-.426c.402-.078.787-.212 1.074-.518.455-.488.546-1.124.385-1.766zm-1.478.772c-.145.137-.363.201-.578.233-2.416.359-4.866.54-7.308.46-1.748-.06-3.477-.254-5.207-.498-.17-.024-.353-.055-.47-.18-.22-.236-.111-.71-.054-.995.052-.26.152-.609.463-.646.484-.057 1.046.148 1.526.22.577.088 1.156.159 1.737.212 2.48.226 5.002.19 7.472-.14.45-.06.899-.13 1.345-.21.399-.072.84-.206 1.08.206.166.281.188.657.162.974a.544.544 0 01-.169.364zm-6.159 3.9c-.862.37-1.84.788-3.109.788a5.884 5.884 0 01-1.569-.217l.877 9.004c.065.78.717 1.38 1.5 1.38 0 0 1.243.065 1.658.065.447 0 1.786-.065 1.786-.065.783 0 1.434-.6 1.499-1.38l.94-9.95a3.996 3.996 0 00-1.322-.238c-.826 0-1.491.284-2.26.613z"/>
</svg>
</a>
</li>
{{ end }}
{{ if eq .website "medium" }}
<li>
<a
href="{{ .url }}"
target="_blank"
rel="noopener"
aria-label="Medium"
class="p-1 inline-block rounded-full border border-transparent text-gray-500 hover:text-gray-800 hover:border-gray-800 cursor-pointer transition-colors dark:text-gray-600 dark:hover:border-gray-300 dark:hover:text-gray-300"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
>
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<rect x="4" y="4" width="16" height="16" rx="2" />
<path d="M8 9h1l3 3l3 -3h1" />
<line x1="8" y1="15" x2="10" y2="15" />
<line x1="14" y1="15" x2="16" y2="15" />
<line x1="9" y1="9" x2="9" y2="15" />
<line x1="15" y1="9" x2="15" y2="15" />
</svg>
</a>
</li>
{{ end }}
{{ if eq .website "reddit" }}
<li>
<a
href="{{ .url }}"
target="_blank"
rel="noopener"
aria-label="Medium"
class="p-1 inline-block rounded-full border border-transparent text-gray-500 hover:text-gray-800 hover:border-gray-800 cursor-pointer transition-colors dark:text-gray-600 dark:hover:border-gray-300 dark:hover:text-gray-300"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
>
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path
d="M12 8c2.648 0 5.028 .826 6.675 2.14a2.5 2.5 0 0 1 2.326 4.36c0 3.59 -4.03 6.5 -9 6.5c-4.875 0 -8.845 -2.8 -9 -6.294l-1 -.206a2.5 2.5 0 0 1 2.326 -4.36c1.646 -1.313 4.026 -2.14 6.674 -2.14z"
/>
<path d="M12 8l1 -5l6 1" />
<circle cx="19" cy="4" r="1" />
<circle cx="9" cy="13" r=".5" fill="currentColor" />
<circle cx="15" cy="13" r=".5" fill="currentColor" />
<path d="M10 17c.667 .333 1.333 .5 2 .5s1.333 -.167 2 -.5" />
</svg>
</a>
</li>
{{ end }}
{{ if eq .website "dribbble" }}
<li>
<a
href="{{ .url }}"
target="_blank"
rel="noopener"
aria-label="Dribbble"
class="p-1 inline-block rounded-full border border-transparent text-gray-500 hover:text-gray-800 hover:border-gray-800 cursor-pointer transition-colors dark:text-gray-600 dark:hover:border-gray-300 dark:hover:text-gray-300"
>
<svg
xmlns="http://www.w3.org/2000/svg"
class="icon icon-tabler icon-tabler-brand-dribbble"
width="24"
height="24"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
>
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<circle cx="12" cy="12" r="9" />
<path d="M9 3.6c5 6 7 10.5 7.5 16.2" />
<path d="M6.4 19c3.5 -3.5 6 -6.5 14.5 -6.4" />
<path d="M3.1 10.75c5 0 9.814 -.38 15.314 -5" />
</svg>
</a>
</li>
{{ end }}
{{ if eq .website "youtube" }}
<li>
<a
href="{{ .url }}"
target="_blank"
rel="noopener"
aria-label="YouTube"
class="p-1 inline-block rounded-full border border-transparent text-gray-500 hover:text-gray-800 hover:border-gray-800 cursor-pointer transition-colors dark:text-gray-600 dark:hover:border-gray-300 dark:hover:text-gray-300"
>
<svg
xmlns="http://www.w3.org/2000/svg"
class="icon icon-tabler icon-tabler-brand-youtube"
width="24"
height="24"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
>
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<circle cx="12" cy="12" r="9" />
<path d="M10 9l5 3l-5 3z" />
</svg>
</a>
</li>
{{ end }}
{{ if eq .website "instagram" }}
<li>
<a
href="{{ .url }}"
target="_blank"
rel="noopener"
aria-label="Instagram"
class="p-1 inline-block rounded-full border border-transparent text-gray-500 hover:text-gray-800 hover:border-gray-800 cursor-pointer transition-colors dark:text-gray-600 dark:hover:border-gray-300 dark:hover:text-gray-300"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24px"><path fill="#647eff" d="M7.8,2H16.2C19.4,2 22,4.6 22,7.8V16.2A5.8,5.8 0 0,1 16.2,22H7.8C4.6,22 2,19.4 2,16.2V7.8A5.8,5.8 0 0,1 7.8,2M7.6,4A3.6,3.6 0 0,0 4,7.6V16.4C4,18.39 5.61,20 7.6,20H16.4A3.6,3.6 0 0,0 20,16.4V7.6C20,5.61 18.39,4 16.4,4H7.6M17.25,5.5A1.25,1.25 0 0,1 18.5,6.75A1.25,1.25 0 0,1 17.25,8A1.25,1.25 0 0,1 16,6.75A1.25,1.25 0 0,1 17.25,5.5M12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9Z"/></svg>
</a>
</li>
{{ end }}
{{ if eq .website "stackoverflow" }}
<li>
<a
href="{{ .url }}"
target="_blank"
rel="noopener"
aria-label="stackoverflow"
class="p-1 inline-block rounded-full border border-transparent text-gray-500 hover:text-gray-800 hover:border-gray-800 cursor-pointer transition-colors dark:text-gray-600 dark:hover:border-gray-300 dark:hover:text-gray-300"
>
<svg xmlns="http://www.w3.org/2000/svg"
class="icon icon-tabler icon-tabler-brand-stackoverflow"
width="23"
height="23"
viewBox="-135 22 32 38"
stroke-width="0.2"
stroke="currentColor"
fill="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
>
<polygon points="-108.5,56.2 -108.5,46.3 -105.2,46.3 -105.2,59.5 -135,59.5 -135,46.3 -131.7,46.3 -131.7,56.2 "/>
<path d="M-128,45.4l16.2,3.4l0.7-3.2l-16.2-3.4L-128,45.4z M-125.9,37.6l15,7l1.4-3l-15-7L-125.9,37.6z M-121.7,30.2l12.7,10.6l2.1-2.5l-12.7-10.6L-121.7,30.2z M-113.5,22.4l-2.7,2l9.9,13.3l2.7-2L-113.5,22.4z M-128.4,52.9h16.6 v-3.3h-16.6V52.9z"/>
</svg>
</a>
</li>
{{ end }}
{{ if eq .website "xda" }}
<li>
<a
href="{{ .url }}"
target="_blank"
rel="noopener"
aria-label="XDA"
class="p-1 inline-block rounded-full border border-transparent text-gray-500 hover:text-gray-800 hover:border-gray-800 cursor-pointer transition-colors dark:text-gray-600 dark:hover:border-gray-300 dark:hover:text-gray-300"
>
<svg
xmlns="http://www.w3.org/2000/svg"
class="icon icon-tabler icon-tabler-brand-xda"
width="24"
height="24"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M13.84 3.052V0h7.843v17.583H13.84v-3.024h4.591V3.052zM5.569 14.53V3.024h4.592V0H2.318v17.583H6.98L10.16 24v-9.483z"/>
</svg>
</a>
</li>
{{ end }}
{{ if eq .website "tiktok" }}
<li>
<a
href="{{ .url }}"
target="_blank"
rel="noopener"
aria-label="Tiktok"
class="p-1 inline-block rounded-full border border-transparent text-gray-500 hover:text-gray-800 hover:border-gray-800 cursor-pointer transition-colors dark:text-gray-600 dark:hover:border-gray-300 dark:hover:text-gray-300"
>
<svg xmlns="http://www.w3.org/2000/svg"
class="icon icon-tabler icon-tabler-brand-tiktok"
width="23"
height="23"
viewBox="0 0 448 512"
stroke-width="30"
stroke="currentColor"
fill="none">
<path d="M448,209.91a210.06,210.06,0,0,1-122.77-39.25V349.38A162.55,162.55,0,1,1,185,188.31V278.2a74.62,74.62,0,1,0,52.23,71.18V0l88,0a121.18,121.18,0,0,0,1.86,22.17h0A122.18,122.18,0,0,0,381,102.39a121.43,121.43,0,0,0,67,20.14Z"/>
</svg>
</a>
</li>
{{ end }}
{{ if eq .website "googlescholar" }}
<li>
<a
href="{{ .url }}"
target="_blank"
rel="noopener"
aria-label="Google Scholar"
class="p-1 inline-block rounded-full border border-transparent text-gray-500 hover:text-gray-800 hover:border-gray-800 cursor-pointer transition-colors dark:text-gray-600 dark:hover:border-gray-300 dark:hover:text-gray-300"
>
<svg xmlns="http://www.w3.org/2000/svg"
class="icon icon-tabler icon-tabler-brand-googlescholar"
width="22"
height="23"
viewBox="0 0 24 24"
stroke-width="1.4"
stroke="currentColor"
fill="none">
<path d="M5.242 13.769L0 9.5 12 0l12 9.5-5.242 4.269C17.548 11.249 14.978 9.5 12 9.5c-2.977 0-5.548 1.748-6.758 4.269zM12 10a7 7 0 1 0 0 14 7 7 0 0 0 0-14z"/>
</svg>
</a>
</li>
{{ end }}
{{ if eq .website "facebook" }}
<li>
<a
href="{{ .url }}"
target="_blank"
rel="noopener"
aria-label="Facebook"
class="p-1 inline-block rounded-full border border-transparent text-gray-500 hover:text-gray-800 hover:border-gray-800 cursor-pointer transition-colors dark:text-gray-600 dark:hover:border-gray-300 dark:hover:text-gray-300"
>
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-brand-facebook" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M7 10v4h3v7h4v-7h3l1 -4h-4v-2a1 1 0 0 1 1 -1h3v-4h-3a5 5 0 0 0 -5 5v2h-3"></path>
</svg>
</a>
</li>
{{ end }}
{{ if eq .website "behance" }}
<li>
<a
href="{{ .url }}"
target="_blank"
rel="noopener"
aria-label="Behance"
class="p-1 inline-block rounded-full border border-transparent text-gray-500 hover:text-gray-800 hover:border-gray-800 cursor-pointer transition-colors dark:text-gray-600 dark:hover:border-gray-300 dark:hover:text-gray-300"
>
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-brand-behance" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M3 18v-12h4.5a3 3 0 0 1 0 6a3 3 0 0 1 0 6h-4.5"></path>
<line x1="3" y1="12" x2="7.5" y2="12"></line>
<path d="M14 13h7a3.5 3.5 0 0 0 -7 0v2a3.5 3.5 0 0 0 6.64 1"></path>
<line x1="16" y1="6" x2="19" y2="6"></line>
</svg>
</a>
</li>
{{ end }}
{{end}}
</ul>
</div>
</div>

94
layouts/partials/toc.html Normal file
View File

@ -0,0 +1,94 @@
{{- $headers := findRE "<h[1-4].*?>(.|\n])+?</h[1-4]>" .Content -}}
{{- $has_headers := ge (len $headers) 1 -}}
{{- if $has_headers -}}
{{- $largest := 6 -}}
{{- range $headers -}}
{{- $headerLevel := index (findRE "[1-4]" . 1) 0 -}}
{{- $headerLevel := len (seq $headerLevel) -}}
{{- if lt $headerLevel $largest -}}
{{- $largest = $headerLevel -}}
{{- end -}}
{{- end -}}
{{- $firstHeaderLevel := len (seq (index (findRE "[1-4]" (index $headers 0) 1) 0)) -}}
{{- $.Scratch.Set "bareul" slice -}}
<details id="TableOfContents" class="px-4 mt-4 bg-gray-100 dark:bg-gray-700 rounded toc">
<summary class="flex items-center font-bold py-2 px-4 cursor-pointer justify-between select-none text-black dark:text-white">
<span>Inhalt</span>
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-chevron-down" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<polyline points="6 9 12 15 18 9"></polyline>
</svg>
</summary>
<ul class="mt-2 pb-4">
{{- range seq (sub $firstHeaderLevel $largest) -}}
<ul>
{{- $.Scratch.Add "bareul" (sub (add $largest .) 1) -}}
{{- end -}}
{{- range $i, $header := $headers -}}
{{- $headerLevel := index (findRE "[1-4]" . 1) 0 -}}
{{- $headerLevel := len (seq $headerLevel) -}}
{{/* get id="xyz" */}}
{{ $id := index (findRE "(id=\"(.*?)\")" $header 9) 0 }}
{{/* strip id="" to leave xyz (no way to get regex capturing groups in hugo :( */}}
{{ $cleanedID := replace (replace $id "id=\"" "") "\"" "" }}
{{- $header := replaceRE "<h[1-4].*?>((.|\n])+?)</h[1-4]>" "$1" $header -}}
{{- if ne $i 0 -}}
{{- $prevHeaderLevel := index (findRE "[1-4]" (index $headers (sub $i 1)) 1) 0 -}}
{{- $prevHeaderLevel := len (seq $prevHeaderLevel) -}}
{{- if gt $headerLevel $prevHeaderLevel -}}
{{- range seq $prevHeaderLevel (sub $headerLevel 1) -}}
<ul>
{{/* the first should not be recorded */}}
{{- if ne $prevHeaderLevel . -}}
{{- $.Scratch.Add "bareul" . -}}
{{- end -}}
{{- end -}}
{{- else -}}
</li>
{{- if lt $headerLevel $prevHeaderLevel -}}
{{- range seq (sub $prevHeaderLevel 1) -1 $headerLevel -}}
{{- if in ($.Scratch.Get "bareul") . -}}
</ul>
{{/* manually do pop item */}}
{{- $tmp := $.Scratch.Get "bareul" -}}
{{- $.Scratch.Delete "bareul" -}}
{{- $.Scratch.Set "bareul" slice}}
{{- range seq (sub (len $tmp) 1) -}}
{{- $.Scratch.Add "bareul" (index $tmp (sub . 1)) -}}
{{- end -}}
{{- else -}}
</ul>
</li>
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
<li>
<a href="#{{- $cleanedID -}}">{{- $header | safeHTML -}}</a>
{{- else -}}
<li>
<a href="#{{- $cleanedID -}}">{{- $header | safeHTML -}}</a>
{{- end -}}
{{- end -}}
<!-- {{- $firstHeaderLevel := len (seq (index (findRE "[1-4]" (index $headers 0) 1) 0)) -}} -->
{{ $firstHeaderLevel := $largest }}
{{- $lastHeaderLevel := len (seq (index (findRE "[1-4]" (index $headers (sub (len $headers) 1)) 1) 0)) -}}
</li>
{{- range seq (sub $lastHeaderLevel $firstHeaderLevel) -}}
{{- if in ($.Scratch.Get "bareul") (add . $firstHeaderLevel) -}}
</ul>
{{- else -}}
</ul>
</li>
{{- end -}}
{{- end -}}
</ul>
</details>
{{- end -}}

View File

@ -0,0 +1,2 @@
<a href="{{ .Permalink }}" lang="{{ .Lang }}">{{ default .Lang .Site.Language.LanguageName }}</a>