Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/AmazingRise/hugo-theme-diary.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthebestwj <wisestwang@163.com>2020-05-19 14:36:53 +0300
committeramazingrise <8315221+AmazingRise@users.noreply.github.com>2020-05-19 15:06:41 +0300
commitcd0d787c16ffcea36cff2d0b9fc35e8da55e6995 (patch)
tree1765a21d4a9cab9207e4fe99cb1b28138668b578 /layouts/partials
parentf47ba7b246b44d333b59e67b3fe3af16af6f4fbe (diff)
Extract post-item-title
Diffstat (limited to 'layouts/partials')
-rw-r--r--layouts/partials/post-item-meta.html22
1 files changed, 22 insertions, 0 deletions
diff --git a/layouts/partials/post-item-meta.html b/layouts/partials/post-item-meta.html
new file mode 100644
index 0000000..183c9fa
--- /dev/null
+++ b/layouts/partials/post-item-meta.html
@@ -0,0 +1,22 @@
+<div class="post-item-meta">
+ {{ .PublishDate.Format "2006-01-02" }}
+ &emsp;
+ <!-- Reading Time Start -->
+ {{ if .Site.Params.enableReadingTime }}
+ <i class="material-icons" style="font-size:10px">schedule</i>
+ {{ $readTime := mul (div (countwords .Content) 220.0) 60 }}
+
+ {{ $minutes := math.Floor (div $readTime 60) }}
+ {{ $seconds := mod $readTime 60 }}
+
+ {{ if gt $minutes 0}}
+ {{ $minutes }} {{ cond (eq $minutes 1) "minute" "min" }}
+ {{ end }}
+ {{ $seconds }} {{ cond (eq $seconds 1) "second" "s" }}
+ {{ end }}
+ <!-- Reading Time End -->
+ &emsp;
+ {{ if .Draft }}
+ <span class="draft-label">DRAFT</span>
+ {{ end }}
+</div> \ No newline at end of file