Merge branch 'dev' into remove-jquery

This commit is contained in:
Nuno C. authored and GitHub committed 2026-02-11 21:27:54 +00:00
commit 92c7b3ecdf
11 files changed
+267 -80

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
{{ range .Data.Pages }}{{ if not (in .Site.Params.sitemap.excludedKinds .Kind) }}{{ if and (.Param "xml" | default true) (or (not .Params.externalUrl) (and (.Params.externalUrl) (and (not (hasPrefix .Params.externalUrl "http://")) (not (hasPrefix .Params.externalUrl "https://"))))) (not .Params.excludeFromSearch) }}
{{ range .Data.Pages }}{{ if and (not .Sitemap.Disable) (not (in .Site.Params.sitemap.excludedKinds .Kind)) }}{{ if and (.Param "xml" | default true) (or (not .Params.externalUrl) (and (.Params.externalUrl) (and (not (hasPrefix .Params.externalUrl "http://")) (not (hasPrefix .Params.externalUrl "https://"))))) (not .Params.excludeFromSearch) }}
{{- if .Permalink -}}{{ $link := .Permalink }}{{ if .Params.externalUrl }}{{ $link = printf "%s%s" .Site.BaseURL (substr .Params.externalUrl 1) }}{{ end }}
<url>
<loc>{{ $link }}</loc>{{ if not .Lastmod.IsZero }}
+5 -1
View File
@@ -119,7 +119,11 @@
</div>
{{ end }}
</div>
<section class="prose prose-invert w-full">{{ .Content }}</section>
{{ if not $disableHeroImageFilter }}
<section class="prose prose-invert w-full">{{ .Content }}</section>
{{ else }}
<section class="prose dark:prose-invert w-full">{{ .Content }}</section>
{{ end }}
</div>
</div>
</div>
+46
View File
@@ -0,0 +1,46 @@
{{ $id := delimit (slice "accordion" (partial "functions/uid.html" .)) "-" }}
{{ $mode := .Get "mode" | default "collapse" }}
{{ $separated := .Get "separated" | default false }}
{{ $isSeparated := or (eq $separated true) (eq $separated "true") }}
<div
id="{{ $id }}"
class="{{ if $isSeparated }}space-y-2{{ else }}border border-neutral-200 dark:border-neutral-700 rounded-lg overflow-hidden{{ end }}"
data-accordion="{{ $mode }}"
data-accordion-separated="{{ $isSeparated }}"
>
{{- .Inner -}}
</div>
{{ if $isSeparated }}
<style>
#{{ $id }} > details + details {
margin-top: 0.5rem;
}
</style>
{{ else }}
<style>
#{{ $id }} > details + details {
border-top: 1px solid rgb(var(--color-neutral-200));
}
.dark #{{ $id }} > details + details {
border-top-color: rgb(var(--color-neutral-700));
}
</style>
{{ end }}
{{ if eq $mode "collapse" }}
<script>
(() => {
const root = document.getElementById("{{ $id }}");
if (!root) return;
const items = root.querySelectorAll("details[data-accordion-item]");
items.forEach((item) => {
item.addEventListener("toggle", () => {
if (!item.open) return;
items.forEach((other) => {
if (other !== item) other.removeAttribute("open");
});
});
});
})();
</script>
{{ end }}
+31
View File
@@ -0,0 +1,31 @@
{{ $parent := .Parent }}
{{ $separated := false }}
{{ if $parent }}
{{ $separated = $parent.Get "separated" | default false }}
{{ end }}
{{ $isSeparated := or (eq $separated true) (eq $separated "true") }}
{{ $title := .Get "title" | default (.Get "header") }}
{{ $md := .Get "md" | default true }}
{{ $open := .Get "open" | default false }}
{{ $isOpen := or (eq $open true) (eq $open "true") }}
<details
class="{{ if $isSeparated }}rounded-lg border border-neutral-200 dark:border-neutral-700 overflow-hidden{{ else }}border-none{{ end }}"
data-accordion-item
{{ if $isOpen }}open{{ end }}
>
<summary class="flex w-full cursor-pointer items-center justify-between gap-4 px-4 py-3 text-left text-lg font-semibold text-neutral-900 dark:text-neutral-100">
<span>{{ $title }}</span>
<span>
{{ partial "icon" "chevron-down" }}
</span>
</summary>
<div class="px-4 pb-4 text-neutral-700 dark:text-neutral-300">
{{ if $md }}
{{- .Inner | markdownify -}}
{{ else }}
{{- .Inner -}}
{{ end }}
</div>
</details>