sync theme

This commit is contained in:
Christoph Cullmann 2024-08-28 22:54:34 +02:00
parent 8db6bd0e55
commit 8f3d03b188
No known key found for this signature in database
53 changed files with 1747 additions and 213 deletions

View file

@ -30,10 +30,10 @@
var oid = "views_{{ $path }}"
var oid_likes = "likes_{{ $path }}"
</script>
{{ end }}
{{ $jsPage := resources.Get "js/page.js" }}
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint "sha512" }}
<script type="text/javascript" src="{{ $jsPage.RelPermalink }}" integrity="{{ $jsPage.Data.Integrity }}"></script>
{{ end }}
</header>
<section class="{{ if $toc -}}
mt-12

View file

@ -17,11 +17,11 @@
<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>
<language>{{ site.LanguageCode }}</language>{{ with .Site.Author.email }}
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}
<language>{{ site.LanguageCode }}</language>{{ with .Site.Params.Author.email }}
<managingEditor>{{.}}{{ with $.Site.Params.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Params.Author.email }}
<webMaster>{{.}}{{ with $.Site.Params.Author.name }} ({{.}}){{end}}</webMaster>{{end}}
{{ if .Site.Params.footer.showCopyright | default true -}}
<copyright>{{ with replace .Site.Params.copyright "{ year }" now.Year }}{{.}}{{ else }}© {{ now.Format "2006" }} {{ .Site.Author.name }}{{- end }}</copyright>
<copyright>{{ with replace .Site.Params.copyright "{ year }" now.Year }}{{.}}{{ else }}© {{ now.Format "2006" }} {{ .Site.Params.Author.name }}{{- end }}</copyright>
{{- end }}
{{ if not .Date.IsZero }}<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
{{- with .OutputFormats.Get "RSS" -}}
@ -32,7 +32,7 @@
<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}}
{{ with .Site.Params.Author.email }}<author>{{.}}{{ with $.Site.Params.Author.name }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid>
<description>{{ .Summary | html }}</description>
{{ range ( where .Site.RegularPages ".RelPermalink" .RelPermalink | first 1 ) }}

View file

@ -46,7 +46,7 @@
{{- if $authorData -}}
{{ range $taxonomyname, $taxonomy := $taxonomies }}
{{ if (eq $taxonomyname $author) }}
{{ $taxonomyLink = delimit (slice $baseURL "/authors/" $author) "" }}
{{ $taxonomyLink = delimit (slice $baseURL "authors/" $author "/") "" }}
{{ end }}
{{ end }}
{{ partial "author-extra.html" (dict "context" . "data" $authorData "link" $taxonomyLink) }}
@ -81,6 +81,17 @@
<div class="article-content max-w-prose mb-20">
{{ .Content }}
{{ $defaultReplyByEmail := .Site.Params.replyByEmail }}
{{ $replyByEmail := default $defaultReplyByEmail .Params.replyByEmail }}
{{ if $replyByEmail }}
<strong class="block mt-8">
<a target="_blank"
class="m-1 rounded bg-neutral-300 p-1.5 text-neutral-700 hover:bg-primary-500 hover:text-neutral dark:bg-neutral-700 dark:text-neutral-300 dark:hover:bg-primary-400 dark:hover:text-neutral-800"
href="mailto:{{ .Site.Params.Author.email }}?subject={{ replace (printf "Reply to %s" .Title) "\"" "'" }}">
Reply by Email
</a>
</strong>
{{ end }}
</div>
{{ if (.Params.showAuthorBottom | default ( .Site.Params.article.showAuthorBottom | default false)) }}
@ -95,7 +106,7 @@
{{- if $authorData -}}
{{ range $taxonomyname, $taxonomy := $taxonomies }}
{{ if (eq $taxonomyname $author) }}
{{ $taxonomyLink = delimit (slice $baseURL "/authors/" $author) "" }}
{{ $taxonomyLink = delimit (slice $baseURL "authors/" $author "/") "" }}
{{ end }}
{{ end }}
{{ partial "author-extra.html" (dict "context" . "data" $authorData "link" $taxonomyLink) }}
@ -124,10 +135,10 @@
var oid = "views_{{ $path }}"
var oid_likes = "likes_{{ $path }}"
</script>
{{ end }}
{{ $jsPage := resources.Get "js/page.js" }}
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint "sha512" }}
<script type="text/javascript" src="{{ $jsPage.RelPermalink }}" integrity="{{ $jsPage.Data.Integrity }}"></script>
{{ end }}
</section>
<footer class="pt-8 max-w-prose print:hidden">

View file

@ -28,7 +28,6 @@
{{ .Content }}
</div>
</section>
{{ end }}
<script>
var oid = "views_taxonomy_{{ .Data.Plural }}"
var oid_likes = "likes_taxonomy_{{ .Data.Plural }}"
@ -36,7 +35,7 @@
{{ $jsPage := resources.Get "js/page.js" }}
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint "sha512" }}
<script type="text/javascript" src="{{ $jsPage.RelPermalink }}" integrity="{{ $jsPage.Data.Integrity }}"></script>
{{ end }}
{{ if .Site.Params.taxonomy.cardView }}

View file

@ -1,6 +1,6 @@
{{ define "main" }}
{{ .Scratch.Set "scope" "list" }}
{{ .Scratch.Set "scope" "term" }}
{{ if .Site.Params.term.showHero | default false }}
{{ $heroStyle := print "partials/hero/" .Site.Params.term.heroStyle ".html" }}
{{ if templates.Exists $heroStyle }}
@ -26,7 +26,6 @@
<div class="min-w-0 min-h-0 max-w-prose">
{{ .Content }}
</div>
{{ end }}
<script>
var oid = "views_term_{{ .Data.Term }}"
var oid_likes = "likes_term_{{ .Data.Term }}"
@ -34,14 +33,15 @@
{{ $jsPage := resources.Get "js/page.js" }}
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint "sha512" }}
<script type="text/javascript" src="{{ $jsPage.RelPermalink }}" integrity="{{ $jsPage.Data.Integrity }}"></script>
{{ end }}
</section>
{{ if gt .Pages 0 }}
{{ $cardView := .Params.cardView | default (.Site.Params.list.cardView | default false) }}
{{ $cardViewScreenWidth := .Site.Params.list.cardViewScreenWidth | default false }}
{{ $groupByYear := .Params.groupByYear | default ($.Site.Params.list.groupByYear | default false) }}
{{ $cardView := .Params.cardView | default (.Site.Params.term.cardView | default false) }}
{{ $cardViewScreenWidth := .Site.Params.term.cardViewScreenWidth | default false }}
{{ $groupByYear := .Params.groupByYear | default ($.Site.Params.term.groupByYear | default false) }}
{{ if not $cardView }}
@ -121,7 +121,7 @@
{{ else }}
<section class="mt-10 prose dark:prose-invert">
<p class="py-8 border-t">
<em>{{ i18n "list.no_articles" | emojify }}</em>
<em>{{ i18n "term.no_articles" | emojify }}</em>
</p>
</section>
{{ end }}

View file

@ -6,4 +6,7 @@
{{ end }}
{{ with site.Params.umamiAnalytics.websiteid }}
{{ partial "analytics/umami.html" }}
{{ end }}
{{ with site.Params.selineAnalytics.token }}
{{ partial "analytics/seline.html" }}
{{ end }}

View file

@ -0,0 +1,18 @@
<script async src="https://cdn.seline.so/seline.js" data-token="{{ site.Params.selineAnalytics.token }}" data-id="seline-script"></script>
{{ if .Site.Params.selineAnalytics.enableTrackEvent | default true }}
<script type="text/javascript">
document.querySelector('script[data-id="seline-script"]')
.addEventListener('load', function () {
const type = document.head.querySelector('meta[property = "og:type"]').getAttribute('content');
let title = document.head.querySelector('meta[property = "og:title"]').getAttribute('content');
let url = document.head.querySelector('meta[property = "og:url"]').getAttribute('content');
seline.track("user:" + type + ':' + title, {
type: type,
title: title,
url: url
});
});
</script>
{{ end }}

View file

@ -10,6 +10,7 @@
</script>
{{ end }}
{{ if .Site.Params.umamiAnalytics.enableTrackEvent | default true }}
<script type="text/javascript">
document.querySelector('script[data-id="umami-script"]')
.addEventListener('load', function () {
@ -18,4 +19,5 @@
let url = document.head.querySelector('meta[property = "og:url"]').getAttribute('content');
umami.track(type + ':' + title, {'url': url});
});
</script>
</script>
{{ end }}

View file

@ -19,7 +19,7 @@
{{ end }}
{{ if and (.Params.showDateUpdated | default (.Site.Params.article.showDateUpdated | default false)) (ne (partial
"functions/date.html" .Date) (partial "functions/date.html" .Lastmod)) }}
"functions/date.html" .Date) (partial "functions/date.html" .Lastmod)) (gt (.Lastmod | time.Format "2006") 1) }}
{{ $meta.Add "partials" (slice (partial "meta/date-updated.html" .Lastmod)) }}
{{ end }}
@ -96,4 +96,4 @@
</div>
{{ end }}
{{ end }}
{{ end }}

View file

@ -1,4 +1,4 @@
{{ with .Site.Author.links }}
{{ with .Site.Params.Author.links }}
<div class="flex flex-wrap text-neutral-400 dark:text-neutral-500">
{{ range $links := . }}
{{ range $name, $url := $links }}

View file

@ -1,6 +1,6 @@
{{ $disableImageOptimization := .Site.Params.disableImageOptimization | default false }}
<div class="flex author">
{{ with .Site.Author.image }}
{{ with .Site.Params.Author.image }}
{{ $authorImage := "" }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $authorImage = resources.GetRemote . }}
@ -12,18 +12,18 @@
{{ $authorImage = $authorImage.Fill "192x192" }}
{{ end }}
<img class="!mt-0 !mb-0 h-24 w-24 rounded-full ltr:mr-4 rtl:ml-4" width="96" height="96"
alt="{{ $.Site.Author.name | default " Author" }}" src="{{ $authorImage.RelPermalink }}" />
alt="{{ $.Site.Params.Author.name | default " Author" }}" src="{{ $authorImage.RelPermalink }}" />
{{ else }}
{{ $authorImage := resources.GetRemote . }}
{{ if not $disableImageOptimization }}
{{ $authorImage = $authorImage.Fill "192x192" }}
{{ end }}
<img class="!mt-0 !mb-0 h-24 w-24 rounded-full ltr:mr-4 rtl:ml-4" width="96" height="96"
alt="{{ $.Site.Author.name | default " Author" }}" src="{{ $authorImage.RelPermalink }}" />
alt="{{ $.Site.Params.Author.name | default " Author" }}" src="{{ $authorImage.RelPermalink }}" />
{{ end }}
{{ end }}
<div class="place-self-center">
{{ with .Site.Author.name | markdownify }}
{{ with .Site.Params.Author.name | markdownify }}
<div class="text-[0.6rem] uppercase leading-3 text-neutral-500 dark:text-neutral-400">
{{ i18n "author.byline_title" | markdownify }}
</div>
@ -31,7 +31,7 @@
{{ . }}
</div>
{{ end }}
{{ with .Site.Author.bio | markdownify }}
{{ with .Site.Params.Author.bio | markdownify }}
<div class="text-sm text-neutral-700 dark:text-neutral-400">{{ . }}</div>
{{ end }}
<div class="text-2xl sm:text-lg">{{ partialCached "author-links.html" . }}</div>

View file

@ -31,7 +31,7 @@
{{- else }}
&copy;
{{ now.Format "2006" }}
{{ .Site.Author.name | markdownify }}
{{ .Site.Params.Author.name | markdownify }}
{{- end }}
</p>
{{ end }}

View file

@ -74,7 +74,8 @@
}}"></script>
{{ end }}
{{ if not .Site.Params.disableImageZoom | default true }}
<script src="{{ "js/zoom.min.js" | relURL }}"></script>
{{ $zoomJS := resources.Get "lib/zoom/zoom.min.js" | resources.Fingerprint "sha512" }}
<script src="{{ $zoomJS.RelPermalink }}" integrity="{{ $zoomJS.Data.Integrity }}"></script>
{{ end }}
{{/* Icons */}}
{{ if templates.Exists "partials/favicons.html" }}
@ -104,9 +105,9 @@
{{/* Schema */}}
{{ partial "schema.html" . }}
{{/* Me */}}
{{ with .Site.Author.name }}
{{ with .Site.Params.Author.name }}
<meta name="author" content="{{ . }}" />{{ end }}
{{ with .Site.Author.links }}
{{ with .Site.Params.Author.links }}
{{ range $links := . }}
{{ range $name, $url := $links }}
<link href="{{ $url }}" rel="me" />{{ end }}

View file

@ -7,8 +7,14 @@
<a href="{{ "" | relLangURL }}" class="flex">
<span class="sr-only">{{ .Site.Title | markdownify }}</span>
{{ if eq $logo.MediaType.SubType "svg" }}
<span class="logo object-scale-down object-left nozoom">
{{ $logo.Content | safeHTML }}
</span>
{{ else }}
<img src="{{ $logo.RelPermalink }}" width="{{ div $logo.Width 2 }}" height="{{ div $logo.Height 2 }}"
class="logo max-h-[5rem] max-w-[5rem] object-scale-down object-left nozoom" alt="{{ .Site.Title }}" />
{{ end }}
</a>
</div>

View file

@ -41,7 +41,7 @@
style="background-image:url({{ .RelPermalink }});">
{{ end }}
{{ else }}
{{ with .Resize "1200x" }}
{{ with .Resize (print ($.Site.Params.backgroundImageWidth | default "1200") "x") }}
<div class="fixed inset-x-0 top-0 h-[800px] single_hero_background nozoom"
style="background-image:url({{ .RelPermalink }});">
{{ end }}

View file

@ -26,7 +26,7 @@
<div class="w-full h-36 md:h-56 lg:h-72 single_hero_basic nozoom" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ else }}
{{ with .Resize "1200x" }}
{{ with .Resize (print ($.Site.Params.backgroundImageWidth | default "1200") "x") }}
<div class="w-full h-36 md:h-56 lg:h-72 single_hero_basic nozoom" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ end }}

View file

@ -48,7 +48,7 @@
</figure>
{{ end }}
{{ else }}
{{ with .Resize "1200x" }}
{{ with .Resize (print ($.Site.Params.backgroundImageWidth | default "1200") "x") }}
<figure>
<img class="w-full rounded-lg single_hero_round nozoom" alt="{{ $alt }}" width="{{ .Width }}" height="{{ .Height }}" src="{{ .RelPermalink }}">
{{ if $caption }}

View file

@ -25,7 +25,7 @@
<div class="w-full rounded-md h-36 md:h-56 lg:h-72 single_hero_basic nozoom" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ else }}
{{ with .Resize "1200x" }}
{{ with .Resize (print ($.Site.Params.backgroundImageWidth | default "1200") "x") }}
<div class="w-full rounded-md h-36 md:h-56 lg:h-72 single_hero_basic nozoom" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ end }}
@ -44,7 +44,7 @@
</div>
</div>{{ end }}
{{ else }}
{{ with .Resize "1200x" }}
{{ with .Resize (print ($.Site.Params.backgroundImageWidth | default "1200") "x") }}
<div class="fixed inset-x-0 top-0 h-[800px] single_hero_background nozoom"
style="background-image:url({{ .RelPermalink }});">
<div class="absolute inset-0 bg-gradient-to-t from-neutral dark:from-neutral-800 to-transparent mix-blend-normal">

View file

@ -31,7 +31,7 @@
{{ end }}
</div>
<div class="relative px-1 py-1 flex flex-col items-center justify-center text-center">
{{ with .Site.Author.image }}
{{ with .Site.Params.Author.image }}
{{ $authorImage := "" }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $authorImage = resources.GetRemote . }}
@ -40,22 +40,22 @@
{{ end }}
{{ if $authorImage }}
{{ if not $disableImageOptimization }}
{{ $authorImage = $authorImage.Fill "288x288" }}
{{ $authorImage = $authorImage.Fill (print "288x288 q" ( $.Site.Params.Author.imagequality | default "96" )) }}
{{ end }}
<img class="mb-2 rounded-full h-36 w-36" width="144" height="144"
alt="{{ $.Site.Author.name | default " Author" }}" src="{{ $authorImage.RelPermalink }}" />
alt="{{ $.Site.Params.Author.name | default " Author" }}" src="{{ $authorImage.RelPermalink }}" />
{{ end }}
{{ end }}
<h1 class="mb-2 text-4xl font-extrabold text-neutral-800 dark:text-neutral-200">
{{ .Site.Author.name | default .Site.Title }}
{{ .Site.Params.Author.name | default .Site.Title }}
</h1>
{{ with .Site.Author.headline }}
{{ with .Site.Params.Author.headline }}
<h2 class="mt-0 mb-0 text-xl text-neutral-800 dark:text-neutral-300">
{{ . | markdownify }}
</h2>
{{ end }}
<div class="mt-3 mb-10 text-2xl">
{{ with .Site.Author.links }}
{{ with .Site.Params.Author.links }}
<div class="flex flex-wrap">
{{ range $links := . }}
{{ range $name, $url := $links }}

View file

@ -28,7 +28,7 @@
{{ end }}
</div>
<div class="relative px-4 py-16 sm:px-6 sm:py-24 lg:py-32 lg:px-8 flex flex-col items-center justify-center text-center">
{{ with .Site.Author.image }}
{{ with .Site.Params.Author.image }}
{{ $authorImage := "" }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $authorImage = resources.GetRemote . }}
@ -37,22 +37,22 @@
{{ end }}
{{ if $authorImage }}
{{ if not $disableImageOptimization }}
{{ $authorImage = $authorImage.Fill "288x288" }}
{{ $authorImage = $authorImage.Fill (print "288x288 q" ( $.Site.Params.Author.imagequality | default "96" )) }}
{{ end }}
<img class="mb-2 rounded-full h-36 w-36" width="144" height="144"
alt="{{ $.Site.Author.name | default " Author" }}" src="{{ $authorImage.RelPermalink }}" />
alt="{{ $.Site.Params.Author.name | default " Author" }}" src="{{ $authorImage.RelPermalink }}" />
{{ end }}
{{ end }}
<h1 class="mb-2 text-4xl font-extrabold text-neutral-200">
{{ .Site.Author.name | default .Site.Title }}
{{ .Site.Params.Author.name | default .Site.Title }}
</h1>
{{ with .Site.Author.headline }}
{{ with .Site.Params.Author.headline }}
<h2 class="mt-0 mb-0 text-xl text-neutral-300">
{{ . | markdownify }}
</h2>
{{ end }}
<div class="mt-3 mb-10 text-2xl">
{{ with .Site.Author.links }}
{{ with .Site.Params.Author.links }}
<div class="flex flex-wrap">
{{ range $links := . }}
{{ range $name, $url := $links }}

View file

@ -3,7 +3,7 @@
h-full
{{ end }} flex flex-col items-center justify-center text-center">
<header class="relative px-1 py-1 flex flex-col items-center mb-3">
{{ with .Site.Author.image }}
{{ with .Site.Params.Author.image }}
{{ $authorImage := "" }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $authorImage = resources.GetRemote . }}
@ -12,16 +12,16 @@
{{ end }}
{{ if $authorImage }}
{{ if not $disableImageOptimization }}
{{ $authorImage = $authorImage.Fill "288x288" }}
{{ $authorImage = $authorImage.Fill (print "288x288 q" ( $.Site.Params.Author.imagequality | default "96" )) }}
{{ end }}
<img class="mb-2 rounded-full h-36 w-36" width="144" height="144" alt="{{ $.Site.Author.name | default " Author" }}"
<img class="mb-2 rounded-full h-36 w-36" width="144" height="144" alt="{{ $.Site.Params.Author.name | default " Author" }}"
src="{{ $authorImage.RelPermalink }}" />
{{ end }}
{{ end }}
<h1 class="text-4xl font-extrabold">
{{ .Site.Author.name | default .Site.Title }}
{{ .Site.Params.Author.name | default .Site.Title }}
</h1>
{{ with .Site.Author.headline }}
{{ with .Site.Params.Author.headline }}
<h2 class="text-xl text-neutral-500 dark:text-neutral-400">
{{ . | markdownify }}
</h2>

View file

@ -1,4 +1,4 @@
<time datetime="{{ . }}">
{{- i18n "article.date_updated" (dict "Date" (partial "functions/date.html" .)) | markdownify -}}
<time datetime="{{ . | time.Format "2006-01-02T15:04:05-07:00" }}">
{{- i18n "article.date_updated" (dict "Date" (partial "functions/date.html" .)) -}}
</time>
{{- /* Trim EOF */ -}}

View file

@ -1,4 +1,4 @@
<time datetime="{{ . }}">
{{- i18n "article.date" (dict "Date" (partial "functions/date.html" .)) | markdownify -}}
<time datetime="{{ . | time.Format "2006-01-02T15:04:05-07:00" }}">
{{- i18n "article.date" (dict "Date" (partial "functions/date.html" .)) -}}
</time>
{{- /* Trim EOF */ -}}

View file

@ -1,5 +1,5 @@
{{ $recentArticles := 5 }}
{{ $showMoreLinkDest := "/posts" }}
{{ $showMoreLinkDest := "/posts/" }}
{{ if .Site.Params.homepage.showRecent | default false }}
{{ if index .Site.Params.homepage "showRecentItems" }}
{{ $recentArticles = .Site.Params.homepage.showRecentItems }}

View file

@ -11,7 +11,7 @@
{{ with .Site.Params.keywords }}"keywords": {{ . }},{{ end }}
"publisher" : {
"@type": "Person",
"name": "{{ .Site.Author.name | safeJS }}"
"name": "{{ .Site.Params.Author.name | safeJS }}"
}
}
</script>
@ -30,7 +30,7 @@
"url" : "{{ .Permalink }}",
"author" : {
"@type": "Person",
"name": "{{ .Site.Author.name | safeJS }}"
"name": "{{ .Site.Params.Author.name | safeJS }}"
},
{{ with .PublishDate }}"copyrightYear": "{{ .Format "2006" }}",{{ end }}
{{ with .Date }}"dateCreated": "{{ .Format $iso8601 }}",{{ end }}

View file

@ -1,5 +1,5 @@
{{/* jQuery */}}
{{ $jqueryLib := resources.Get "lib/jquery/jquery.slim.min.js" }}
{{ $jqueryLib := resources.Get "lib/jquery/jquery.slim.min.js" | resources.Fingerprint "sha512" }}
<script src="{{ $jqueryLib.RelPermalink }}" integrity="{{ $jqueryLib.Data.Integrity }}"></script>
{{/* Mermaid */}}
@ -46,7 +46,7 @@
{{/* TypeIt */}}
{{ if .Page.HasShortcode "typeit" }}
{{ $typeitLib := resources.Get "lib/typeit/typeit.umd.js" }}
{{ $typeitLib := resources.Get "lib/typeit/typeit.umd.js" | resources.Fingerprint "sha512" }}
<script defer src="{{ $typeitLib.RelPermalink }}" integrity="{{ $typeitLib.Data.Integrity }}"></script>
{{ end }}
@ -68,8 +68,8 @@
{{/* youtubeLite */}}
{{ if .Page.HasShortcode "youtubeLite" }}
{{ $youtubeLiteJS := resources.Get "lib/lite-youtube-embed/lite-yt-embed.js" }}
{{ $youtubeLiteJS := resources.Get "lib/lite-youtube-embed/lite-yt-embed.js" | resources.Fingerprint "sha512" }}
{{ $youtubeLiteCSS := resources.Get "lib/lite-youtube-embed/lite-yt-embed.css" }}
<link rel="stylesheet" href="{{ $youtubeLiteCSS.RelPermalink }}" integrity="{{ $youtubeLiteCSS.Data.Integrity }}"/>
<script src="{{ $youtubeLiteJS.RelPermalink }}" integrity="{{ $youtubeLiteJS.Data.Integrity }}"></script>
{{ end }}
{{ end }}

View file

@ -2,6 +2,7 @@
class="!rounded-md bg-primary-600 px-4 py-2 !text-neutral !no-underline hover:!bg-primary-500 dark:bg-primary-800 dark:hover:!bg-primary-700"
{{ with .Get "href" }}href="{{ . }}"{{ end }}
{{ with .Get "target" }}target="{{ . }}"{{ end }}
{{ with .Get "rel" }}rel="{{ . }}"{{ end }}
role="button"
>
{{ .Inner }}

View file

@ -1,6 +1,6 @@
{{ $id := delimit (slice "codeberg" (partial "functions/uid.html" .)) "-" }}
{{- $codebergURL := print "https://codeberg.org/api/v1/repos/" (.Get "repo") -}}
{{- $codebergData := getJSON ($codebergURL) -}}
{{- $codebergData := resources.GetRemote $codebergURL | transform.Unmarshal -}}
{{- $codebergColors := .Site.Data.codebergColors -}}
{{- with $codebergData -}}
@ -34,14 +34,14 @@
<span class="text-md mr-1 text-neutral-800 dark:text-neutral">
{{ partial "icon.html" "star" }}
</span>
<div id="{{ $id }}-stargazers" class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
<div id="{{ $id }}-stars_count" class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
{{ .stars_count }}
</div>
<span class="text-md mr-1 text-neutral-800 dark:text-neutral">
{{ partial "icon.html" "fork" }}
</span>
<div id="{{ $id }}-forks" class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
<div id="{{ $id }}-forks_count" class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
{{ .forks_count }}
</div>
@ -58,7 +58,7 @@
.then(data => {
document.getElementById('{{ $id }}-full_name').innerHTML = data.full_name;
document.getElementById('{{ $id }}-description').innerHTML = data.description;
document.getElementById('{{ $id }}-stars_count').innerHTML = data.starts_count;
document.getElementById('{{ $id }}-stars_count').innerHTML = data.stars_count;
document.getElementById('{{ $id }}-forks_count').innerHTML = data.forks_count;
})
.catch(error => console.error(error))

View file

@ -0,0 +1,67 @@
{{ $id := delimit (slice "forgejo" (partial "functions/uid.html" .)) "-" }}
{{- $forgejoURL := print (.Get "server" | default .Site.Params.forgejoDefaultServer) "/api/v1/repos/" (.Get "repo") -}}
{{- $forgejoData := resources.GetRemote $forgejoURL | transform.Unmarshal -}}
{{- $forgejoColors := .Site.Data.forgejoColors -}}
{{- with $forgejoData -}}
<a id="{{ $id }}" target="_blank" href="{{ .html_url }}" class="cursor-pointer">
<div
class="w-full md:w-auto pt-3 p-5 border border-neutral-200 dark:border-neutral-700 border rounded-md shadow-2xl">
<div class="flex items-center">
<span class="text-2xl text-neutral-800 dark:text-neutral" style="margin-right:10px;">
{{ partial "icon.html" "forgejo" }}
</span>
<div
id="{{ $id }}-full_name"
class="m-0 font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral">
{{ .full_name | markdownify }}
</div>
</div>
<p id="{{ $id }}-description" class="m-0 mt-2 text-md text-neutral-800 dark:text-neutral">
{{ .description | markdownify }}
</p>
<div class="m-0 mt-2 flex items-center">
<span class="mr-1 inline-block h-3 w-3 rounded-full"
style="background-color: {{ if .language }} {{- index $forgejoColors .language -}} {{ else }} #0077b6 {{ end }}"></span>
<div class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
{{ if .language }} {{ .language }} {{ else }} null {{ end }}
</div>
<span class="text-md mr-1 text-neutral-800 dark:text-neutral">
{{ partial "icon.html" "star" }}
</span>
<div id="{{ $id }}-stars_count" class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
{{ .stars_count }}
</div>
<span class="text-md mr-1 text-neutral-800 dark:text-neutral">
{{ partial "icon.html" "fork" }}
</span>
<div id="{{ $id }}-forks_count" class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
{{ .forks_count }}
</div>
</div>
</div>
<script>
fetch({{ $forgejoURL }}, {
headers: new Headers({
'User-agent': 'Mozilla/4.0 Custom User Agent'
})
})
.then(response => response.json())
.then(data => {
document.getElementById('{{ $id }}-full_name').innerHTML = data.full_name;
document.getElementById('{{ $id }}-description').innerHTML = data.description;
document.getElementById('{{ $id }}-stars_count').innerHTML = data.stars_count;
document.getElementById('{{ $id }}-forks_count').innerHTML = data.forks_count;
})
.catch(error => console.error(error))
</script>
</a>
{{- end -}}

View file

@ -0,0 +1,67 @@
{{ $id := delimit (slice "gitea" (partial "functions/uid.html" .)) "-" }}
{{- $giteaURL := print (.Get "server" | default .Site.Params.giteaDefaultServer) "/api/v1/repos/" (.Get "repo") -}}
{{- $giteaData := resources.GetRemote $giteaURL | transform.Unmarshal -}}
{{- $giteaColors := .Site.Data.giteaColors -}}
{{- with $giteaData -}}
<a id="{{ $id }}" target="_blank" href="{{ .html_url }}" class="cursor-pointer">
<div
class="w-full md:w-auto pt-3 p-5 border border-neutral-200 dark:border-neutral-700 border rounded-md shadow-2xl">
<div class="flex items-center">
<span class="text-2xl text-neutral-800 dark:text-neutral" style="margin-right:10px;">
{{ partial "icon.html" "gitea" }}
</span>
<div
id="{{ $id }}-full_name"
class="m-0 font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral">
{{ .full_name | markdownify }}
</div>
</div>
<p id="{{ $id }}-description" class="m-0 mt-2 text-md text-neutral-800 dark:text-neutral">
{{ .description | markdownify }}
</p>
<div class="m-0 mt-2 flex items-center">
<span class="mr-1 inline-block h-3 w-3 rounded-full"
style="background-color: {{ if .language }} {{- index $giteaColors .language -}} {{ else }} #0077b6 {{ end }}"></span>
<div class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
{{ if .language }} {{ .language }} {{ else }} null {{ end }}
</div>
<span class="text-md mr-1 text-neutral-800 dark:text-neutral">
{{ partial "icon.html" "star" }}
</span>
<div id="{{ $id }}-stars_count" class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
{{ .stars_count }}
</div>
<span class="text-md mr-1 text-neutral-800 dark:text-neutral">
{{ partial "icon.html" "fork" }}
</span>
<div id="{{ $id }}-forks_count" class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
{{ .forks_count }}
</div>
</div>
</div>
<script>
fetch({{ $giteaURL }}, {
headers: new Headers({
'User-agent': 'Mozilla/4.0 Custom User Agent'
})
})
.then(response => response.json())
.then(data => {
document.getElementById('{{ $id }}-full_name').innerHTML = data.full_name;
document.getElementById('{{ $id }}-description').innerHTML = data.description;
document.getElementById('{{ $id }}-stars_count').innerHTML = data.stars_count;
document.getElementById('{{ $id }}-forks_count').innerHTML = data.forks_count;
})
.catch(error => console.error(error))
</script>
</a>
{{- end -}}

View file

@ -1,6 +1,6 @@
{{ $id := delimit (slice "github" (partial "functions/uid.html" .)) "-" }}
{{- $githubURL := print "https://api.github.com/repos/" (.Get "repo") -}}
{{- $githubData := getJSON ($githubURL) -}}
{{- $githubData := resources.GetRemote $githubURL | transform.Unmarshal -}}
{{- $githubColors := .Site.Data.githubColors -}}
{{- with $githubData -}}

View file

@ -1,7 +1,7 @@
{{ $id := delimit (slice "gitlab" (partial "functions/uid.html" .)) "-" }}
{{- $gitlabURL := print (default "https://gitlab.com/" (.Get "baseURL")) "api/v4/projects/" (.Get "projectID") -}}
{{- $gitLabData := getJSON ($gitlabURL) -}}
{{- $gitLabData := resources.GetRemote $gitlabURL | transform.Unmarshal -}}
{{- with $gitLabData -}}
<a id="{{ $id }}" target="_blank" href="{{ .web_url }}" class="cursor-pointer">