From 1e5f8eb33bc41cb59faf059e83701152785cabea Mon Sep 17 00:00:00 2001 From: yingyu5658 Date: Sat, 13 Dec 2025 08:33:08 +0800 Subject: Initial commit --- layouts/_default/_markup/render-image.html | 4 + layouts/_default/baseof.html | 43 +++++ layouts/_default/list.html | 70 +++++++ layouts/_default/rss.xml | 85 +++++++++ layouts/_default/single.html | 297 +++++++++++++++++++++++++++++ layouts/_default/term.html | 36 ++++ 6 files changed, 535 insertions(+) create mode 100644 layouts/_default/_markup/render-image.html create mode 100644 layouts/_default/baseof.html create mode 100644 layouts/_default/list.html create mode 100644 layouts/_default/rss.xml create mode 100644 layouts/_default/single.html create mode 100644 layouts/_default/term.html (limited to 'layouts/_default') diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html new file mode 100644 index 0000000..bf19bf9 --- /dev/null +++ b/layouts/_default/_markup/render-image.html @@ -0,0 +1,4 @@ +
+ {{ .Text }} +
{{ .Text }}
+
\ No newline at end of file diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..8729df0 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,43 @@ + + + + + + + + {{- partial "favicon.html" . -}} + {{ .Title }} + + {{- partial "seo_tags.html" . -}} + + + {{ with .OutputFormats.Get "rss" -}} + {{ printf `` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} + {{ end -}} + + {{- partial "style.html" . -}} + + + {{- partial "custom_head.html" . -}} + + + +
+ {{- partial "header.html" . -}} +
+
+ {{- block "main" . }}{{- end }} +
+ + + + {{- partial "custom_body.html" . -}} + + + diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..8c1db86 --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,70 @@ +{{ define "main" }} + + {{ if .Site.Params.postSearch }} + + + {{ end }} + + +{{ end }} diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml new file mode 100644 index 0000000..37ab6ea --- /dev/null +++ b/layouts/_default/rss.xml @@ -0,0 +1,85 @@ +{{- /* Deprecate site.Author.email in favor of site.Params.author.email */}} +{{- $authorEmail := "" }} +{{- with site.Params.author }} + {{- if reflect.IsMap . }} + {{- with .email }} + {{- $authorEmail = . }} + {{- end }} + {{- end }} +{{- else }} + {{- with site.Author.email }} + {{- $authorEmail = . }} + {{- warnf "The author key in site configuration is deprecated. Use params.author.email instead." }} + {{- end }} +{{- end }} + +{{- /* Deprecate site.Author.name in favor of site.Params.author.name */}} +{{- $authorName := "" }} +{{- with site.Params.author }} + {{- if reflect.IsMap . }} + {{- with .name }} + {{- $authorName = . }} + {{- end }} + {{- else }} + {{- $authorName = . }} + {{- end }} +{{- else }} + {{- with site.Author.name }} + {{- $authorName = . }} + {{- warnf "The author key in site configuration is deprecated. Use params.author.name instead." }} + {{- end }} +{{- end }} + +{{- $pctx := . }} +{{- if .IsHome }}{{ $pctx = .Site }}{{ end }} +{{- $pages := slice }} +{{- if or $.IsHome $.IsSection }} +{{- $pages = $pctx.RegularPages }} +{{- else }} +{{- $pages = $pctx.Pages }} +{{- end }} +{{- $limit := .Site.Params.RSS.pageLimit }} +{{- if ge $limit 1 }} +{{- $pages = $pages | first $limit }} +{{- end }} +{{- printf "" | safeHTML }} + + + {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}{{ end }} + {{ .Permalink }} + Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ .Site.Title }} + Hugo + {{ site.LanguageCode }} + {{ with $authorEmail }} + {{ . }}{{ with $authorName }} ({{ . }}){{ end }} + {{ end }} + {{ with $authorEmail }} + {{ . }}{{ with $authorName }} ({{ . }}){{ end }} + {{ end }} + {{ with .Site.Params.copyright }} + {{ . }} + {{ end }} + {{ if not .Date.IsZero }} + {{ (index $pages.ByLastmod.Reverse 0).Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{ end }} + {{ if and .Site.Params.RSS.followFeedId .Site.Params.RSS.followUserId }} + + {{ .Site.Params.RSS.followFeedId }} + {{ .Site.Params.RSS.followUserId }} + + {{ end }} + {{- with .OutputFormats.Get "RSS" }} + {{ printf "" .Permalink .MediaType | safeHTML }} + {{- end }} + {{- range $pages }} + + {{ .Title }} + {{ .Permalink }} + {{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{- with $authorEmail }}{{ . }}{{ with $authorName }} ({{ . }}){{ end }}{{ end }} + {{ .Permalink }} + {{ .Content | transform.XMLEscape | safeHTML }} + + {{- end }} + + \ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..78814e5 --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,297 @@ +{{ define "main" }} {{ if eq .Type "blog" }} {{ if not .Params.menu }} +

{{ .Title }}

+{{ end }} {{ end }} + +
+

{{ .Title }}

+ + +
+ {{ .Content }} +
+
+ + +

+ {{ range (.GetTerms "tags") }} + #{{ .LinkTitle }} + {{ end }} +

+ +{{ $upvoteEnabled := default .Site.Params.upvote .Params.upvote }} +{{ if $upvoteEnabled }} +
+ + + +
+ + +{{ end }} + + +{{ $tocEnabled := default .Site.Params.toc .Params.toc }} {{ if $tocEnabled }} +
{{ partial "toc.html" . }}
+{{ end }} +
+
+ +

评论 与 Webmentions

+
+
+ +
+
+ + +
+ 如何参与 Webmentions 互动? +
+
+

如果你想回应这篇文章,请在你的博客或社交媒体中链接本页面,然后在下面的表单中提交你的页面链接。

+
+ + + +
+ + + +
+
+
+
+关于 Webmention 的更多信息 以及 为什么要这么做? +
+ + + + + +{{ end }} diff --git a/layouts/_default/term.html b/layouts/_default/term.html new file mode 100644 index 0000000..0d55fc1 --- /dev/null +++ b/layouts/_default/term.html @@ -0,0 +1,36 @@ +{{ define "main" }} +
+

{{ .Title }}

+ +
+ {{ range .Pages }} + +
  • + + {{ .Title }} +
  • + + {{ else }} +

    该分类下还没有文章。

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