Skip to content

Commit

Permalink
feat: Add time to read post
Browse files Browse the repository at this point in the history
  • Loading branch information
cdecarlos authored and mikroskeem committed Jan 8, 2025
1 parent 7f9ab7f commit 0991c66
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 1 deletion.
3 changes: 3 additions & 0 deletions i18n/de.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ other = "Made with <a href='https://gohugo.io'>Hugo</a> using the <a href='https

[publishdate]
other = "{{ .PublishDate.Day }}. {{ index $.Site.Data.months_de (printf \"%d\" .PublishDate.Month) }} {{ .PublishDate.Year }}"

[minutes]
other = "minuten"
5 changes: 4 additions & 1 deletion i18n/en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ other = "on"
other = "Made with <a href='https://gohugo.io'>Hugo</a> using the <a href='https://github.com/EmielH/tale-hugo/'>Tale</a> theme."

[publishdate]
other = "{{ .PublishDate.Format \"January 2, 2006\" }}"
other = "{{ .PublishDate.Format \"January 2, 2006\" }}"

[minutes]
other = "minutes"
3 changes: 3 additions & 0 deletions i18n/es.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ other = "Hecho con <a href='https://gohugo.io'>Hugo</a> usando el tema <a href='

[publishdate]
other = "{{ .PublishDate.Day }} de {{ index $.Site.Data.months_es (printf \"%d\" .PublishDate.Month) }} de {{ .PublishDate.Year }}"

[minutes]
other = "minutos"
3 changes: 3 additions & 0 deletions i18n/fr.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ other = "Fait avec <a href='https://gohugo.io'>Hugo</a>, à partir du thème <a

[publishdate]
other = "{{ .PublishDate.Day }} {{ index $.Site.Data.months_fr (printf \"%d\" .PublishDate.Month) }} {{ .PublishDate.Year }}"

[minutes]
other = "minutes"
3 changes: 3 additions & 0 deletions i18n/it.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ other = "Creato con <a href='https://gohugo.io'>Hugo</a> usando il tema <a href=

[publishdate]
other = "{{ .PublishDate.Day }} {{ index $.Site.Data.months_it (printf \"%d\" .PublishDate.Month) }} {{ .PublishDate.Year }}"

[minutes]
other = "minuti"
3 changes: 3 additions & 0 deletions i18n/ku.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ other = "Bi <a href='https://gohugo.io'>Hugo</a> û <a href='https://github.com/

[publishdate]
other = "{{ .PublishDate.Day }} {{ index $.Site.Data.months_ku (printf \"%d\" .PublishDate.Month) }} {{ .PublishDate.Year }}"

[minutes]
other = "minutes"
3 changes: 3 additions & 0 deletions i18n/nl.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ other = "Gemaakt met <a href='https://gohugo.io'>Hugo</a> en thema <a href='http

[publishdate]
other = "{{ .PublishDate.Day }} {{ index $.Site.Data.months_nl (printf \"%d\" .PublishDate.Month) }} {{ .PublishDate.Year }}"

[minutes]
other = "minuten"
3 changes: 3 additions & 0 deletions i18n/pl.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ other = "Made with <a href='https://gohugo.io'>Hugo</a> using the <a href='https

[publishdate]
other = "{{ .PublishDate.Day }}. {{ index $.Site.Data.months_pl (printf \"%d\" .PublishDate.Month) }} {{ .PublishDate.Year }}"

[minutes]
other = "minutos"
2 changes: 2 additions & 0 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

{{ partial "single/header.html" . }}

🕒 {{ math.Round (div (countwords .Content) 220.0) }} {{ i18n "minutes" }}

{{ .Content }}

{{ partial "single/footer.html" . }}
Expand Down
1 change: 1 addition & 0 deletions layouts/_default/summary.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<a href="{{ .Permalink }}" class="catalogue-item">
<div>
<time datetime="{{ .PublishDate }}" class="catalogue-time">{{ i18n "publishdate" . }}</time>
🕒 {{ math.Round (div (countwords .Content) 220.0) }} {{ i18n "minutes" }}
<h2 class="catalogue-title">{{ .Title }}</h2>
<div class="catalogue-line"></div>

Expand Down

0 comments on commit 0991c66

Please sign in to comment.