chore(style): update code style and add an i18n word
This commit is contained in:
@@ -38,6 +38,14 @@ dateFormatToUse = "2006-01-02"
|
|||||||
tabWidth = 4
|
tabWidth = 4
|
||||||
# Goldmark is from Hugo 0.60 the default library used for Markdown
|
# Goldmark is from Hugo 0.60 the default library used for Markdown
|
||||||
[markup.goldmark]
|
[markup.goldmark]
|
||||||
|
[markup.goldmark.extensions]
|
||||||
|
definitionList = true
|
||||||
|
footnote = true
|
||||||
|
linkify = true
|
||||||
|
strikethrough = true
|
||||||
|
table = true
|
||||||
|
taskList = true
|
||||||
|
typographer = true
|
||||||
[markup.goldmark.renderer]
|
[markup.goldmark.renderer]
|
||||||
# whether to use HTML tags directly in the document
|
# whether to use HTML tags directly in the document
|
||||||
unsafe = true
|
unsafe = true
|
||||||
|
|||||||
@@ -38,6 +38,14 @@ dateFormatToUse = "2006-01-02"
|
|||||||
tabWidth = 4
|
tabWidth = 4
|
||||||
# Goldmark 是 Hugo 0.60 以来的默认 Markdown 解析库
|
# Goldmark 是 Hugo 0.60 以来的默认 Markdown 解析库
|
||||||
[markup.goldmark]
|
[markup.goldmark]
|
||||||
|
[markup.goldmark.extensions]
|
||||||
|
definitionList = true
|
||||||
|
footnote = true
|
||||||
|
linkify = true
|
||||||
|
strikethrough = true
|
||||||
|
table = true
|
||||||
|
taskList = true
|
||||||
|
typographer = true
|
||||||
[markup.goldmark.renderer]
|
[markup.goldmark.renderer]
|
||||||
# 是否在文档中直接使用 HTML 标签
|
# 是否在文档中直接使用 HTML 标签
|
||||||
unsafe = true
|
unsafe = true
|
||||||
|
|||||||
@@ -46,6 +46,11 @@ other = "Powered by %s"
|
|||||||
other = "Theme - "
|
other = "Theme - "
|
||||||
# === partials/footer.html ===
|
# === partials/footer.html ===
|
||||||
|
|
||||||
|
# === partials/post/share.html ===
|
||||||
|
[share]
|
||||||
|
other = "Share on"
|
||||||
|
# === partials/post/share.html ===
|
||||||
|
|
||||||
# === posts/single.html ===
|
# === posts/single.html ===
|
||||||
[toc]
|
[toc]
|
||||||
other = "Contents"
|
other = "Contents"
|
||||||
|
|||||||
@@ -46,6 +46,11 @@ other = "由 %s 强力驱动"
|
|||||||
other = "主题 - "
|
other = "主题 - "
|
||||||
# === partials/footer.html ===
|
# === partials/footer.html ===
|
||||||
|
|
||||||
|
# === partials/post/share.html ===
|
||||||
|
[share]
|
||||||
|
other = "分享到"
|
||||||
|
# === partials/post/share.html ===
|
||||||
|
|
||||||
# === posts/single.html ===
|
# === posts/single.html ===
|
||||||
[toc]
|
[toc]
|
||||||
other = "目录"
|
other = "目录"
|
||||||
|
|||||||
@@ -4,19 +4,19 @@
|
|||||||
|
|
||||||
{{- define "content" -}}
|
{{- define "content" -}}
|
||||||
<div class="notfound">
|
<div class="notfound">
|
||||||
<h1 class="error-emoji"></h1>
|
<h1 id="error-emoji"></h1>
|
||||||
<p class="error-text">
|
<p class="error-text">
|
||||||
{{- T "pageNotFoundText" -}}
|
{{- T "pageNotFoundText" -}}
|
||||||
<a href="{{ .Site.BaseURL }}" title="{{ T "backToHome" }}">↩︎</a>
|
<a href="{{ .Site.BaseURL }}" title="{{ T "backToHome" }}">↩︎</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
var errorEmojiContainer = document.getElementsByClassName('error-emoji')[0];
|
const emojiArray = [
|
||||||
var emojiArray = [
|
|
||||||
'\\(o_o)/', '(o^^)o', '(˚Δ˚)b', '(^-^*)', '(≥o≤)', '(^_^)b', '(·_·)',
|
'\\(o_o)/', '(o^^)o', '(˚Δ˚)b', '(^-^*)', '(≥o≤)', '(^_^)b', '(·_·)',
|
||||||
'(=\'X\'=)', '(>_<)', '(;-;)', '\\(^Д^)/',
|
'(=\'X\'=)', '(>_<)', '(;-;)', '\\(^Д^)/',
|
||||||
];
|
];
|
||||||
var errorEmoji = emojiArray[Math.floor(Math.random() * emojiArray.length)];
|
const errorEmoji = emojiArray[Math.floor(Math.random() * emojiArray.length)];
|
||||||
|
const errorEmojiContainer = document.getElementById('error-emoji');
|
||||||
errorEmojiContainer.appendChild(document.createTextNode(errorEmoji));
|
errorEmojiContainer.appendChild(document.createTextNode(errorEmoji));
|
||||||
</script>
|
</script>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
<figure>
|
<figure>
|
||||||
|
{{- /* Lazyload */ -}}
|
||||||
{{- $loading := resources.Get "svg/loading.svg" | minify -}}
|
{{- $loading := resources.Get "svg/loading.svg" | minify -}}
|
||||||
<img src="{{ $loading.RelPermalink }}" data-sizes="auto" data-src="{{ .Destination | safeURL }}" alt="{{ .Text }}"{{ with .Title }} title="{{ . }}"{{ end }} class="lazyload">
|
<img src="{{ $loading.RelPermalink }}" data-sizes="auto" data-src="{{ .Destination | safeURL }}" alt="{{ .Text }}"{{ with .Title }} title="{{ . }}"{{ end }} class="lazyload">
|
||||||
<figcaption class="image-caption">
|
{{- $caption := .Title | default .Text -}}
|
||||||
{{- if .Title -}}
|
{{- with $caption -}}
|
||||||
{{- .Title -}}
|
<figcaption class="image-caption">
|
||||||
{{- else -}}
|
{{- . -}}
|
||||||
{{- .Text -}}
|
</figcaption>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
</figcaption>
|
|
||||||
</figure>
|
</figure>
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
|
{{- /* LoveIt theme version detection */ -}}
|
||||||
{{- if ne .Site.Params.version "0.1.X" -}}
|
{{- if ne .Site.Params.version "0.1.X" -}}
|
||||||
{{- errorf "\n\nThere are two possible situations that led to this error:\n 1. You haven't copied the config.toml yet. See https://github.com/dillonzq/LoveIt#installation \n 2. You have an incompatible update. See https://github.com//dillonzq/LoveIt/blob/master/CHANGELOG.md \n\n有两种可能的情况会导致这个错误发生:\n 1. 你还没有复制 config.toml 参考 https://github.com/dillonzq/LoveIt#installation \n 2. 你进行了一次不兼容的更新 参考 https://github.com//dillonzq/LoveIt/blob/master/CHANGELOG.md \n" -}}
|
{{- errorf "\n\nThere are two possible situations that led to this error:\n 1. You haven't copied the config.toml yet. See https://github.com/dillonzq/LoveIt#installation \n 2. You have an incompatible update. See https://github.com//dillonzq/LoveIt/blob/master/CHANGELOG.md \n\n有两种可能的情况会导致这个错误发生:\n 1. 你还没有复制 config.toml 参考 https://github.com/dillonzq/LoveIt#installation \n 2. 你进行了一次不兼容的更新 参考 https://github.com//dillonzq/LoveIt/blob/master/CHANGELOG.md \n" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="{{ .Site.LanguageCode }}">
|
<html lang="{{ .Site.LanguageCode }}">
|
||||||
<head>
|
<head>
|
||||||
@@ -12,10 +14,13 @@
|
|||||||
{{- partial "head.html" . -}}
|
{{- partial "head.html" . -}}
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
{{- /* Check theme isDark before body rendering */ -}}
|
||||||
<script>
|
<script>
|
||||||
window.isDark = (window.localStorage && window.localStorage.getItem('theme')) === 'dark';
|
window.isDark = (window.localStorage && window.localStorage.getItem('theme')) === 'dark';
|
||||||
window.isDark && document.body.classList.add('dark-theme');
|
window.isDark && document.body.classList.add('dark-theme');
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
{{- /* Body wrapper */ -}}
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
{{- partial "header.html" . -}}
|
{{- partial "header.html" . -}}
|
||||||
<main class="main">
|
<main class="main">
|
||||||
@@ -24,10 +29,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
{{- partial "footer.html" . -}}
|
{{- partial "footer.html" . -}}
|
||||||
{{- partial "scripts.html" . -}}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{- /* Dynamic to top button */ -}}
|
||||||
<a href="#" class="dynamic-to-top" id="dynamic-to-top" data-scroll>
|
<a href="#" class="dynamic-to-top" id="dynamic-to-top" data-scroll>
|
||||||
<span> </span>
|
<span> </span>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
{{- /* Load scripts */ -}}
|
||||||
|
{{- partial "scripts.html" . -}}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -3,12 +3,13 @@
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- define "content" -}}
|
{{- define "content" -}}
|
||||||
{{- $data := .Data -}}
|
|
||||||
<div class="page archive">
|
<div class="page archive">
|
||||||
|
{{- /* Title */ -}}
|
||||||
<h2 class="post-title animated pulse faster">
|
<h2 class="post-title animated pulse faster">
|
||||||
{{- T "all" | humanize}}{{ T .Section | default .Section | humanize -}}
|
{{- T "all" | humanize}}{{ T .Section | default .Section | humanize -}}
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
{{- /* Paginate */ -}}
|
||||||
{{- range (.Paginate (.Pages.GroupByDate "2006")).PageGroups -}}
|
{{- range (.Paginate (.Pages.GroupByDate "2006")).PageGroups -}}
|
||||||
<h3>{{ .Key }}</h3>
|
<h3>{{ .Key }}</h3>
|
||||||
{{- range .Pages -}}
|
{{- range .Pages -}}
|
||||||
|
|||||||
@@ -2,9 +2,12 @@
|
|||||||
|
|
||||||
{{- define "content" -}}
|
{{- define "content" -}}
|
||||||
<div class="page single">
|
<div class="page single">
|
||||||
|
{{- /* Title */ -}}
|
||||||
<h1 class="post-title animated pulse faster">
|
<h1 class="post-title animated pulse faster">
|
||||||
{{- .Title -}}
|
{{- .Title -}}
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
|
{{- /* Content */ -}}
|
||||||
<div class="post-content">
|
<div class="post-content">
|
||||||
{{- partial "hook/content.html" .Content | safeHTML -}}
|
{{- partial "hook/content.html" .Content | safeHTML -}}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,26 +1,28 @@
|
|||||||
<article class="post" itemscope itemtype="http://schema.org/Article">
|
<article class="post" itemscope itemtype="http://schema.org/Article">
|
||||||
{{- $publish_date := .PublishDate.Format (.Site.Params.dateFormatToUse | default "2006-01-02") -}}
|
{{- /* Featured image */ -}}
|
||||||
{{- $author := .Params.author | default .Site.Author.name -}}
|
|
||||||
{{- $author_link := .Params.author_link | default .Site.Author.link | default .Site.BaseURL -}}
|
|
||||||
|
|
||||||
<!--featured_image-->
|
|
||||||
{{- with .Params.featured_image -}}
|
{{- with .Params.featured_image -}}
|
||||||
<div class="post-featured-image-preview">
|
<div class="post-featured-image-preview">
|
||||||
{{- $image := $.Params.featured_image_preview | default . -}}
|
{{- $image := $.Params.featured_image_preview | default . -}}
|
||||||
{{- partial "image" $image -}}
|
{{- partial "image" $image -}}
|
||||||
</div>
|
</div>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
<!-- end featured_image-->
|
|
||||||
|
|
||||||
|
{{- /* Title */ -}}
|
||||||
<h1 class="post-title post-list-title" itemprop="name headline">
|
<h1 class="post-title post-list-title" itemprop="name headline">
|
||||||
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
|
{{- /* Meta */ -}}
|
||||||
<div class="post-meta">
|
<div class="post-meta">
|
||||||
|
{{- $author := .Params.author | default .Site.Author.name -}}
|
||||||
|
{{- $author_link := .Params.author_link | default .Site.Author.link | default .Site.BaseURL -}}
|
||||||
<a class="author" href="{{ $author_link }}" rel="author" target="_blank">
|
<a class="author" href="{{ $author_link }}" rel="author" target="_blank">
|
||||||
<i class="fas fa-user-circle fa-fw"></i>{{ $author }}
|
<i class="fas fa-user-circle fa-fw"></i>{{ $author }}
|
||||||
</a>
|
</a>
|
||||||
{{ T "publish" }} <time datetime={{ $publish_date }}>{{ $publish_date }}</time>
|
|
||||||
|
{{- $publish_date := .PublishDate.Format (.Site.Params.dateFormatToUse | default "2006-01-02") -}}
|
||||||
|
{{ T "publish" }} <time datetime={{ $publish_date }}>{{ $publish_date }}</time>
|
||||||
|
|
||||||
{{- with .Params.categories -}}
|
{{- with .Params.categories -}}
|
||||||
<span class="post-category">
|
<span class="post-category">
|
||||||
{{- T "included" -}}
|
{{- T "included" -}}
|
||||||
@@ -34,6 +36,8 @@
|
|||||||
</span>
|
</span>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{- /* Content */ -}}
|
||||||
<div class="post-content">
|
<div class="post-content">
|
||||||
{{- if .Params.show_description -}}
|
{{- if .Params.show_description -}}
|
||||||
<p>
|
<p>
|
||||||
@@ -43,6 +47,8 @@
|
|||||||
{{- partial "hook/content.html" .Summary | safeHTML -}}
|
{{- partial "hook/content.html" .Summary | safeHTML -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{- /* Footer */ -}}
|
||||||
<div class="post-footer">
|
<div class="post-footer">
|
||||||
<a href="{{ .Permalink }}">{{ T "readMore" }}</a>
|
<a href="{{ .Permalink }}">{{ T "readMore" }}</a>
|
||||||
{{- with .Params.tags -}}
|
{{- with .Params.tags -}}
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
{{- define "content" -}}
|
{{- define "content" -}}
|
||||||
|
{{- /* Home mode [post] */ -}}
|
||||||
{{- if eq .Site.Params.home_mode "post" -}}
|
{{- if eq .Site.Params.home_mode "post" -}}
|
||||||
<div class="page">
|
<div class="page">
|
||||||
|
{{- /* Profile */ -}}
|
||||||
{{- partial "home/profile.html" . -}}
|
{{- partial "home/profile.html" . -}}
|
||||||
|
|
||||||
|
{{- /* Paginate */ -}}
|
||||||
{{- $paginator := where .Site.RegularPages "Type" "posts" -}}
|
{{- $paginator := where .Site.RegularPages "Type" "posts" -}}
|
||||||
{{- $paginator = where $paginator "Params.show_in_homepage" "!=" false -}}
|
{{- $paginator = where $paginator "Params.show_in_homepage" "!=" false -}}
|
||||||
{{- with .Site.Params.home_paginate -}}
|
{{- with .Site.Params.home_paginate -}}
|
||||||
@@ -13,10 +16,12 @@
|
|||||||
{{- range $paginator.Pages -}}
|
{{- range $paginator.Pages -}}
|
||||||
{{- .Render "summary" -}}
|
{{- .Render "summary" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- partial "paginator.html" . -}}
|
{{- partial "paginator.html" . -}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{- /* Home mode [other] */ -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
|
{{- /* Profile */ -}}
|
||||||
{{- partial "home/profile.html" . -}}
|
{{- partial "home/profile.html" . -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
@@ -1,14 +1,13 @@
|
|||||||
{{- if eq (getenv "HUGO_ENV") "production" | and .IsPage | and (ne .Params.comment false) -}}
|
{{- if eq (getenv "HUGO_ENV") "production" | and .IsPage | and (ne .Params.comment false) -}}
|
||||||
<!-- Disqus Comment System-->
|
{{- /* Disqus Comment System */ -}}
|
||||||
{{- if .Site.Params.disqus.shortname -}}
|
{{- if .Site.Params.disqus.shortname -}}
|
||||||
<div id="disqus_thread"></div>
|
<div id="disqus_thread"></div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
(function() {
|
(function() {
|
||||||
// Don't ever inject Disqus on localhost--it creates unwanted
|
// Don't ever inject Disqus on localhost--it creates unwanted
|
||||||
// discussions from "localhost:1313" on your Disqus account...
|
// discussions from "localhost" on your Disqus account...
|
||||||
if (window.location.hostname == "localhost")
|
if (window.location.hostname == "localhost")
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var dsq = document.createElement("script"); dsq.type = "text/javascript"; dsq.async = true;
|
var dsq = document.createElement("script"); dsq.type = "text/javascript"; dsq.async = true;
|
||||||
var disqus_shortname = "{{ .Site.Params.disqus.shortname }}";
|
var disqus_shortname = "{{ .Site.Params.disqus.shortname }}";
|
||||||
dsq.src = "//" + disqus_shortname + ".disqus.com/embed.js";
|
dsq.src = "//" + disqus_shortname + ".disqus.com/embed.js";
|
||||||
@@ -16,10 +15,9 @@
|
|||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
||||||
<a href="https://disqus.com/" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
|
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
<!-- gitalk Comment System-->
|
{{- /* Gitalk Comment System */ -}}
|
||||||
{{- if .Site.Params.gitalk.owner -}}
|
{{- if .Site.Params.gitalk.owner -}}
|
||||||
<div id="gitalk-container"></div>
|
<div id="gitalk-container"></div>
|
||||||
{{- if .Site.Params.cdn.gitalk_css -}}
|
{{- if .Site.Params.cdn.gitalk_css -}}
|
||||||
@@ -35,22 +33,28 @@
|
|||||||
<script src="{{ $res.RelPermalink }}"></script>
|
<script src="{{ $res.RelPermalink }}"></script>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var gitalk = new Gitalk({
|
(function () {
|
||||||
id: "{{ .Date }}",
|
// Don't ever inject Gitalk on localhost--it creates unwanted
|
||||||
title: "{{ .Title }}",
|
// discussions from "localhost" on your Gitalk account...
|
||||||
clientID: "{{ .Site.Params.gitalk.clientId }}",
|
if (window.location.hostname == "localhost")
|
||||||
clientSecret: "{{ .Site.Params.gitalk.clientSecret }}",
|
return;
|
||||||
repo: "{{ .Site.Params.gitalk.repo }}",
|
var gitalk = new Gitalk({
|
||||||
owner: "{{ .Site.Params.gitalk.owner }}",
|
id: "{{ .Date }}",
|
||||||
admin: ["{{ .Site.Params.gitalk.owner }}"],
|
title: "{{ .Title }}",
|
||||||
body: decodeURI(location.href)
|
clientID: "{{ .Site.Params.gitalk.clientId }}",
|
||||||
});
|
clientSecret: "{{ .Site.Params.gitalk.clientSecret }}",
|
||||||
gitalk.render("gitalk-container");
|
repo: "{{ .Site.Params.gitalk.repo }}",
|
||||||
|
owner: "{{ .Site.Params.gitalk.owner }}",
|
||||||
|
admin: ["{{ .Site.Params.gitalk.owner }}"],
|
||||||
|
body: decodeURI(location.href)
|
||||||
|
});
|
||||||
|
gitalk.render("gitalk-container");
|
||||||
|
})();
|
||||||
</script>
|
</script>
|
||||||
<noscript>Please enable JavaScript to view the <a href="https://github.com/gitalk/gitalk">comments powered by gitalk.</a></noscript>
|
<noscript>Please enable JavaScript to view the <a href="https://github.com/gitalk/gitalk">comments powered by Gitalk.</a></noscript>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
<!-- valine -->
|
{{- /* Valine Comment System */ -}}
|
||||||
{{- if .Site.Params.valine.enable -}}
|
{{- if .Site.Params.valine.enable -}}
|
||||||
<div id="vcomments"></div>
|
<div id="vcomments"></div>
|
||||||
{{- if .Site.Params.cdn.valine_js -}}
|
{{- if .Site.Params.cdn.valine_js -}}
|
||||||
@@ -60,23 +64,30 @@
|
|||||||
<script src="{{ $res.RelPermalink }}"></script>
|
<script src="{{ $res.RelPermalink }}"></script>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
new Valine({
|
(function () {
|
||||||
el: "#vcomments",
|
// Don't ever inject Valine on localhost--it creates unwanted
|
||||||
appId: "{{ .Site.Params.valine.appId }}",
|
// discussions from "localhost" on your Valine account...
|
||||||
appKey: "{{ .Site.Params.valine.appKey }}",
|
if (window.location.hostname == "localhost")
|
||||||
meta: ["nick", "mail"],
|
return;
|
||||||
notify: "{{ .Site.Params.valine.notify }}",
|
new Valine({
|
||||||
verify: "{{ .Site.Params.valine.verify }}",
|
el: "#vcomments",
|
||||||
avatar: "{{ .Site.Params.valine.avatar }}",
|
appId: "{{ .Site.Params.valine.appId }}",
|
||||||
placeholder: "{{ .Site.Params.valine.placeholder }}",
|
appKey: "{{ .Site.Params.valine.appKey }}",
|
||||||
visitor: "{{ .Site.Params.valine.visitor }}",
|
meta: ["nick", "mail"],
|
||||||
recordIP: "{{ .Site.Params.valine.recordIP }}",
|
notify: "{{ .Site.Params.valine.notify }}",
|
||||||
lang: "{{ T `valineLang` }}",
|
verify: "{{ .Site.Params.valine.verify }}",
|
||||||
});
|
avatar: "{{ .Site.Params.valine.avatar }}",
|
||||||
|
placeholder: "{{ .Site.Params.valine.placeholder }}",
|
||||||
|
visitor: "{{ .Site.Params.valine.visitor }}",
|
||||||
|
recordIP: "{{ .Site.Params.valine.recordIP }}",
|
||||||
|
lang: "{{ T `valineLang` }}",
|
||||||
|
});
|
||||||
|
})();
|
||||||
</script>
|
</script>
|
||||||
|
<noscript>Please enable JavaScript to view the <a href="https://valine.js.org/">comments powered by Valine.</a></noscript>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
<!-- facebook comment -->
|
{{- /* Facebook Comment System */ -}}
|
||||||
{{- if .Site.Params.facebook.enable -}}
|
{{- if .Site.Params.facebook.enable -}}
|
||||||
<div id="fb-root"></div>
|
<div id="fb-root"></div>
|
||||||
<script
|
<script
|
||||||
@@ -91,5 +102,6 @@
|
|||||||
data-width="{{ .Site.Params.facebook.width }}"
|
data-width="{{ .Site.Params.facebook.width }}"
|
||||||
data-numposts="{{ .Site.Params.facebook.numPosts }}"
|
data-numposts="{{ .Site.Params.facebook.numPosts }}"
|
||||||
></div>
|
></div>
|
||||||
|
<noscript>Please enable JavaScript to view the <a href="https://developers.facebook.com/docs/plugins/comments/">comments powered by Facebook.</a></noscript>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
@@ -1,9 +1,12 @@
|
|||||||
<footer class="footer">
|
<footer class="footer">
|
||||||
<div class="copyright">
|
<div class="copyright">
|
||||||
|
{{- /* Hugo and LoveIt */ -}}
|
||||||
<div class="copyright-line">
|
<div class="copyright-line">
|
||||||
{{- (printf (T "powered") `<a href="https://gohugo.io/" target="_blank" rel="external nofollow noopener noreffer">Hugo</a>`) | safeHTML }} | {{ T "theme" }}<a href="https://github.com/dillonzq/LoveIt" target="_blank" rel="external nofollow noopener noreffer">LoveIt<i class="far fa-heart fa-fw"></i></a>
|
{{- printf (T "powered") `<a href="https://gohugo.io/" target="_blank" rel="external nofollow noopener noreffer">Hugo</a>` | safeHTML }} | {{ T "theme" }}<a href="https://github.com/dillonzq/LoveIt" target="_blank" rel="external nofollow noopener noreffer">LoveIt<i class="far fa-heart fa-fw"></i></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="copyright-line">
|
<div class="copyright-line">
|
||||||
|
{{- /* Copyright year */ -}}
|
||||||
<i class="far fa-copyright fa-fw"></i>
|
<i class="far fa-copyright fa-fw"></i>
|
||||||
{{- with .Site.Params.since -}}
|
{{- with .Site.Params.since -}}
|
||||||
<span itemprop="copyrightYear">
|
<span itemprop="copyrightYear">
|
||||||
@@ -12,14 +15,20 @@
|
|||||||
{{- else -}}
|
{{- else -}}
|
||||||
<span itemprop="copyrightYear">{{ now.Year }}</span>
|
<span itemprop="copyrightYear">{{ now.Year }}</span>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- /* Author */ -}}
|
||||||
{{- with .Site.Author.name -}}
|
{{- with .Site.Author.name -}}
|
||||||
<span class="author" itemprop="copyrightHolder"> <a href="{{ $.Site.BaseURL }}">{{ . }}</a></span>
|
<span class="author" itemprop="copyrightHolder"> <a href="{{ $.Site.Author.link | default $.Site.BaseURL }}" target="_blank">{{ . }}</a></span>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- /* ICP */ -}}
|
||||||
{{- with .Site.Params.icp -}}
|
{{- with .Site.Params.icp -}}
|
||||||
<span class="icp"> | {{ . | safeHTML }}</span>
|
| <span class="icp">{{ . | safeHTML }}</span>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- /* License */ -}}
|
||||||
{{- with .Site.Params.license -}}
|
{{- with .Site.Params.license -}}
|
||||||
<span class="license"> | {{ . | safeHTML }}</span>
|
| <span class="license">{{ . | safeHTML }}</span>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -36,7 +36,10 @@
|
|||||||
<link rel="feed" href="{{ .RelPermalink }}" type="application/rss+xml" title="{{ $.Site.Title }}">
|
<link rel="feed" href="{{ .RelPermalink }}" type="application/rss+xml" title="{{ $.Site.Title }}">
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- template "_internal/twitter_cards.html" . -}}
|
{{- $share := .Params.share.enable | default .Site.Params.share.enable | eq true -}}
|
||||||
|
{{- if $share | and (.Params.Share.Twitter | default .Site.Params.Share.Twitter | eq true) -}}
|
||||||
|
{{- template "_internal/twitter_cards.html" . -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
{{- partial "seo.html" . -}}
|
{{- partial "seo.html" . -}}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
{{- /* Desktop navbar */ -}}
|
||||||
<nav class="navbar">
|
<nav class="navbar">
|
||||||
<div class="navbar-container">
|
<div class="navbar-container">
|
||||||
<div class="navbar-header animated bounceIn">
|
<div class="navbar-header animated bounceIn">
|
||||||
@@ -12,16 +13,17 @@
|
|||||||
{{- .Name | safeHTML -}}
|
{{- .Name | safeHTML -}}
|
||||||
</a>
|
</a>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
<a href="javascript:void(0);" class="theme-switch"><i class="fas fa-adjust fa-rotate-180 fa-fw" title={{ T "switchTheme" }}></i></a>
|
<a href="javascript:void(0);" class="theme-switch"><i class="fas fa-adjust fa-rotate-180 fa-fw" title="{{ T "switchTheme" }}"></i></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
{{- /* Mobile navbar */ -}}
|
||||||
<nav class="navbar-mobile">
|
<nav class="navbar-mobile">
|
||||||
<div class="navbar-container">
|
<div class="navbar-container">
|
||||||
<div class="navbar-header">
|
<div class="navbar-header">
|
||||||
<div class="navbar-header-title animated bounceIn">
|
<div class="navbar-header-title animated bounceIn">
|
||||||
<a href="{{.Site.BaseURL}}">
|
<a href="{{ .Site.BaseURL }}">
|
||||||
{{- .Site.Title -}}
|
{{- .Site.Title -}}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -36,7 +38,7 @@
|
|||||||
{{- .Name | safeHTML -}}
|
{{- .Name | safeHTML -}}
|
||||||
</a>
|
</a>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
<a href="javascript:void(0);" class="theme-switch"><i class="fas fa-adjust fa-rotate-180 fa-fw" title={{ T "switchTheme" }}></i></a>
|
<a href="javascript:void(0);" class="theme-switch"><i class="fas fa-adjust fa-rotate-180 fa-fw" title="{{ T "switchTheme" }}"></i></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
{{- $REin := `:\(([\w- ]+?)\):` -}}
|
{{- $REin := `:\(([\w- ]+?)\):` -}}
|
||||||
{{- $REout := `<i class="$1 fa-fw"></i>` -}}
|
{{- $REout := `<i class="$1 fa-fw"></i>` -}}
|
||||||
{{- $content := replaceRE $REin $REout . -}}
|
{{- $content := replaceRE $REin $REout . -}}
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
|
{{- /* Lazyload */ -}}
|
||||||
{{- $res := resources.Get "svg/loading.svg" | minify -}}
|
{{- $res := resources.Get "svg/loading.svg" | minify -}}
|
||||||
<img src="{{ $res.RelPermalink }}" data-sizes="auto" data-src="{{ . }}" alt="featured image" class="lazyload">
|
<img src="{{ $res.RelPermalink }}" data-sizes="auto" data-src="{{ . }}" alt="featured image" class="lazyload">
|
||||||
@@ -1,51 +1,70 @@
|
|||||||
{{- if or (eq .Params.share.enable false) (eq .Site.Params.share.enable false) | not -}}
|
{{- if .Params.share.enable | default .Site.Params.share.enable | eq true -}}
|
||||||
{{- if or .Params.Share.Twitter (and .Site.Params.Share.Twitter (ne .Params.Share.Twitter false)) -}}
|
{{- /* Share on Twitter */ -}}
|
||||||
<a href="//twitter.com/share?url={{ .Permalink }}&text={{ .Title }}&via={{ .Site.Params.Social.Twitter }}" target="_blank" title="Share on Twitter">
|
{{- if .Params.Share.Twitter | default .Site.Params.Share.Twitter | eq true -}}
|
||||||
|
<a href="//twitter.com/share?url={{ .Permalink }}&text={{ .Title }}&via={{ .Site.Params.Social.Twitter }}" target="_blank" title="{{ T "share" }} Twitter">
|
||||||
<i class="fab fa-twitter fa-fw"></i>
|
<i class="fab fa-twitter fa-fw"></i>
|
||||||
</a>
|
</a>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- if or .Params.Share.Facebook (and .Site.Params.Share.Facebook (ne .Params.Share.Facebook false)) -}}
|
|
||||||
<a href="//www.facebook.com/sharer/sharer.php?u={{ .Permalink }}" target="_blank" title="Share on Facebook">
|
{{- /* Share on Facebook */ -}}
|
||||||
|
{{- if .Params.Share.Facebook | default .Site.Params.Share.Facebook | eq true -}}
|
||||||
|
<a href="//www.facebook.com/sharer/sharer.php?u={{ .Permalink }}" target="_blank" title="{{ T "share" }} Facebook">
|
||||||
<i class="fab fa-facebook-square fa-fw"></i>
|
<i class="fab fa-facebook-square fa-fw"></i>
|
||||||
</a>
|
</a>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- if or .Params.Share.Reddit (and .Site.Params.Share.Reddit (ne .Params.Share.Reddit false)) -}}
|
|
||||||
<a href="//reddit.com/submit?url={{ .Permalink }}&title={{ .Title }}" target="_blank" title="Share on Reddit">
|
{{- /* Share on Reddit */ -}}
|
||||||
|
{{- if .Params.Share.Reddit | default .Site.Params.Share.Reddit | eq true -}}
|
||||||
|
<a href="//reddit.com/submit?url={{ .Permalink }}&title={{ .Title }}" target="_blank" title="{{ T "share" }} Reddit">
|
||||||
<i class="fab fa-reddit fa-fw"></i>
|
<i class="fab fa-reddit fa-fw"></i>
|
||||||
</a>
|
</a>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- if or .Params.Share.Linkedin (and .Site.Params.Share.Linkedin (ne .Params.Share.Linkedin false)) -}}
|
|
||||||
<a href="//www.linkedin.com/shareArticle?url={{ .Permalink }}&title={{ .Title }}" target="_blank" title="Share on LinkedIn">
|
{{- /* Share on Linkedin */ -}}
|
||||||
|
{{- if .Params.Share.Linkedin | default .Site.Params.Share.Linkedin | eq true -}}
|
||||||
|
<a href="//www.linkedin.com/shareArticle?url={{ .Permalink }}&title={{ .Title }}" target="_blank" title="{{ T "share" }} LinkedIn">
|
||||||
<i class="fab fa-linkedin fa-fw"></i>
|
<i class="fab fa-linkedin fa-fw"></i>
|
||||||
</a>
|
</a>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- if or .Params.Share.Pinterest (and .Site.Params.Share.Pinterest (ne .Params.Share.Pinterest false)) -}}
|
|
||||||
<a href="//www.pinterest.com/pin/create/button/?url={{ .Permalink }}&description={{ .Title }}" target="_blank" title="Share on Pinterest">
|
{{- /* Share on Pinterest */ -}}
|
||||||
|
{{- if .Params.Share.Pinterest | default .Site.Params.Share.Pinterest | eq true -}}
|
||||||
|
<a href="//www.pinterest.com/pin/create/button/?url={{ .Permalink }}&description={{ .Title }}" target="_blank" title="{{ T "share" }} Pinterest">
|
||||||
<i class="fab fa-pinterest fa-fw"></i>
|
<i class="fab fa-pinterest fa-fw"></i>
|
||||||
</a>
|
</a>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- if or .Params.Share.YCombinator (and .Site.Params.Share.YCombinator (ne .Params.Share.YCombinator false)) -}}
|
|
||||||
<a href="//news.ycombinator.com/submitlink?u={{ .Permalink }}&description={{ .Title }}" target="_blank" title="Share on Hacker News">
|
{{- /* Share on Hacker News */ -}}
|
||||||
|
{{- if .Params.Share.Hackernews | default .Site.Params.Share.Hackernews | eq true -}}
|
||||||
|
<a href="//news.ycombinator.com/submitlink?u={{ .Permalink }}&description={{ .Title }}" target="_blank" title="{{ T "share" }} Hacker News">
|
||||||
<i class="fab fa-y-combinator fa-fw"></i>
|
<i class="fab fa-y-combinator fa-fw"></i>
|
||||||
</a>
|
</a>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- if or .Params.Share.Mix (and .Site.Params.Share.Mix (ne .Params.Share.Mix false)) -}}
|
|
||||||
<a href="//mix.com/add?url={{ .Permalink }}&description={{ .Title }}" target="_blank" title="Share on Mix">
|
{{- /* Share on Mix */ -}}
|
||||||
|
{{- if .Params.Share.Mix | default .Site.Params.Share.Mix | eq true -}}
|
||||||
|
<a href="//mix.com/add?url={{ .Permalink }}&description={{ .Title }}" target="_blank" title="{{ T "share" }} Mix">
|
||||||
<i class="fab fa-mix fa-fw"></i>
|
<i class="fab fa-mix fa-fw"></i>
|
||||||
</a>
|
</a>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- if or .Params.Share.Tumblr (and .Site.Params.Share.Tumblr (ne .Params.Share.Tumblr false)) -}}
|
|
||||||
<a href="//www.tumblr.com/widgets/share/tool?canonicalUrl={{ .Permalink }}&title={{ .Title }}" target="_blank" title="Share on Tumblr">
|
{{- /* Share on Tumblr */ -}}
|
||||||
|
{{- if .Params.Share.Tumblr | default .Site.Params.Share.Tumblr | eq true -}}
|
||||||
|
<a href="//www.tumblr.com/widgets/share/tool?canonicalUrl={{ .Permalink }}&title={{ .Title }}" target="_blank" title="{{ T "share" }} Tumblr">
|
||||||
<i class="fab fa-tumblr fa-fw"></i>
|
<i class="fab fa-tumblr fa-fw"></i>
|
||||||
</a>
|
</a>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- if or .Params.Share.VK (and .Site.Params.Share.VK (ne .Params.Share.VK false)) -}}
|
|
||||||
<a href="//vk.com/share.php?url={{ .Permalink }}&title={{ .Title }}" target="_blank" title="Share on VKontakte ">
|
{{- /* Share on VKontakte */ -}}
|
||||||
|
{{- if .Params.Share.VKontakte | default .Site.Params.Share.VKontakte | eq true -}}
|
||||||
|
<a href="//vk.com/share.php?url={{ .Permalink }}&title={{ .Title }}" target="_blank" title="{{ T "share" }} VKontakte ">
|
||||||
<i class="fab fa-vk fa-fw"></i>
|
<i class="fab fa-vk fa-fw"></i>
|
||||||
</a>
|
</a>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- if or .Params.Share.Weibo (and .Site.Params.Share.Weibo (ne .Params.Share.Weibo false)) -}}
|
|
||||||
<a href="//service.weibo.com/share/share.php?url={{ .Permalink }}&appkey=&title={{ .Title }}{{ with $.Params.featured_image }}&pic={{ . }}{{- end -}}" target="_blank" title="Share on Weibo">
|
{{- /* Share on Weibo */ -}}
|
||||||
|
{{- if .Params.Share.Weibo | default .Site.Params.Share.Weibo | eq true -}}
|
||||||
|
<a href="//service.weibo.com/share/share.php?url={{ .Permalink }}&appkey=&title={{ .Title }}{{ with $.Params.featured_image }}&pic={{ . }}{{- end -}}" target="_blank" title="{{ T "share" }} Weibo">
|
||||||
<i class="fab fa-weibo fa-fw"></i>
|
<i class="fab fa-weibo fa-fw"></i>
|
||||||
</a>
|
</a>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|||||||
@@ -1,143 +1,136 @@
|
|||||||
<!-- jQuery https://github.com/jquery/jquery -->
|
{{- /* jQuery https://github.com/jquery/jquery */ -}}
|
||||||
{{- $jquery := "" -}}
|
{{- $jquery := "" -}}
|
||||||
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.jquery_js -}}
|
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.jquery_js -}}
|
||||||
{{- $jquery = .Site.Params.cdn.jquery_js -}}
|
{{- $jquery = .Site.Params.cdn.jquery_js -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- $res := resources.Get "js/lib/jquery/jquery.slim.min.js" | resources.Minify -}}
|
{{- $res := resources.Get "js/lib/jquery/jquery.slim.min.js" -}}
|
||||||
{{- $jquery = printf "<script src=\"%s\"></script>" $res.RelPermalink -}}
|
{{- $jquery = printf "<script src=\"%s\"></script>" $res.RelPermalink -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
<!-- lazysizes https://github.com/aFarkas/lazysizes -->
|
|
||||||
|
{{- /* lazysizes https://github.com/aFarkas/lazysizes */ -}}
|
||||||
{{- $lazysizes := "" -}}
|
{{- $lazysizes := "" -}}
|
||||||
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.lazysizes_js -}}
|
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.lazysizes_js -}}
|
||||||
{{- $lazysizes = .Site.Params.cdn.lazysizes_js -}}
|
{{- $lazysizes = .Site.Params.cdn.lazysizes_js -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- $res := resources.Get "js/lib/lazysizes/lazysizes.min.js" | resources.Minify -}}
|
{{- $res := resources.Get "js/lib/lazysizes/lazysizes.min.js" -}}
|
||||||
{{- $lazysizes = printf "<script src=\"%s\"></script>" $res.RelPermalink -}}
|
{{- $lazysizes = printf "<script src=\"%s\"></script>" $res.RelPermalink -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
<!-- Smooth Scroll https://github.com/cferdinandi/smooth-scroll -->
|
|
||||||
|
{{- /* Smooth Scroll https://github.com/cferdinandi/smooth-scroll */ -}}
|
||||||
{{- $smooth_scroll := "" -}}
|
{{- $smooth_scroll := "" -}}
|
||||||
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.smooth_scroll_js -}}
|
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.smooth_scroll_js -}}
|
||||||
{{- $smooth_scroll = .Site.Params.cdn.smooth_scroll_js -}}
|
{{- $smooth_scroll = .Site.Params.cdn.smooth_scroll_js -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- $res := resources.Get "js/lib/smooth-scroll/smooth-scroll.polyfills.min.js" | resources.Minify -}}
|
{{- $res := resources.Get "js/lib/smooth-scroll/smooth-scroll.polyfills.min.js" -}}
|
||||||
{{- $smooth_scroll = printf "<script src=\"%s\"></script>" $res.RelPermalink -}}
|
{{- $smooth_scroll = printf "<script src=\"%s\"></script>" $res.RelPermalink -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- $smooth_scroll = delimit (slice $smooth_scroll "<script>window.scroll = new SmoothScroll('[data-scroll]', {speed: 300, speedAsDuration: true});</script>") "" -}}
|
{{- $smooth_scroll = delimit (slice $smooth_scroll "<script>window.scroll = new SmoothScroll('[data-scroll]', {speed: 300, speedAsDuration: true});</script>") "" -}}
|
||||||
<!-- KaTeX https://github.com/KaTeX/KaTeX -->
|
|
||||||
|
{{- /* KaTeX https://github.com/KaTeX/KaTeX */ -}}
|
||||||
{{- $katex_css := "" -}}
|
{{- $katex_css := "" -}}
|
||||||
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.katex_css -}}
|
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.katex_css -}}
|
||||||
{{- $katex_css = .Site.Params.cdn.katex_css -}}
|
{{- $katex_css = .Site.Params.cdn.katex_css -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- $res := resources.Get "css/lib/katex/katex.min.css" | resources.Minify -}}
|
{{- $res := resources.Get "css/lib/katex/katex.min.css" -}}
|
||||||
{{- $katex_css = printf "<link rel=\"stylesheet\" href=\"%s\">" $res.RelPermalink -}}
|
{{- $katex_css = printf "<link rel=\"stylesheet\" href=\"%s\">" $res.RelPermalink -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- $katex_js := "" -}}
|
{{- $katex_js := "" -}}
|
||||||
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.katex_js -}}
|
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.katex_js -}}
|
||||||
{{- $katex_js = .Site.Params.cdn.katex_js -}}
|
{{- $katex_js = .Site.Params.cdn.katex_js -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- $res := resources.Get "js/lib/katex/katex.min.js" | resources.Minify -}}
|
{{- $res := resources.Get "js/lib/katex/katex.min.js" -}}
|
||||||
{{- $katex_js = printf "<script src=\"%s\"></script>" $res.RelPermalink -}}
|
{{- $katex_js = printf "<script src=\"%s\"></script>" $res.RelPermalink -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- $katex_auto_render_js := "" -}}
|
{{- $katex_auto_render_js := "" -}}
|
||||||
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.katex_auto_render_js -}}
|
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.katex_auto_render_js -}}
|
||||||
{{- $katex_auto_render_js = .Site.Params.cdn.katex_auto_render_js -}}
|
{{- $katex_auto_render_js = .Site.Params.cdn.katex_auto_render_js -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- $res := resources.Get "js/lib/katex/auto-render.min.js" | resources.Minify -}}
|
{{- $res := resources.Get "js/lib/katex/auto-render.min.js" -}}
|
||||||
{{- $katex_auto_render_js = printf "<script defer src=\"%s\" onload=\"renderMathInElement(document.body);\"></script>" $res.RelPermalink -}}
|
{{- $katex_auto_render_js = printf "<script defer src=\"%s\" onload=\"renderMathInElement(document.body);\"></script>" $res.RelPermalink -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- $katex := delimit (slice $katex_css $katex_js $katex_auto_render_js) "" -}}
|
{{- $katex := delimit (slice $katex_css $katex_js $katex_auto_render_js) "" -}}
|
||||||
<!-- mermaid https://github.com/knsv/mermaid -->
|
|
||||||
|
{{- /* mermaid https://github.com/knsv/mermaid */ -}}
|
||||||
{{- $mermaid := "" -}}
|
{{- $mermaid := "" -}}
|
||||||
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.mermaid_js -}}
|
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.mermaid_js -}}
|
||||||
{{- $mermaid = .Site.Params.cdn.mermaid_js -}}
|
{{- $mermaid = .Site.Params.cdn.mermaid_js -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- $res := resources.Get "js/lib/mermaid/mermaid.min.js" | resources.Minify -}}
|
{{- $res := resources.Get "js/lib/mermaid/mermaid.min.js" -}}
|
||||||
{{- $mermaid = printf "<script src=\"%s\"></script>" $res.RelPermalink -}}
|
{{- $mermaid = printf "<script src=\"%s\"></script>" $res.RelPermalink -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- $mermaidInit := "<script>mermaid.initialize({startOnLoad: false, theme: null});</script>" -}}
|
{{- $mermaidInit := "<script>mermaid.initialize({startOnLoad: false, theme: null});</script>" -}}
|
||||||
{{- $mermaid = delimit (slice $mermaid $mermaidInit) "" -}}
|
{{- $mermaid = delimit (slice $mermaid $mermaidInit) "" -}}
|
||||||
<!-- ECharts https://github.com/apache/incubator-echarts -->
|
|
||||||
{{- $echarts_js := "" -}}
|
{{- /* TypeIt https://github.com/alexmacarthur/typeit */ -}}
|
||||||
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.echarts_js -}}
|
|
||||||
{{- $echarts_js = .Site.Params.cdn.echarts_js -}}
|
|
||||||
{{- else -}}
|
|
||||||
{{- $res := resources.Get "js/lib/echarts/echarts.min.js" | resources.Minify -}}
|
|
||||||
{{- $echarts_js = printf "<script src=\"%s\"></script>" $res.RelPermalink -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- $echarts_macarons_js := "" -}}
|
|
||||||
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.echarts_macarons_js -}}
|
|
||||||
{{- $echarts_macarons_js = .Site.Params.cdn.echarts_macarons_js -}}
|
|
||||||
{{- else -}}
|
|
||||||
{{- $res := resources.Get "js/lib/echarts/macarons.js" | resources.Minify -}}
|
|
||||||
{{- $echarts_macarons_js = printf "<script src=\"%s\"></script>" $res.RelPermalink -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- $echarts := delimit (slice $echarts_js $echarts_macarons_js) "" -}}
|
|
||||||
<!-- TypeIt https://github.com/alexmacarthur/typeit -->
|
|
||||||
{{- $typeit := "" -}}
|
{{- $typeit := "" -}}
|
||||||
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.typeit_js -}}
|
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.typeit_js -}}
|
||||||
{{- $typeit = .Site.Params.cdn.typeit_js -}}
|
{{- $typeit = .Site.Params.cdn.typeit_js -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- $res := resources.Get "js/lib/typeit/typeit.min.js" | resources.Minify -}}
|
{{- $res := resources.Get "js/lib/typeit/typeit.min.js" -}}
|
||||||
{{- $typeit = printf "<script src=\"%s\"></script>" $res.RelPermalink -}}
|
{{- $typeit = printf "<script src=\"%s\"></script>" $res.RelPermalink -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
<!-- jQuery.countdown https://github.com/hilios/jQuery.countdown -->
|
|
||||||
|
{{- /* jQuery.countdown https://github.com/hilios/jQuery.countdown */ -}}
|
||||||
{{- $countdown := "" -}}
|
{{- $countdown := "" -}}
|
||||||
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.jquery_countdown_js -}}
|
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.jquery_countdown_js -}}
|
||||||
{{- $countdown = .Site.Params.cdn.jquery_countdown_js -}}
|
{{- $countdown = .Site.Params.cdn.jquery_countdown_js -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- $res := resources.Get "js/lib/jquery-countdown/jquery.countdown.min.js" | resources.Minify -}}
|
{{- $res := resources.Get "js/lib/jquery-countdown/jquery.countdown.min.js" -}}
|
||||||
{{- $countdown = printf "<script src=\"%s\"></script>" $res.RelPermalink -}}
|
{{- $countdown = printf "<script src=\"%s\"></script>" $res.RelPermalink -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
<!-- APlayer https://github.com/MoePlayer/APlayer -->
|
|
||||||
|
{{- /* APlayer https://github.com/MoePlayer/APlayer */ -}}
|
||||||
{{- $aplayer_css := "" -}}
|
{{- $aplayer_css := "" -}}
|
||||||
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.aplayer_css -}}
|
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.aplayer_css -}}
|
||||||
{{- $aplayer_css = .Site.Params.cdn.aplayer_css -}}
|
{{- $aplayer_css = .Site.Params.cdn.aplayer_css -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- $res := resources.Get "css/lib/aplayer/APlayer.min.css" | resources.Minify -}}
|
{{- $res := resources.Get "css/lib/aplayer/APlayer.min.css" -}}
|
||||||
{{- $aplayer_css = printf "<link rel=\"stylesheet\" href=\"%s\">" $res.RelPermalink -}}
|
{{- $aplayer_css = printf "<link rel=\"stylesheet\" href=\"%s\">" $res.RelPermalink -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- $aplayer_js := "" -}}
|
{{- $aplayer_js := "" -}}
|
||||||
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.aplayer_js -}}
|
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.aplayer_js -}}
|
||||||
{{- $aplayer_js = .Site.Params.cdn.aplayer_js -}}
|
{{- $aplayer_js = .Site.Params.cdn.aplayer_js -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- $res := resources.Get "js/lib/aplayer/APlayer.min.js" | resources.Minify -}}
|
{{- $res := resources.Get "js/lib/aplayer/APlayer.min.js" -}}
|
||||||
{{- $aplayer_js = printf "<script src=\"%s\"></script>" $res.RelPermalink -}}
|
{{- $aplayer_js = printf "<script src=\"%s\"></script>" $res.RelPermalink -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- $aplayer := delimit (slice $aplayer_css $aplayer_js) "" -}}
|
{{- $aplayer := delimit (slice $aplayer_css $aplayer_js) "" -}}
|
||||||
<!-- MetingJS https://github.com/metowolf/MetingJS -->
|
|
||||||
|
{{- /* MetingJS https://github.com/metowolf/MetingJS */ -}}
|
||||||
{{- $meting := "" -}}
|
{{- $meting := "" -}}
|
||||||
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.meting_js -}}
|
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.meting_js -}}
|
||||||
{{- $meting = .Site.Params.cdn.meting_js -}}
|
{{- $meting = .Site.Params.cdn.meting_js -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- $res := resources.Get "js/lib/meting/Meting.min.js" | resources.Minify -}}
|
{{- $res := resources.Get "js/lib/meting/Meting.min.js" -}}
|
||||||
{{- $meting = printf "<script src=\"%s\"></script>" $res.RelPermalink -}}
|
{{- $meting = printf "<script src=\"%s\"></script>" $res.RelPermalink -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- /* ECharts https://github.com/apache/incubator-echarts */ -}}
|
||||||
|
{{- $echarts_js := "" -}}
|
||||||
|
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.echarts_js -}}
|
||||||
|
{{- $echarts_js = .Site.Params.cdn.echarts_js -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $res := resources.Get "js/lib/echarts/echarts.min.js" -}}
|
||||||
|
{{- $echarts_js = printf "<script src=\"%s\"></script>" $res.RelPermalink -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- $echarts_macarons_js := "" -}}
|
||||||
|
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.echarts_macarons_js -}}
|
||||||
|
{{- $echarts_macarons_js = .Site.Params.cdn.echarts_macarons_js -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $res := resources.Get "js/lib/echarts/macarons.js" | minify -}}
|
||||||
|
{{- $echarts_macarons_js = printf "<script src=\"%s\"></script>" $res.RelPermalink -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- $echarts := delimit (slice $echarts_js $echarts_macarons_js) "" -}}
|
||||||
|
|
||||||
{{- $jquery | safeHTML -}}
|
{{- $jquery | safeHTML -}}
|
||||||
{{- $lazysizes | safeHTML -}}
|
{{- $lazysizes | safeHTML -}}
|
||||||
{{- $smooth_scroll | safeHTML -}}
|
{{- $smooth_scroll | safeHTML -}}
|
||||||
|
|
||||||
{{- if .IsPage -}}
|
{{- if .IsPage -}}
|
||||||
{{/* dev feature */}}
|
|
||||||
{{- if .Params.dev -}}
|
|
||||||
{{- with .Scratch.Get "echartsMap" -}}
|
|
||||||
{{- $echarts | safeHTML -}}
|
|
||||||
<script>
|
|
||||||
window.echartsMap = {
|
|
||||||
{{- range $key, $var := . -}}
|
|
||||||
{{- $key }}: {{ $var | safeJS -}},
|
|
||||||
{{- end -}}
|
|
||||||
};
|
|
||||||
window.echartsArr=[];
|
|
||||||
</script>
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{/* dev feature */}}
|
|
||||||
|
|
||||||
{{- with .Scratch.Get "mermaidMap" -}}
|
{{- with .Scratch.Get "mermaidMap" -}}
|
||||||
{{- $mermaid | safeHTML -}}
|
{{- $mermaid | safeHTML -}}
|
||||||
<script>
|
<script>
|
||||||
window.mermaidMap = {{ . | jsonify | safeJS }};
|
{{- printf "window.mermaidMap=%s;" (jsonify .) | safeJS -}}
|
||||||
</script>
|
</script>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
@@ -153,26 +146,40 @@
|
|||||||
{{- with .Scratch.Get "countdownMap" -}}
|
{{- with .Scratch.Get "countdownMap" -}}
|
||||||
{{- $countdown | safeHTML -}}
|
{{- $countdown | safeHTML -}}
|
||||||
<script>
|
<script>
|
||||||
window.countdownMap = {{ . | jsonify | safeJS }};
|
{{- printf "window.countdownMap=%s;" (jsonify .) | safeJS -}}
|
||||||
</script>
|
</script>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- /* dev feature */ -}}
|
||||||
|
{{- if .Params.dev -}}
|
||||||
|
{{- with .Scratch.Get "echartsMap" -}}
|
||||||
|
{{- $echarts | safeHTML -}}
|
||||||
|
<script>
|
||||||
|
window.echartsMap = {
|
||||||
|
{ { - range $key, $var := .-} }
|
||||||
|
{ { - $key } }: { { $var | safeJS -} },
|
||||||
|
{ { - end -} }
|
||||||
|
};
|
||||||
|
window.echartsArr = [];
|
||||||
|
</script>
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- $typeitMap := .Scratch.Get "typeitMap" -}}
|
{{- with .Scratch.Get "typeitMap" -}}
|
||||||
{{- if $typeitMap -}}
|
|
||||||
{{- $typeit | safeHTML -}}
|
{{- $typeit | safeHTML -}}
|
||||||
{{- $typeitArr := slice -}}
|
{{- $typeitArr := slice -}}
|
||||||
{{- range $key, $val := $typeitMap -}}
|
{{- range $key, $val := . -}}
|
||||||
{{- $typeitArr = $typeitArr | append (slice $val) -}}
|
{{- $typeitArr = $typeitArr | append (slice $val) -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
<script>
|
<script>
|
||||||
window.typeitArr = {{ $typeitArr | jsonify | safeJS }};
|
{{- printf "window.typeitArr=%s;" (jsonify $typeitArr) | safeJS -}}
|
||||||
</script>
|
</script>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- $res := resources.Get "/js/blog.js" | resources.Minify -}}
|
{{- $res := resources.Get "/js/blog.js" | minify -}}
|
||||||
<script src="{{ $res.RelPermalink }}"></script>
|
<script src="{{ $res.RelPermalink }}"></script>
|
||||||
|
|
||||||
{{- if not .Site.IsServer -}}
|
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.GoogleAnalytics -}}
|
||||||
{{- template "_internal/google_analytics_async.html" . -}}
|
{{- template "_internal/google_analytics_async.html" . -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
{{- /* Home SEO */ -}}
|
||||||
{{- if .IsHome -}}
|
{{- if .IsHome -}}
|
||||||
<script type="application/ld+json">
|
<script type="application/ld+json">
|
||||||
{
|
{
|
||||||
@@ -25,7 +26,9 @@
|
|||||||
"name": "{{ .Site.Title }}"
|
"name": "{{ .Site.Title }}"
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
{{ else if .IsPage -}}
|
|
||||||
|
{{- /* Page SEO */ -}}
|
||||||
|
{{- else if .IsPage -}}
|
||||||
<script type="application/ld+json">
|
<script type="application/ld+json">
|
||||||
{
|
{
|
||||||
"@context": "http://schema.org",
|
"@context": "http://schema.org",
|
||||||
|
|||||||
@@ -1,31 +1,32 @@
|
|||||||
{{- define "title" }}{{ .Title }} | {{ .Site.Title }}{{ end -}}
|
{{- define "title" }}{{ .Title }} | {{ .Site.Title }}{{ end -}}
|
||||||
|
|
||||||
{{- define "content" -}}
|
{{- define "content" -}}
|
||||||
{{- $publish_date := .PublishDate.Format (.Site.Params.dateFormatToUse | default "2006-01-02") -}}
|
|
||||||
{{- $author := .Params.author | default .Site.Author.name -}}
|
|
||||||
{{- $author_link := .Params.author_link | default .Site.Author.link | default .Site.BaseURL -}}
|
|
||||||
|
|
||||||
<article class="page">
|
<article class="page">
|
||||||
|
{{- /* Title */ -}}
|
||||||
<h1 class="post-title animated flipInX">{{ .Title }}</h1>
|
<h1 class="post-title animated flipInX">{{ .Title }}</h1>
|
||||||
|
|
||||||
|
{{- /* Meta */ -}}
|
||||||
<div class="post-meta">
|
<div class="post-meta">
|
||||||
<div class="post-meta-main">
|
<div class="post-meta-main">
|
||||||
|
{{- $author := .Params.author | default .Site.Author.name -}}
|
||||||
|
{{- $author_link := .Params.author_link | default .Site.Author.link | default .Site.BaseURL -}}
|
||||||
<a class="author" href="{{ $author_link }}" rel="author" target="_blank">
|
<a class="author" href="{{ $author_link }}" rel="author" target="_blank">
|
||||||
<i class="fas fa-user-circle fa-fw"></i>{{ $author }}
|
<i class="fas fa-user-circle fa-fw"></i>{{ $author }}
|
||||||
</a>
|
</a>
|
||||||
{{- with .Params.categories -}}
|
{{- with .Params.categories -}}
|
||||||
<span class="post-category">
|
<span class="post-category">
|
||||||
{{- T "included" -}}
|
{{- T "included" -}}
|
||||||
{{- range . -}}
|
{{- range . -}}
|
||||||
{{- $name := . -}}
|
{{- $name := . -}}
|
||||||
{{- with $.Site.GetPage "taxonomy" (printf "categories/%s" $name) | default ($.Site.GetPage "taxonomy" (printf "categories/%s" ($name | urlize))) -}}
|
{{- with $.Site.GetPage "taxonomy" (printf "categories/%s" $name) | default ($.Site.GetPage "taxonomy" (printf "categories/%s" ($name | urlize))) -}}
|
||||||
<i class="far fa-folder fa-fw"></i><a href="{{ .Permalink }}">{{ $name | humanize }}</a>
|
<i class="far fa-folder fa-fw"></i><a href="{{ .Permalink }}">{{ $name | humanize }}</a>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
</span>
|
</span>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
</div>
|
</div>
|
||||||
<div class="post-meta-other">
|
<div class="post-meta-other">
|
||||||
|
{{- $publish_date := .PublishDate.Format (.Site.Params.dateFormatToUse | default "2006-01-02") -}}
|
||||||
<i class="far fa-calendar-alt fa-fw"></i><time datetime={{ $publish_date }}>{{ $publish_date }}</time>
|
<i class="far fa-calendar-alt fa-fw"></i><time datetime={{ $publish_date }}>{{ $publish_date }}</time>
|
||||||
<i class="fas fa-pencil-alt fa-fw"></i>{{ T "wordCount" .WordCount }}
|
<i class="fas fa-pencil-alt fa-fw"></i>{{ T "wordCount" .WordCount }}
|
||||||
<i class="far fa-clock fa-fw"></i>{{ T "readingTime" .ReadingTime }}
|
<i class="far fa-clock fa-fw"></i>{{ T "readingTime" .ReadingTime }}
|
||||||
@@ -37,12 +38,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{- /* Featured image */ -}}
|
||||||
{{- with .Params.featured_image -}}
|
{{- with .Params.featured_image -}}
|
||||||
<div class="post-featured-image">
|
<div class="post-featured-image">
|
||||||
{{- partial "image" . -}}
|
{{- partial "image" . -}}
|
||||||
</div>
|
</div>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- /* TOC */ -}}
|
||||||
{{- if or .Params.toc (and .Site.Params.toc (ne .Params.toc false)) -}}
|
{{- if or .Params.toc (and .Site.Params.toc (ne .Params.toc false)) -}}
|
||||||
<div class="post-toc" id="post-toc">
|
<div class="post-toc" id="post-toc">
|
||||||
<h2 class="post-toc-title">{{ T "toc" }}</h2>
|
<h2 class="post-toc-title">{{ T "toc" }}</h2>
|
||||||
@@ -68,12 +71,15 @@
|
|||||||
</div>
|
</div>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- /* Content */ -}}
|
||||||
<div class="post-content">
|
<div class="post-content">
|
||||||
{{- partial "hook/content.html" .Content | safeHTML -}}
|
{{- partial "hook/content.html" .Content | safeHTML -}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{- /* Footer */ -}}
|
||||||
{{- partial "post/footer.html" . -}}
|
{{- partial "post/footer.html" . -}}
|
||||||
|
|
||||||
|
{{- /* Comment */ -}}
|
||||||
<div class="post-comment">
|
<div class="post-comment">
|
||||||
{{- if ( .Params.comment | default true ) -}}
|
{{- if ( .Params.comment | default true ) -}}
|
||||||
{{- partial "comments.html" . -}}
|
{{- partial "comments.html" . -}}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
{{- define "content" -}}
|
{{- define "content" -}}
|
||||||
<div class="page archive">
|
<div class="page archive">
|
||||||
|
{{- /* Title */ -}}
|
||||||
<h2 class="post-title animated pulse faster">
|
<h2 class="post-title animated pulse faster">
|
||||||
{{- $taxonomy := .Data.Singular -}}
|
{{- $taxonomy := .Data.Singular -}}
|
||||||
{{- if eq $taxonomy "category" -}}
|
{{- if eq $taxonomy "category" -}}
|
||||||
@@ -15,6 +16,7 @@
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
{{- /* Paginate */ -}}
|
||||||
{{- range (.Paginate (.Pages.GroupByDate "2006")).PageGroups -}}
|
{{- range (.Paginate (.Pages.GroupByDate "2006")).PageGroups -}}
|
||||||
<h3>{{ .Key }}</h3>
|
<h3>{{ .Key }}</h3>
|
||||||
{{- range .Pages -}}
|
{{- range .Pages -}}
|
||||||
|
|||||||
@@ -8,11 +8,12 @@
|
|||||||
{{- $type := .Type -}}
|
{{- $type := .Type -}}
|
||||||
|
|
||||||
<div class="page archive">
|
<div class="page archive">
|
||||||
|
{{- /* Title */ -}}
|
||||||
<h2 class="post-title animated pulse faster">
|
<h2 class="post-title animated pulse faster">
|
||||||
{{- T "all" | humanize}}{{ T $taxonomies | default $taxonomies | humanize -}}
|
{{- T "all" | humanize}}{{ T $taxonomies | default $taxonomies | humanize -}}
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
<!-- Categories Page -->
|
{{- /* Categories Page */ -}}
|
||||||
{{- if eq $taxonomies "categories" -}}
|
{{- if eq $taxonomies "categories" -}}
|
||||||
<div class="categories-card">
|
<div class="categories-card">
|
||||||
{{- range $terms -}}
|
{{- range $terms -}}
|
||||||
@@ -44,14 +45,13 @@
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Tag Cloud Page -->
|
{{- /* Tag Cloud Page */ -}}
|
||||||
{{- else if eq $taxonomies "tags" -}}
|
{{- else if eq $taxonomies "tags" -}}
|
||||||
<div class="tag-cloud-tags">
|
<div class="tag-cloud-tags">
|
||||||
{{- range $.Site.Taxonomies.tags.ByCount -}}
|
{{- range $.Site.Taxonomies.tags.ByCount -}}
|
||||||
<a href="{{ .Page.Permalink }}"> {{ .Page.Title }} <small>({{ .Count }})</small></a>
|
<a href="{{ .Page.Permalink }}"> {{ .Page.Title }} <small>({{ .Count }})</small></a>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
</div>
|
</div>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
Reference in New Issue
Block a user