🔀 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"
date: "2019-03-09"
lastmod: "2022-01-24"
draft: true
description: "Lorem Ipsum Dolor Si Amet"
tags: ["markdown", "text", "sample", "latin"]
showDateUpdated: true
xml: false
---

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -13,7 +13,11 @@
{{/* Gather partials for this context */}}
{{ 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 }}
{{ if and (.Params.showWordCount | default (.Site.Params.article.showWordCount | default false)) (ne .WordCount 0) }}
@ -29,7 +33,7 @@
{{ end }}
<div class="flex flex-row items-center">
<div class="flex flex-row flex-wrap items-center">
{{/* Output partials */}}
{{ with ($meta.Get "partials") }}
{{ 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">
{{ if .Params.showDate | default (.Site.Params.article.showDate | default true) }}
{{ partial "meta/date.html" .NextInSection }}
{{ partial "meta/date.html" .NextInSection.Date }}
{{ end }}
</span>
</span>
@ -29,7 +29,7 @@
>
<span class="mt-[0.1rem] text-xs text-neutral-500 dark:text-neutral-400">
{{ if .Params.showDate | default (.Site.Params.article.showDate | default true) }}
{{ partial "meta/date.html" .PrevInSection }}
{{ partial "meta/date.html" .PrevInSection.Date }}
{{ end }}
</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 }}">
{{- .Date.Format (.Site.Params.article.dateFormat | default "2 January 2006") -}}
<time datetime="{{ . }}">
{{- .Format (site.Params.article.dateFormat | default "2 January 2006") -}}
</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 */ -}}