mirror of
https://github.com/Wonderfall/hugo-WonderMod.git
synced 2024-11-25 03:51:37 +01:00
support Multilingual navigation
add reading time as i18n
This commit is contained in:
parent
04f9fabf92
commit
e35915a561
@ -20,7 +20,7 @@
|
||||
<div class="archive-meta">
|
||||
{{- if or .Params.author .Site.Params.author }}{{- .Params.author | default .Site.Params.author }} ·
|
||||
{{ end }}
|
||||
{{ if $.Site.Params.ShowReadingTime }}{{ .ReadingTime }}{{ $.Site.Params.MinuteReadingTime | default "min read" }}
|
||||
{{ if $.Site.Params.ShowReadingTime }}{{ .ReadingTime }}{{ i18n "read_time" | default "min read" }}
|
||||
· {{ end }}
|
||||
{{- .Date.Format "January 2, 2006" -}}
|
||||
</div>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ .Site.LanguageCode }}">
|
||||
<html lang="{{ .Site.Language }}">
|
||||
|
||||
<head>
|
||||
{{- partial "head.html" . }}
|
||||
|
@ -52,7 +52,7 @@
|
||||
<footer class="entry-footer">
|
||||
<time>{{ .Date.Format "January 2, 2006" }}</time>
|
||||
{{ 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 }}
|
||||
</footer>
|
||||
<a class="entry-link" href="{{ .Permalink }}"></a>
|
||||
|
@ -28,7 +28,7 @@
|
||||
<footer class="entry-footer">
|
||||
<time>{{ .Date.Format "January 2, 2006" }}</time>
|
||||
{{ 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 }}
|
||||
</footer>
|
||||
<a class="entry-link" href="{{ .Permalink }}"></a>
|
||||
|
@ -31,7 +31,7 @@
|
||||
{{- if .Params.tags }}
|
||||
<ul class="post-tags">
|
||||
{{- range .Params.tags }}
|
||||
{{- $href := print (absURL "tags/") (urlize .) }}
|
||||
{{- $href := print (absLangURL "tags/") (urlize .) }}
|
||||
<li><a href="{{ $href }}">{{ . }}</a></li>
|
||||
{{- end }}
|
||||
</ul>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<footer class="footer">
|
||||
<span>© {{ now.Year }} <a href="{{ "" | absURL }}">{{ .Site.Title }}</a></span>
|
||||
<span>© {{ now.Year }} <a href="{{ "" | absLangURL }}">{{ .Site.Title }}</a></span>
|
||||
<span>·</span>
|
||||
<span>Powered by <a href="https://gohugo.io/" rel="noopener" target="_blank">Hugo️️</a>️</span>
|
||||
<span>·</span>
|
||||
|
@ -6,15 +6,15 @@
|
||||
{{- end -}}
|
||||
<nav class="nav">
|
||||
{{- if .IsHome }}
|
||||
<h1 class="logo"><a href="{{ "" | absURL }}">{{ .Site.Title }}</a></h1>
|
||||
<h1 class="logo"><a href="{{ "" | absLangURL }}">{{ .Site.Title }}</a></h1>
|
||||
{{- else }}
|
||||
<p class="logo"><a href="{{ "" | absURL }}">{{ .Site.Title }}</a></p>
|
||||
<p class="logo"><a href="{{ "" | absLangURL }}">{{ .Site.Title }}</a></p>
|
||||
{{- end }}
|
||||
{{- if .Site.Menus.main }}
|
||||
<ul class="menu" id="menu" onscroll="menu_on_scroll()">
|
||||
{{- range .Site.Menus.main }}
|
||||
<li>
|
||||
<a href="{{ .URL }}">{{ .Name }}</a>
|
||||
<a href="{{ .URL | absLangURL}}">{{ .Name }}</a>
|
||||
</li>
|
||||
{{- end }}
|
||||
</ul>
|
||||
|
Loading…
Reference in New Issue
Block a user