mirror of
https://github.com/Brandon-Rozek/website-theme.git
synced 2024-11-24 17:16:31 -05:00
Added icons to publish date and reading time
This commit is contained in:
parent
0cefeeb270
commit
2fbfe38e3d
2 changed files with 12 additions and 4 deletions
|
@ -3,12 +3,19 @@
|
|||
{{ $singlePageDateFormat := .Site.Params.singlePageDateFormat | default "January 2, 2006"}}
|
||||
{{ $pubdate := .Date.Format $singlePageDateFormat }}
|
||||
|
||||
<p class="date">{{ $publishString }}<time class="dt-published" datetime='{{ .Date.Format "2006-01-02T15:04:05Z0700" }}'>{{ $pubdate }}</time></p>
|
||||
<p class="date">
|
||||
<i class="fas fa-calendar"></i>
|
||||
{{ $publishString }}
|
||||
<time class="dt-published" datetime='{{ .Date.Format "2006-01-02T15:04:05Z0700" }}'>{{ $pubdate }}</time>
|
||||
</p>
|
||||
|
||||
{{- if and (not (.Scratch.Get "noDateUpdate")) .Lastmod }}
|
||||
{{- $lastmod := .Lastmod.Format $singlePageDateFormat }}
|
||||
{{- if ne $lastmod $pubdate }}
|
||||
<p class="date-updated">Updated on <time class='dt-updated' datetime='{{ .Lastmod.Format "2006-01-02T15:04:05Z0700" }}'>{{ $lastmod }}</time></p>
|
||||
<p class="date-updated">
|
||||
Updated on
|
||||
<time class='dt-updated' datetime='{{ .Lastmod.Format "2006-01-02T15:04:05Z0700" }}'>{{ $lastmod }}</time>
|
||||
</p>
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
|
@ -2,7 +2,8 @@
|
|||
{{ $readTime := mul (div (countwords .Content) 220.0) 60 }}
|
||||
{{ if gt $readTime 60 }}
|
||||
<p>
|
||||
Reading Time:
|
||||
{{ math.Ceil (div $readTime 60) }} minutes.
|
||||
<i class="fas fa-stopwatch"></i>
|
||||
{{ math.Ceil (div $readTime 60) }} minute
|
||||
reading time
|
||||
</p>
|
||||
{{ end }}
|
Loading…
Reference in a new issue