From 73d60625a3d4e9a2dd11af31ef71bb970b065d06 Mon Sep 17 00:00:00 2001 From: TsaiLintung <101155567+TsaiLintung@users.noreply.github.com> Date: Sun, 20 Oct 2024 11:37:49 -0700 Subject: [PATCH 01/13] Update _home.scss --- assets/css/_page/_home.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/css/_page/_home.scss b/assets/css/_page/_home.scss index d6f4c1215..64e47cf34 100644 --- a/assets/css/_page/_home.scss +++ b/assets/css/_page/_home.scss @@ -170,7 +170,7 @@ .post-footer { margin-top: 0.4rem; - display: flex; + display: none; justify-content: space-between; align-items: center; font-size: 0.875rem; From 507eb73550312616a7d8cdd6de9dd7c5d11ab9c6 Mon Sep 17 00:00:00 2001 From: TsaiLintung <101155567+TsaiLintung@users.noreply.github.com> Date: Sun, 20 Oct 2024 11:51:13 -0700 Subject: [PATCH 02/13] remove date pre and auth --- layouts/_default/summary.html | 6 +++--- layouts/partials/single/post-author.html | 18 ------------------ 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index 45dc616cf..e17208c71 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -39,9 +39,9 @@

{{- partial "single/post-author.html" . -}} {{- with .PublishDate | dateFormat (.Site.Params.dateFormat | default "2006-01-02") -}} -   - {{- printf `` . . | dict "Date" | T "single.publishedOnDate" | safeHTML -}} - +   + + {{- end -}} {{- partial "single/post-included-in.html" . -}} 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 -}} - {{- $content := $author.name | default "Anonymous" -}} - {{- $icon := dict "Class" "fa-solid fa-user-circle" -}} - {{- /* Deprecate $params.authorAvatar in favor of $params.showAvatar and dd front matter gravatar {bool} */ -}} - {{- if $author.avatar | and $params.authorAvatar -}} - {{- $content = printf "%v %v" (dict "Src" $author.avatar "Class" "avatar" "Alt" $content "Width" 20 "Height" 20 | partial "plugin/image.html") $content -}} - {{- $icon = "" -}} - {{- end -}} - {{- if $author.link -}} - {{- $options := dict "Class" "author" "Destination" $author.link "Title" (T "single.author") "Rel" "author" "Icon" $icon "Content" $content -}} - {{- partial "plugin/link.html" $options -}} - {{- else -}} - - {{- with $icon -}} - {{- . | partial "plugin/icon.html" }} - {{ end -}} - {{- $content | safeHTML -}} - - {{- end -}} {{- /* EOF */ -}} From 8c13b3e41f2b726a2dbc327912bf92160652c1e5 Mon Sep 17 00:00:00 2001 From: TsaiLintung <101155567+TsaiLintung@users.noreply.github.com> Date: Sun, 20 Oct 2024 11:52:20 -0700 Subject: [PATCH 03/13] this work? --- layouts/_default/summary.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index e17208c71..dd92d4432 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -39,9 +39,9 @@

{{- partial "single/post-author.html" . -}} {{- with .PublishDate | dateFormat (.Site.Params.dateFormat | default "2006-01-02") -}} -   - - +   + {{- printf `` . . | dict "Date" | safeHTML -}} + {{- end -}} {{- partial "single/post-included-in.html" . -}} From ab3a42890627a69ab76fc4340d6930927e928b68 Mon Sep 17 00:00:00 2001 From: TsaiLintung <101155567+TsaiLintung@users.noreply.github.com> Date: Sun, 20 Oct 2024 11:53:42 -0700 Subject: [PATCH 04/13] Update summary.html --- layouts/_default/summary.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index dd92d4432..a3b6d29ec 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -39,9 +39,9 @@

{{- partial "single/post-author.html" . -}} {{- with .PublishDate | dateFormat (.Site.Params.dateFormat | default "2006-01-02") -}} -   - {{- printf `` . . | dict "Date" | safeHTML -}} - +   + + {{- end -}} {{- partial "single/post-included-in.html" . -}} From e57f0265a4bce6dcae0346a1ab5cf3a2b757fb5b Mon Sep 17 00:00:00 2001 From: TsaiLintung <101155567+TsaiLintung@users.noreply.github.com> Date: Sun, 20 Oct 2024 11:58:07 -0700 Subject: [PATCH 05/13] this should work --- i18n/zh-TW.toml | 2 +- layouts/_default/summary.html | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/i18n/zh-TW.toml b/i18n/zh-TW.toml index 53092dead..38484266e 100644 --- a/i18n/zh-TW.toml +++ b/i18n/zh-TW.toml @@ -110,7 +110,7 @@ other = "分享到" contents = "目錄" pin = "置頂" repost = "轉貼" -publishedOnDate = "發佈於 {{ .Date }}" +publishedOnDate = "{{ .Date }}" views = "次閱讀" comments = "條評論" author = "作者" diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index a3b6d29ec..45dc616cf 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -39,9 +39,9 @@

{{- partial "single/post-author.html" . -}} {{- with .PublishDate | dateFormat (.Site.Params.dateFormat | default "2006-01-02") -}} -   - - +   + {{- printf `` . . | dict "Date" | T "single.publishedOnDate" | safeHTML -}} + {{- end -}} {{- partial "single/post-included-in.html" . -}} From ecb5464150dada2853feb4333bc5e5219d5d7dd6 Mon Sep 17 00:00:00 2001 From: TsaiLintung <101155567+TsaiLintung@users.noreply.github.com> Date: Sun, 20 Oct 2024 12:00:20 -0700 Subject: [PATCH 06/13] Update summary.html --- layouts/_default/summary.html | 32 ++++++-------------------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index 45dc616cf..3f0ca5570 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -19,33 +19,13 @@ {{- /* Title */ -}}

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

- - {{- /* Meta */ -}} -
- {{- partial "single/post-author.html" . -}} - - {{- with .PublishDate | dateFormat (.Site.Params.dateFormat | default "2006-01-02") -}} -   - {{- printf `` . . | dict "Date" | T "single.publishedOnDate" | safeHTML -}} +
+ {{ cond (.Param "capitalizeTitles") (title .Title) .Title }} + + - {{- end -}} - - {{- partial "single/post-included-in.html" . -}} -
+
+ {{- /* Summary content */ -}}
From 15bf302a13d729fac9d2901b997acc37a5af2a77 Mon Sep 17 00:00:00 2001 From: TsaiLintung <101155567+TsaiLintung@users.noreply.github.com> Date: Sun, 20 Oct 2024 12:01:28 -0700 Subject: [PATCH 07/13] Update summary.html --- layouts/_default/summary.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index 3f0ca5570..bf7b516c1 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -22,11 +22,11 @@

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

- + {{- /* Summary content */ -}}
{{- if .Summary -}} From 8f5551c416df4fbca3e6d54f3e306ab191819a19 Mon Sep 17 00:00:00 2001 From: TsaiLintung <101155567+TsaiLintung@users.noreply.github.com> Date: Sun, 20 Oct 2024 12:02:43 -0700 Subject: [PATCH 08/13] Update summary.html --- layouts/_default/summary.html | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index bf7b516c1..263d9d4e5 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -19,14 +19,25 @@ {{- /* Title */ -}}

-
- {{ cond (.Param "capitalizeTitles") (title .Title) .Title }} - - - -
+ {{- 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 }} +   + {{- printf `` . . | dict "Date" | T "single.publishedOnDate" | safeHTML -}} +

- + + {{- /* Summary content */ -}}
{{- if .Summary -}} From 77f2f66fd77df7772c584064c49cc27e55f36737 Mon Sep 17 00:00:00 2001 From: TsaiLintung <101155567+TsaiLintung@users.noreply.github.com> Date: Sun, 20 Oct 2024 12:05:35 -0700 Subject: [PATCH 09/13] Update summary.html remove date pre and auth this work? Update summary.html this should work Update summary.html Update summary.html --- i18n/zh-TW.toml | 2 +- layouts/_default/summary.html | 15 +++------------ layouts/partials/single/post-author.html | 18 ------------------ 3 files changed, 4 insertions(+), 31 deletions(-) diff --git a/i18n/zh-TW.toml b/i18n/zh-TW.toml index 53092dead..38484266e 100644 --- a/i18n/zh-TW.toml +++ b/i18n/zh-TW.toml @@ -110,7 +110,7 @@ other = "分享到" contents = "目錄" pin = "置頂" repost = "轉貼" -publishedOnDate = "發佈於 {{ .Date }}" +publishedOnDate = "{{ .Date }}" views = "次閱讀" comments = "條評論" author = "作者" diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index 45dc616cf..263d9d4e5 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -32,20 +32,11 @@

{{- end -}} {{- end -}} {{ cond (.Param "capitalizeTitles") (title .Title) .Title }} +   + {{- printf `` . . | dict "Date" | T "single.publishedOnDate" | safeHTML -}} +

- {{- /* Meta */ -}} - {{- /* Summary content */ -}}
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 */ -}} From 444ba86f31bae673b44eb40bdd103e5f43ed854f Mon Sep 17 00:00:00 2001 From: TsaiLintung <101155567+TsaiLintung@users.noreply.github.com> Date: Sun, 20 Oct 2024 12:41:06 -0700 Subject: [PATCH 10/13] clean --- assets/css/_page/_home.scss | 18 ++++++++++++-- i18n/zh-TW.toml | 2 +- layouts/_default/summary.html | 45 +++++++++++++++++++++++++++++++---- layouts/posts/single.html | 5 ++-- 4 files changed, 61 insertions(+), 9 deletions(-) diff --git a/assets/css/_page/_home.scss b/assets/css/_page/_home.scss index 64e47cf34..f61961848 100644 --- a/assets/css/_page/_home.scss +++ b/assets/css/_page/_home.scss @@ -118,11 +118,25 @@ } .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: 0.9rem; + color: $global-font-color; + } + .content { display: block; margin-top: 0.3rem; diff --git a/i18n/zh-TW.toml b/i18n/zh-TW.toml index 38484266e..748ccd3b2 100644 --- a/i18n/zh-TW.toml +++ b/i18n/zh-TW.toml @@ -114,7 +114,7 @@ publishedOnDate = "{{ .Date }}" views = "次閱讀" comments = "條評論" author = "作者" -updatedOnDate = "更新於 {{ .Date }}" +updatedOnDate = "{{ .Date }}" readMarkdown = "閱讀原始文檔" viewSource = "查看原始碼" editThisPage = "編輯此頁" diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index 263d9d4e5..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 */ -}}
@@ -67,4 +104,4 @@

{{- end -}}

-{{- /* EOF */ -}} +{{- /* EOF */ -}} \ No newline at end of file diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 5e5509ff1..24d733f29 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -43,7 +43,7 @@

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

{{ . | $.RenderString }}

{{- end -}}

- + {{- /* Featured image */ -}} {{- $image := $params.featuredimage -}} From 228f3ffb0a7077d9723679e65ff86698e1a6ff83 Mon Sep 17 00:00:00 2001 From: TsaiLintung <101155567+TsaiLintung@users.noreply.github.com> Date: Sun, 20 Oct 2024 12:54:02 -0700 Subject: [PATCH 11/13] fix dark, remove animation --- assets/css/_page/_home.scss | 8 +++++++- layouts/_default/single.html | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/assets/css/_page/_home.scss b/assets/css/_page/_home.scss index f61961848..2b40716d5 100644 --- a/assets/css/_page/_home.scss +++ b/assets/css/_page/_home.scss @@ -133,8 +133,14 @@ .date-container { white-space: nowrap; - font-size: 0.9rem; + font-size: 16px; + font-weight: 400; color: $global-font-color; + + [data-theme='dark'] & { + color: $global-font-color-dark; + } + } .content { diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 6ba062f31..a0d7d2c62 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -8,7 +8,7 @@
{{- /* Title */ -}} -

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

+

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

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

{{ . | $.RenderString }}

{{- end -}} From 9c57b8a2e92bd1a1adf4b134c1ea7435c6c27378 Mon Sep 17 00:00:00 2001 From: TsaiLintung <101155567+TsaiLintung@users.noreply.github.com> Date: Sun, 20 Oct 2024 12:56:49 -0700 Subject: [PATCH 12/13] wrong one --- layouts/posts/single.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 24d733f29..c4ec16b51 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -24,7 +24,7 @@
{{- /* Title */ -}} -

+

{{- $repost := $params.repost | default dict -}} {{- with $repost -}} {{- if eq .Enable true -}} From 31487fec914ec8a3e41787b2de0d57fa21f9c4ad Mon Sep 17 00:00:00 2001 From: TsaiLintung <101155567+TsaiLintung@users.noreply.github.com> Date: Sat, 26 Oct 2024 15:06:00 -0700 Subject: [PATCH 13/13] less animation --- layouts/_default/home.archives.html | 2 +- layouts/_default/single.html | 2 +- layouts/partials/header.html | 4 ++-- layouts/posts/single.html | 4 ++-- layouts/section/section.html | 2 +- layouts/taxonomy/list.html | 2 +- layouts/taxonomy/terms.html | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) 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 a0d7d2c62..2db8fb440 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -11,7 +11,7 @@

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

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

{{ . | $.RenderString }}

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

{{ . | $.RenderString }}

{{- end -}}
{{- /* Content */ -}} 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/posts/single.html b/layouts/posts/single.html index c4ec16b51..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 ``) -}} -