summaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authoreltrac <hi@eltr.ac>2026-04-07 14:53:17 +0800
committereltrac <hi@eltr.ac>2026-04-07 14:53:17 +0800
commit10431bd8f5ff71690ae4e5444e8d7894fd401ae5 (patch)
tree62b7fd1b6c1f68d2804f380eb522bcebeb2c8d9f /layouts
parent3e0edacc4a0cafa53ede57ebb6f0378c93f3123b (diff)
chore: move templates out of site repo
Diffstat (limited to 'layouts')
-rw-r--r--layouts/404.html47
-rw-r--r--layouts/_markup/render-blockquote.html30
-rw-r--r--layouts/_markup/render-heading.html12
-rw-r--r--layouts/_markup/render-image.html25
-rw-r--r--layouts/_markup/render-link.html6
-rw-r--r--layouts/_markup/render-table.html32
-rw-r--r--layouts/_partials/components/back-to-top.html16
-rw-r--r--layouts/_partials/components/backlinks.html37
-rw-r--r--layouts/_partials/components/category-pill.html7
-rw-r--r--layouts/_partials/components/date.html31
-rw-r--r--layouts/_partials/components/logo.html18
-rw-r--r--layouts/_partials/components/microformats.html9
-rw-r--r--layouts/_partials/components/section-title.html10
-rw-r--r--layouts/_partials/components/shade-mask.html7
-rw-r--r--layouts/_partials/components/svg-filters.html4
-rw-r--r--layouts/_partials/components/tags.html3
-rw-r--r--layouts/_partials/components/wordcount.html1
-rw-r--r--layouts/_partials/content.html9
-rw-r--r--layouts/_partials/footer.html39
-rw-r--r--layouts/_partials/head.html10
-rw-r--r--layouts/_partials/head/css.html19
-rw-r--r--layouts/_partials/head/scripts.html4
-rw-r--r--layouts/_partials/head/siteinfo.html59
-rw-r--r--layouts/_partials/head/verification.html10
-rw-r--r--layouts/_partials/header.html28
-rw-r--r--layouts/_partials/header/navigation.html13
-rw-r--r--layouts/_partials/header/other-navigation.html29
-rw-r--r--layouts/_partials/home/home-nav-item.html15
-rw-r--r--layouts/_partials/home/home-nav.html11
-rw-r--r--layouts/_partials/home/latest-posts.html11
-rw-r--r--layouts/_partials/home/microformats.html7
-rw-r--r--layouts/_partials/home/more-links.html15
-rw-r--r--layouts/_partials/items/book.html36
-rw-r--r--layouts/_partials/items/card.html19
-rw-r--r--layouts/_partials/items/post-small.html11
-rw-r--r--layouts/_partials/items/post.html41
-rw-r--r--layouts/_partials/posts/action-area.html16
-rw-r--r--layouts/_partials/posts/banner.html9
-rw-r--r--layouts/_partials/posts/comment.html38
-rw-r--r--layouts/_partials/posts/endnotes.html13
-rw-r--r--layouts/_partials/posts/fediverse-form.html14
-rw-r--r--layouts/_partials/posts/toc.html10
-rw-r--r--layouts/_partials/posts/webmention-form.html6
-rw-r--r--layouts/_partials/posts/webmention-mentions.html56
-rw-r--r--layouts/_partials/posts/webmention-replies.html69
-rw-r--r--layouts/_partials/posts/webmention-summary.html54
-rw-r--r--layouts/_partials/posts/webmention.html73
-rw-r--r--layouts/_partials/scripts.html43
-rw-r--r--layouts/_partials/stats/external-link-rank.html37
-rw-r--r--layouts/_partials/stats/publish-time-chart.html78
-rw-r--r--layouts/_partials/stats/stats-table.html44
-rw-r--r--layouts/_partials/stats/word-count-chart.html46
-rw-r--r--layouts/_partials/taxonomy/all-categories.html33
-rw-r--r--layouts/_partials/taxonomy/all-tags.html46
-rw-r--r--layouts/_partials/taxonomy/archived-categories.html16
-rw-r--r--layouts/_partials/taxonomy/pagefind.html7
-rw-r--r--layouts/_partials/taxonomy/tag-pill.html24
-rw-r--r--layouts/_partials/template/post-page.html45
-rw-r--r--layouts/_partials/term/term-books.html9
-rw-r--r--layouts/_partials/term/term-fictions.html10
-rw-r--r--layouts/_partials/term/term-posts.html6
-rw-r--r--layouts/_partials/term/term-weeklies.html10
-rw-r--r--layouts/_partials/utils/inject-footnotes.html70
-rw-r--r--layouts/_partials/utils/render.html1
-rw-r--r--layouts/_shortcodes/book.html17
-rw-r--r--layouts/_shortcodes/bookcard.html28
-rw-r--r--layouts/_shortcodes/daysfrom.html12
-rw-r--r--layouts/_shortcodes/fedicard.html148
-rw-r--r--layouts/_shortcodes/float-image.html13
-rw-r--r--layouts/_shortcodes/gallery.html3
-rw-r--r--layouts/_shortcodes/link.html15
-rw-r--r--layouts/_shortcodes/linkding-bookmarks.html68
-rw-r--r--layouts/_shortcodes/linkrank.html2
-rw-r--r--layouts/_shortcodes/music.html53
-rw-r--r--layouts/_shortcodes/opml-links.html19
-rw-r--r--layouts/_shortcodes/postcount.html1
-rw-r--r--layouts/_shortcodes/quotecard.html11
-rw-r--r--layouts/_shortcodes/right.html1
-rw-r--r--layouts/_shortcodes/wordcount.html7
-rw-r--r--layouts/archive.html23
-rw-r--r--layouts/article/page.html3
-rw-r--r--layouts/article/section.html38
-rw-r--r--layouts/baseof.404.html9
-rw-r--r--layouts/baseof.html14
-rw-r--r--layouts/baseof.page.html14
-rw-r--r--layouts/baseof.section.html15
-rw-r--r--layouts/blank.html10
-rw-r--r--layouts/cards/page.html12
-rw-r--r--layouts/cards/section.html29
-rw-r--r--layouts/fiction/page.html24
-rw-r--r--layouts/fiction/section.html25
-rw-r--r--layouts/highlights.html20
-rw-r--r--layouts/home.html8
-rw-r--r--layouts/library/page.html62
-rw-r--r--layouts/library/section.html85
-rw-r--r--layouts/page.html9
-rw-r--r--layouts/rss.xml63
-rw-r--r--layouts/stats.html30
-rw-r--r--layouts/tags/taxonomy.html12
-rw-r--r--layouts/taxonomy.html13
-rw-r--r--layouts/term.html15
-rw-r--r--layouts/uncategorized.html22
-rw-r--r--layouts/weekly/page.html3
-rw-r--r--layouts/weekly/section.html41
104 files changed, 0 insertions, 2561 deletions
diff --git a/layouts/404.html b/layouts/404.html
deleted file mode 100644
index 6f17a145..00000000
--- a/layouts/404.html
+++ /dev/null
@@ -1,47 +0,0 @@
-{{ define "main" }}
- <style>
- .page-404 {
- position: relative;
- height: calc(100dvh - var(--page-margin-y) * 2)
- }
- .page-404 .title-404 {
- position: absolute;
- bottom: 0;
- right: 0;
- font-size: 5rem;
- font-style: italic;
- filter: url(#x);
- color: var(--secondary-text-color);
- margin: 0;
- }
-
- .image-404 {
- width: 10rem;
- filter: url(#xs);
- @media (prefers-color-scheme: dark) {
- filter: url(#xs) invert(1);
- }
- }
-
- @media screen and (min-width: 768px) {
- .page-404 {
- display: flex;
- align-items: center;
- justify-content: center;
- gap: 5rem;
- }
- .image-404 {
- width: 15rem;
- }
- }
- </style>
- <article class="page-404">
- <img src="/img/ghost-window.svg" class="image-404" />
- <div class="markdown-body text-size-lg md:text-size-xl">
- <h1 class="title-404">404</h1>
- <p>Windows 和幽灵偷走了你的页面</p>
- <p>可恶的微软和能量体生物!</p>
- <p><a href="/">Mac 和骷髅为你祈祷</a></p>
- </div>
- </article>
-{{ end }}
diff --git a/layouts/_markup/render-blockquote.html b/layouts/_markup/render-blockquote.html
deleted file mode 100644
index 79f57a85..00000000
--- a/layouts/_markup/render-blockquote.html
+++ /dev/null
@@ -1,30 +0,0 @@
-{{ $emojis := dict
- "caution" "🚨"
- "important" "☝️"
- "note" "ℹ️"
- "tip" "💡"
- "warning" "⚠️"
- "announcement" "📣"
-}}
-
-{{ if eq .Type "alert" }}
- <blockquote class="rounded-1 leading-[1.75] mx-0 px-5
- flex gap-3 my-2 alert-{{ .AlertType }}"
- style="background-color: oklch(from var(--block-background-color) l c h / calc(alpha - 0.5))"
- >
- <div class="py-5">
- {{ with .AlertTitle }}
- {{.}}
- {{ else }}
- {{ index $emojis .AlertType }}
- {{ end }}
- </div>
- <div>
- {{ .Text }}
- </div>
- </blockquote>
-{{ else }}
- <blockquote class="text-secondary p-0 m-0 ml-[1em]">
- {{ .Text }}
- </blockquote>
-{{ end }}
diff --git a/layouts/_markup/render-heading.html b/layouts/_markup/render-heading.html
deleted file mode 100644
index 52b2f3ff..00000000
--- a/layouts/_markup/render-heading.html
+++ /dev/null
@@ -1,12 +0,0 @@
-{{ $size := index (dict
- "1" "text-[1.5em] font-extrabold"
- "2" "text-[1.25em] font-extrabold"
- "3" "text-[1.125em] font-bold"
- "4" "text-[1em] font-bold"
- "5" "text-[0.9em] font-bold"
- "6" "text-[0.875em]") (printf "%d" .Level) }}
-<h{{ .Level }}
- id="{{ .Anchor }}"
- class="{{ $size }} {{ with .Attributes.class }} {{ . }}{{ end }}">
- {{- .Text -}}
-</h{{ .Level }}>
diff --git a/layouts/_markup/render-image.html b/layouts/_markup/render-image.html
deleted file mode 100644
index 49c9fcee..00000000
--- a/layouts/_markup/render-image.html
+++ /dev/null
@@ -1,25 +0,0 @@
-{{- $src := .Destination -}}
-{{- $alt := .Text | default "" -}}
-{{- $caption := .Title | default "" -}}
-{{- $class := .Attributes.class | default "" -}}
-
-{{- if and (not (strings.HasPrefix $src "https://")) (not (strings.HasPrefix $src "http://")) -}}
- {{- if not (strings.HasPrefix $src "/") -}}
- {{- $src = printf "%s/%s%s" site.Params.assetBaseUrl .Page.File.Dir $src -}}
- {{- else -}}
- {{- $src = printf "%s%s" site.Params.assetBaseUrl $src -}}
- {{- end -}}
-{{- end -}}
-
-<figure>
- <img
- class="lazy {{ $class }}" loading="lazy"
- src="{{ $src }}" alt="{{ $alt }}"
- data-libra
- />
- {{- if $caption }}
- <figcaption>
- <h4>{{ $caption | markdownify }}</h4>
- </figcaption>
- {{- end }}
-</figure>
diff --git a/layouts/_markup/render-link.html b/layouts/_markup/render-link.html
deleted file mode 100644
index 2e8d32f7..00000000
--- a/layouts/_markup/render-link.html
+++ /dev/null
@@ -1,6 +0,0 @@
-{{ $url := .Destination | safeURL }}
-{{ if or (strings.HasPrefix $url "http://") (strings.HasPrefix $url "https://") }}
- <a href="{{ $url }}" class="external-link" target="_blank" rel="noopener noreferrer">{{ .Text }}</a>
-{{ else }}
- <a href="{{ $url }}">{{ .Text }}</a>
-{{ end }}
diff --git a/layouts/_markup/render-table.html b/layouts/_markup/render-table.html
deleted file mode 100644
index 010942f0..00000000
--- a/layouts/_markup/render-table.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<div class="overflow-x-auto">
- <table class="border-collapse w-max min-w-full table-fixed
- b-t-2 b-t-solid b-t-[var(--border-color)]"
- style="-webkit-overflow-scrolling: touch;">
- {{- if .THead }}
- <thead>
- {{- range .THead }}
- <tr class="b-t-1 b-t-solid b-t-[var(--border-color)]">
- {{- range . }}
- <th
- class="max-w-[200px] py-2 px-4 leading-snug whitespace-normal break-words"
- {{ with .Alignment }} style="text-align:{{ . }}"{{ end }}
- >{{ .Text | safeHTML }}</th>
- {{- end }}
- </tr>
- {{- end }}
- </thead>
- {{- end }}
- <tbody>
- {{- range .TBody }}
- <tr class="b-t-1 b-t-solid b-t-[var(--border-color)]">
- {{- range . }}
- <td
- class="max-w-[200px] py-2 px-4 leading-snug whitespace-normal break-words"
- {{ with .Alignment }} style="text-align:{{ . }}"{{ end }}
- >{{ .Text | safeHTML }}</td>
- {{- end }}
- </tr>
- {{- end }}
- </tbody>
- </table>
-</div>
diff --git a/layouts/_partials/components/back-to-top.html b/layouts/_partials/components/back-to-top.html
deleted file mode 100644
index 157fbe7b..00000000
--- a/layouts/_partials/components/back-to-top.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<div id="back2top" class="fixed -top-25 left-0 right-0 z-30
- flex justify-center items-center transition-all animate-head-shake
- bg-linear-to-t bg-gradient-from-transparent bg-gradient-to-zinc">
- <button id="back2top-button"
- class="block bg-transparent mt-5 flex flex-col items-center">
- <img src="/img/bat.svg"
- class="block w-8 h-8 dark:invert-100 drop-shadow-xl"
- alt="Back to top"
- />
- <p id="back2top-instruction"
- class="text-size-xs bg-black/80 text-white px-2 py-1 border rounded">
- {{ T "back2top" . }}
- </p>
- </button>
-</div>
-
diff --git a/layouts/_partials/components/backlinks.html b/layouts/_partials/components/backlinks.html
deleted file mode 100644
index e97c295c..00000000
--- a/layouts/_partials/components/backlinks.html
+++ /dev/null
@@ -1,37 +0,0 @@
-{{ $type := .type }}
-{{ $filename := .filename }}
-{{ $ctx := .context }}
-{{ $referencedBy := slice }}
-
-{{ if eq $type "library" }}
- {{ range $ctx.Site.Pages }}
- {{ if and (isset .Params "mentioned_books") (in .Params.mentioned_books $filename) }}
- {{ $referencedBy = $referencedBy | append . }}
- {{ end }}
- {{ end }}
-{{ else if eq $type "cards" }}
- {{ range $ctx.Site.Pages }}
- {{ if and (isset .Params "related_cards") (in .Params.related_cards $filename) }}
- {{ $referencedBy = $referencedBy | append . }}
- {{ end }}
- {{ end }}
-{{ end }}
-
-{{- /* 如果有文章引用这个卡片,就显示它们 */ -}}
-{{ if gt (len $referencedBy) 0 }}
-<section class="related-posts post-content my-5">
- <h2 class="text-size-base m-0 flex items-center gap-2">
- <span>反向链接</span>
- <span class="inline-block bg-blockBg rounded-full px-1 text-secondary cursor-help text-size-sm"
- data-tooltip="这里列出了引用了该页面的其他文章">?</span>
- </h2>
- <ul class="my-4 list-none ps-4">
- {{- range $referencedBy }}
- <li class="flex gap-4">
- <span class="text-secondary">→</span>
- <a href="{{ .Permalink }}">{{ .Title }}</a>
- </li>
- {{- end }}
- </ul>
-</section>
-{{ end }}
diff --git a/layouts/_partials/components/category-pill.html b/layouts/_partials/components/category-pill.html
deleted file mode 100644
index 6146f0d4..00000000
--- a/layouts/_partials/components/category-pill.html
+++ /dev/null
@@ -1,7 +0,0 @@
-{{ with .GetTerms "categories" }}
- {{ with index . 0 }}
- <a class="post-category text-secondary" href="{{ .RelPermalink }}">
- <span>《{{ .LinkTitle }}》</span>
- </a>
- {{ end }}
-{{ end }}
diff --git a/layouts/_partials/components/date.html b/layouts/_partials/components/date.html
deleted file mode 100644
index 398e2b1d..00000000
--- a/layouts/_partials/components/date.html
+++ /dev/null
@@ -1,31 +0,0 @@
-{{ if .Date }}
- {{ $hour := .Date.Hour }}
- {{ $fuzzyTimes := slice
- (dict "limit" 5 "label" (T "fuzzyTimes.afterMidnight"))
- (dict "limit" 7 "label" (T "fuzzyTimes.earlyMorning"))
- (dict "limit" 11 "label" (T "fuzzyTimes.morning"))
- (dict "limit" 13 "label" (T "fuzzyTimes.noon"))
- (dict "limit" 17 "label" (T "fuzzyTimes.afternoon"))
- (dict "limit" 19 "label" (T "fuzzyTimes.evening"))
- (dict "limit" 22 "label" (T "fuzzyTimes.night"))
- }}
- {{ $fuzzyTime := (T "fuzzyTimes.midnight") }} {{/* default */}}
- {{ range $fuzzyTimes }}
- {{ if lt $hour .limit }}
- {{ $fuzzyTime = .label }}
- {{ break }}
- {{ end }}
- {{ end }}
-
- <time class="post-date dt-published"
- datetime="{{ .Date.Format "2006-01-02 15:04:05 MST" }}"
- data-pagefind-sort="date[datetime], weight[data-weight]"
- data-weight="20">
- {{ if eq .Site.Language.Lang "zh" }}
- {{ .Date.Format "2006年1月2日" }}
- {{ else }}
- {{ .Date.Format "January 2, 2006" }},
- {{ end }}
- {{ $fuzzyTime }}
- </time>
-{{ end }}
diff --git a/layouts/_partials/components/logo.html b/layouts/_partials/components/logo.html
deleted file mode 100644
index 88c2284e..00000000
--- a/layouts/_partials/components/logo.html
+++ /dev/null
@@ -1,18 +0,0 @@
-{{ $ctx := .ctx }}
-{{ $link := .link | default "" }}
-{{- $src :=
- (or .ctx.Params.logo
- (printf "%s%s"
- (.ctx.Site.Params.assetBaseUrl)
- (.ctx.Site.Params.logo)))
--}}
-{{ $class := .class | default "" }}
-{{ $imageClass := .imageClass | default "" }}
-
-<a href="{{ $ctx.Site.LanguagePrefix }}/{{ $link }}"
- class="title-image-container {{ $class }}">
- <img src="{{ $src }}" alt="Logo"
- class="dark:invert title-image {{ $imageClass }}"
- style="view-transition-name: title-image"
- />
-</a>
diff --git a/layouts/_partials/components/microformats.html b/layouts/_partials/components/microformats.html
deleted file mode 100644
index 8cd64f50..00000000
--- a/layouts/_partials/components/microformats.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<div class="hidden p-author h-card pt">
- <img class="u-photo icon" alt="{{ .Site.Params.author.name }}"
- src="{{ printf "%s%s" .Site.Params.assetBaseUrl .Site.Params.author.avatar }}" />
- <a class="p-name u-url" href="{{ .Site.BaseURL }}"
- >{{ .Site.Params.author.name }}</a
- >
-</div>
-
-<a href="{{ .Permalink }}" class="u-url hidden"></a>
diff --git a/layouts/_partials/components/section-title.html b/layouts/_partials/components/section-title.html
deleted file mode 100644
index 698f71e8..00000000
--- a/layouts/_partials/components/section-title.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{{ $left := .Left }}
-{{ $right := .Right }}
-<h2 class="border-b-2 border-b-solid border-[var(--border-color)]
- py-2 text-6 flex justify-between items-center
- sticky top-0 bg-[var(--background-color)] z-1">
- <span>{{ $left }}</span>
- <span class="font-mono text-secondary text-3">
- {{ $right }}
- </span>
-</h2>
diff --git a/layouts/_partials/components/shade-mask.html b/layouts/_partials/components/shade-mask.html
deleted file mode 100644
index c53415d8..00000000
--- a/layouts/_partials/components/shade-mask.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<!-- 上渐变 -->
-<div class="pointer-events-none fixed top-0 left-0 w-full h-22 z-20
- bg-gradient-to-b from-bg to-transparent "></div>
-
-<!-- 下渐变 -->
-<div class="pointer-events-none fixed bottom-0 left-0 w-full h-22 z-20
- bg-gradient-to-t from-bg to-transparent "></div>
diff --git a/layouts/_partials/components/svg-filters.html b/layouts/_partials/components/svg-filters.html
deleted file mode 100644
index 5e68d6ec..00000000
--- a/layouts/_partials/components/svg-filters.html
+++ /dev/null
@@ -1,4 +0,0 @@
-<div style="display:none;">
- <svg class="hidden" xmlns="http://www.w3.org/2000/svg"><filter id="x" height="500%"><feTurbulence baseFrequency="0.01 0.02" numOctaves="2" result="t0"></feTurbulence><feDisplacementMap in="SourceGraphic" in2="t0" result="d0" scale="4"></feDisplacementMap><feComposite in="SourceGraphic" in2="d0" operator="atop" result="0"></feComposite><feTurbulence baseFrequency="1" numOctaves="2" result="t1"></feTurbulence><feDisplacementMap in="0" in2="t1" result="d1" scale="1"></feDisplacementMap><feComposite in="0" in2="d1" operator="atop" result="1"></feComposite><feOffset dx="-3" dy="-3" in="1"></feOffset></filter></svg>
- <svg class="hidden" xmlns="http://www.w3.org/2000/svg"><filter id="xs"><feTurbulence baseFrequency="0.01 0.02" numOctaves="2" result="t0"></feTurbulence><feDisplacementMap in="SourceGraphic" in2="t0" result="d0" scale="4"></feDisplacementMap><feComposite in="SourceGraphic" in2="d0" operator="atop" result="0"></feComposite><feTurbulence baseFrequency="1" numOctaves="2" result="t1"></feTurbulence><feDisplacementMap in="0" in2="t1" result="d1" scale="1"></feDisplacementMap><feComposite in="0" in2="d1" operator="atop" result="1"></feComposite><feOffset dx="-3" dy="-3" in="1"></feOffset></filter></svg>
-</div>
diff --git a/layouts/_partials/components/tags.html b/layouts/_partials/components/tags.html
deleted file mode 100644
index 78d87f5b..00000000
--- a/layouts/_partials/components/tags.html
+++ /dev/null
@@ -1,3 +0,0 @@
-{{ range .Params.tags }}
-<a class="tag text-secondary no-underline!" href="{{ site.LanguagePrefix }}/tags/{{ lower . | urlize }}/">#{{ . }}</a>
-{{ end }}
diff --git a/layouts/_partials/components/wordcount.html b/layouts/_partials/components/wordcount.html
deleted file mode 100644
index 526acaa4..00000000
--- a/layouts/_partials/components/wordcount.html
+++ /dev/null
@@ -1 +0,0 @@
-<span>{{ printf (T "postPage.wordcount") .WordCount }}</span>
diff --git a/layouts/_partials/content.html b/layouts/_partials/content.html
deleted file mode 100644
index c3c61cd5..00000000
--- a/layouts/_partials/content.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<div class="e-content min-h-[60%] leading-loose mb-8 markdown-body text-size-md md:text-size-lg"
- style="view-transition-name: post-content-{{ .File.UniqueID }}">
- {{ partial "posts/toc" . }}
- <div id="post-content">
- {{ partial "utils/render" .Content }}
- </div>
- {{ partial "posts/endnotes" . }}
-</div>
-
diff --git a/layouts/_partials/footer.html b/layouts/_partials/footer.html
deleted file mode 100644
index bf28dc51..00000000
--- a/layouts/_partials/footer.html
+++ /dev/null
@@ -1,39 +0,0 @@
-<footer class="pagefind-exclude my-8 mx-auto font-mono px-4 md:px-0
- text-sm
- md:w-[var(--page-width)] md:flex md:justify-between">
- <!-- copyright -->
- <section>
- <p class="copyright">&copy; 2022-{{ now | dateFormat "2006" }} <a href="https://www.eltr.ac/" target="_blank">Eltrac</a></p>
- <p class="license">{{ T "footer.licenseStatement" (printf "<a href=\"https://creativecommons.org/licenses/by-sa/4.0/\" target=\"_blank\">CC BY-SA 4.0</a>") | safeHTML }}</p>
- </section>
- <!-- links -->
- <section class="flex justify-between items-center
- md:justify-start md:flex-col md:items-end">
-
- <!-- IndieWeb ring -->
- <p class="inline-flex justify-center items-center gap-2">
- <a href="https://xn--sr8hvo.ws/previous">←</a>
- <a href="https://xn--sr8hvo.ws">IndieWeb ring</a>
- <a href="https://xn--sr8hvo.ws/next">→</a>
- </p>
- <!-- External Links -->
- <ul class="list-style-none flex items-center gap-2 ps-0 m-0 md:justify-end">
- {{ range .Site.Params.footerExternalLinks }}
- <li class="inline-flex items-center">
- <a href="{{ .link }}" title="{{ .name }}" target="_blank" data-tooltip
- class="transition opacity-70 hover:opacity-100">
- <img
- class="h-4 w-auto inline-block grayscale dark:invert"
- src="{{ .icon }}"
- alt="{{ .name }} icon."
- loading="lazy"
- width="1rem"
- height="1rem"
- />
- </a>
- </li>
- {{ end }}
- </ul>
-
- </section>
-</footer>
diff --git a/layouts/_partials/head.html b/layouts/_partials/head.html
deleted file mode 100644
index 3a8cd25c..00000000
--- a/layouts/_partials/head.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<head>
- <meta charset="utf-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1" />
- <link rel="preconnect" href="https://r2.eltr.ac" />
- {{ hugo.Generator }}
- {{ partial "head/siteinfo" . }}
- {{ partial "head/verification" . }}
- {{ partial "head/css" . }}
- {{ partial "head/scripts" . }}
-</head>
diff --git a/layouts/_partials/head/css.html b/layouts/_partials/head/css.html
deleted file mode 100644
index 7ff49fd5..00000000
--- a/layouts/_partials/head/css.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!-- Pagefind -->
-<link rel="stylesheet" href="/pagefind/pagefind-ui.css">
-
-<!-- Extra -->
-{{ range .Site.Params.extraCSSFiles -}}
-<link
- rel="stylesheet"
- href="{{ $.Site.Params.staticPrefix }}{{ . | relURL }}"
-/>
-{{- end }}
-
-<!-- theme css -->
-{{ with resources.Get "css/uno.css" | minify }}
-<style>{{ .Content | safeCSS }}</style>
-{{ end }}
-
-{{ with resources.Get "css/main.scss" | css.Sass | minify }}
-<style>{{ .Content | safeCSS }}</style>
-{{ end }}
diff --git a/layouts/_partials/head/scripts.html b/layouts/_partials/head/scripts.html
deleted file mode 100644
index f067944c..00000000
--- a/layouts/_partials/head/scripts.html
+++ /dev/null
@@ -1,4 +0,0 @@
-{{ with resources.Get "js/darkmode.js" }}
-<script>{{ .Content | safeJS }}</script>
-{{ end }}
-
diff --git a/layouts/_partials/head/siteinfo.html b/layouts/_partials/head/siteinfo.html
deleted file mode 100644
index e251a009..00000000
--- a/layouts/_partials/head/siteinfo.html
+++ /dev/null
@@ -1,59 +0,0 @@
-<!-- Link preview meta tags -->
-{{- $isHome := .IsHome -}}
-{{- $title := cond $isHome .Site.Title .Title -}}
-{{- $description := cond $isHome .Site.Params.description (default .Summary .Description | plainify) -}}
-{{- $ogType := cond $isHome "website" "article" -}}
-{{- $image := cond (isset .Params "banner")
- .Params.banner
- (cond (isset .Params "cover")
- .Params.cover
- .Site.Params.favicon)
--}}
-
-<title>{{ $title }}</title>
-<link rel="canonical" href="{{ .Permalink }}" />
-<meta name="author" content="{{ .Site.Params.author.name }}" />
-<link rel="icon" href="{{ .Site.Params.favicon }}">
-<meta property="og:url" content="{{ .Permalink }}" />
-<meta property="og:title" content="{{ $title }}" />
-<meta property="og:type" content="{{ $ogType }}" />
-<meta property="og:description" content="{{ $description }}" />
-<meta name="description" content="{{ $description }}" />
-<meta property="og:locale" content="{{ .Site.LanguageCode }}" />
-<meta property="og:image" content="{{ $image }}" />
-
-<!-- RSS -->
-<link rel="alternate" type="application/atom+xml" href="{{.Site.BaseURL}}index.xml" title="{{ .Site.Title }}">
-<link href="{{ .Site.Params.staticPrefix }}{{ "index.xml" | relURL }}" rel="alternate" type="application/rss+xml"
- title="{{ .Site.Title }}">
-
-<!-- JSON-LD -->
-<script type="application/ld+json">
- {
- "@context" : "http://schema.org",
- "@type" : "BlogPosting",
- "mainEntityOfPage": {
- "@type": "WebPage",
- "@id": "{{ .Site.BaseURL }}"
- },
- "articleSection" : "{{ .Section }}",
- "name" : "{{ .Title }}",
- "headline" : "{{ .Title }}",
- {{ if .IsHome -}}
- "description" : "{{ .Site.Params.description | plainify }}",
- {{- else -}}
- "description" : "{{ default .Summary .Description | plainify }}",
- {{- end }}
- "inLanguage" : "zh-CN",
- "author" : "{{ .Site.Params.author.name }}",
- "creator" : "{{ .Site.Params.author.name }}",
- "publisher": "{{ .Site.Params.author.name }}",
- "accountablePerson" : "{{ .Site.Params.author.name }}",
- "copyrightHolder" : "{{ .Site.Params.author.name }}",
- "copyrightYear" : "{{ .Date.Format "2006" }}",
- "datePublished": "{{ .Date }}",
- "dateModified" : "{{ .Date }}",
- "url" : "{{ .Permalink }}",
- "keywords" : [ {{ if isset .Params "tags" }}{{ range .Params.tags }}"{{ . }}",{{ end }}{{ end }} ]
- }
-</script>
diff --git a/layouts/_partials/head/verification.html b/layouts/_partials/head/verification.html
deleted file mode 100644
index 11705435..00000000
--- a/layouts/_partials/head/verification.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!-- verify my identity -->
-<link rel="me" href="https://c7.io/@eltrac">
-<link rel="me" href="https://akk.eltr.ac/@eltrac">
-<link rel="me" href="https://github.com/BigCoke233" />
-<link rel="me" href="mailto:hi@guhub.cn" />
-<link rel="me" href="mailto:hi@eltr.ac" />
-<meta name="fediverse:creator" content="@eltrac@eltr.ac">
-
-<!-- webmention -->
-<link rel="webmention" href="https://wm.geedea.pro/endpoint" />
diff --git a/layouts/_partials/header.html b/layouts/_partials/header.html
deleted file mode 100644
index 279c822b..00000000
--- a/layouts/_partials/header.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<header class="pagefind-exclude
- md:flex md:justify-between mb-4 mx-auto max-w-[var(--page-width)]">
- <!-- Logo & Title -->
- <div class="flex items-center justify-center gap-5
- md:flex-col md:items-start md:justify-start md:gap-2">
- {{ partial "components/logo" (dict "imageClass" "w-12 md:w-20 h-auto" "ctx" .) }}
- <a class="text-8 font-900 text-center tracking-widest
- xerox hover:no-underline"
- href="{{ .Site.LanguagePrefix }}/"
- >
- {{ if .IsHome }}
- {{ .Site.Title }}
- {{ else }}
- {{ if eq .Kind "term" }}
- {{ if eq .Data.Singular "tag" }}#{{ else }}+{{ end }}
- {{ end }}
- {{ .Title }}
- {{ end }}
- </a
- >
- </div>
- <!-- Navigation -->
- <div class="flex justify-center items-center gap-3 text-size-base
- md:flex-col md:items-end md:justify-start md:pl-6">
- {{ partial "header/navigation" . }}
- {{ partial "header/other-navigation" . }}
- </div>
-</header>
diff --git a/layouts/_partials/header/navigation.html b/layouts/_partials/header/navigation.html
deleted file mode 100644
index 168d614f..00000000
--- a/layouts/_partials/header/navigation.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<nav class="my-6 flex justify-center items-center w-fit rounded-4 overflow-hidden">
- {{ range .Site.Params.nav }}
- <a class="inline-block py-1 px-[0.35rem] md:px-2 first:pl-3 last:pr-3
- block hover:no-underline text-nowrap
- {{ if eq $.Page.RelPermalink .link }}
- text-[var(--text-color)] bg-[var(--block-background-color)]
- {{ else }}
- text-[var(--background-color)] bg-[var(--text-color)]
- {{ end }}"
- href="{{ .link }}"
- >{{ .name }}</a>
- {{ end }}
-</nav>
diff --git a/layouts/_partials/header/other-navigation.html b/layouts/_partials/header/other-navigation.html
deleted file mode 100644
index 4be0dba0..00000000
--- a/layouts/_partials/header/other-navigation.html
+++ /dev/null
@@ -1,29 +0,0 @@
-{{ $langButtonSize := "w-4 h-4" }}
-
-<div class="flex gap-2 pr-2">
- <!-- theme switch -->
- <label for="theme-select" class="hidden">colorscheme</label>
- <select id="theme-select"
- class="bg-neutral/10 border-1 border-[var(--text-color)] border-solid rd text-[var(--text-color)] font-serif text-size-[0.5rem] font-extrabold">
- {{ $switches := slice "auto" "light" "dark" }}
- {{ range $switches }}
- <option value="{{ . }}">{{ T (printf "theme.%s" .) }}</option>
- {{ end }}
- </select>
- <!-- language switch -->
- {{- $lang := .Site.Language.Lang -}}
- {{- $switch := dict
- "en" (dict "url" "/zh/" "label" "ZH" "title" "查看中文博客")
- "zh" (dict "url" "/en/" "label" "EN" "title" "View English Blog") -}}
- {{- $entry := index $switch $lang -}}
- <a
- href="{{ $entry.url }}"
- class="rd-full text-center hover:no-underline {{ $langButtonSize }}
- bg-neutral/10 border-1 border-[var(--text-color)] border-solid
- bg-[var(--block-background-color)]
- flex items-center justify-center"
- title="{{ $entry.title }}"
- >
- <span class="text-size-[0.5rem] font-extrabold">{{ $entry.label }}</span>
- </a>
-</div>
diff --git a/layouts/_partials/home/home-nav-item.html b/layouts/_partials/home/home-nav-item.html
deleted file mode 100644
index b9b70c0f..00000000
--- a/layouts/_partials/home/home-nav-item.html
+++ /dev/null
@@ -1,15 +0,0 @@
-{{ $active := .active }}
-{{ $link := .link }}
-{{ $text := .text }}
-
-<a href="{{ .Site.LanguagePrefix }}{{ $link }}"
- class="texl-base md:text-lg relative
- hover:no-underline relative
- {{ if $active }}font-extrabold{{ end }}"
->
- {{ $text }}
- {{ if $active }}
- <div class="absolute left-0 right-0 text-center top-3"
- style="view-transition-name: home-nav-item-emphasis;">·</div>
- {{ end }}
-</a>
diff --git a/layouts/_partials/home/home-nav.html b/layouts/_partials/home/home-nav.html
deleted file mode 100644
index ce66e563..00000000
--- a/layouts/_partials/home/home-nav.html
+++ /dev/null
@@ -1,11 +0,0 @@
-{{ if eq .Site.Language.Lang "zh" }}
-<nav id="home-nav" class="relative w-full ps-0 flex list-none gap-4 text-size-sm mx-auto max-w-[var(--page-width)]">
- {{ range .Site.Params.homenav }}
- {{ partial "home/home-nav-item" (dict
- "text" .name
- "link" .link
- "active" (eq .link $.Page.RelPermalink)
- ) }}
- {{ end }}
-</nav>
-{{ end }}
diff --git a/layouts/_partials/home/latest-posts.html b/layouts/_partials/home/latest-posts.html
deleted file mode 100644
index ac015111..00000000
--- a/layouts/_partials/home/latest-posts.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<!-- Latest Posts -->
-<section class="pagefind-exclude flex flex-col my-4">
- {{ $firstPost := true }}
- {{ range first 12 (where site.RegularPages "Type" "in" site.Params.mainSections) }}
- {{ partial "items/post" (dict
- "ctx" .
- "showSummary" $firstPost
- ) }}
- {{ $firstPost = false }}
- {{ end }}
-</section>
diff --git a/layouts/_partials/home/microformats.html b/layouts/_partials/home/microformats.html
deleted file mode 100644
index 8641b04c..00000000
--- a/layouts/_partials/home/microformats.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<div class="hidden p-author h-card pt">
- <img class="u-photo icon" alt="{{ .Site.Params.author.name }}"
- src="{{ printf "%s%s" .Site.Params.assetBaseUrl .Site.Params.author.avatar }}" />
- <a class="p-name u-url" rel="me" href="{{ .Site.BaseURL }}"
- >{{ .Site.Params.author.name }}</a>
- <a class="u-url" rel="me" href="https://www.eltr.ac/">Home</a>
-</div>
diff --git a/layouts/_partials/home/more-links.html b/layouts/_partials/home/more-links.html
deleted file mode 100644
index 6201f642..00000000
--- a/layouts/_partials/home/more-links.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<!-- more links: see archive & slash pages -->
-<div class="flex justify-between items-center">
- <div>
- <a class="small-button" href="{{ if eq .Site.Language.Lang "zh" }}/archive{{ else }}{{ .Site.LanguagePrefix }}/posts{{ end }}">
- {{ T "seeArchive" }} →
- </a>
- </div>
- <ul class="list-none flex gap-1 md:gap-2 text-sm md:text-base ps-0 my-2 mx-0 md:justify-end">
- {{ range .Site.Params.internalLinks }}
- <li><a href="{{ .link }}" title="{{ .name }}"
- class="text-secondary">{{ .name }}</a></li>
- <li class="text-secondary last:hidden">·</li>
- {{ end }}
- </ul>
-</div>
diff --git a/layouts/_partials/items/book.html b/layouts/_partials/items/book.html
deleted file mode 100644
index 5b6e61c2..00000000
--- a/layouts/_partials/items/book.html
+++ /dev/null
@@ -1,36 +0,0 @@
-{{ $ctx := .ctx }}
-{{ $NoViewTransition := (or .NoViewTransition false) }}
-
-<!-- Transform cover images via Cloudflare URL patterns -->
-{{ $splitURL := split $ctx.Params.cover "/" }}
-{{ $cover := "" }}
-{{ $i := 0 }}
-{{ range $splitURL }}
- {{ if eq $i 3 }}
- {{ $cover = printf "%s%s" $cover "cdn-cgi/image/width=150,quality=75/" }}
- {{ end }}
- {{ $cover = printf "%s%s/" $cover . }}
- {{ $i = add $i 1 }}
-{{ end }}
-{{ $cover = strings.TrimSuffix "/" $cover }}
-
-<div{{ if eq .Params.rating 1 }} class="opacity-50 z-0"{{ end }}
- {{ if not $NoViewTransition }}style="view-transition-name: book-{{ $ctx.File.UniqueID }}"{{ end }}>
- <a href="{{ $ctx.Permalink }}"
- {{ if not $NoViewTransition }}style="view-transition-name: book-{{ $ctx.Title }}"{{ end }}
- class="border-3 border-solid rotate-3 shadow-md block
- hover:rotate-0 hover:-translate-y-2 hover:scale-110 transition
-
- {{ if eq $ctx.Params.rating 1 }} relative
- {{ else if eq $ctx.Params.rating 5 }} border-amber-300 shadow-amber-200 shadow-xl
- {{ else }} border-white{{ end }}">
- <img class="lazy w-full block min-h-[120px] bg-neutral-500" src="{{ $cover }}" />
- {{ if eq $ctx.Params.rating 1 }}
- <div class="absolute z-1 top-[25%] left-[25%] h-[50%] w-[50%]"
- style="background-image: url('https://r2.eltr.ac/uPic/2025/05/thumbs-down.png');
- background-size: 100%;
- background-position: center;
- background-repeat: no-repeat;"></div>
- {{ end }}
- </a>
-</div>
diff --git a/layouts/_partials/items/card.html b/layouts/_partials/items/card.html
deleted file mode 100644
index 01a3cfb8..00000000
--- a/layouts/_partials/items/card.html
+++ /dev/null
@@ -1,19 +0,0 @@
-{{ $ctx := .context }}
-{{ $showSummary := .summary }}
-{{ $summaryClass := .summaryClass }}
-<div class="relative p-6 bg-white dark:bg-neutral-800 rounded-lg shadow-md border border-gray-200 dark:border-gray-700"
- style="view-transition-name: card-{{ $ctx.File.UniqueID }}">
- <div class="card-header">
- <h3 class="text-xl font-extrabold m-0 text-gray-900 dark:text-gray-100"
- data-pagefind-meta="title"
- data-pagefind-sort="date[data-date], weight[data-weight]"
- data-date="{{ .Date.Format "2006-01-02" }}"
- data-weight="5">
- <a href="{{ $ctx.RelPermalink }}" class="no-underline! text-[var(--text-color)]!">{{ $ctx.Title }}</a>
- </h3>
- <div class="text-base m-0">{{ partial "components/tags" $ctx }}</div>
- </div>
- <div class="{{ $summaryClass }} mt-2 leading-loose markdown-body">
- {{ if $showSummary }}{{ $ctx.Summary }}{{ else }}{{ $ctx.Content }}{{ end }}
- </div>
-</div>
diff --git a/layouts/_partials/items/post-small.html b/layouts/_partials/items/post-small.html
deleted file mode 100644
index 28a4a995..00000000
--- a/layouts/_partials/items/post-small.html
+++ /dev/null
@@ -1,11 +0,0 @@
-{{ $isWeekly := (eq .Params.categories "稻草人周刊") }}
-<li class="flex justify-between text-size-lg
- {{ if $isWeekly }} weekly animate-duration-500 transition-opacity{{ end }}">
- <a href="{{ .RelPermalink }}">
- {{ .Title }}{{ with .Params.subtitle }}:<span class="text-secondary">{{. }}</span>
- {{ end }}
- </a>
- <time class="text-size-sm font-mono text-secondary flex-shrink-0">
- {{ .Date.Format "2006-1-2" }}
- </time>
-</li>
diff --git a/layouts/_partials/items/post.html b/layouts/_partials/items/post.html
deleted file mode 100644
index 5527ea6c..00000000
--- a/layouts/_partials/items/post.html
+++ /dev/null
@@ -1,41 +0,0 @@
-{{ $ctx := .ctx }}
-{{ $showSummary := .showSummary }}
-<div class="posts-item w-full my-2"
- style="view-transition-name: post-{{ .ctx.File.UniqueID }}">
- <header class="w-full md:flex md:justify-between">
- <div>
- <p class="font-mono text-secondary">
- <time>{{ .ctx.Date.Format "January 2" }},</time>
- <span>in <a href="/{{ .ctx.Section }}/">{{ .ctx.Section }}</a></span>
- </p>
- <h2 class="xerox"
- {{ if $showSummary }} style="margin-bottom: 0"{{ end }}>
- <a href="{{ .ctx.Permalink }}">
- {{ if eq .ctx.Section "library" }}
- 读《{{ .ctx.Title }}》
- {{ else }}
- {{ .ctx.Title }}
- {{ end }}
- </a>
- {{ if eq .ctx.Section "fictions" }}
- <span class="font-normal text-4 text-secondary">小说</span>
- {{ end }}
- </h2>
- </div>
- {{ with .ctx.Params.categories }}
- <div class="my-4">
- {{ partial "components/category-pill" $ctx }}
- </div>
- {{ end }}
- </header>
- {{ if or $showSummary .ctx.Params.description }}
- <div class="markdown-body text-size-lg leading-relaxed"
- style="view-transition-name: post-content-{{ .ctx.File.UniqueID }}">
- {{ if $showSummary }}
- {{ .ctx.Summary }}
- {{ else if .ctx.Params.description }}
- {{ .ctx.Params.description }}
- {{ end }}
- </div>
- {{ end }}
-</div>
diff --git a/layouts/_partials/posts/action-area.html b/layouts/_partials/posts/action-area.html
deleted file mode 100644
index 06f0003d..00000000
--- a/layouts/_partials/posts/action-area.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<div popover
- id="action-area"
- class="bg-white dark:bg-neutral-800
- border border-neutral-200 dark:border-neutral-600
- rd-md shadow-lg p-4 w-80">
- <div class="grid grid-cols-2 gap-4">
- {{ partial "posts/fediverse-form" . }}
- {{ partial "posts/webmention-form" . }}
- </div>
- <div class="flex justify-between mt-2 items-center">
- <p class="text-sm text-secondary m-0"><a href="mailto:hi@eltr.ac?subject=Re%3A%20{{ .Title }}">📧 {{ T "actionMenu.email" }}</a></p>
- {{ if eq .Site.Language.Lang "zh" }}
- <p class="m-0 text-xs"><a class="text-secondary" href="/posts/site-report-4/#所以怎么点赞和评论你的博客">这是什么?</a></p>
- {{ end }}
- </div>
-</div>
diff --git a/layouts/_partials/posts/banner.html b/layouts/_partials/posts/banner.html
deleted file mode 100644
index 6acaafdc..00000000
--- a/layouts/_partials/posts/banner.html
+++ /dev/null
@@ -1,9 +0,0 @@
-{{ $page := . }}
-{{ with .Params.banner }}
-<img
- class="lazy w-full h-auto block rounded-lg{{ if $page.Params.bannerAutoInvert }} dark:invert{{ end }}"
- loading="lazy"
- data-pagefind-meta="image[src]"
- src="{{ . }}"
->
-{{ end }}
diff --git a/layouts/_partials/posts/comment.html b/layouts/_partials/posts/comment.html
deleted file mode 100644
index 90757781..00000000
--- a/layouts/_partials/posts/comment.html
+++ /dev/null
@@ -1,38 +0,0 @@
-<!--
- Giscus has been abandoned since 2026-01-30,
- old data from GitHub Discussion and some other comment systems
- has been exported to `data/gicus.json`
- They are rendered here if found.
--->
-{{ $cutoffDate := time.AsTime "2026-01-30" }}
-{{ if .Params.Date.Before $cutoffDate }}
- {{ $giscusData := hugo.Data.giscus }}
- {{ $pageTitle := .Title }}
- {{ range $giscusData }}
- {{ if eq .title $pageTitle }}
- {{ $url := .url }}
- {{ with .comments.nodes }}
- <details>
- <summary class="text-size-sm text-secondary cursor-pointer">博客的评论区已经被禁用,旧的数据已经导出,可以点击这行字查看。</summary>
- <div class="my-4">
- {{ range . }}
- <div class="text-md py-4 px-1">
- <div class="mb-4 flex justify-between">
- <span class="font-bold">{{ .author.login }}</span>
- <span class="text-secondary">{{ .createdAt | time.Format "2006/01/02" }}</span>
- </div>
- <div>
- {{ .body | markdownify }}
- </div>
- </div>
- {{ end }}
- </div>
- {{ with $url }}
- <p><a href="{{ . }}" class="small-button" target="_blank">Full GitHub Discussion →</a></p>
- {{ end }}
- <hr />
- </details>
- {{ end }}
- {{ end }}
- {{ end }}
-{{ end }}
diff --git a/layouts/_partials/posts/endnotes.html b/layouts/_partials/posts/endnotes.html
deleted file mode 100644
index 107ffd77..00000000
--- a/layouts/_partials/posts/endnotes.html
+++ /dev/null
@@ -1,13 +0,0 @@
-{{ if .Params.endnotes }}
-<hr>
-<div id="post-endnotes" class="text-secondary text-4">
- <ul class="list-none">
- {{ range .Params.endnotes }}
- <li class="flex gap-4 pl-4">
- <span>→</span>
- <span>{{ . | markdownify }}</span>
- </li>
- {{ end }}
- </ul>
-</div>
-{{ end }}
diff --git a/layouts/_partials/posts/fediverse-form.html b/layouts/_partials/posts/fediverse-form.html
deleted file mode 100644
index faff355f..00000000
--- a/layouts/_partials/posts/fediverse-form.html
+++ /dev/null
@@ -1,14 +0,0 @@
-{{ if .Params.toot }}
-<div class="flex flex-col gap-2">
- <h4 class="text-sm font-semibold m-0 dark:text-white">{{ T "actionMenu.fediverse" }}</h4>
- <input type="text" id="fediverse-instance" placeholder="{{ T "actionMenu.fediversePlaceholder" }}" class="text-sm px-2 py-1 border border-neutral-300 dark:border-neutral-600 rounded bg-transparent dark:text-white">
- <div class="flex gap-2">
- <button id="fediform-copy-button" class="text-xs px-2 py-1 bg-neutral-100 dark:bg-neutral-700 rounded hover:bg-neutral-200 dark:hover:bg-neutral-700 transition-colors">📋</button>
-
- <button id="fediform-button" class="w-full text-xs px-2 py-1 bg-neutral-200 dark:bg-neutral-600 rounded hover:bg-neutral-300 dark:hover:bg-neutral-500 transition-colors">{{ T "actionMenu.openToot" }}</button>
- </div>
-</div>
-<script>
- const tootUrl = '{{ .Params.toot }}'
-</script>
-{{ end }}
diff --git a/layouts/_partials/posts/toc.html b/layouts/_partials/posts/toc.html
deleted file mode 100644
index 0bc96782..00000000
--- a/layouts/_partials/posts/toc.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{{ $top := cond (eq .Section "posts") "top-[19rem]" (cond (eq .Section "library") "top-[34rem]" "top-[17rem]") }}
-{{ if .Params.toc }}
-<div id="toc-container"
- class="absolute bottom-0 left-[calc(50%_+_var(--page-width)_/_2)] right-auto
- h-full w-[calc(50%_-_var(--page-width)_/_2)] {{ $top }} hidden lg:block">
- <div id="toc"
- class="sticky top-12 text-size-xs xl:text-size-sm 2xl:text-size-base w-full"
- >{{ .TableOfContents }}</div>
-</div>
-{{ end }}
diff --git a/layouts/_partials/posts/webmention-form.html b/layouts/_partials/posts/webmention-form.html
deleted file mode 100644
index 4499f89b..00000000
--- a/layouts/_partials/posts/webmention-form.html
+++ /dev/null
@@ -1,6 +0,0 @@
-<form action="https://wm.geedea.pro/endpoint" method="POST" class="flex flex-col gap-2">
- <h4 class="text-sm font-semibold m-0 dark:text-white">{{ T "actionMenu.webmention" }}</h4>
- <input type="url" name="source" placeholder="{{ T "actionMenu.webmentionPlaceholder" }}" class="text-sm px-2 py-1 border border-neutral-300 dark:border-neutral-600 rounded bg-transparent dark:text-white">
- <input type="hidden" name="target" value="{{ .Permalink }}">
- <button type="submit" class="text-xs px-2 py-1 bg-neutral-200 dark:bg-neutral-600 rounded hover:bg-neutral-300 dark:hover:bg-neutral-500 transition-colors">{{ T "actionMenu.send" }}</button>
-</form>
diff --git a/layouts/_partials/posts/webmention-mentions.html b/layouts/_partials/posts/webmention-mentions.html
deleted file mode 100644
index e4744bf7..00000000
--- a/layouts/_partials/posts/webmention-mentions.html
+++ /dev/null
@@ -1,56 +0,0 @@
-{{ with . }}
-<section class="my-4">
-<ul class="list-none p-0 m-0">
-{{ range . }}
- {{ if index . "microformats" }}
- {{ $mf := index . "microformats" "properties" }}
- {{ $author := dict }}
- {{ if $mf.author }}
- {{ if reflect.IsSlice $mf.author }}
- {{ $authorElem := index $mf.author 0 }}
- {{ if reflect.IsMap $authorElem }}
- {{ $author = index $authorElem "properties" }}
- {{ else }}
- {{ $author = $authorElem }}
- {{ end }}
- {{ else }}
- {{ $author = $mf.author }}
- {{ end }}
- {{ end }}
- {{ if eq (index .microformats.type 0) "h-card" }}
- {{ $author = $mf }}
- {{ end }}
- {{ $photo := "" }}
- {{ $authorName := "" }}
- {{ $authorUrl := "" }}
-
- {{ if reflect.IsMap $author }}
- {{ $photo = or (index . "extra" "proxied-photo") (index $author.photo 0) }}
- {{ $authorName = index $author.name 0 }}
- {{ $authorUrl = index $author.url 0 }}
- {{ else }}
- {{ $photo = index . "extra" "proxied-photo" }}
- {{ $authorName = $author }}
- {{ $authorUrl = .webmention.source }}
- {{ end }}
-
- <li class="flex gap-2">
- {{ if $photo }}
- <img src="{{ $photo }}" class="h-5 w-5 rd-full inline m-0">
- {{ else }}
- <div class="h-5 w-5 rd-full m-0 bg-neutral-300"></div>
- {{ end }}
- <a href="{{ $authorUrl }}" target="_blank">{{ $authorName }}</a>
- <a href="{{ .webmention.source }}" target="_blank">{{ T "webmention.mentionedThisPost" . }}</a>
- </li>
- {{ else }}
- <li class="flex gap-2">
- {{ $u := urls.Parse .webmention.source }}
- <div class="h-5 w-5 rd-full m-0 bg-neutral-300"></div>
- <span>{{ $u.Hostname }}</span>
- <a href="{{ .webmention.source }}" target="_blank">{{ T "webmention.mentionedThisPost" . }}</a></li>
- {{ end }}
-{{ end }}
-</ul>
-</section>
-{{ end }}
diff --git a/layouts/_partials/posts/webmention-replies.html b/layouts/_partials/posts/webmention-replies.html
deleted file mode 100644
index 66b64ef9..00000000
--- a/layouts/_partials/posts/webmention-replies.html
+++ /dev/null
@@ -1,69 +0,0 @@
-{{ with . }}
-<section class="flex flex-col gap-4 bg-[var(--background-color)]">
-{{ range . }}
- {{ $reply := index . "microformats" "properties" }}
- {{ $author := dict }}
- {{ $photo := "" }}
-
- {{ if $reply.author }}
- {{ if reflect.IsSlice $reply.author }}
- {{ $authorElem := index $reply.author 0 }}
- {{ if reflect.IsMap $authorElem }}
- {{ $author = index $authorElem "properties" }}
- {{ else }}
- {{ $author = $authorElem }}
- {{ end }}
- {{ $photo = or (index $author.photo 0) (index $reply.photo 0) }}
- {{ else }}
- {{ $author = $reply.author }}
- {{ $photo = index $reply.photo 0 }}
- {{ end }}
- {{ end }}
-
-<div class="relative">
- <header class="flex justify-between items-start">
- <div class="flex items-center gap-3">
- <img src="{{ $photo }}" alt="Profile Picture"
- class="h-8 w-8 rd-full" loading="lazy" />
- <div class="text-secondary">
- <p class="font-bold m-0">
- <a href="{{ if reflect.IsMap $author }}
- {{ or (index $author.url 0) (index $reply.url 0) }}
- {{ else }}
- {{ index $reply.url 0 }}
- {{ end }}">
- {{ if reflect.IsMap $author }}
- {{ replaceRE ":.*?:" "" (index $author.name 0) }}
- {{ else }}
- {{ $author }}
- {{ end }}
- </a>
- </p>
- {{ $time := (index $reply.published 0) }}
- {{ $isFormated := strings.Contains $time " " }}
- {{ if not $isFormated }}
- {{ $t := time.AsTime $time }}
- {{ $time = time.Format "2006-1-2 15:04" $t }}
- {{ end }}
- <p class="m-0"><time>{{ $time }}</time></p>
- </div>
- </div>
- <div class="flex items-start">
- <a href="{{ .webmention.source }}" target="_blank"
- title="{{ T "viewExternalSource" }}"
- data-tooltip>↗</a>
- </div>
- </header>
-
- <div class="max-h-[500px] overflow-y-auto overflow-x-hidden">
- <div class="webmention-body markdown-body leading-relaxed ml-3 pl-4 pr-2 b-l-4 b-l-solid b-neutral-200/50 dark:b-neutral-700/50">
- {{ index (index $reply.content 0) "html" | safeHTML }}
- {{ if strings.Contains .webmention.source "https://brid.gy" }}
- <p class="text-xs text-right text-secondary">通过 <a href="https://brid.gy/" target="_blank">Bridgy</a> 发送自联邦宇宙</p>
- {{ end }}
- </div>
- </div>
-</div>
-{{ end }}
-</section>
-{{ end }}
diff --git a/layouts/_partials/posts/webmention-summary.html b/layouts/_partials/posts/webmention-summary.html
deleted file mode 100644
index 18be7344..00000000
--- a/layouts/_partials/posts/webmention-summary.html
+++ /dev/null
@@ -1,54 +0,0 @@
-{{ $likes := .likes }}
-{{ $page := .page }}
-{{ $othercount := .othercount }}
-
-<section class="group relative mb-6 vertical-middle">
- <!-- Action Area Toggle -->
- <button
- popovertarget="action-area"
- data-tooltip
- title="{{ T "actionMenu.interact" }}"
- class="m-0 p-0 bg-transparent hover:no-underline cursor-pointer float-left mr-2">
- <div class="w-5 h-5 bg-neutral-200 dark:bg-neutral-600 flex justify-center items-center rd-full font-800">+</div>
- </button>
-
- <!-- Likes -->
- {{ range $likes }}
- {{ $authors := index . "microformats" "properties" "author" }}
- {{ $author := dict }}
- {{ $photo := "" }}
- {{ if $authors }}
- {{ if reflect.IsSlice $authors }}
- {{ $authorElem := index $authors 0 }}
- {{ if reflect.IsMap $authorElem }}
- {{ $author = index $authorElem "properties" }}
- {{ else }}
- {{ $author = $authorElem }}
- {{ end }}
- {{ else }}
- {{ $author = $authors }}
- {{ end }}
- {{ end }}
- {{ $photo = or (index . "extra" "proxied-photo") (index $author.photo 0) }}
- <a href="{{ if reflect.IsMap $author }}{{ index $author.url 0 }}{{ else }}#{{ end }}" target="_blank" title="{{ if reflect.IsMap $author }}{{ index $author.name 0 }}{{ else }}{{ $author }}{{ end }}" class="box-border hover:no-underline inline-block h-5 w-5 float-left -ml-1 hover:scale-150 transition-transform">
- {{ $value := math.Floor (mul math.Rand 80) }}
- {{ $rotate := cond (lt $value 40) (sub 10 $value) (sub $value 30) }}
- {{ if $photo }}
- <img src="{{ $photo }}" alt="Profile Picture"
- loading="lazy"
- class="h-5 w-5 rd-full transition-transform"
- style="{{ if ne $rotate 0 }}--rotate-amount: {{ $rotate }}deg;{{ end }}" />
- {{ else }}
- <div class="h-5 w-5 rd-full bg-neutral-300"></div>
- {{ end }}
- </a>
- {{ end }}
- <div class="text-secondary m-0 text-sm inline ml-2">
- {{ printf (T "webmention.likedBy") (len $likes ) }}
- {{ if gt $othercount 0 }}
- {{ printf (T "webmention.repliedAndMentionedBy") $othercount }}
- {{ end }}
- </div>
- <div class="clear-left"></div>
-</section>
-
diff --git a/layouts/_partials/posts/webmention.html b/layouts/_partials/posts/webmention.html
deleted file mode 100644
index 77b89f25..00000000
--- a/layouts/_partials/posts/webmention.html
+++ /dev/null
@@ -1,73 +0,0 @@
-{{ $page := . }}
-{{ $currentPagePath := .RelPermalink }}
-{{ $webmentions_url := .Site.Params.webmention.src }}
-
-{{ with try (resources.GetRemote $webmentions_url) }}
- {{ with .Err }}
- {{ errorf "%s" . }}
-
- {{ else with .Value }}
- {{ $webmentions := slice }}
- {{ $data := . | transform.Unmarshal }}
-
- {{ range $data }}
- {{ $urlObj := urls.Parse .webmention.target }}
- {{ $targetPath := $urlObj.Path }}
-
- {{ if or (strings.Contains $targetPath $currentPagePath)
- (strings.Contains $targetPath ($currentPagePath | urlquery)) }}
- {{ $webmentions = $webmentions | append . }}
- {{ end }}
- {{ end }}
-
- {{ $likes := slice }}
- {{ $replies := slice }}
- {{ $reposts := slice }}
- {{ $mentions := slice }}
-
- {{ range $webmentions }}
- {{ $props := index . "microformats" "properties" }}
- {{ $type := index . "microformats" "type" 0 }}
-
- {{ if eq $type "h-entry" }}
- {{ if index $props "like-of" }}
- {{ $likes = $likes | append . }}
-
-
- {{ else if index $props "repost-of" }}
- {{ $reposts = $mentions | append . }}
-
- {{ else }}
- {{ $replies = $replies | append . }}
-
- {{ end }}
- {{ else }}
- {{ $mentions = $mentions | append . }}
- {{ end }}
-
- {{ end }}
-
- {{ partial "posts/action-area" $page }}
- <details class="my-4 mb-5 no-mark">
- <summary class="cursor-pointer flex">
- {{ partial "posts/webmention-summary" (dict
- "likes" $likes
- "page" $page
- "othercount" (add (len $replies) (len $mentions))
- ) }}
- </summary>
- {{ with $page.Params.toot }}
- <p class="text-secondary text-sm">
- {{ $link := printf "<a href=\"%s\" target=\"_blank\">Eucalyptus</a>" . }}
- *{{ printf (T "webmention.bridgyNotice") $link | safeHTML }}
- </p>
- {{ end }}
- <div id="webmention-details">
- {{ partial "posts/webmention-replies" $replies }}
- {{ partial "posts/webmention-mentions" $mentions }}
- </div>
- </details>
- {{ else }}
- <p>Unable to fetch webmentions. Please contact webmaster.</p>
- {{ end }}
-{{ end }}
diff --git a/layouts/_partials/scripts.html b/layouts/_partials/scripts.html
deleted file mode 100644
index 5d782dd7..00000000
--- a/layouts/_partials/scripts.html
+++ /dev/null
@@ -1,43 +0,0 @@
-<!-- Theme Switch -->
-<script>
-document.addEventListener("DOMContentLoaded", () => {
- const themeSelect = document.getElementById('theme-select')
- themeSelect.value = localStorage.getItem('geedeapro.theme')
- themeSelect.onchange = () => switchTheme(themeSelect.value, true)
-})
-</script>
-
-<!-- global JS -->
-{{ $commonJS := slice
- (resources.Get "js/tooltip.js")
- (resources.Get "js/instantpage.min.js")
-}}
-{{ $commonBundle := $commonJS | resources.Concat "js/common-bundle.js" | minify | fingerprint }}
-<script src="{{ $commonBundle.RelPermalink }}" integrity="{{ $commonBundle.Data.Integrity }}" defer></script>
-
-<!-- content page only JS -->
-{{ if not .IsHome }}
- {{ $articleJS := slice
- (resources.Get "js/toc.js")
- (resources.Get "js/back2top.js")
- (resources.Get "js/fediform.js")
- }}
- {{ $articleBundle := $articleJS | resources.Concat "js/article-bundle.js" | minify | fingerprint }}
- <script src="{{ $articleBundle.RelPermalink }}" integrity="{{ $articleBundle.Data.Integrity }}" defer></script>
-{{ end }}
-
-<!-- libra.js -->
-<script type="module">
-document.addEventListener('DOMContentLoaded', async () => {
- const { default: LightBox } = await import('/js/libra.min.js');
- const lightbox = new LightBox({
- offset: { x: -8, y: -48 },
- selector: "[data-libra]:not(.disable-libra *)",
- });
-});
-</script>
-
-<!-- GoatCounter -->
-<script data-goatcounter="https://stats.geedea.pro/count"
- async src="//stats.geedea.pro/count.js"></script>
-
diff --git a/layouts/_partials/stats/external-link-rank.html b/layouts/_partials/stats/external-link-rank.html
deleted file mode 100644
index 4268d4d9..00000000
--- a/layouts/_partials/stats/external-link-rank.html
+++ /dev/null
@@ -1,37 +0,0 @@
-{{/* Find the maximum link count */}}
-{{ $max := 0 }}
-{{ range hugo.Data.externallinks }}
- {{ if gt (index . 1) $max }}
- {{ $max = index . 1 }}
- {{ end }}
-{{ end }}
-
-{{/* Sort by count (descending) */}}
-{{ $links := hugo.Data.externallinks }}
-{{ $sorted := slice }}
-{{ range $links }}
- {{ $sorted = $sorted | append (dict "domain" (index . 0) "count" (index . 1)) }}
-{{ end }}
-{{ $sorted = sort $sorted "count" "desc" }}
-
-<ol id="external-link-rank"
- class="p-0! m-0 box-border">
-{{ range $sorted }}
- {{ $label := .domain }}
- {{ $count := .count }}
- {{ if gt $count 4 }}
- {{ $percent := div (mul $count 100) $max }}
- <li class="list-none w-full my-2 box-border py-[0.1rem] px-2 relative">
- <div class="mx-2 flex justify-between items-center">
- <a class="inline-flex items-center gap-2 no-icon" href="https://{{ $label }}/" target="_blank">
- <img src="https://favicone.com/{{ $label }}?s=20"
- class="w-4 h-4 m-0!" loading="lazy" />
- {{ $label }}
- </a>
- <span class="text-secondary font-mono">{{ $count }}</span>
- </div>
- <div class="bg-gray-200 dark:bg-zinc-700 absolute top-0 left-0 right-0 bottom-0 -z-1" style="width:{{ $percent }}%"></div>
- </li>
- {{ end }}
-{{ end }}
-</ol>
diff --git a/layouts/_partials/stats/publish-time-chart.html b/layouts/_partials/stats/publish-time-chart.html
deleted file mode 100644
index 3fa35078..00000000
--- a/layouts/_partials/stats/publish-time-chart.html
+++ /dev/null
@@ -1,78 +0,0 @@
-{{/* 定义时间段 */}}
-{{ $fuzzyTimes := slice
- (dict "limit" 5 "label" "凌晨" "class" "dawn")
- (dict "limit" 11 "label" "早上" "class" "morning")
- (dict "limit" 13 "label" "中午" "class" "noon")
- (dict "limit" 17 "label" "下午" "class" "afternoon")
- (dict "limit" 22 "label" "晚上" "class" "night")
- (dict "limit" 24 "label" "深夜" "class" "late-night")
-}}
-
-{{/* 初始化时间段计数 */}}
-{{ $timeCounts := dict
- "凌晨" 0
- "清晨" 0
- "早上" 0
- "中午" 0
- "下午" 0
- "傍晚" 0
- "晚上" 0
- "深夜" 0
-}}
-
-{{/* 统计每个时间段的文章数量 */}}
-{{ $total := 0 }}
-{{ range .Site.RegularPages }}
- {{ if .Date }}
- {{ $hour := .Date.Hour }}
- {{ $fuzzyTime := "深夜" }}
- {{ range $fuzzyTimes }}
- {{ if lt $hour .limit }}
- {{ $fuzzyTime = .label }}
- {{ break }}
- {{ end }}
- {{ end }}
- {{ $total = add $total 1 }}
- {{ $currentCount := index $timeCounts $fuzzyTime }}
- {{ $timeCounts = merge $timeCounts (dict $fuzzyTime (add $currentCount 1)) }}
- {{ end }}
-{{ end }}
-
-<div class="w-full max-w-[700px] my-4">
- <div class="flex items-center gap-4 mb-4">
- <div class="text-size-2xl flex-shrink-0">☀️</div>
- <div class="flex gap-2 w-full h-6 dark:invert">
- {{ range $fuzzyTimes }}
- {{ $count := index $timeCounts .label }}
- {{ if gt $total 0 }}
- {{ $percentage := div (mul $count 100.0) $total }}
- {{ if gt $count 0 }}
- <div class="flex items-center justify-center
- text-white rounded-2xl text-size-sm font-500 relative
- bg-black opacity-{{ add (mul (int (div $percentage 10)) 10) 30 }}
- {{ .class }}"
- style="width: {{ printf "%.1f" $percentage }}%;"
- title="{{ .label }}: {{ $count }}篇 ({{ printf "%.1f" $percentage }}%)">
- {{ if gt $percentage 8 }}{{ .label }}{{ end }}
- </div>
- {{ end }}
- {{ end }}
- {{ end }}
- </div>
- <div class="text-size-2xl flex-shrink-0">🌙</div>
- </div>
-
- <div class="flex gap-2 mt-2 px-10">
- {{ range $fuzzyTimes }}
- {{ $count := index $timeCounts .label }}
- {{ if gt $count 0 }}
- {{ $percentage := div (mul $count 100.0) $total }}
- <div class="flex flex-col items-center text-size-xs
- text-secondary font-mono"
- style="width: {{ printf "%.1f" $percentage }}%;">
- <span class="font-600 text-[var(--primary-text-color)]">{{ $count }}</span>
- </div>
- {{ end }}
- {{ end }}
- </div>
-</div>
diff --git a/layouts/_partials/stats/stats-table.html b/layouts/_partials/stats/stats-table.html
deleted file mode 100644
index bb936721..00000000
--- a/layouts/_partials/stats/stats-table.html
+++ /dev/null
@@ -1,44 +0,0 @@
-<style>
-.site-stats-table td {
- padding: 0.5rem;
- text-align: left;
-}
-.site-stats-table td:nth-child(2n) {
- text-align: right;
-}
-.number-pill {
- text-align: center;
- display: inline-block;
- line-height: 1.75rem;
- box-sizing: border-box;
- border-radius: 5px;
- padding: 0 0.5rem;
- background-color: var(--block-background-color);
- font-size: 1rem;
-}
-</style>
-
-<table class="site-stats-table w-full max-w-[700px] border-collapse mb-6">
- <tbody>
- <tr>
- <td>页面总数</td>
- <td><span class="number-pill">{{ len .Site.RegularPages }}</span></td>
- <td>总字数</td>
- <td>
- <span class="number-pill">
- {{- $words := 0 -}}
- {{- range (where .Site.RegularPages "Section" "!=" "") -}}
- {{- $words = add $words .WordCount -}}
- {{- end -}}
- {{ lang.FormatNumber 0 $words }}
- </span>
- </td>
- </tr>
- <tr>
- <td>标签总数</td>
- <td><span class="number-pill">{{ len .Site.Taxonomies.tags }}</span></td>
- <td>文章系列数量</td>
- <td><span class="number-pill">{{ len .Site.Taxonomies.categories }}</span></td>
- </tr>
- </tbody>
-</table>
diff --git a/layouts/_partials/stats/word-count-chart.html b/layouts/_partials/stats/word-count-chart.html
deleted file mode 100644
index 835ecbda..00000000
--- a/layouts/_partials/stats/word-count-chart.html
+++ /dev/null
@@ -1,46 +0,0 @@
-{{/* Group word counts per month */}}
-{{ $monthly := dict }}
-{{ range .Site.RegularPages }}
- {{ $month := .Date.Format "2006-01" }}
- {{ $count := .WordCount }}
- {{ with index $monthly $month }}
- {{ $monthly = merge $monthly (dict $month (add . $count)) }}
- {{ else }}
- {{ $monthly = merge $monthly (dict $month $count) }}
- {{ end }}
-{{ end }}
-
-{{/* Sort months */}}
-{{ $months := slice }}
-{{ range $month, $_ := $monthly }}
- {{ $months = $months | append $month }}
-{{ end }}
-{{ $months = sort $months }}
-
-{{/* Find max value */}}
-{{ $max := 0 }}
-{{ range $month := $months }}
- {{ $val := index $monthly $month }}
- {{ if gt $val $max }}{{ $max = $val }}{{ end }}
-{{ end }}
-
-<div class="flex items-end justify-end h-[300px] gap-2 px-4
- text-size-xs w-full overflow-x-auto box-border">
- {{ range $month := $months }}
- {{ $val := index $monthly $month }}
- {{ $height := mul (div (float $val) (float $max)) 100 }}
- {{ $opacity := add 0.5 (div $height 200) }}
- <div class="flex flex-col justify-center">
- <div class="flex flex-col items-center justify-end
- w-4 gap-1 h-[200px] relative">
- <div class="text-size-[0.65rem]"
- style="writing-mode: vertical-rl;">{{ $val }}</div>
- <div class="w-full bg-gray-900 flex-shrink-0 transition dark:invert"
- style="height: {{ printf "%.1f" $height }}%;
- background-color: rgba(20,20,20,{{ printf "%.2f" $opacity }});"></div>
- </div>
- <div class="h-12 text-center flex-shrink"
- style="writing-mode: vertical-rl;">{{ $month }}</div>
- </div>
- {{ end }}
-</div>
diff --git a/layouts/_partials/taxonomy/all-categories.html b/layouts/_partials/taxonomy/all-categories.html
deleted file mode 100644
index 7cb5813a..00000000
--- a/layouts/_partials/taxonomy/all-categories.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<p class="text-sm text-secondary">* 表示常驻系列,其他系列可能会在完成后停止更新<p>
-<!-- Display Categories -->
-<div class="md:relative outbox md:h-[20rem] md:w-full">
-<section class="md:overflow-x-auto md:absolute md:left-0 md:right-0">
- <div class="flex flex-wrap justify-between md:flex-nowrap md:gap-6">
- <hr />
- {{ range sort (sort .Site.Taxonomies.categories ".Count" "desc") ".Page.Params.pinned" "desc" }}
- {{ if not .Page.Params.archive }}
- <a href="{{ .Page.RelPermalink }}"
- class="block hover:no-underline hover:-transform-translate-y-2 transition-transform
- md:writing-vertical"
- style="view-transition-name: category-{{ .Page.Title }};">
- <div>
- <h3 class="mx-2 xerox">
- 《{{ .Page.LinkTitle }}》
- {{ if .Page.Params.pinned }}*{{ end }}
- </h3>
- <p class="m-0 text-secondary mt-4">{{ .Page.Params.description | markdownify }}</p>
- </div>
- </a>
- <hr />
- {{ end }}
- {{ end }}
- </div>
-</section>
-</div>
-
-
-<p class="mt-4">
- <a class="small-button" href="/categories/uncategorized/">
- 查看随笔 <span class="text-secondary">→</span>
- </a>
-</p>
diff --git a/layouts/_partials/taxonomy/all-tags.html b/layouts/_partials/taxonomy/all-tags.html
deleted file mode 100644
index efd63fb4..00000000
--- a/layouts/_partials/taxonomy/all-tags.html
+++ /dev/null
@@ -1,46 +0,0 @@
-<!-- Display Tags -->
-<section>
- {{ $categorizedTags := dict }}
- {{ $uncategorizedTags := slice }}
-
- <!-- Group tags by category -->
- {{ range $tagName, $tagPages := .Site.Taxonomies.tags }}
- {{ $tagPage := site.GetPage (printf "/tags/%s" $tagName) }}
- {{ $tagData := dict "Name" $tagName "Count" (len $tagPages) "Page" $tagPage }}
- {{ if $tagPage.Params.category }}
- {{ $category := $tagPage.Params.category }}
- {{ $categoryTags := index $categorizedTags $category | default slice }}
- {{ $categoryTags = $categoryTags | append $tagData }}
- {{ $categorizedTags = merge $categorizedTags (dict $category $categoryTags) }}
- {{ else }}
- {{ $uncategorizedTags = $uncategorizedTags | append $tagData }}
- {{ end }}
- {{ end }}
-
- <!-- Sort tags by count -->
- {{ $uncategorizedTags = sort $uncategorizedTags "Count" "desc" }}
- {{ range $category, $categoryTags := $categorizedTags }}
- {{ $categorizedTags = merge $categorizedTags (dict $category (sort $categoryTags "Count" "desc")) }}
- {{ end }}
-
- <!-- Display uncategorized tags first -->
- {{ if $uncategorizedTags }}
- <div class="flex flex-wrap gap-2">
- {{ range $uncategorizedTags }}
- {{ partial "taxonomy/tag-pill" . }}
- {{ end }}
- </div>
- {{ end }}
-
- <!-- Display categorized tags -->
- {{ range $category, $categoryTags := $categorizedTags }}
- <div>
- <h3>{{ $category }}</h3>
- <div class="flex flex-wrap gap-2">
- {{ range $categoryTags }}
- {{ partial "taxonomy/tag-pill" . }}
- {{ end }}
- </div>
- </div>
- {{ end }}
-</section>
diff --git a/layouts/_partials/taxonomy/archived-categories.html b/layouts/_partials/taxonomy/archived-categories.html
deleted file mode 100644
index 26ed68d8..00000000
--- a/layouts/_partials/taxonomy/archived-categories.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<ul class="list-none p-0">
- {{ range .Site.Taxonomies.categories }}
- {{ if .Page.Params.archive }}
- <li class="flex justify-between items-center gap-4">
- <a class="flex-shrink-0" href="{{ .Page.RelPermalink }}">
- <h3 class="xerox">《{{ .Page.LinkTitle }}》</h3>
- </a>
- <div class="w-full"><hr class="m-0" /></div>
- <span class="text-secondary font-mono flex-shrink-0">
- {{ T "archivePage.postCountMonthly" (len .Pages) }}
- </span>
- </li>
- {{ end }}
- {{ end }}
-</ul>
-
diff --git a/layouts/_partials/taxonomy/pagefind.html b/layouts/_partials/taxonomy/pagefind.html
deleted file mode 100644
index 2c41457d..00000000
--- a/layouts/_partials/taxonomy/pagefind.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<div id="pagefind" class="py-3"></div>
-<script src="/pagefind/pagefind-ui.js"></script>
-<script>
- window.addEventListener('DOMContentLoaded', () => {
- new PagefindUI({ element: "#pagefind", showSubResults: true });
- });
-</script>
diff --git a/layouts/_partials/taxonomy/tag-pill.html b/layouts/_partials/taxonomy/tag-pill.html
deleted file mode 100644
index ad13c62e..00000000
--- a/layouts/_partials/taxonomy/tag-pill.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<a href="{{ .Page.RelPermalink }}"
- class="inline-flex items-center gap-2 text-size-sm px-2 py-1
- transition-colors duration-300 rounded-md hover:no-underline
-
- {{ if lt .Count 4 }}
- bg-none border border-dashed border-[var(--border-color)] text-[var(--secondary-text-color)]
- hover:text-inherit hover:border-solid
- {{ else }}
- bg-[var(--block-background-color)]
- hover:bg-[var(--text-color)] hover:text-[var(--block-background-color)]
- {{ end }}">
- {{ if .Page.Params.icon }}
- {{ if or (hasPrefix .Page.Params.icon "http://") (hasPrefix .Page.Params.icon "https://") }}
- <span class="inline-flex items-center">
- <img src="{{ .Page.Params.icon }}" alt="{{ .Page.LinkTitle }}"
- style="height:1em;width:1em">
- </span>
- {{ else }}
- <span class="inline-flex items-center">{{ .Page.Params.icon }}</span>
- {{ end }}
- {{ end }}
- <span>{{ if not .Page.Params.icon }}#{{ end }}{{ .Page.LinkTitle }}</span>
- <span class="text-size-xs text-[var(--secondary-text-color)]">{{ .Count }}</span>
-</a>
diff --git a/layouts/_partials/template/post-page.html b/layouts/_partials/template/post-page.html
deleted file mode 100644
index 0b55d48a..00000000
--- a/layouts/_partials/template/post-page.html
+++ /dev/null
@@ -1,45 +0,0 @@
-<article class="h-entry">
- <!-- Post Header -->
- <header
- style="view-transition-name: post-{{ .File.UniqueID }}"
- class="mb-8 relative"
- >
- {{ if .Params.banner }}
- {{ partial "components/logo" (dict
- "class" "block round-sticker w-14 h-14 lg:w-28 lg:h-28 right-2 lg:-right-20 top-2 lg:top-4 absolute rotate-[3.0deg] z-10"
- "imageClass" "block w-full"
- "ctx" .
- ) }}
- {{ else }}
- {{ partial "components/logo" (dict
- "class" "block w-[10rem]"
- "imageClass" "block w-full"
- "ctx" .
- ) }}
- {{ end }}
-
- {{ partial "posts/banner" . }}
- <!-- Title and Subtitle -->
- <h1 class="text-size-3xl font-900 xerox">
- <span data-pagefind-meta="title" class="p-name">{{ .Title }}</span>
- {{ with .Params.subtitle }}
- <small class="block text-secondary font-italic text-size-xl">{{ . }}</small>
- {{ end }}
- </h1>
- <!-- Post Meta -->
- <div class="flex flex-wrap items-center gap-2">
- <span class="text-secondary">{{ partial "components/date" . }}</span>
- {{ if or .Params.categories .Params.tags }}<span>·</span>{{ end }}
- {{ partial "components/category-pill" . }}
- {{ partial "components/tags" . }}
- </div>
- </header>
-
- {{ partial "content" . }}
- {{ partial "posts/webmention" . }}
- <!-- kept for legacy pages -->
- {{ partial "posts/comment" . }}
-
- {{ partial "components/back-to-top" . }}
- {{ partial "components/microformats" . }}
-</article>
diff --git a/layouts/_partials/term/term-books.html b/layouts/_partials/term/term-books.html
deleted file mode 100644
index 2bd48295..00000000
--- a/layouts/_partials/term/term-books.html
+++ /dev/null
@@ -1,9 +0,0 @@
-{{ $books := where .Pages "Section" "eq" "library" }}
-{{ if gt (len $books) 0 }}
-<h2>{{ T "termPage.books" }}</h2>
-<div class="grid grid-cols-4 md:grid-cols-6 items-center gap-4 my-4">
- {{ range $books }}
- {{ partial "items/book" (dict "ctx" .) }}
- {{ end }}
-</div>
-{{ end }}
diff --git a/layouts/_partials/term/term-fictions.html b/layouts/_partials/term/term-fictions.html
deleted file mode 100644
index 3e3fd4a9..00000000
--- a/layouts/_partials/term/term-fictions.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{{ $fictions := where .Pages "Section" "fiction" }}
-{{ if gt (len $fictions) 0 }}
-<h2>{{ T "termPage.fictions" }}</h2>
-<ul id="term-fictions"
- class="animate-duration-100 ps-0 flex flex-col gap-2 list-none leading-relaxed">
- {{ range $fictions }}
- {{ partial "items/post-small" . }}
- {{ end }}
-</ul>
-{{ end }}
diff --git a/layouts/_partials/term/term-posts.html b/layouts/_partials/term/term-posts.html
deleted file mode 100644
index e9f8136f..00000000
--- a/layouts/_partials/term/term-posts.html
+++ /dev/null
@@ -1,6 +0,0 @@
-<ul id="term-posts"
- class="animate-duration-100 ps-0 flex flex-col gap-2 list-none leading-relaxed">
- {{ range where .Pages "Section" "article" }}
- {{ partial "items/post-small" . }}
- {{ end }}
-</ul>
diff --git a/layouts/_partials/term/term-weeklies.html b/layouts/_partials/term/term-weeklies.html
deleted file mode 100644
index 56697b60..00000000
--- a/layouts/_partials/term/term-weeklies.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{{ $weeklies := where .Pages "Section" "weekly" }}
-{{ if gt (len $weeklies) 0 }}
-<h2>{{ T "termPage.weeklies" }}</h2>
-<ul id="term-weeklies"
- class="animate-duration-100 ps-0 flex flex-col gap-2 list-none leading-relaxed">
- {{ range $weeklies }}
- {{ partial "items/post-small" . }}
- {{ end }}
-</ul>
-{{ end }}
diff --git a/layouts/_partials/utils/inject-footnotes.html b/layouts/_partials/utils/inject-footnotes.html
deleted file mode 100644
index 31fdae82..00000000
--- a/layouts/_partials/utils/inject-footnotes.html
+++ /dev/null
@@ -1,70 +0,0 @@
-{{ $content := . }}
-
-{{ $footnotesPattern := `(?s)<div class="footnotes"[^>]*>.*?</div>` }}
-{{ $footnotesMatch := findRE $footnotesPattern $content 1 }}
-
-{{ if $footnotesMatch }}
- {{ $footnotesSection := index $footnotesMatch 0 }}
-
- {{ $liPattern := `(?s)<li id="fn:(\d+)">(.*?)</li>` }}
- {{ $footnoteItems := findRESubmatch $liPattern $footnotesSection }}
-
- {{ $footnoteMap := dict }}
- {{ range $footnoteItems }}
- {{ $id := index . 1 }}
- {{ $contentRaw := index . 2 }}
- {{ $cleanContent := replaceRE `(?s)\s*<a href="#fnref:\d+"[^>]*>.*?</a>\s*$` "" $contentRaw }}
- {{ $footnoteMap = merge $footnoteMap (dict $id $cleanContent) }}
- {{ end }}
-
- {{ $contentWithoutFootnotes := replaceRE $footnotesPattern "" $content }}
-
- {{ $refPattern := `<sup id="fnref:(\d+)".*?</sup>` }}
- {{ $refs := findRESubmatch $refPattern $contentWithoutFootnotes }}
-
- {{ $result := $contentWithoutFootnotes }}
- {{ $count := len $refs }}
-
- {{ range seq (sub $count 1) -1 0 }}
- {{ $ref := index $refs . }}
- {{ $refFull := index $ref 0 }}
- {{ $refId := index $ref 1 }}
- {{ $noteContent := index $footnoteMap $refId }}
-
- {{ if $noteContent }}
- {{ $inlineFootnote := printf `<div class="inline-footnote text-xs text-secondary flex gap-2 ml-2 my-1 opacity-50 hover:opacity-100 transition-opacity" id="fn:%s"><span>%s.</span><div>%s</div></div>` $refId $refId $noteContent }}
-
- {{ $blockTags := slice "p" "li" "td" "th" "blockquote" "h1" "h2" "h3" "h4" "h5" "h6" "figcaption" "dt" "dd" }}
-
- {{ $found := false }}
-
- {{ range $blockTags }}
- {{ if not $found }}
- {{ $tag := . }}
- {{ $pattern := printf `(?s)<%s[^>]*>.*?</%s>` $tag $tag }}
- {{ $matches := findRE $pattern $result }}
-
- {{ range $matches }}
- {{ if not $found }}
- {{ $block := . }}
- {{ if strings.Contains $block $refFull }}
- {{ $newBlock := printf `%s%s` $block $inlineFootnote }}
- {{ $result = replace $result $block $newBlock 1 }}
- {{ $found = true }}
- {{ end }}
- {{ end }}
- {{ end }}
- {{ end }}
- {{ end }}
-
- {{ if not $found }}
- {{ $replacement := printf `%s%s` $refFull $inlineFootnote }}
- {{ $result = replace $result $refFull $replacement 1 }}
- {{ end }}
- {{ end }}
- {{ end }}
-
- {{ $content = $result }}
-{{ end }}
-
-{{ $content | safeHTML }}
diff --git a/layouts/_partials/utils/render.html b/layouts/_partials/utils/render.html
deleted file mode 100644
index bdc4bf2f..00000000
--- a/layouts/_partials/utils/render.html
+++ /dev/null
@@ -1 +0,0 @@
-{{ partial "utils/inject-footnotes" . }}
diff --git a/layouts/_shortcodes/book.html b/layouts/_shortcodes/book.html
deleted file mode 100644
index 7ea49089..00000000
--- a/layouts/_shortcodes/book.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<div class="book-showcase">
- <div class="book-cover">
- <a href="{{ .Get "cover" }}" data-libra>
- <img class="lazy" src="{{ .Get "cover" }}" loading="lazy" />
- </a>
- </div>
- <div class="book-description">
- <div class="book-description-header">
- <h3 class="book-title" id="book-{{ .Get "title" }}">{{ .Get "title" }}</h3>
- <p>分数:{{ .Get "rating" }}</p>
- </div>
- <div>
-
- {{ .Inner | markdownify }}
- </div>
- </div>
-</div>
diff --git a/layouts/_shortcodes/bookcard.html b/layouts/_shortcodes/bookcard.html
deleted file mode 100644
index 48e6924c..00000000
--- a/layouts/_shortcodes/bookcard.html
+++ /dev/null
@@ -1,28 +0,0 @@
-{{- $books := where .Site.Pages "Section" "library" -}}
-{{- $book := index (where $books "File.BaseFileName" (.Get 0)) 0 -}}
-
-{{- if $book }}
- <div class="markdown-body text-size-lg md:text-size-xl">
- <div class="mx-auto max-w-[50%] ">
- <img class="block w-full" src="{{ $book.Params.cover }}" />
- </div>
- <h3 class="book-title">
- <a href="{{ $book.Permalink }}">{{ $book.Title }}</a>
- </h3>
-
- {{- $rating := $book.Params.rating -}}
- {{- $fullStars := math.Floor $rating -}}
- <div class="rating">
- <span>评分:</span>
- {{- range seq $fullStars }}
- <span class="star">★</span>
- {{- end -}}
- </div>
-
- <div class="book-content">
- {{ $book.Content }}
- </div>
- </div>
-{{- else }}
- <p style="color: red;">⚠️ 无法找到书评: {{ .Get 0 }}</p>
-{{- end }}
diff --git a/layouts/_shortcodes/daysfrom.html b/layouts/_shortcodes/daysfrom.html
deleted file mode 100644
index c2750480..00000000
--- a/layouts/_shortcodes/daysfrom.html
+++ /dev/null
@@ -1,12 +0,0 @@
-{{- $date := .Get 0 -}}
-{{- $t := time $date -}}
-{{- $now := now -}}
-{{- $durSeconds := sub $now.Unix $t.Unix | int -}}
-
-{{- $days := div $durSeconds 86400 -}}
-
-{{- if lt $days 0 -}}
- {{ mul $days -1 }}
-{{- else -}}
- {{ $days }}
-{{- end -}}
diff --git a/layouts/_shortcodes/fedicard.html b/layouts/_shortcodes/fedicard.html
deleted file mode 100644
index 1f10ebeb..00000000
--- a/layouts/_shortcodes/fedicard.html
+++ /dev/null
@@ -1,148 +0,0 @@
-{{- $url := .Get 0 -}}
-{{- $parsed := urls.Parse $url -}}
-{{- $parts := split $parsed.Path "/" -}}
-{{- $id := index $parts (sub (len $parts) 1) -}}
-{{- $instance := printf "%s://%s" $parsed.Scheme $parsed.Host -}}
-{{- $apiUrl := printf "%s/api/v1/statuses/%s" $instance $id -}}
-{{- $data := resources.GetRemote $apiUrl -}}
-{{- $json := $data | transform.Unmarshal -}}
-{{- $author := $json.account -}}
-
-{{- $publishedAt := time $json.created_at -}}
-
-{{- $avatarSrc := $author.avatar -}}
-{{- with resources.GetRemote $author.avatar -}}
- {{- with .Resize "88x88 q85 webp" -}}
- {{- $avatarSrc = .RelPermalink -}}
- {{- end -}}
-{{- end -}}
-
-{{- /* Count image attachments */ -}}
-{{- $imgCount := 0 -}}
-{{- range $json.media_attachments -}}{{- if eq .type "image" -}}{{- $imgCount = add $imgCount 1 -}}{{- end -}}{{- end -}}
-{{- $cId := printf "sc-%s" (md5 $url) -}}
-{{- $dId := printf "sd-%s" (md5 $url) -}}
-
-<div class="social-card-final cnt-undo rd bg-[var(--block-background-color)] p-4 md:px-8 md:py-6 relative overflow-hidden" style="background-color: oklch(from var(--block-background-color) l c h / calc(alpha - 0.5))">
- <div style="display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 8px;">
- <div style="display: flex; align-items: center; gap: 12px;">
- <img src="{{ $avatarSrc }}" style="width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; object-fit: cover;" />
- <div style="display: flex; flex-direction: column; line-height: 1.2;">
- <span style="font-weight: 700; color: var(--color-neso-fg1); font-size: 1rem;">{{ $author.display_name }}</span>
- <span style="color: var(--color-neso-fg3); font-size: 0.9rem;">@{{ $author.acct }}</span>
- </div>
- </div>
- <a href="{{ $url }}" target="_blank" style="color: #6364ff; align-self: flex-start; margin-top: 2px; transition: transform 0.2s ease-in-out; display: flex; flex-shrink: 0;" onmouseover="this.style.transform='scale(1.2)'" onmouseout="this.style.transform='scale(1)'">
-<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 196.52 196.52">
- <path fill="#a730b8" d="M47.9242 72.7966a18.2278 18.2278 0 0 1-7.7959 7.7597l42.7984 42.9653 10.3182-5.2291zm56.4524 56.6704-10.3182 5.2291 21.686 21.7708a18.2278 18.2278 0 0 1 7.7975-7.7608z"/>
- <path fill="#5496be" d="M129.6645 102.0765l1.7865 11.4272 27.4149-13.8942a18.2278 18.2278 0 0 1-4.9719-9.8124zm-14.0658 7.1282-57.2891 29.0339a18.2278 18.2278 0 0 1 4.9728 9.8133l54.1027-27.4194z"/>
- <path fill="#ce3d1a" d="M69.5312 91.6539l8.1618 8.1933 29.269-57.1387a18.2278 18.2278 0 0 1-9.787-5.0219zm-7.1897 14.0363-14.0022 27.3353a18.2278 18.2278 0 0 1 9.786 5.0214l12.3775-24.1639z"/>
- <path fill="#d0188f" d="M39.8906 80.6763a18.2278 18.2278 0 0 1-10.8655 1.7198l8.1762 52.2981a18.2278 18.2278 0 0 1 10.8645-1.7198z"/>
- <path fill="#5b36e9" d="M63.3259 148.3109a18.2278 18.2278 0 0 1-1.7322 10.8629l52.2893 8.3907a18.2278 18.2278 0 0 1 1.7322-10.8629z"/>
- <path fill="#30b873" d="M134.9148 146.9182a18.2278 18.2278 0 0 1 9.788 5.0224l24.1345-47.117a18.2278 18.2278 0 0 1-9.7875-5.0229z"/>
- <path fill="#ebe305" d="M126.1329 33.1603a18.2278 18.2278 0 0 1-7.7975 7.7608l37.3765 37.5207a18.2278 18.2278 0 0 1 7.7969-7.7608z"/>
- <path fill="#f47601" d="M44.7704 51.6279a18.2278 18.2278 0 0 1 4.9723 9.8123l47.2478-23.9453a18.2278 18.2278 0 0 1-4.9718-9.8113z"/>
- <path fill="#57c115" d="M118.2491 40.9645a18.2278 18.2278 0 0 1-10.8511 1.8123l4.1853 26.8 11.42 1.8324zm-4.2333 44.1927 9.8955 63.3631a18.2278 18.2278 0 0 1 10.88-1.6278l-9.355-59.9035z"/>
- <path fill="#dbb210" d="M49.7763 61.6412a18.2278 18.2278 0 0 1-1.694 10.8686l26.8206 4.3077 5.2715-10.2945zm45.9677 7.382-5.272 10.2955 63.3713 10.1777a18.2278 18.2278 0 0 1 1.7606-10.8593z"/>
- <path fill="#ffca00" d="M93.4385 23.8419a1 1 0 1 0 33.0924 1.8025 1 1 0 1 0-33.0924-1.8025"/>
- <path fill="#64ff00" d="M155.314 85.957a1 1 0 1 0 33.0923 1.8025 1 1 0 1 0-33.0923-1.8025"/>
- <path fill="#00a3ff" d="M115.3466 163.9824a1 1 0 1 0 33.0923 1.8025 1 1 0 1 0-33.0923-1.8025"/>
- <path fill="#9500ff" d="M28.7698 150.0898a1 1 0 1 0 33.0923 1.8025 1 1 0 1 0-33.0923-1.8025"/>
- <path fill="#ff0000" d="M15.2298 63.4781a1 1 0 1 0 33.0923 1.8025 1 1 0 1 0-33.0923-1.8025"/>
-</svg>
- </a>
- </div>
-
- {{- $bodyText := $json.content -}}
- {{- $bodyText = $bodyText | replaceRE `(<p>[\s]*(<a [^>]*class="mention hashtag"[^>]*>#<span>[^<]+</span></a>[\s]*)+</p>[\s]*)+$` "" -}}
- {{- $bodyText = $bodyText | replaceRE `<span class="invisible">[^<]*</span>` "" -}}
- {{- $bodyText = $bodyText | replaceRE `<a ` `<a style="text-decoration:none;" ` -}}
- {{- $bodyText = $bodyText | replaceRE `<p>` `<p style="margin:0 0 0.9em 0;">` -}}
- {{- $bodyText = $bodyText | replaceRE `<p [^>]+>[\s]*</p>` "" -}}
-
- <div style="font-size: 1.05rem; line-height: 1.6; margin-bottom: 12px; color: var(--color-neso-fg1);">
- {{ $bodyText | safeHTML }}
- </div>
-
- {{- if gt $imgCount 0 -}}
- {{- if le $imgCount 2 -}}
- {{- /* 1–2 images: flex row (2 images split 50/50, cropped) */ -}}
- <div style="display: flex; gap: 8px; margin-top: 8px; margin-bottom: 12px; overflow: hidden;">
- {{- range $json.media_attachments -}}
- {{- if eq .type "image" -}}
- {{- $imgSrc := .preview_url -}}
- {{- with resources.GetRemote .preview_url -}}
- {{- with .Process "q85 webp" -}}
- {{- $imgSrc = .RelPermalink -}}
- {{- end -}}
- {{- end -}}
- <img src="{{ $imgSrc }}" alt="{{ .description }}" onclick="window.__scLb&&window.__scLb(this.src)" style="flex: 1 1 0%; min-width: 0; border-radius: 8px; display: block; margin: 0 !important; cursor: pointer;{{ if gt $imgCount 1 }} height: 250px; object-fit: cover;{{ else }} height: auto; width: 100%;{{ end }}" loading="lazy">
- {{- end -}}
- {{- end -}}
- </div>
- {{- else -}}
- {{- /* 3+ images: scroll-snap carousel */ -}}
- <style>#{{ $cId }}::-webkit-scrollbar{display:none}</style>
- <div style="margin: 8px 0 4px; overflow: hidden;">
- <div id="{{ $cId }}" style="display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; border-radius: 8px;">
- {{- range $json.media_attachments -}}
- {{- if eq .type "image" -}}
- {{- $imgSrc := .preview_url -}}
- {{- with resources.GetRemote .preview_url -}}
- {{- with .Process "q85 webp" -}}
- {{- $imgSrc = .RelPermalink -}}
- {{- end -}}
- {{- end -}}
- <img src="{{ $imgSrc }}" alt="{{ .description }}" onclick="window.__scLb&&window.__scLb(this.src)" style="scroll-snap-align: start; flex-shrink: 0; width: 100%; height: 280px; object-fit: cover; border-radius: 8px; cursor: pointer; display: block; margin: 0 !important;" loading="lazy">
- {{- end -}}
- {{- end -}}
- </div>
- {{- $imgAttachments := slice -}}
- {{- range $json.media_attachments -}}{{- if eq .type "image" -}}{{- $imgAttachments = $imgAttachments | append . -}}{{- end -}}{{- end -}}
- <div id="{{ $dId }}" style="display: flex; justify-content: center; gap: 6px; margin-top: 8px; margin-bottom: 12px;">
- {{- range $i, $_ := $imgAttachments -}}
- <button onclick="(function(){var c=document.getElementById('{{ $cId }}');c.scrollTo({left:c.children[{{ $i }}].offsetLeft,behavior:'smooth'});})()" aria-label="Image {{ add $i 1 }}" style="width: 8px; height: 8px; border-radius: 50%; border: none; background: {{ if eq $i 0 }}var(--color-neso-fg2){{ else }}var(--color-neso-deco2){{ end }}; cursor: pointer; padding: 0; transition: background 0.2s;"></button>
- {{- end -}}
- </div>
- </div>
- <script>(function(){var c=document.getElementById('{{ $cId }}'),ds=document.getElementById('{{ $dId }}').querySelectorAll('button');c.addEventListener('scroll',function(){var i=Math.round(c.scrollLeft/c.offsetWidth);ds.forEach(function(d,j){d.style.background=j===i?'var(--color-neso-fg2)':'var(--color-neso-deco2)';});},{passive:true});})()</script>
- {{- end -}}
- {{- end -}}
-
- {{- /* Link preview card — use original image URL, skip processing (CDN images can return 403) */ -}}
- {{- with $json.card -}}
- {{- if or (eq .type "link") (eq .type "photo") (eq .type "video") -}}
- <a href="{{ .url }}" target="_blank" rel="noopener noreferrer" style="display: block; margin-top: 8px; margin-bottom: 16px; border: 1px solid var(--color-neso-deco2); border-radius: 10px; overflow: hidden; text-decoration: none; color: inherit;">
- {{- if .image -}}
- <img src="{{ .image }}" alt="{{ .title }}" style="width: 100%; height: 180px; object-fit: cover; display: block; margin: 0 !important;">
- {{- end -}}
- <div style="padding: 10px 14px;">
- <div style="font-weight: 600; font-size: 0.95rem; color: var(--color-neso-fg1); margin-bottom: 3px;">{{ .title }}</div>
- {{- if .description -}}<div style="font-size: 0.85rem; color: var(--color-neso-fg3); margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;">{{ .description }}</div>{{- end -}}
- <div style="font-size: 0.8rem; color: var(--color-neso-fg3);">{{ (urls.Parse .url).Host }}</div>
- </div>
- </a>
- {{- end -}}
- {{- end -}}
-
- <div style="border-top: 1px solid var(--color-neso-deco3); padding-top: 12px; margin-top: 16px; display: flex; justify-content: space-between; align-items: center;">
- <time class="social-card-time" datetime="{{ $publishedAt.Format "2006-01-02T15:04:05Z" }}" style="color: var(--color-neso-fg3); font-size: 0.9rem;">{{ $publishedAt.Format "Jan 2, 2006 at 3:04 PM UTC" }}</time>
- <a href="{{ $url }}" target="_blank" style="color: #6364ff; font-weight: 600; text-decoration: none; font-size: 0.9rem; transition: color 0.2s ease-in-out;" onmouseover="this.style.color='#8A8BFF'" onmouseout="this.style.color='#6364ff'">{{ T "ViewOnFediverse" . }}</a>
- </div>
-</div>
-
-{{- /* Shared lightbox — injected once per page via DOM API (no innerHTML) */ -}}
-<script>
-if (!window.__scLb) {
- var _lbImg = document.createElement('img');
- _lbImg.style.cssText = 'max-width:92vw;max-height:92vh;object-fit:contain;border-radius:8px;cursor:default;';
- _lbImg.addEventListener('click', function(e) { e.stopPropagation(); });
- var _lbOv = document.createElement('div');
- _lbOv.style.cssText = 'display:none;position:fixed;inset:0;z-index:9999;background:rgba(0,0,0,0.88);cursor:zoom-out;align-items:center;justify-content:center;';
- _lbOv.appendChild(_lbImg);
- _lbOv.addEventListener('click', function() { _lbOv.style.display = 'none'; document.body.style.overflow = ''; });
- document.addEventListener('keydown', function(e) { if (e.key === 'Escape') { _lbOv.style.display = 'none'; document.body.style.overflow = ''; } });
- document.body.appendChild(_lbOv);
- window.__scLb = function(src) { _lbImg.src = src; _lbOv.style.display = 'flex'; document.body.style.overflow = 'hidden'; };
-}
-</script>
diff --git a/layouts/_shortcodes/float-image.html b/layouts/_shortcodes/float-image.html
deleted file mode 100644
index 2c03992d..00000000
--- a/layouts/_shortcodes/float-image.html
+++ /dev/null
@@ -1,13 +0,0 @@
-{{ $src := .Get 0 }}
-
-{{ $float := .Get 1 }}
-{{ $padding := "" }}
-{{ if eq $float "left" }}
- {{ $padding = "pr-4 sm:pr-6 md:pr-8" }}
-{{ else }}
- {{ $padding = "pl-4 sm:pl-6 md:pr-8" }}
-{{ end }}
-
-<figure style="float: {{ $float }}" class="{{ $padding }} w-25 sm:w-30 md:w-50">
- <img src="{{ $src }}" data-libra class="my-0" />
-</figure>
diff --git a/layouts/_shortcodes/gallery.html b/layouts/_shortcodes/gallery.html
deleted file mode 100644
index da8e4ab5..00000000
--- a/layouts/_shortcodes/gallery.html
+++ /dev/null
@@ -1,3 +0,0 @@
-<div class="gallery{{ with .Get "class" }} {{ . }}{{ end }}">
- {{ .Page.RenderString .Inner }}
-</div>
diff --git a/layouts/_shortcodes/link.html b/layouts/_shortcodes/link.html
deleted file mode 100644
index 9f7ea3e5..00000000
--- a/layouts/_shortcodes/link.html
+++ /dev/null
@@ -1,15 +0,0 @@
-{{ if eq (.Get "type") "podcast" }}
-<a href="{{ .Get "link" }}" target="_blank" title="{{ .Get "title" }}"
- class="block w-[calc(25%_-_1rem)] rounded-md overflow-hidden box-border p-0"
- style="background-color: var(--block-background-color);
- color: var(--text-color);text-decoration: none;">
- <img src="{{ .Get "image" }}" class="block m-0!" alt="{{ .Get "title" }}">
-</a>
-{{ else }}
-<a href="{{ .Get "link" }}" target="_blank"
- class="block w-[calc(50%_-_1rem)] rounded-4 box-border px-6"
- style="background-color: var(--block-background-color);
- color: var(--text-color);text-decoration: none;">
- <h3>{{ .Get "title" }}</h3>
-</a>
-{{ end }}
diff --git a/layouts/_shortcodes/linkding-bookmarks.html b/layouts/_shortcodes/linkding-bookmarks.html
deleted file mode 100644
index fd54c0d2..00000000
--- a/layouts/_shortcodes/linkding-bookmarks.html
+++ /dev/null
@@ -1,68 +0,0 @@
-{{/*
-Shortcode to display Linkding RSS feed bookmarks
-Usage: {{< linkding-bookmarks >}}
-*/}}
-
-{{/* Fetch RSS feed from remote URL with caching */}}
-{{ $url := "https://links.eltr.ac/feeds/shared?limit=12" }}
-{{ $cacheKey := print $url (now.Format "2006-01-02") }}
-{{ $rssContent := resources.GetRemote $url
- (dict
- "key" $cacheKey
- "headers" (dict "User-Agent" "Hugo/1.0")
- )
-}}
-
-{{ if $rssContent }}
- {{/* Parse RSS XML */}}
- {{ $rss := $rssContent.Content | transform.Unmarshal }}
-
- {{ if $rss }}
- {{/* Get channel items */}}
- {{ $items := $rss.channel.item }}
-
- {{ if $items }}
- <div class="linkding-bookmarks">
- {{ range $items }}
- <div class="bookmark-item mb-4 p-4 rounded-md" style="background-color: var(--block-background-color);">
- <h3 class="m-0 mb-2">
- <a href="{{ .link }}" target="_blank" rel="noopener noreferrer"
- style="color: var(--text-color); text-decoration: none;">
- {{ .title }}
- </a>
- </h3>
- {{ if .description }}
- <p class="m-0 text-sm opacity-80">{{ .description }}</p>
- {{ end }}
- {{ if .category }}
- <div class="mt-2 flex flex-wrap gap-2">
- {{ if reflect.IsSlice .category }}
- {{ range .category }}
- <span class="text-secondary text-xs rounded"
- style="background-color: var(--border-color-light);">
- #{{ . }}
- </span>
- {{ end }}
- {{ else }}
- <span class="text-secondary text-xs rounded"
- style="background-color: var(--border-color-light);">
- #{{ .category }}
- </span>
- {{ end }}
- </div>
- {{ end }}
- <div class="mt-2 text-xs opacity-60">
- 于 {{ dateFormat "2006-01-02" .pubDate }} 添加至书签
- </div>
- </div>
- {{ end }}
- </div>
- {{ else }}
- <p>No bookmarks found in RSS feed.</p>
- {{ end }}
- {{ else }}
- <p>Unable to parse RSS feed.</p>
- {{ end }}
-{{ else }}
- <p>Unable to fetch RSS feed from remote URL.</p>
-{{ end }}
diff --git a/layouts/_shortcodes/linkrank.html b/layouts/_shortcodes/linkrank.html
deleted file mode 100644
index 19de1fe6..00000000
--- a/layouts/_shortcodes/linkrank.html
+++ /dev/null
@@ -1,2 +0,0 @@
-{{ partial "stats/external-link-rank" . }}
-
diff --git a/layouts/_shortcodes/music.html b/layouts/_shortcodes/music.html
deleted file mode 100644
index 8017566d..00000000
--- a/layouts/_shortcodes/music.html
+++ /dev/null
@@ -1,53 +0,0 @@
-{{ $title := .Get "title" }}
-{{ $cover := .Get "cover" }}
-{{ $artist := .Get "artist" }}
-{{ $isAlbum := .Get "album" }}
-
-{{ $platforms := slice "bandcamp" "apple" "spotify" "netease" "tidal" }}
-{{ $page := . }}
-
-<div class="flex flex-col md:flex-row md:justify-between md:items-center gap-2">
- <!-- Cover, title, artist -->
- <div class="flex gap-5 items-center">
- <div class="relative flex-shrink-0">
- <img class="w-15 h-15 rd-lg shadow-lg m-0!"
- alt="{{ $title }} music cover"
- src="{{ $cover }}" loading="lazy" />
- {{ if $isAlbum }}
- <div class="w-13 h-13 rd-md bg-neutral-400 dark:bg-neutral-600 absolute top-1 left-3 -z-1"></div>
- {{ end }}
- </div>
- <div>
- <h4 class="m-0 text-size-base flex items-center gap-2 leading-tight">
- <span>{{ $title }}</span>
- {{ if $isAlbum }}
- <span class="font-mono bg-neutral-400 dark:bg-neutral-700 text-white
- px-1 rd text-xs leading-relaxed hidden sm:inline-block"
- >{{ T "music.album" }}</span>
- {{ end }}
- </h4>
- <p class="m-0! text-size-sm text-secondary">{{ $artist }}</p>
- </div>
- </div>
- <!-- Links -->
- <div class="flex gap-2 items-center">
- {{ range $platforms }}
- {{ $code := . }}
- {{ $langcode := (printf "music.%s" $code) }}
- {{ $name := T $langcode }}
- {{ with $page.Get . }}
- <a href="{{ . }}"
- class="block rounded-full px-3 md:p-4 bg-neutral-200/50 dark:bg-neutral-600/50 hover:bg-neutral-200 dark:hover:bg-neutral-600 transition-colors no-underline! text-size-xs inline-flex gap-1 items-center"
- target="_blank"
- title="{{ T "music.openIn" $name }}"
- alt="{{ $name }}"
- data-tooltip
- >
- <img src="{{ printf "/icons/music/%s.png" $code }}"
- loading="lazy" class="block w-3 h-3 md:w-5 md:h-5 m-0!" />
- <span class="md:hidden">{{ $name }}</span>
- </a>
- {{ end }}
- {{ end }}
- </div>
-</div>
diff --git a/layouts/_shortcodes/opml-links.html b/layouts/_shortcodes/opml-links.html
deleted file mode 100644
index 541e0fee..00000000
--- a/layouts/_shortcodes/opml-links.html
+++ /dev/null
@@ -1,19 +0,0 @@
-{{ $opml := hugo.Data.rss }}
-
-<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
-{{ range shuffle $opml.body.outline }}
- {{ $title := index . "-title" }}
- {{ $url := index . "-htmlUrl" }}
- {{ if and $title $url }}
- {{ $parts := split $url "/" }}
- {{ $url := printf "%s//%s/" (index $parts 0) (index $parts 2) }}
- <a href="{{ $url }}" target="_blank"
- class="block rounded-md overflow-hidden box-border p-4"
- style="background-color: var(--block-background-color);
- color: var(--text-color);
- text-decoration: none;">
- <h3 class="m-0 text-lg font-medium">{{ $title }}</h3>
- </a>
- {{ end }}
-{{ end }}
-</div>
diff --git a/layouts/_shortcodes/postcount.html b/layouts/_shortcodes/postcount.html
deleted file mode 100644
index 84c6378f..00000000
--- a/layouts/_shortcodes/postcount.html
+++ /dev/null
@@ -1 +0,0 @@
-{{ len (where .Site.RegularPages "Section" "!=" "") }}
diff --git a/layouts/_shortcodes/quotecard.html b/layouts/_shortcodes/quotecard.html
deleted file mode 100644
index 941280ce..00000000
--- a/layouts/_shortcodes/quotecard.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<div class="text-5 md:text-6 font-italic text-center
- my-12 md:my-20 mx-4 md:mx-12 p-4
- border border-solid border-gray-300 rounded-4 shadow-lg
- rotate-[3deg] bg-[rgba(255,255,255,0.35)] backdrop-blur-md"
- style="background: linear-gradient(rgba(255,255,255,0.1), rgba(255,255,255,0.1)),
- repeating-radial-gradient(rgba(255,255,255,0.25) 0 0.0001%, rgba(255,255,255,0.04) 0 0.0002%) 50% 0 / 2500px 2500px,
- repeating-conic-gradient(rgba(255,255,255,0.25) 0 0.0001%, rgba(255,255,255,0.04) 0 0.0002%) 60% 60% / 2500px 2500px;
- background-blend-mode: normal, difference;"
- {{ with .Get "rotate" }}style="transform: rotate({{. }}deg)"{{ end }}>
- {{ .Inner | markdownify }}
-</div>
diff --git a/layouts/_shortcodes/right.html b/layouts/_shortcodes/right.html
deleted file mode 100644
index 775dcc04..00000000
--- a/layouts/_shortcodes/right.html
+++ /dev/null
@@ -1 +0,0 @@
-<p style="text-align: right">{{ index .Params 0 | markdownify }}</p>
diff --git a/layouts/_shortcodes/wordcount.html b/layouts/_shortcodes/wordcount.html
deleted file mode 100644
index b2f5b414..00000000
--- a/layouts/_shortcodes/wordcount.html
+++ /dev/null
@@ -1,7 +0,0 @@
-{{ $total := 0 }}
-
-{{ range where .Site.RegularPages "Section" "!=" "" }}
- {{ $total = add $total .WordCount }}
-{{ end }}
-
-{{ $total }}
diff --git a/layouts/archive.html b/layouts/archive.html
deleted file mode 100644
index 82f0f49f..00000000
--- a/layouts/archive.html
+++ /dev/null
@@ -1,23 +0,0 @@
-{{ define "main" }}
-<article>
- {{ partial "taxonomy/pagefind" . }}
- <div class="post-content text-size-lg">
- {{ range .Site.RegularPages.GroupByDate "2006" }}
- {{ partial "components/section-title" (dict
- "Left" .Key
- "Right" (T "archivePage.pageCount" (len .Pages))
- )}}
- <ol class="mx-0 my-4 p-0 leading-loose flex flex-col">
- {{ range .Pages }}
- <li class="list-decimal text-secondary lazy-render">
- <div class="flex justify-between">
- <a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
- <a href="/{{ .Section }}" class="font-mono text-secondary">{{ .Section }}</a>
- </div>
- </li>
- {{ end }}
- </ol>
- {{ end }}
- </div>
-</article>
-{{ end }}
diff --git a/layouts/article/page.html b/layouts/article/page.html
deleted file mode 100644
index e093e810..00000000
--- a/layouts/article/page.html
+++ /dev/null
@@ -1,3 +0,0 @@
-{{ define "main" }}
- {{ partial "template/post-page" . }}
-{{ end }}
diff --git a/layouts/article/section.html b/layouts/article/section.html
deleted file mode 100644
index 5072f416..00000000
--- a/layouts/article/section.html
+++ /dev/null
@@ -1,38 +0,0 @@
-{{ define "main" }}
- {{ $pages := .Pages }}
- {{ $categories := slice }}
-
- <article>
- <div class="posts-list pagefind-exclude">
- <div class="markdown-body">{{ .Content }}</div>
-
- {{ $remainingMonthsToOpen := 3 }}
- {{ range $pages.GroupByDate "2006" -}}
- <section class="w-full">
- {{ partial "components/section-title" (dict
- "Left" .Key
- "Right" (T "archivePage.postCountAnnual" (len .Pages))
- )}}
-
- {{ range .Pages.GroupByDate "January" }}
- <details class="lazy-render"{{ if gt $remainingMonthsToOpen 0 }} open{{ end }}>
- <summary class="flex items-center border-b border-b-dashed border-[var(--border-color)] py-2 px-1">
- <h2 class="text-size-lg inline-block w-full m-0
- flex justify-between items-center">
- {{ .Key }}
- <small class="font-mono text-secondary text-3">{{ T "archivePage.postCountMonthly" (len .Pages) }}</small>
- </h2>
- </summary>
- <ul class="ps-0 flex flex-col gap-2 list-none leading-relaxed">
- {{ range .Pages }}
- {{ partial "items/post-small" . }}
- {{ end }}
- </ul>
- </details>
- {{ $remainingMonthsToOpen = sub $remainingMonthsToOpen 1 }}
- {{ end }}
- </section>
- {{ end }}
- </div>
- </article>
-{{ end }}
diff --git a/layouts/baseof.404.html b/layouts/baseof.404.html
deleted file mode 100644
index 5140f5f0..00000000
--- a/layouts/baseof.404.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE html>
-<html lang="{{ .Site.LanguageCode }}" prefix="og: http://ogp.me/ns#">
- {{ partial "head.html" . }}
- <body>
- <main class="my-[var(--page-margin-y)] relative">
- {{ block "main" . }}{{ end }}
- </main>
- </body>
-</html>
diff --git a/layouts/baseof.html b/layouts/baseof.html
deleted file mode 100644
index f26dea17..00000000
--- a/layouts/baseof.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<!DOCTYPE html>
-<html lang="{{ .Site.LanguageCode }}" prefix="og: http://ogp.me/ns#">
- {{ partial "head.html" . }}
- <body>
- <main class="my-[var(--page-margin-y)] relative">
- {{ partial "header.html" . }}
- {{ block "main" . }}{{ end }}
- {{ partial "footer.html" . }}
- </main>
- {{ partial "components/svg-filters" . }}
- {{ partial "components/shade-mask" . }}
- {{ partial "scripts.html" . }}
- </body>
-</html>
diff --git a/layouts/baseof.page.html b/layouts/baseof.page.html
deleted file mode 100644
index 753d37ff..00000000
--- a/layouts/baseof.page.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<!DOCTYPE html>
-<html lang="{{ .Site.LanguageCode }}" prefix="og: http://ogp.me/ns#">
- {{ partial "head" . }}
- <body>
- <main class="my-[var(--page-margin-y)] relative">
- {{ if eq .Section "" }}{{ partial "header" . }}{{ end }}
- {{ block "main" . }}{{ end }}
- {{ if eq .Section "" }}{{ partial "footer" . }}{{ end }}
- </main>
- {{ partial "components/svg-filters" . }}
- {{ partial "components/shade-mask" . }}
- {{ partial "scripts" . }}
- </body>
-</html>
diff --git a/layouts/baseof.section.html b/layouts/baseof.section.html
deleted file mode 100644
index 5fc6ecef..00000000
--- a/layouts/baseof.section.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<!DOCTYPE html>
-<html lang="{{ .Site.LanguageCode }}" prefix="og: http://ogp.me/ns#">
- {{ partial "head.html" . }}
- <body>
- <main class="my-[var(--page-margin-y)] relative">
- {{ partial "header.html" . }}
- {{ partial "home/home-nav" . }}
- {{ block "main" . }}{{ end }}
- {{ partial "footer.html" . }}
- </main>
- {{ partial "components/svg-filters" . }}
- {{ partial "components/shade-mask" . }}
- {{ partial "scripts.html" . }}
- </body>
-</html>
diff --git a/layouts/blank.html b/layouts/blank.html
deleted file mode 100644
index 799c398a..00000000
--- a/layouts/blank.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{{ define "main" }}
- <article class="flex flex-col justify-center items-center"
- style="height: calc(100dvh - var(--page-margin-y) * 2)">
- {{ partial "components/logo" (dict "imageClass" "w-20 md:w-[7rem] my-4" "ctx" .) }}
- <div class="markdown-body font-mono text-sm">
- {{ .Content }}
- </div>
- <p class="text-secondary font-mono">* * *</p>
- </article>
-{{ end }}
diff --git a/layouts/cards/page.html b/layouts/cards/page.html
deleted file mode 100644
index 7c97ce1a..00000000
--- a/layouts/cards/page.html
+++ /dev/null
@@ -1,12 +0,0 @@
-{{ define "main" }}
- <article class="relative">
- {{ partial "components/logo" (dict
- "link" "cards"
- "class" "round-sticker absolute -top-4 -right-4 w-16 h-16 z-1 -rotate-5"
- "ctx" .
- "imageClass" "w-full"
- ) }}
- {{ partial "items/card" (dict "context" .) }}
- {{ partial "components/backlinks" (dict "filename" .File.BaseFileName "type" "cards" "context" .) }}
- </article>
-{{ end }}
diff --git a/layouts/cards/section.html b/layouts/cards/section.html
deleted file mode 100644
index 2ea36990..00000000
--- a/layouts/cards/section.html
+++ /dev/null
@@ -1,29 +0,0 @@
-{{ define "main" }}
-<article>
-
- <div class="bg-red-200 text-red b-1 b-solid b-red px-4 py-2 rd-md">
- <p>「卡片」分区已经弃用,这里的内容不会再更新。</p>
- </div>
-
- {{- $pages := .RegularPages }}
- {{- $featured := first 6 $pages }}
- {{- $rest := after 6 $pages }}
- <div class="grid md:grid-cols-2 gap-4 my-4">
- {{- range $featured }}
- {{ partial "items/card" (dict
- "context" .
- "summary" true
- "summaryClass" "text-base!") }}
- {{- end }}
- </div>
-
- <div class="grid grid-cols-3 gap-4 list-none text-lg">
- {{- range $rest }}
- <a class="border-b-dashed border-b-1 border-b-neutral-300 dark:border-b-neutral-700
- flex items-end py-1
- block text-secondary hover:text-unset hover:no-underline transition"
- href="{{ .RelPermalink }}">{{ .Title }}</a>
- {{- end }}
- </div>
-</article>
-{{ end }}
diff --git a/layouts/fiction/page.html b/layouts/fiction/page.html
deleted file mode 100644
index 37e91c86..00000000
--- a/layouts/fiction/page.html
+++ /dev/null
@@ -1,24 +0,0 @@
-{{ define "main" }}
- <article class="h-entry">
- <header class="text-center">
- {{ partial "components/logo" (dict
- "link" "fiction/"
- "ctx" .
- "imageClass" "block w-[10rem]"
- "class" "flex justify-center"
- ) }}
- <h1
- class="xerox text-4xl font-900"
- data-pagefind-meta="title"
- ><span class="p-name" style="view-transition-name: post-{{ .File.UniqueID }}">{{ .Title }}</span></h1>
- <div class="text-secondary">
- {{ partial "components/date" . }} ·
- {{ partial "components/wordcount" . }}</div>
- </header>
-
- {{ partial "content" . }}
- {{ partial "posts/webmention" . }}
- {{ partial "components/back-to-top" . }}
- {{ partial "components/microformats" . }}
- </article>
-{{ end }}
diff --git a/layouts/fiction/section.html b/layouts/fiction/section.html
deleted file mode 100644
index 9bbf122f..00000000
--- a/layouts/fiction/section.html
+++ /dev/null
@@ -1,25 +0,0 @@
-{{ define "main" }}
- <article>
- <div class="markdown-body">{{ .Content }}</div>
- <div class="pagefind-exclude my-8">
- <div class="flex flex-wrap justify-around gap-8">
- {{- range .Pages }}
-
- {{ $rotationDeg := add (math.Floor (mul (math.Rand) 7)) -4 }}
- {{- $deg := int $rotationDeg -}}
-
- {{ $steps := slice 60 70 80 90 100 }}
- {{ $opacity := index $steps (int (math.Floor (mul (math.Rand) 5))) }}
- {{ $opacityClass := printf "opacity-%d" $opacity }}
-
- <div class="xerox text-center text-2xl font-extrabold
- {{ $opacityClass }}
- transition hover:opacity-100 hover:scale-110"
- style="view-transition-name: post-{{ .File.UniqueID }}; {{ if ne $deg 0 }}--rotation-deg: {{ $deg }}deg; transform: rotate({{ $deg }}deg);{{ end }}">
- <a class="hover:no-underline" href="{{ .Permalink }}">《{{ .Title }}》</a>
- </div>
- {{- end }}
- </div>
- </div>
- </article>
-{{ end }}
diff --git a/layouts/highlights.html b/layouts/highlights.html
deleted file mode 100644
index 0865b063..00000000
--- a/layouts/highlights.html
+++ /dev/null
@@ -1,20 +0,0 @@
-{{ define "main" }}
- <article>
- <div class="post-content markdown-body text-size-lg md:text-size-xl">
- <p>{{ .Content }}</p>
- </div>
- <!-- Highlights -->
- {{ range shuffle hugo.Data.highlights }}
- <section class="post-content lazy-render">
- <h3><a href="{{ .url }}">《{{ .title }}》</a></h3>
- <ul class="list-none">
- {{ range .highlights }}
- <li class="my-4 text-lg">
- <a class="hover:no-underline" href="{{ .link }}">{{ .text | markdownify }}</a>
- </li>
- {{ end }}
- </ul>
- </section>
- {{ end }}
- </article>
-{{ end }}
diff --git a/layouts/home.html b/layouts/home.html
deleted file mode 100644
index a74fee5d..00000000
--- a/layouts/home.html
+++ /dev/null
@@ -1,8 +0,0 @@
-{{ define "main" }}
- {{ partial "home/microformats" . }}
- <article>
- {{ partial "home/home-nav" . }}
- {{ partial "home/latest-posts" . }}
- {{ partial "home/more-links" . }}
- </article>
-{{ end }}
diff --git a/layouts/library/page.html b/layouts/library/page.html
deleted file mode 100644
index fbc5d15f..00000000
--- a/layouts/library/page.html
+++ /dev/null
@@ -1,62 +0,0 @@
-{{ define "main" }}
- <article class="h-entry">
- <header class="flex flex-col items-center gap-2">
- <div class="relative border-3 border-solid border-white shadow-lg w-[10rem] md:w-[15rem]"
- style="view-transition-name: book-{{ .File.UniqueID }}">
- <img
- class="lazy block w-full h-auto" loading="lazy"
- data-pagefind-meta="image[src]"
- src="{{ .Params.cover }}"
- />
- {{ partial "components/logo"
- (dict
- "link" "library"
- "ctx" .
- "class" "round-sticker absolute w-8 h-8 md:w-20 md:h-20 top-8 -right-8 md:-right-12"
- "imageClass" "w-full") }}
- </div>
- <h1 class="xerox p-name" data-pagefind-meta="title">{{ .Title }}</h1>
- {{- $rating := .Params.rating -}}
- {{- $fullStars := math.Floor $rating -}}
- <p class="m-0">
- {{ with .Params.authors }}{{ delimit . ", " }}{{ end }}
- </p>
- <p class="m-0">
- {{- range seq $fullStars }}
- <span class="star">⭐</span>
- {{- end -}}
- </p>
- </header>
-
- {{ partial "content" . }}
-
- <div class="text-size-base text-secondary md:flex md:justify-between">
- <p>于 {{ partial "components/date" . }} 读完</p>
- <p>{{ partial "components/tags" . }}</p>
- </div>
-
- {{ partial "components/backlinks" (dict "filename" .File.BaseFileName "type" "library" "context" .) }}
- {{ partial "posts/webmention" . }}
- {{ partial "components/back-to-top.html" . }}
- {{ partial "components/microformats" . }}
-
-
-
- {{ with .Params.authors }}
- {{ $author := index . 0 }}
- {{ $term := index $.Site.Taxonomies.authors $author }}
- {{ if and $term (gt (len $term.Pages) 1) }}
- <h2>我读过的 {{ $author }} 的其它书籍</h2>
- <div class="grid grid-cols-4 md:grid-cols-6 items-center gap-4 my-4">
- {{ range $term.Pages }}
- {{ if ne .File.UniqueID $.File.UniqueID }}
- <div data-tooltip="{{ .Title }}">
- {{ partial "items/book" (dict "ctx" .) }}
- </div>
- {{ end }}
- {{ end }}
- </div>
- {{ end }}
- {{ end }}
- </article>
-{{ end }}
diff --git a/layouts/library/section.html b/layouts/library/section.html
deleted file mode 100644
index bb297a0d..00000000
--- a/layouts/library/section.html
+++ /dev/null
@@ -1,85 +0,0 @@
-{{ define "main" }}
-
-{{ $isLibraryHome := eq .RelPermalink "/library/" }}
-{{ $books := .RegularPages }}
-{{ if $isLibraryHome }}
- {{ $sections := (sort .Sections "value" "asc") }}
- {{ range $sections }}
- {{ $books = $books | append .RegularPages }}
- {{ end }}
-{{ end }}
-
-{{ $years := slice }}
-{{ range .Sections }}
- {{ $years = $years | append .Title }}
-{{ end }}
-{{ $years = $years | collections.Reverse }}
-
- <article class="pagefind-exclude">
- <div class="markdown-body">{{ .Content }}</div>
-
- <div>
-
- {{ if $isLibraryHome }}
- {{ partial "components/section-title" (dict
- "Left" "最近读的书"
- "Right" (printf "共 %d 篇书评" (len $books))
- )}}
- {{ end }}
-
- <div class="grid grid-cols-4 md:grid-cols-6 items-center gap-4 my-4">
- {{ $booksToShow := $books }}
- {{ if $isLibraryHome }}
- {{ $booksToShow = first 18 $books }}
- {{ end }}
- {{ range $i, $book := $booksToShow }}
- <div class="{{ if gt $i 15 }}hidden md:block{{ end }}">
- {{ partial "items/book" (dict
- "ctx" $book
- ) }}
- </div>
- {{ end }}
- </div>
-
-
- <!-- ONLY SHOW IN HOME SECTION / START -->
- {{ if $isLibraryHome }}
-
- <!-- === year list === -->
- <div class="flex items-center my-8 justify-between gap-4">
- <a href="/library/{{ now.Year }}" class="small-button">
- {{ T "library.viewAllThisYear" }}
- <span class="text-secondary">→</span>
- </a>
- <p class="my-0">
- {{ $currentYear := printf "%d" now.Year }}
- {{ range $i, $year := $years }}
- {{ if ne $year $currentYear }}
- <a class="text-secondary" href="{{ printf "/library/%s/" $year }}">{{ $year }} 年</a>
- {{ if not (eq $i (sub (len $years) 1)) }}·{{ end }}
- {{ end }}
- {{ end }}
- </p>
- </div>
-
- <!-- === good books section === -->
- {{ $goodBooks := where $books ".Params.rating" "==" 5 }}
- {{ partial "components/section-title" (dict
- "Left" "推荐好书"
- "Right" (printf "共 %d 本" (len $goodBooks))
- )}}
- <div class="grid grid-cols-4 md:grid-cols-6 items-center gap-4 my-4">
- {{ range $goodBooks }}
- {{ partial "items/book" (dict
- "ctx" .
- "NoViewTransition" true
- ) }}
- {{ end }}
- </div>
-
- {{ end }}
- <!-- ONLY SHOW IN HOME SECTION / END -->
-
- </div>
- </article>
-{{ end }}
diff --git a/layouts/page.html b/layouts/page.html
deleted file mode 100644
index ab703e2e..00000000
--- a/layouts/page.html
+++ /dev/null
@@ -1,9 +0,0 @@
-{{ define "main" }}
- <article>
- <div id="post-content" class="post-content markdown-body text-size-md md:text-size-lg leading-loose"
- style="view-transition-name: post-content-{{ .File.UniqueID }}">
- {{ partial "posts/toc" . }}
- {{ partial "utils/render" .Content }}
- </div>
- </article>
-{{ end }}
diff --git a/layouts/rss.xml b/layouts/rss.xml
deleted file mode 100644
index 026d9a87..00000000
--- a/layouts/rss.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-{{- $authorEmail := "" }}
-{{- with site.Params.author }}
- {{- if reflect.IsMap . }}
- {{- with .email }}
- {{- $authorEmail = . }}
- {{- end }}
- {{- end }}
-{{- end }}
-
-{{- $authorName := "" }}
-{{- with site.Params.author }}
- {{- if reflect.IsMap . }}
- {{- with .name }}
- {{- $authorName = . }}
- {{- end }}
- {{- else }}
- {{- $authorName = . }}
- {{- end }}
-{{- end }}
-
-{{- $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 type=\"text/xsl\" href=\"/atom.xsl.xml\"?>" | safeHTML }}
-<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
- <channel>
- <title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} | {{ end }}{{ .Site.Title }}{{ end }}</title>
- <link>{{ .Permalink }}</link>
- <description>{{ .Site.Title }}{{ if ne .Title .Site.Title }}{{ with .Title }}:在「{{.}}」分区下的最新内容{{ end }}{{ end }}</description>
- <generator>Hugo</generator>
- <language>{{ site.Language.LanguageCode }}</language>{{ with $authorEmail }}
- <managingEditor>{{.}}{{ with $authorName }} ({{ . }}){{ end }}</managingEditor>{{ end }}{{ with $authorEmail }}
- <webMaster>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</webMaster>{{ end }}{{ with .Site.Copyright }}
- <copyright>{{ . }}</copyright>{{ end }}{{ if not .Date.IsZero }}
- <lastBuildDate>{{ (index $pages.ByLastmod.Reverse 0).Lastmod.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 }}
- {{- range $pages }}
- <item>
- <title>{{ .Title }}</title>
- <link>{{ .Permalink }}</link>
- <pubDate>{{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
- {{- with $authorEmail }}<author>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</author>{{ end }}
- <guid>{{ .Permalink }}</guid>
- <description>
- {{ .Content | transform.XMLEscape | safeHTML }}
- {{ printf `<div style="text-align:right;"><a href="%s#action-menu">%s</a></div>` .Permalink (T "rss_comment_link") | transform.XMLEscape | safeHTML }}
- </description>
- </item>
- {{- end }}
- </channel>
-</rss>
diff --git a/layouts/stats.html b/layouts/stats.html
deleted file mode 100644
index ea0f3e2a..00000000
--- a/layouts/stats.html
+++ /dev/null
@@ -1,30 +0,0 @@
-{{ define "main" }}
- <article>
- <section>
- {{ partial "stats/stats-table" . }}
- </section>
-
- <section>
- <h2>每月文章字数</h2>
- {{ partial "stats/word-count-chart" . }}
- </section>
-
- <section>
- <h2>文章发布时间段分布</h2>
- <div class="outbox">
- {{ partial "stats/publish-time-chart" . }}
- </div>
- </section>
- <hr>
-
- <section>
- <h2>内部链接图谱</h2>
- <p>站内各个页面之间通过超链接建立起来的联系,你可以通过视觉化的双向链接逛逛我的博客。图谱可以缩放和拖拽,你也可以<a href="/graph" style="text-decoration: underline;">点击这里</a>全屏浏览。</p>
- <div class="outbox small">
- <iframe src="https://www.geedea.pro/graph.html"
- style="width:100%;height: 30rem;border-radius:5px;border:none"></iframe>
- </div>
- </section>
- <hr>
- </article>
-{{ end }}
diff --git a/layouts/tags/taxonomy.html b/layouts/tags/taxonomy.html
deleted file mode 100644
index d716e87e..00000000
--- a/layouts/tags/taxonomy.html
+++ /dev/null
@@ -1,12 +0,0 @@
-{{ define "main" }}
-<article>
- <div class="post-content markdown-body text-size-md md:text-size-lg leading-loose">
- {{ partial "utils/render" .Content }}
- </div>
- <h2>切面</h2>
- {{ partial "taxonomy/all-tags" . }}
- <hr />
- <h2>开始速切!</h2>
- <p class="text-secondary text-sm">快速切换到你想去的地方。</p>
- {{ partial "taxonomy/pagefind" . }}
-{{ end }}
diff --git a/layouts/taxonomy.html b/layouts/taxonomy.html
deleted file mode 100644
index 4ae858d9..00000000
--- a/layouts/taxonomy.html
+++ /dev/null
@@ -1,13 +0,0 @@
-{{ define "main" }}
- <article>
- <div class="post-content markdown-body text-size-md md:text-size-lg leading-loose">
- {{ partial "utils/render" .Content }}
- </div>
- <h2>文章系列</h2>
- {{ partial "taxonomy/all-categories.html" . }}
- <hr />
- <h2>尘封的系列</h2>
- <p>这些文章系列已经不再更新。</p>
- {{ partial "taxonomy/archived-categories.html" . }}
- </article>
-{{ end }}
diff --git a/layouts/term.html b/layouts/term.html
deleted file mode 100644
index 743fc69e..00000000
--- a/layouts/term.html
+++ /dev/null
@@ -1,15 +0,0 @@
-{{ define "main" }}
- <article>
- <section>
- {{ with .Content }}
- <div class="markdown-body text-size-lg md:text-size-xl">
- {{ . }}<hr/>
- </div>
- {{ end }}
- {{ partial "term/term-posts" . }}
- {{ partial "term/term-weeklies" . }}
- {{ partial "term/term-fictions" . }}
- {{ partial "term/term-books" . }}
- </section>
- </article>
-{{ end }}
diff --git a/layouts/uncategorized.html b/layouts/uncategorized.html
deleted file mode 100644
index a269a18a..00000000
--- a/layouts/uncategorized.html
+++ /dev/null
@@ -1,22 +0,0 @@
-{{ define "main" }}
- <article>
- {{ partial "header" . }}
- {{ partial "home/home-nav" . }}
- <div class="post-content markdown-body">
- <p>{{ .Content }}</p>
- </div>
- <!-- Uncategorized -->
- {{ $posts := .Site.GetPage "section" "posts" }}
- {{ $essays := .Site.GetPage "section" "essays" }}
- {{ $combined := $posts.Pages | append $essays.Pages }}
- {{ $uncategorized := where $combined "Params.categories" "eq" nil }}
- {{ if $uncategorized }}
- <ol class="ps-0 flex flex-col gap-2 leading-relaxed">
- {{ range $uncategorized }}
- {{ partial "items/post-small" . }}
- {{ end }}
- </ol>
- {{ end }}
- </article>
-{{ partial "footer.html" . }}
-{{ end }}
diff --git a/layouts/weekly/page.html b/layouts/weekly/page.html
deleted file mode 100644
index e093e810..00000000
--- a/layouts/weekly/page.html
+++ /dev/null
@@ -1,3 +0,0 @@
-{{ define "main" }}
- {{ partial "template/post-page" . }}
-{{ end }}
diff --git a/layouts/weekly/section.html b/layouts/weekly/section.html
deleted file mode 100644
index c1bc53b9..00000000
--- a/layouts/weekly/section.html
+++ /dev/null
@@ -1,41 +0,0 @@
-{{ define "main" }}
- {{ $pages := .Pages }}
- {{ $categories := slice }}
-
- <article>
- <div class="posts-list pagefind-exclude">
- <div class="markdown-body">{{ .Content }}</div>
-
- <!-- Post Archive List -->
- {{ $remainingMonthsToOpen := 3 }}
- {{ range $pages.GroupByDate "2006" -}}
- <section class="w-full">
- {{ partial "components/section-title" (dict
- "Left" .Key
- "Right" (T "archivePage.postCountAnnual" (len .Pages))
- )}}
-
- {{ range .Pages.GroupByDate "January" }}
- <div class="lazy-render"{{ if gt $remainingMonthsToOpen 0 }} open{{ end }}>
- <h2 class="text-size-lg inline-block w-full m-0
- flex justify-between items-center">
- {{ .Key }}
- </h2>
- <ul class="ps-0 flex flex-col gap-2 list-none leading-relaxed">
- {{ range .Pages }}
- <li class="text-size-lg">
- <a href="{{ .RelPermalink }}">
- {{ .Title }}{{ with .Params.subtitle }}:<span class="text-secondary">{{. }}</span>
- {{ end }}
- </a>
- </li>
- {{ end }}
- </ul>
- </div>
- {{ $remainingMonthsToOpen = sub $remainingMonthsToOpen 1 }}
- {{ end }}
- </section>
- {{ end }}
- </div>
- </article>
-{{ end }}