From 4f0ebaeed13c1c44c7d7c5778b187b69f5849552 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Fri, 18 Apr 2025 14:40:33 +0800 Subject: refactor: separate post single template and page template --- layouts/posts/single.html | 73 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 layouts/posts/single.html (limited to 'layouts/posts/single.html') diff --git a/layouts/posts/single.html b/layouts/posts/single.html new file mode 100644 index 00000000..525db84d --- /dev/null +++ b/layouts/posts/single.html @@ -0,0 +1,73 @@ +{{ define "main" }} + {{ partial "components/post-page-header.html" . }} +
+ +
+ {{ partial "components/banner.html" . }} + +

+ {{ .Title }} + {{ with .Params.subtitle }} + {{ . }} + {{ end }} +

+ + +
+ + +
+ {{ if .Params.toc }} +
+ {{ end }} + {{ .Site.Params.postHeaderContent | safeHTML }} + {{ .Content }} + {{ if eq .Site.Language.Lang "zh" }} +

如果你觉得文章对你有帮助,可以考虑赞助作者

+ {{ end }} +
+ + {{ partial "components/comment.html" . }} + + {{ with site.RegularPages.Related . | first 5 }} +

{{ T "relatedContent" }}

+ + {{ end }} + + + + +
+{{ end }} -- cgit v1.2.3 From 8825eab3e3e82e0719f58d013218e2b957a2b1c4 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Fri, 18 Apr 2025 14:59:48 +0800 Subject: feat: related posts style & reading time estimate --- layouts/posts/single.html | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'layouts/posts/single.html') diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 525db84d..efea94f0 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -47,16 +47,28 @@ {{ end }} - {{ partial "components/comment.html" . }} + + {{ partial "components/comment.html" . }} - {{ with site.RegularPages.Related . | first 5 }} -

{{ T "relatedContent" }}

-