initial commit

This commit is contained in:
Colmaris 2025-02-12 22:47:22 +01:00
parent 2012aa8834
commit 9ddfa58ace
2289 changed files with 11217 additions and 0 deletions

View file

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html class="{{ if .IsHome }}home{{ end }}" lang="{{ .Site.LanguageCode }}">
{{- partial "head.html" . -}}
{{- partial "build_assets.html" . -}}
<body>
<div id="baseContainer">
{{- partial "header.html" . -}}
<div id="contentContainer">
<div id="content">
<main>
{{- block "main" . }}{{- end }}
</main>
{{- partial "footer.html" . -}}
</div>
</div>
</div>
{{- partial "plausible.html" . -}}
{{- partial "umami.html" . -}}
{{- partial "inject/body.html" . -}}
</body>
</html>

View file

@ -0,0 +1 @@
{{- block "main" . }}{{- end }}

View file

@ -0,0 +1,8 @@
{{ define "main" }}
{{ if in (site.Params.extraContentDirs | default (slice)) .Section }}
<h1>{{ .Section | humanize }}</h1>
{{- partial "home_post_list.html" (dict "Ctx" . "AllPostsList" .Pages) -}}
{{ else }}
{{- partial "simple_posts_list.html" . -}}
{{ end }}
{{ end }}

View file

@ -0,0 +1,37 @@
{
"$schema": "https://json.schemastore.org/web-manifest-combined.json",
"name": "{{ .Site.Title }}",
"short_name": "{{ .Site.Title }}",
"start_url": "/",
"display": "standalone",
{{ $bg := (.Site.Data.colors.dark.bg | default "#242629") }}
{{ $accent := (.Site.Data.colors.dark.accent | default "#db5793") }}
{{ if eq .Site.Data.colors.default "light" }}
{{ $bg = (.Site.Data.colors.light.bg | default "#f5f5f5") }}
{{ $accent = (.Site.Data.colors.light.accent | default "#db5793") }}
{{ end }}
"background_color": "{{ $bg }}",
"theme_color": "{{ $accent }}"
{{ if .Site.Params.description }}
,
"description": "{{ .Site.Params.description }}"
{{ end }}
{{ if .Site.Params.icon512 }}
,
"icons": [
{
"src": "{{ .Site.Params.icon512 }}",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "{{ .Site.Params.icon512 }}",
"sizes": "512x512",
"type": "image/png",
"purpose": "any"
}
]
{{ end }}
}

View file

@ -0,0 +1,46 @@
{{- $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 }}
{{- printf "<?xml-stylesheet href=\"/feed_style.xsl\" type=\"text/xsl\"?>" | safeHTML -}}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="https://www.rssboard.org/media-rss">
<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 -}}
<icon>{{ .Site.Params.Logo | default "/img/icon.svg" | absURL }}</icon>
{{ range $pages }}
{{ if not ( .Params.norss | default false) }}
<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>
<description>{{ printf "<![CDATA[" | safeHTML }}{{ .Content | safeHTML }}{{ printf "]]>" | safeHTML }}</description>
{{ if .Params.image }}
<media:thumbnail url="{{ .Params.image | absURL }}" />
{{ end }}
</item>
{{ end }}
{{ end }}
</channel>
</rss>

View file

@ -0,0 +1,45 @@
{{ define "main" }}
<noscript>
You need to enable JavaScript to be able to search.
</noscript>
{{- partial "searchbar.html" . -}}
<div class="postlist {{ if .Site.Params.gridView }}gridView{{ end }}" id="postlist">
</div>
{{- partial "js_paginator.html" . -}}
<script>
const noResFoundStr = {{ i18n "noResultsFound" }}
function matchTags(page, term) {
for (let tag of page.tags) {
if (tag.includes(term)) return true;
}
return false;
}
function performSearch(term) {
document.getElementById('postlist').innerHTML = '';
term = term.toLowerCase();
fetch('/search/index.json').then(res => res.json())
.then(res => {
let articles = res.pages.filter(page => (
page.title.toLowerCase().includes(term) ||
matchTags(page, term) ||
page.text.includes(term)
));
if (articles.length > 0) renderArticles(articles);
else document.getElementById('postlist').innerHTML = `
<h3>${noResFoundStr}</h3>
`;
});
}
var url = location.href;
var baseUrl = url.split('?')[0];
var searchbar = document.getElementById('searchbar');
if (url.includes('?')) {
var urlParams = new URLSearchParams(url.split('?')[1]);
if (urlParams.has('q')) {
let searchTerm = urlParams.get('q');
searchbar.value = searchTerm;
performSearch(searchTerm);
}
}
</script>
{{ end }}

View file

@ -0,0 +1,27 @@
{{ define "main" }}
{
{{ $mscratch := newScratch }}
{{ $mscratch.Add "articles" slice }}
{{ $pages := where .Site.RegularPages "Params.nosearch" "!=" "true" }}
{{ range $pages }}
{{ $image := "" }}
{{ if .Params.Image }}
{{ if or (hasPrefix .Params.Image "/") (hasPrefix .Params.Image "http://") (hasPrefix .Params.Image "https://") }}
{{ $image = .Params.Image }}
{{ else }}
{{ $image = print .Permalink "/" .Params.Image }}
{{ end }}
{{ end }}
{{ $mscratch.Add "articles" (dict
"title" .Title
"date" (.Date.Format "2006-01-02")
"tags" (sort (or .Params.tags slice))
"summary" (or .Params.description .Summary)
"text" (lower .Plain)
"link" .Permalink
"image" $image
"imageAlt" (or .Params.Alt "")) }}
{{ end }}
"pages": {{ $mscratch.Get "articles" | jsonify }}
}
{{ end }}

View file

@ -0,0 +1,3 @@
{{ define "main" }}
{{- partial "single_post.html" . -}}
{{ end }}