docs: update zh-CN docs and fix some bugs

This commit is contained in:
Dillon
2020-03-10 03:33:28 +08:00
parent 426e24598d
commit fb9a9e7324
27 changed files with 159 additions and 227 deletions

View File

@@ -222,7 +222,7 @@
{{- else if not (strings.HasSuffix . ".min.css") -}}
{{- $res = minify $res -}}
{{- end -}}
{{- $stylesheet := (dict "resource" $res "fingerprint" ($scratch.Get "fingerprint")) -}}
{{- $stylesheet := dict "resource" $res "fingerprint" ($scratch.Get "fingerprint") -}}
{{- partial "plugin/stylesheet.html" $stylesheet -}}
{{- end -}}
@@ -234,7 +234,7 @@
{{- if not (strings.HasSuffix . ".min.js") -}}
{{- $res = minify $res -}}
{{- end -}}
{{- $script := (dict "resource" $res "fingerprint" ($scratch.Get "fingerprint")) -}}
{{- $script := dict "resource" $res "fingerprint" ($scratch.Get "fingerprint") -}}
{{- partial "plugin/script.html" $script -}}
{{- end -}}

View File

@@ -26,7 +26,7 @@
{{- . | safeHTML -}}
{{- else -}}
{{- $res := resources.Get "lib/fontawesome-free/all.min.css" -}}
{{- $stylesheet := (dict "resource" $res "fingerprint" ($scratch.Get "fingerprint")) -}}
{{- $stylesheet := dict "resource" $res "fingerprint" ($scratch.Get "fingerprint") -}}
{{- partial "plugin/stylesheet.html" $stylesheet -}}
{{- end -}}
@@ -35,7 +35,7 @@
{{- . | safeHTML -}}
{{- else -}}
{{- $res := resources.Get "lib/fontawesome-free/all.min.css" -}}
{{- $stylesheet := (dict "resource" $res "fingerprint" ($scratch.Get "fingerprint")) -}}
{{- $stylesheet := dict "resource" $res "fingerprint" ($scratch.Get "fingerprint") -}}
{{- partial "plugin/stylesheet.html" $stylesheet -}}
{{- end -}}
@@ -46,5 +46,5 @@
{{- $options = dict "outputStyle" "compressed" | merge $options -}}
{{- $options = dict "enableSourceMap" true | merge $options -}}
{{- $res = resources.ExecuteAsTemplate "style.scss" . $res | toCSS $options -}}
{{- $stylesheet := (dict "resource" $res "fingerprint" ($scratch.Get "fingerprint")) -}}
{{- $stylesheet := dict "resource" $res "fingerprint" ($scratch.Get "fingerprint") -}}
{{- partial "plugin/stylesheet.html" $stylesheet -}}

View File

@@ -15,21 +15,23 @@
{{- if .Site.IsMultiLingual -}}
 | 
<a href="javascript:void(0);" class="menu-item" title="{{ T "selectLanguage" }}">
<i class="fas fa-language fa-fw"></i>&nbsp;
<select class="language-select" onchange="location = this.value;">
{{- range .Page.AllTranslations -}}
{{- $translation := . -}}
{{- range $.Site.Languages -}}
{{- if eq $translation.Lang .Lang -}}
{{- if eq $.Page.Lang .Lang -}}
<option value="{{ $translation.RelPermalink }}" selected>{{ .LanguageName }}</option>
{{- else -}}
<option value="{{ $translation.RelPermalink }}">{{ .LanguageName }}</option>
<label for="language-select-desktop">
<i class="fas fa-language fa-fw"></i>&nbsp;
<select class="language-select" id="language-select-desktop" onchange="location = this.value;">
{{- range .Page.AllTranslations -}}
{{- $translation := . -}}
{{- range $.Site.Languages -}}
{{- if eq $translation.Lang .Lang -}}
{{- if eq $.Page.Lang .Lang -}}
<option value="{{ $translation.RelPermalink }}" selected>{{ .LanguageName }}</option>
{{- else -}}
<option value="{{ $translation.RelPermalink }}">{{ .LanguageName }}</option>
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
</select>
</select>
</label>
</a>
{{- end -}}
<a href="javascript:void(0);" class="theme-switch" title="{{ T "switchTheme" }}">
@@ -61,21 +63,23 @@
{{- end -}}
{{- if .Site.IsMultiLingual -}}
<a href="javascript:void(0);" class="menu-item" title="{{ T "selectLanguage" }}">
<i class="fas fa-language fa-fw"></i>&nbsp;
<select class="language-select" onchange="location = this.value;">
{{- range .Page.AllTranslations -}}
{{- $translation := . -}}
{{- range $.Site.Languages -}}
{{- if eq $translation.Lang .Lang -}}
{{- if eq $.Page.Lang .Lang -}}
<option value="{{ $translation.RelPermalink }}" selected>{{ .LanguageName }}</option>
{{- else -}}
<option value="{{ $translation.RelPermalink }}">{{ .LanguageName }}</option>
<label for="language-select-mobile">
<i class="fas fa-language fa-fw"></i>&nbsp;
<select class="language-select" id="language-select-mobile" onchange="location = this.value;">
{{- range .Page.AllTranslations -}}
{{- $translation := . -}}
{{- range $.Site.Languages -}}
{{- if eq $translation.Lang .Lang -}}
{{- if eq $.Page.Lang .Lang -}}
<option value="{{ $translation.RelPermalink }}" selected>{{ .LanguageName }}</option>
{{- else -}}
<option value="{{ $translation.RelPermalink }}">{{ .LanguageName }}</option>
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
</select>
</select>
</label>
</a>
{{- end -}}
<a href="javascript:void(0);" class="theme-switch" title="{{ T "switchTheme" }}">

View File

@@ -22,4 +22,4 @@
{{- .Set "iconfont" true -}}
{{- end -}}
{{- end -}}
<i class="{{ delimit $classList ` ` }}"></i>
<i class="{{ delimit $classList ` ` }}"></i>

View File

@@ -1,4 +1,4 @@
<a href="{{ .href | safeURL }}"{{ with .title }} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .href "http" }} target="_blank"{{ end }} rel="noopener noreffer{{ with .rel }} {{ . }}{{ end }}">
<a href="{{ .href | safeURL }}"{{ with .title }} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .href "http" }} target="_blank"{{ end }} rel="noopener noreffer{{ with .rel }} {{ . }}{{ end }}"{{ with .class }} class="{{ . }}"{{ end }}>
{{- with .icon -}}
{{- partial "plugin/icon.html" . -}}
{{- end -}}