feat(exampleSite): merge en and zh exampleSite

This commit is contained in:
Dillon
2020-02-19 18:48:37 +08:00
parent 16320fa91b
commit 20c9c812d0
37 changed files with 703 additions and 789 deletions

View File

@@ -7,7 +7,7 @@
<h1 id="error-emoji"></h1>
<p class="error-text">
{{- T "pageNotFoundText" -}}&nbsp;
<a href="{{ .Site.BaseURL }}" title="{{ T "backToHome" }}">↩︎</a>
<a href="{{ `/` | relLangURL }}" title="{{ T `backToHome` }}">↩︎</a>
</p>
</div>
<script>

View File

@@ -15,7 +15,7 @@
{{- /* Meta */ -}}
<div class="meta">
{{- $author := .Params.author | default .Site.Author.name -}}
{{- $authorLink := .Params.authorLink | default .Site.Author.link | default .Site.BaseURL -}}
{{- $authorLink := .Params.authorLink | default .Site.Author.link | default (relLangURL "/") -}}
<a class="author" href="{{ $authorLink }}" rel="author" target="_blank">
<i class="fas fa-user-circle fa-fw"></i>{{ $author }}
</a>

View File

@@ -18,7 +18,7 @@
{{- /* Author */ -}}
{{- with .Site.Author.name -}}
<span class="author" itemprop="copyrightHolder">&nbsp;<a href="{{ $.Site.Author.link | default $.Site.BaseURL }}" target="_blank">{{ . }}</a></span>
<span class="author" itemprop="copyrightHolder">&nbsp;<a href="{{ $.Site.Author.link | default (relLangURL `/`) }}" target="_blank">{{ . }}</a></span>
{{- end -}}
{{- /* License */ -}}

View File

@@ -20,7 +20,7 @@
{
"@context": "http://schema.org",
"@type": "WebSite",
"url": "{{ .Site.BaseURL }}",
"url": "{{ relLangURL `/` }}",
{{- with .Site.Author.name -}}
"author": {
"@type": "Person",

View File

@@ -2,14 +2,14 @@
<header class="desktop" id="header-desktop">
<div class="header-wrapper">
<div class="header-title animated bounceIn">
<a href="{{ .Site.BaseURL }}">
<a href="{{ `/` | relLangURL }}">
{{- .Site.Title -}}
</a>
</div>
<div class="menu">
{{- $currentPage := . }}
{{- range .Site.Menus.main -}}
<a class="menu-item{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) | or (eq $currentPage.RelPermalink .URL) }} active{{ end }}" href="{{ .URL | absLangURL }}" title="{{ .Title }}">
<a class="menu-item{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) | or (eq $currentPage.RelPermalink .URL) }} active{{ end }}" href="{{ .URL | relLangURL }}" title="{{ .Title }}">
{{- .Pre | safeHTML }}{{ .Name -}}
</a>
{{- end -}}
@@ -25,7 +25,7 @@
<div class="header-wrapper">
<div class="header-container">
<div class="header-title animated bounceIn">
<a href="{{ .Site.BaseURL }}">
<a href="{{ `/` | relLangURL }}">
{{- .Site.Title -}}
</a>
</div>

View File

@@ -302,7 +302,7 @@
{{- /* 044: 知乎 */ -}}
{{- with .Site.Params.Social.Zhihu -}}
{{- $options := dict "href" (printf "https://www.zhihu.com/people/%s" .) "title" "知乎" -}}
{{- $options = dict "class" "fab fa-zhihu fa-fw" | merge $options -}}
{{- $options = dict "class" "loveit it-zhihu-line" "type" "other" "scratch" $.Scratch | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}

View File

@@ -48,7 +48,7 @@
{{- end -}}
</section>
<section>
<span><a href="javascript:window.history.back();">{{ T "back" }}</a></span>&nbsp;|&nbsp;<span><a href="{{ .Site.BaseURL }}">{{ T "home" }}</a></span>
<span><a href="javascript:window.history.back();">{{ T "back" }}</a></span>&nbsp;|&nbsp;<span><a href="{{ `/` | relLangURL }}">{{ T "home" }}</a></span>
</section>
</div>

View File

@@ -89,15 +89,16 @@
document.addEventListener("DOMContentLoaded", function () {
renderMathInElement(document.body, {
delimiters: [
{ left: "$", right: "$", display: false },
{ left: "$$", right: "$$", display: true },
{ left: "\\(", right: "\\)", display: false },
{ left: "\\[", right: "\\]", display: true },
{{- if and $math.blockLeftDelimiter $math.blockRightDelimiter -}}
{ left: "{{ $math.blockLeftDelimiter }}", right: "{{ $math.blockRightDelimiter }}", display: true },
{{- end -}}
{{- if and $math.inlineLeftDelimiter $math.inlineRightDelimiter -}}
{ left: "{{ $math.inlineLeftDelimiter }}", right: "{{ $math.inlineRightDelimiter }}", display: false },
{{- end -}}
{{- if and $math.blockLeftDelimiter $math.blockRightDelimiter -}}
{ left: "{{ $math.blockLeftDelimiter }}", right: "{{ $math.blockRightDelimiter }}", display: true },
{{- end -}}
]
});
});

View File

@@ -9,7 +9,7 @@
<div class="meta">
<div class="meta-line">
{{- $author := .Params.author | default .Site.Author.name -}}
{{- $authorLink := .Params.authorLink | default .Site.Author.link | default .Site.BaseURL -}}
{{- $authorLink := .Params.authorLink | default .Site.Author.link | default (relLangURL "/") -}}
<a class="author" href="{{ $authorLink }}" rel="author" target="_blank">
<i class="fas fa-user-circle fa-fw"></i>{{ $author }}
</a>&nbsp;