From 10431bd8f5ff71690ae4e5444e8d7894fd401ae5 Mon Sep 17 00:00:00 2001 From: eltrac Date: Tue, 7 Apr 2026 14:53:17 +0800 Subject: chore: move templates out of site repo --- layouts/_partials/posts/action-area.html | 16 ------ layouts/_partials/posts/banner.html | 9 --- layouts/_partials/posts/comment.html | 38 ------------ layouts/_partials/posts/endnotes.html | 13 ----- layouts/_partials/posts/fediverse-form.html | 14 ----- layouts/_partials/posts/toc.html | 10 ---- layouts/_partials/posts/webmention-form.html | 6 -- layouts/_partials/posts/webmention-mentions.html | 56 ------------------ layouts/_partials/posts/webmention-replies.html | 69 ---------------------- layouts/_partials/posts/webmention-summary.html | 54 ------------------ layouts/_partials/posts/webmention.html | 73 ------------------------ 11 files changed, 358 deletions(-) delete mode 100644 layouts/_partials/posts/action-area.html delete mode 100644 layouts/_partials/posts/banner.html delete mode 100644 layouts/_partials/posts/comment.html delete mode 100644 layouts/_partials/posts/endnotes.html delete mode 100644 layouts/_partials/posts/fediverse-form.html delete mode 100644 layouts/_partials/posts/toc.html delete mode 100644 layouts/_partials/posts/webmention-form.html delete mode 100644 layouts/_partials/posts/webmention-mentions.html delete mode 100644 layouts/_partials/posts/webmention-replies.html delete mode 100644 layouts/_partials/posts/webmention-summary.html delete mode 100644 layouts/_partials/posts/webmention.html (limited to 'layouts/_partials/posts') 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 @@ -
-
- {{ partial "posts/fediverse-form" . }} - {{ partial "posts/webmention-form" . }} -
-
-

📧 {{ T "actionMenu.email" }}

- {{ if eq .Site.Language.Lang "zh" }} -

这是什么?

- {{ end }} -
-
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 }} - -{{ 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 @@ - -{{ $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 }} -
- 博客的评论区已经被禁用,旧的数据已经导出,可以点击这行字查看。 -
- {{ range . }} -
-
- {{ .author.login }} - {{ .createdAt | time.Format "2006/01/02" }} -
-
- {{ .body | markdownify }} -
-
- {{ end }} -
- {{ with $url }} -

Full GitHub Discussion →

- {{ end }} -
-
- {{ 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 }} -
-
- -
-{{ 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 }} -
-

{{ T "actionMenu.fediverse" }}

- -
- - - -
-
- -{{ 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 }} - -{{ 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 @@ -
-

{{ T "actionMenu.webmention" }}

- - - -
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 . }} -
- -
-{{ 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 . }} -
-{{ 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 }} - -
-
-
- Profile Picture -
-

- - {{ if reflect.IsMap $author }} - {{ replaceRE ":.*?:" "" (index $author.name 0) }} - {{ else }} - {{ $author }} - {{ end }} - -

- {{ $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 }} -

-
-
-
- ↗ -
-
- -
-
- {{ index (index $reply.content 0) "html" | safeHTML }} - {{ if strings.Contains .webmention.source "https://brid.gy" }} -

通过 Bridgy 发送自联邦宇宙

- {{ end }} -
-
-
-{{ end }} -
-{{ 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 }} - -
- - - - - {{ 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) }} - - {{ $value := math.Floor (mul math.Rand 80) }} - {{ $rotate := cond (lt $value 40) (sub 10 $value) (sub $value 30) }} - {{ if $photo }} - Profile Picture - {{ else }} -
- {{ end }} -
- {{ end }} -
- {{ printf (T "webmention.likedBy") (len $likes ) }} - {{ if gt $othercount 0 }} - {{ printf (T "webmention.repliedAndMentionedBy") $othercount }} - {{ end }} -
-
-
- 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 }} -
- - {{ partial "posts/webmention-summary" (dict - "likes" $likes - "page" $page - "othercount" (add (len $replies) (len $mentions)) - ) }} - - {{ with $page.Params.toot }} -

- {{ $link := printf "Eucalyptus" . }} - *{{ printf (T "webmention.bridgyNotice") $link | safeHTML }} -

- {{ end }} -
- {{ partial "posts/webmention-replies" $replies }} - {{ partial "posts/webmention-mentions" $mentions }} -
-
- {{ else }} -

Unable to fetch webmentions. Please contact webmaster.

- {{ end }} -{{ end }} -- cgit v1.2.3