feat: support multilingual mode

* fix: wrong lang attribute in multilingual mode
  - baseof.html
* fix: rss link in multilingual mode
  - footer.html
* fix: wrong tags, categories, home link in multilingual mode
  - other files ...

This relates to #25
This commit is contained in:
olOwOlo 2018-01-30 21:26:46 +08:00
parent dcff1e389f
commit 084f8cb2c3
No known key found for this signature in database
GPG key ID: 456394B6E7A15EA6
8 changed files with 14 additions and 10 deletions

View file

@ -4,7 +4,7 @@
<div class="not-found">
<h1 class="error-emoji"></h1>
<p class="error-text">/* 404 page not found. */</p>
<p class="error-link"><a href="{{ "/" | relURL }}">↑ Back Home ↑</a></p>
<p class="error-link"><a href="{{ "/" | relLangURL }}">↑ Back Home ↑</a></p>
</div>
<script>
var errorEmojiContainer = document.getElementsByClassName('error-emoji')[0];

View file

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="{{ $.Site.LanguageCode | default "en" }}">
<html lang="{{ .Site.Language }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

View file

@ -16,7 +16,7 @@
</div>
<div class="categories-tags">
{{ range $key, $value := $terms }}
<a class="category-link" href="{{ $name | urlize | relURL }}/{{ $value.Term | urlize }}/">
<a class="category-link" href="{{ $name | relLangURL }}/{{ $value.Term | urlize }}/">
{{ $value.Term }}
<span class="category-count">{{ len $value.Pages }}</span>
</a>
@ -34,7 +34,7 @@
</div>
<div class="tag-cloud-tags">
{{ range $key, $value := $terms }}
<a href="{{ $name | urlize | relURL }}/{{ $value.Term | urlize }}/">
<a href="{{ $name | relLangURL }}/{{ $value.Term | urlize }}/">
{{ $value.Term }}
<span class="tag-count">{{ len $value.Pages }}</span>
</a>

View file

@ -6,7 +6,11 @@
<a href="{{ $path | safeURL }}" class="iconfont icon-{{ $realName }}" title="{{ $realName }}"></a>
{{- end }}
{{- end }}
<a href="{{ .Site.RSSLink }}" type="application/rss+xml" class="iconfont icon-rss" title="rss"></a>
{{ if .Site.LanguagePrefix -}}
<a href="{{ .Site.LanguagePrefix | absURL }}/index.xml" type="application/rss+xml" class="iconfont icon-rss" title="rss"></a>
{{- else -}}
<a href="{{ .Site.RSSLink }}" type="application/rss+xml" class="iconfont icon-rss" title="rss"></a>
{{- end }}
</div>
<div class="copyright">

View file

@ -1,5 +1,5 @@
<div class="logo-wrapper">
<a href="{{ "/" | relURL }}" class="logo">
<a href="{{ "/" | relLangURL }}" class="logo">
{{- if .Site.Params.logoTitle -}}
{{ .Site.Params.logoTitle }}
{{- else -}}

View file

@ -1,6 +1,6 @@
<div id="mobile-navbar" class="mobile-navbar">
<div class="mobile-header-logo">
<a href="{{ "/" | relURL }}" class="logo">
<a href="{{ "/" | relLangURL }}" class="logo">
{{- if .Site.Params.logoTitle -}}
{{ .Site.Params.logoTitle }}
{{- else -}}

View file

@ -10,7 +10,7 @@
{{ with .Params.categories -}}
<div class="post-category">
{{ range . }}
<a href="{{ "categories" | relURL }}/{{ . | urlize }}/"> {{ . }} </a>
<a href="{{ "categories" | relLangURL }}/{{ . | urlize }}/"> {{ . }} </a>
{{ end }}
</div>
{{- end }}
@ -43,7 +43,7 @@
{{ with .Params.tags -}}
<div class="post-tags">
{{ range . }}
<a href="{{ "tags" | relURL }}/{{ . | urlize }}/">{{ . }}</a>
<a href="{{ "tags" | relLangURL }}/{{ . | urlize }}/">{{ . }}</a>
{{ end }}
</div>
{{- end }}

View file

@ -7,7 +7,7 @@
{{ with .Params.categories -}}
<div class="post-category">
{{ range . }}
<a href="{{ "categories" | relURL }}/{{ . | urlize }}/"> {{ . }} </a>
<a href="{{ "categories" | relLangURL }}/{{ . | urlize }}/"> {{ . }} </a>
{{ end }}
</div>
{{- end }}