diff options
| author | eltrac <hi@eltr.ac> | 2026-04-07 14:53:17 +0800 |
|---|---|---|
| committer | eltrac <hi@eltr.ac> | 2026-04-07 14:53:17 +0800 |
| commit | 10431bd8f5ff71690ae4e5444e8d7894fd401ae5 (patch) | |
| tree | 62b7fd1b6c1f68d2804f380eb522bcebeb2c8d9f /layouts/_partials/components | |
| parent | 3e0edacc4a0cafa53ede57ebb6f0378c93f3123b (diff) | |
chore: move templates out of site repo
Diffstat (limited to 'layouts/_partials/components')
| -rw-r--r-- | layouts/_partials/components/back-to-top.html | 16 | ||||
| -rw-r--r-- | layouts/_partials/components/backlinks.html | 37 | ||||
| -rw-r--r-- | layouts/_partials/components/category-pill.html | 7 | ||||
| -rw-r--r-- | layouts/_partials/components/date.html | 31 | ||||
| -rw-r--r-- | layouts/_partials/components/logo.html | 18 | ||||
| -rw-r--r-- | layouts/_partials/components/microformats.html | 9 | ||||
| -rw-r--r-- | layouts/_partials/components/section-title.html | 10 | ||||
| -rw-r--r-- | layouts/_partials/components/shade-mask.html | 7 | ||||
| -rw-r--r-- | layouts/_partials/components/svg-filters.html | 4 | ||||
| -rw-r--r-- | layouts/_partials/components/tags.html | 3 | ||||
| -rw-r--r-- | layouts/_partials/components/wordcount.html | 1 |
11 files changed, 0 insertions, 143 deletions
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> |
