From f1ca3b22fd272b097eca2b7e5466d25126f1ee7a Mon Sep 17 00:00:00 2001 From: zilcH40 Date: Mon, 12 Sep 2022 12:50:38 +0800 Subject: feat #5: add option to show summary of post --- assets/css/common.scss | 5 +++++ layouts/partials/posts.html | 24 +++++++++++++++++------- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/assets/css/common.scss b/assets/css/common.scss index 3b826b1..1eec40e 100644 --- a/assets/css/common.scss +++ b/assets/css/common.scss @@ -115,6 +115,7 @@ body { } .post-box-title { margin-right: 1.25rem; + margin-bottom: 0.5rem; width: 100%; } .post-box-tags { @@ -130,6 +131,10 @@ body { margin-right: 1.25rem; width: 100%; } +.post-box-summary { + margin-right: 1.25rem; + opacity: 0.9; +} .post-box-meta:last-child { padding-bottom: 1.25rem; } diff --git a/layouts/partials/posts.html b/layouts/partials/posts.html index f8d1810..dfbdeb3 100644 --- a/layouts/partials/posts.html +++ b/layouts/partials/posts.html @@ -12,17 +12,27 @@
{{ .Title }}
+ {{ if .Site.Params.showSummary }} +
+ {{ .Summary }} + {{ if .Truncated }} + + …Read More + + {{ end }} +
+ {{ end }}
{{ .Date.Format "2006/01/02" }} {{ with .Params.Categories }} ・ - {{ range .}} - - {{ end }} + {{ range .}} + + {{ end }} {{ end }}
- {{ with .Params.Tags }} + {{ with .Params.Tags }}
{{ range .}}
- + \ No newline at end of file -- cgit v1.2.3