support Multilingual navigation

add reading time as i18n
This commit is contained in:
Aditya Telange 2020-08-25 01:40:02 +05:30
parent 04f9fabf92
commit e35915a561
No known key found for this signature in database
GPG Key ID: 82E844EF3DA99E77
7 changed files with 9 additions and 9 deletions

View File

@ -20,7 +20,7 @@
<div class="archive-meta"> <div class="archive-meta">
{{- if or .Params.author .Site.Params.author }}{{- .Params.author | default .Site.Params.author }} · {{- if or .Params.author .Site.Params.author }}{{- .Params.author | default .Site.Params.author }} ·
{{ end }} {{ end }}
{{ if $.Site.Params.ShowReadingTime }}{{ .ReadingTime }}{{ $.Site.Params.MinuteReadingTime | default "min read" }} {{ if $.Site.Params.ShowReadingTime }}{{ .ReadingTime }}{{ i18n "read_time" | default "min read" }}
· {{ end }} · {{ end }}
{{- .Date.Format "January 2, 2006" -}} {{- .Date.Format "January 2, 2006" -}}
</div> </div>

View File

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}"> <html lang="{{ .Site.Language }}">
<head> <head>
{{- partial "head.html" . }} {{- partial "head.html" . }}

View File

@ -52,7 +52,7 @@
<footer class="entry-footer"> <footer class="entry-footer">
<time>{{ .Date.Format "January 2, 2006" }}</time> <time>{{ .Date.Format "January 2, 2006" }}</time>
{{ if $.Site.Params.ShowReadingTime }} . {{ if $.Site.Params.ShowReadingTime }} .
{{ .ReadingTime }}{{ $.Site.Params.MinuteReadingTime | default "min read" }}{{ end }} {{ .ReadingTime }}{{ i18n "read_time" | default "min read" }}{{ end }}
{{ if or .Params.author .Site.Params.author }} . {{ .Params.author | default .Site.Params.author }}{{ end }} {{ if or .Params.author .Site.Params.author }} . {{ .Params.author | default .Site.Params.author }}{{ end }}
</footer> </footer>
<a class="entry-link" href="{{ .Permalink }}"></a> <a class="entry-link" href="{{ .Permalink }}"></a>

View File

@ -28,7 +28,7 @@
<footer class="entry-footer"> <footer class="entry-footer">
<time>{{ .Date.Format "January 2, 2006" }}</time> <time>{{ .Date.Format "January 2, 2006" }}</time>
{{ if $.Site.Params.ShowReadingTime }} . {{ if $.Site.Params.ShowReadingTime }} .
{{ .ReadingTime }}{{ $.Site.Params.MinuteReadingTime | default "min read" }}{{ end }} {{ .ReadingTime }}{{ i18n "read_time" | default "min read" }}{{ end }}
{{ if or .Params.author .Site.Params.author }} . {{ .Params.author | default .Site.Params.author }}{{ end }} {{ if or .Params.author .Site.Params.author }} . {{ .Params.author | default .Site.Params.author }}{{ end }}
</footer> </footer>
<a class="entry-link" href="{{ .Permalink }}"></a> <a class="entry-link" href="{{ .Permalink }}"></a>

View File

@ -31,7 +31,7 @@
{{- if .Params.tags }} {{- if .Params.tags }}
<ul class="post-tags"> <ul class="post-tags">
{{- range .Params.tags }} {{- range .Params.tags }}
{{- $href := print (absURL "tags/") (urlize .) }} {{- $href := print (absLangURL "tags/") (urlize .) }}
<li><a href="{{ $href }}">{{ . }}</a></li> <li><a href="{{ $href }}">{{ . }}</a></li>
{{- end }} {{- end }}
</ul> </ul>

View File

@ -1,5 +1,5 @@
<footer class="footer"> <footer class="footer">
<span>&copy; {{ now.Year }} <a href="{{ "" | absURL }}">{{ .Site.Title }}</a></span> <span>&copy; {{ now.Year }} <a href="{{ "" | absLangURL }}">{{ .Site.Title }}</a></span>
<span>&middot;</span> <span>&middot;</span>
<span>Powered by <a href="https://gohugo.io/" rel="noopener" target="_blank">Hugo</a></span> <span>Powered by <a href="https://gohugo.io/" rel="noopener" target="_blank">Hugo</a></span>
<span>&middot;</span> <span>&middot;</span>

View File

@ -6,15 +6,15 @@
{{- end -}} {{- end -}}
<nav class="nav"> <nav class="nav">
{{- if .IsHome }} {{- if .IsHome }}
<h1 class="logo"><a href="{{ "" | absURL }}">{{ .Site.Title }}</a></h1> <h1 class="logo"><a href="{{ "" | absLangURL }}">{{ .Site.Title }}</a></h1>
{{- else }} {{- else }}
<p class="logo"><a href="{{ "" | absURL }}">{{ .Site.Title }}</a></p> <p class="logo"><a href="{{ "" | absLangURL }}">{{ .Site.Title }}</a></p>
{{- end }} {{- end }}
{{- if .Site.Menus.main }} {{- if .Site.Menus.main }}
<ul class="menu" id="menu" onscroll="menu_on_scroll()"> <ul class="menu" id="menu" onscroll="menu_on_scroll()">
{{- range .Site.Menus.main }} {{- range .Site.Menus.main }}
<li> <li>
<a href="{{ .URL }}">{{ .Name }}</a> <a href="{{ .URL | absLangURL}}">{{ .Name }}</a>
</li> </li>
{{- end }} {{- end }}
</ul> </ul>