diff options
Diffstat (limited to 'layouts/partials/post_meta.html')
| -rw-r--r-- | layouts/partials/post_meta.html | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/layouts/partials/post_meta.html b/layouts/partials/post_meta.html new file mode 100644 index 0000000..0c0765f --- /dev/null +++ b/layouts/partials/post_meta.html @@ -0,0 +1,75 @@ +<!-- +The MIT License (MIT) + +Original work Copyright (c) 2015 Dean Attali +Modified work Copyright (c) 2017 Michael Romero + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +--> + +<span class="post-meta"> + {{ $lastmodstr := default (i18n "dateFormat") .Site.Params.dateformat | .Lastmod.Format }} + {{ $datestr := default (i18n "dateFormat") .Site.Params.dateformat | .Date.Format }} + <i class="fas fa-calendar"></i> {{ $datestr | i18n "postedOnDate"}} + {{ if ne $datestr $lastmodstr }} + {{ $lastmodstr | i18n "lastModified" }} + {{ end }} + {{ if .Site.Params.readingTime }} + | <i class="fas fa-clock"></i> {{ i18n "readingTime"}}{{ .ReadingTime }} {{ i18n "readTime" }} + {{ end }} + {{ if .Site.Params.wordCount }} + | <i class="fas fa-book"></i> {{ .WordCount }} {{ i18n "words" }} + {{ end }} + {{ if not .Site.Params.hideAuthor }} + {{ if .Params.author }} + {{ if reflect.IsSlice .Params.author }} + {{ range .Params.author }} + | <i class="fas fa-user"></i> {{ . | safeHTML }} + {{ end }} + {{ else }} + | <i class="fas fa-user"></i> {{ .Params.author | safeHTML }} + {{ end }} + {{ else }} + | <i class="fas fa-user"></i> {{ .Site.Author.name | safeHTML }} + {{ end }} + {{ end }} + {{- if .Site.Params.staticman -}} + | <i class="fas fa-comment"></i> + {{ $slug := replace .RelPermalink "/" "" }} + {{ if .Site.Data.comments }} + {{ $comments := index $.Site.Data.comments $slug }} + {{ if $comments }} + {{ if gt (len $comments) 1 }} + {{ len $comments }} {{ i18n "moreComment" }} + {{ else }} + {{ len $comments }} {{ i18n "oneComment" }} + {{ end }} + {{ else }} + 0 {{ i18n "oneComment" }} + {{ end }} + {{ end }} + {{ end }} + {{ if .IsTranslated -}} + {{- $sortedTranslations := sort .Translations "Site.Language.Weight" -}} + {{- $links := apply $sortedTranslations "partial" "translation_link.html" "." -}} + {{- $cleanLinks := apply $links "chomp" "." -}} + {{- $linksOutput := delimit $cleanLinks (i18n "translationsSeparator") -}} + • {{ i18n "translationsLabel" }}{{ $linksOutput | safeHTML }} + {{- end }} +</span> |
