🔀 Merge pull request #91 from cbelena/dev

💄 Adjust metadata output
pull/100/head
James Panther 2022-01-24 11:00:38 +11:00 committed by GitHub
commit 9fc0a448d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 25 additions and 16 deletions

View File

@ -1,9 +1,11 @@
--- ---
title: "Placeholder Text" title: "Placeholder Text"
date: "2019-03-09" date: "2019-03-09"
lastmod: "2022-01-24"
draft: true draft: true
description: "Lorem Ipsum Dolor Si Amet" description: "Lorem Ipsum Dolor Si Amet"
tags: ["markdown", "text", "sample", "latin"] tags: ["markdown", "text", "sample", "latin"]
showDateUpdated: true
xml: false xml: false
--- ---

View File

@ -6,6 +6,7 @@ article:
one: "{{ .Count }} min" one: "{{ .Count }} min"
other: "{{ .Count }} min" other: "{{ .Count }} min"
reading_time_title: "Lesezeit" reading_time_title: "Lesezeit"
# updated: "Updated"
# word_count: # word_count:
# one: "{{ .Count }} word" # one: "{{ .Count }} word"
# other: "{{ .Count }} words" # other: "{{ .Count }} words"

View File

@ -6,6 +6,7 @@ article:
one: "{{ .Count }} min" one: "{{ .Count }} min"
other: "{{ .Count }} mins" other: "{{ .Count }} mins"
reading_time_title: "Reading time" reading_time_title: "Reading time"
updated: "Updated"
word_count: word_count:
one: "{{ .Count }} word" one: "{{ .Count }} word"
other: "{{ .Count }} words" other: "{{ .Count }} words"

View File

@ -6,9 +6,10 @@ article:
one: "{{ .Count }} min" one: "{{ .Count }} min"
other: "{{ .Count }} mins" other: "{{ .Count }} mins"
reading_time_title: "Tiempo de lectura" reading_time_title: "Tiempo de lectura"
# word_count: updated: "Actualizado"
# one: "{{ .Count }} word" word_count:
# other: "{{ .Count }} words" one: "{{ .Count }} palabra"
other: "{{ .Count }} palabras"
author: author:
byline_title: "Autor" byline_title: "Autor"

View File

@ -6,6 +6,7 @@ article:
one: "{{ .Count }} min" one: "{{ .Count }} min"
other: "{{ .Count }} mins" other: "{{ .Count }} mins"
reading_time_title: "Temps de lecture" reading_time_title: "Temps de lecture"
# updated: "Updated"
# word_count: # word_count:
# one: "{{ .Count }} word" # one: "{{ .Count }} word"
# other: "{{ .Count }} words" # other: "{{ .Count }} words"

View File

@ -6,6 +6,7 @@ article:
one: "{{ .Count }} minuto" one: "{{ .Count }} minuto"
other: "{{ .Count }} minutos" other: "{{ .Count }} minutos"
reading_time_title: "Tempo de leitura" reading_time_title: "Tempo de leitura"
# updated: "Updated"
# word_count: # word_count:
# one: "{{ .Count }} word" # one: "{{ .Count }} word"
# other: "{{ .Count }} words" # other: "{{ .Count }} words"

View File

@ -6,6 +6,7 @@ article:
one: "{{ .Count }} dk" one: "{{ .Count }} dk"
other: "{{ .Count }} dk" other: "{{ .Count }} dk"
reading_time_title: "Okuma süresi" reading_time_title: "Okuma süresi"
# updated: "Updated"
word_count: word_count:
one: "{{ .Count }} kelime" one: "{{ .Count }} kelime"
other: "{{ .Count }} kelime" other: "{{ .Count }} kelime"

View File

@ -5,6 +5,7 @@ article:
reading_time: reading_time:
other: "{{ .Count }} 分钟" other: "{{ .Count }} 分钟"
reading_time_title: "预计阅读" reading_time_title: "预计阅读"
# updated: "Updated"
word_count: word_count:
one: "{{ .Count }} 字" one: "{{ .Count }} 字"
other: "{{ .Count }} 字" other: "{{ .Count }} 字"

View File

@ -13,7 +13,11 @@
{{/* Gather partials for this context */}} {{/* Gather partials for this context */}}
{{ if .Params.showDate | default (.Site.Params.article.showDate | default true) }} {{ if .Params.showDate | default (.Site.Params.article.showDate | default true) }}
{{ $meta.Add "partials" (slice (partial "meta/date.html" .)) }} {{ $meta.Add "partials" (slice (partial "meta/date.html" .Date)) }}
{{ end }}
{{ if .Params.showDateUpdated | default (.Site.Params.article.showDateUpdated | default false) }}
{{ $meta.Add "partials" (slice (partial "meta/date-updated.html" .Lastmod)) }}
{{ end }} {{ end }}
{{ if and (.Params.showWordCount | default (.Site.Params.article.showWordCount | default false)) (ne .WordCount 0) }} {{ if and (.Params.showWordCount | default (.Site.Params.article.showWordCount | default false)) (ne .WordCount 0) }}
@ -29,7 +33,7 @@
{{ end }} {{ end }}
<div class="flex flex-row items-center"> <div class="flex flex-row flex-wrap items-center">
{{/* Output partials */}} {{/* Output partials */}}
{{ with ($meta.Get "partials") }} {{ with ($meta.Get "partials") }}
{{ delimit . "<span class=\"px-2 text-primary-500\">&middot;</span>" }} {{ delimit . "<span class=\"px-2 text-primary-500\">&middot;</span>" }}

View File

@ -13,7 +13,7 @@
> >
<span class="mt-[0.1rem] text-xs text-neutral-500 dark:text-neutral-400"> <span class="mt-[0.1rem] text-xs text-neutral-500 dark:text-neutral-400">
{{ if .Params.showDate | default (.Site.Params.article.showDate | default true) }} {{ if .Params.showDate | default (.Site.Params.article.showDate | default true) }}
{{ partial "meta/date.html" .NextInSection }} {{ partial "meta/date.html" .NextInSection.Date }}
{{ end }} {{ end }}
</span> </span>
</span> </span>
@ -29,7 +29,7 @@
> >
<span class="mt-[0.1rem] text-xs text-neutral-500 dark:text-neutral-400"> <span class="mt-[0.1rem] text-xs text-neutral-500 dark:text-neutral-400">
{{ if .Params.showDate | default (.Site.Params.article.showDate | default true) }} {{ if .Params.showDate | default (.Site.Params.article.showDate | default true) }}
{{ partial "meta/date.html" .PrevInSection }} {{ partial "meta/date.html" .PrevInSection.Date }}
{{ end }} {{ end }}
</span> </span>
</span> </span>

View File

@ -0,0 +1,3 @@
{{- i18n "article.updated" -}}:&nbsp;
{{ partial "meta/date.html" . }}
{{- /* Trim EOF */ -}}

View File

@ -1,11 +1,4 @@
<time datetime="{{ .Date }}"> <time datetime="{{ . }}">
{{- .Date.Format (.Site.Params.article.dateFormat | default "2 January 2006") -}} {{- .Format (site.Params.article.dateFormat | default "2 January 2006") -}}
</time> </time>
{{ if .Params.showDateUpdated | default (.Site.Params.article.showDateUpdated | default false) }}
&nbsp;(Updated:&nbsp;
<time datetime="{{ .Lastmod }}">
{{- .Lastmod.Format (.Site.Params.article.dateFormat | default "2 January 2006") -}}
</time>
)
{{ end }}
{{- /* Trim EOF */ -}} {{- /* Trim EOF */ -}}