Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add time to read post #62

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -7,6 +7,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