diff options
author | Dillon <dillonzq@outlook.com> | 2020-03-09 22:33:28 +0300 |
---|---|---|
committer | Dillon <dillonzq@outlook.com> | 2020-03-09 22:33:28 +0300 |
commit | fb9a9e73243a61f66a57ac94588497390f8955c9 (patch) | |
tree | a66a4e107afdf8ce0b2f276f6a50e5333160ede7 /layouts | |
parent | 426e24598d4cfadeedf2c3177d1137c62753d79c (diff) |
docs: update zh-CN docs and fix some bugs
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/_default/summary.html | 5 | ||||
-rw-r--r-- | layouts/partials/assets.html | 4 | ||||
-rw-r--r-- | layouts/partials/head/link.html | 6 | ||||
-rw-r--r-- | layouts/partials/header.html | 52 | ||||
-rw-r--r-- | layouts/partials/plugin/icon.html | 2 | ||||
-rw-r--r-- | layouts/partials/plugin/link.html | 2 | ||||
-rw-r--r-- | layouts/posts/single.html | 5 |
7 files changed, 39 insertions, 37 deletions
diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index cd95510..7bb78d9 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -19,9 +19,8 @@ {{- $author := .Params.author | default .Site.Author.name | default (T "author") -}} {{- $authorLink := .Params.authorLink | default .Site.Author.link | default (relLangURL "/") -}} <span class="post-author"> - <a class="author" href="{{ $authorLink }}" rel="author" target="_blank"> - <i class="fas fa-user-circle fa-fw"></i>{{ $author }} - </a> + {{- $link := dict "class" "author" "href" $authorLink "title" "Author" "rel" "author" "icon" (dict "class" "fas fa-user-circle fa-fw") "content" $author -}} + {{- partial "plugin/link.html" $link -}} </span> {{- $publish_date := .PublishDate.Format (.Site.Params.dateFormatToUse | default "2006-01-02") -}} diff --git a/layouts/partials/assets.html b/layouts/partials/assets.html index 9ff4cd4..257a107 100644 --- a/layouts/partials/assets.html +++ b/layouts/partials/assets.html @@ -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 -}} diff --git a/layouts/partials/head/link.html b/layouts/partials/head/link.html index 316e91e..1e5ccad 100644 --- a/layouts/partials/head/link.html +++ b/layouts/partials/head/link.html @@ -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 -}} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 0c8d9c9..3062cf5 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -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> - <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> + <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> - <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> + <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" }}"> diff --git a/layouts/partials/plugin/icon.html b/layouts/partials/plugin/icon.html index 9898a08..cb06e04 100644 --- a/layouts/partials/plugin/icon.html +++ b/layouts/partials/plugin/icon.html @@ -22,4 +22,4 @@ {{- .Set "iconfont" true -}} {{- end -}} {{- end -}} -<i class="{{ delimit $classList ` ` }}"></i> +<i class="{{ delimit $classList ` ` }}"></i>
\ No newline at end of file diff --git a/layouts/partials/plugin/link.html b/layouts/partials/plugin/link.html index c71bf34..700676d 100644 --- a/layouts/partials/plugin/link.html +++ b/layouts/partials/plugin/link.html @@ -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 -}} diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 25ffb07..59ab048 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -12,9 +12,8 @@ {{- $author := .Params.author | default .Site.Author.name | default (T "author") -}} {{- $authorLink := .Params.authorLink | default .Site.Author.link | default (relLangURL "/") -}} <span class="post-author"> - <a class="author" href="{{ $authorLink }}" rel="author" target="_blank"> - <i class="fas fa-user-circle fa-fw"></i>{{ $author }} - </a> + {{- $link := dict "class" "author" "href" $authorLink "title" "Author" "rel" "author" "icon" (dict "class" "fas fa-user-circle fa-fw") "content" $author -}} + {{- partial "plugin/link.html" $link -}} </span> {{- with .Params.categories -}} |