diff --git a/assets/css/_page/_home.scss b/assets/css/_page/_home.scss index d6f4c1215..2b40716d5 100644 --- a/assets/css/_page/_home.scss +++ b/assets/css/_page/_home.scss @@ -118,11 +118,31 @@ } .single-title { + display: flex; /* Align elements horizontally */ + align-items: center; /* Vertical alignment */ + justify-content: space-between; /* Optional: spread the title and date apart */ + gap: 10px; /* Space between title and date */ + margin: 0.4rem 0; font-size: 1.25rem; line-height: 140%; - margin: 0.4rem 0; } + + .title-container { + flex: 1; /* Allow the title to take up available space */ + } + + .date-container { + white-space: nowrap; + font-size: 16px; + font-weight: 400; + color: $global-font-color; + [data-theme='dark'] & { + color: $global-font-color-dark; + } + + } + .content { display: block; margin-top: 0.3rem; @@ -170,7 +190,7 @@ .post-footer { margin-top: 0.4rem; - display: flex; + display: none; justify-content: space-between; align-items: center; font-size: 0.875rem; diff --git a/i18n/zh-TW.toml b/i18n/zh-TW.toml index 53092dead..748ccd3b2 100644 --- a/i18n/zh-TW.toml +++ b/i18n/zh-TW.toml @@ -110,11 +110,11 @@ other = "分享到" contents = "目錄" pin = "置頂" repost = "轉貼" -publishedOnDate = "發佈於 {{ .Date }}" +publishedOnDate = "{{ .Date }}" views = "次閱讀" comments = "條評論" author = "作者" -updatedOnDate = "更新於 {{ .Date }}" +updatedOnDate = "{{ .Date }}" readMarkdown = "閱讀原始文檔" viewSource = "查看原始碼" editThisPage = "編輯此頁" diff --git a/layouts/_default/home.archives.html b/layouts/_default/home.archives.html index 0ae4d2664..d7575a7a8 100644 --- a/layouts/_default/home.archives.html +++ b/layouts/_default/home.archives.html @@ -10,7 +10,7 @@
{{- /* Title */ -}} -

+

{{- dict "Class" "fa-solid fa-box-archive fa-fw me-1" | partial "plugin/icon.html" -}} {{- .Params.Title | default (T "archives") }} {{ $pages.Len }}

diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 6ba062f31..2db8fb440 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -8,10 +8,10 @@
{{- /* Title */ -}} -

{{- cond (.Param "capitalizeTitles") (title .Title) .Title -}}

+

{{- cond (.Param "capitalizeTitles") (title .Title) .Title -}}

{{- /* Subtitle */ -}} - {{- with $params.subtitle -}}

{{ . | $.RenderString }}

{{- end -}} + {{- with $params.subtitle -}}

{{ . | $.RenderString }}

{{- end -}}
{{- /* Content */ -}} diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index 45dc616cf..3f5c12cd3 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -17,6 +17,7 @@
{{- end -}} + + +

+
+ {{- with $params.weight -}} + {{- $icon := dict "Class" "fa-solid fa-thumbtack fa-fw" -}} + {{- $icon | partial "plugin/icon.html" -}} + {{- end -}} + {{- $repost := $params.repost | default dict -}} + {{- with $repost -}} + {{- if eq .Enable true -}} + {{- $icon := dict "Class" "fa-solid fa-share fa-fw" -}} + {{- $title := cond (hasPrefix .Url "http") (printf "%v -> %v" (T "single.repost") .Url ) (T "single.repost") -}} + {{- $icon | partial "plugin/icon.html" -}} + {{- end -}} + {{- end -}} + {{ cond (.Param "capitalizeTitles") (title .Title) .Title }} +
+ +
+ {{- with .PublishDate | dateFormat (.Site.Params.dateFormat | default "2006-01-02") -}} + + {{- printf `` . . | dict "Date" | T "single.publishedOnDate" | safeHTML -}} + + {{- end -}} +
+

{{- /* Summary content */ -}}
@@ -76,4 +104,4 @@

{{- end -}}

-{{- /* EOF */ -}} +{{- /* EOF */ -}} \ No newline at end of file diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 1170f7d5c..b508267a4 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -2,7 +2,7 @@ {{- $homeRelPermalink := .Scratch.Get "homeRelPermalink" -}} {{- /* Desktop header */ -}} -
+
{{- /* Mobile header */ -}} -
+
diff --git a/layouts/partials/single/post-author.html b/layouts/partials/single/post-author.html index d81308c78..03d58e0bb 100644 --- a/layouts/partials/single/post-author.html +++ b/layouts/partials/single/post-author.html @@ -3,23 +3,5 @@ {{- .Store.Set "author" $author -}} {{- /* EOF */ -}} diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 5e5509ff1..6f6b6a3b2 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -10,7 +10,7 @@ {{- $tableOfContents := .Fragments.ToHTML ($toc.startlevel | int) ($toc.endlevel | int) ($toc.ordered | default false) -}} {{- $showToc := $toc.enable | and (ne $tableOfContents ``) -}} -