From 90184ca3e7049188709bb804119833a6bfd263d4 Mon Sep 17 00:00:00 2001
From: Dillon
Date: Wed, 15 Apr 2020 15:46:50 +0800
Subject: [PATCH] feat(search): add local search (#231)
* feat(search): add local search
* docs: add docs for search
---
README.md | 20 +-
README.zh-cn.md | 8 +-
archetypes/default.md | 1 +
assets/css/_core/_base.scss | 34 +-
assets/css/_core/_layout.scss | 8 -
assets/css/_core/_media.scss | 20 +-
assets/css/_mixin/_blur.scss | 5 +
assets/css/_mixin/_compatibility.scss | 69 +
assets/css/_mixin/_index.scss | 2 +
assets/css/_mixin/_link.scss | 4 +-
assets/css/_mixin/_summary.scss | 13 +-
assets/css/_page/_404.scss | 2 +-
assets/css/_page/_home.scss | 28 +-
assets/css/_page/_index.scss | 2 +
assets/css/_page/_single.scss | 49 +-
assets/css/_partial/_archive/_tags.scss | 13 +-
assets/css/_partial/_archive/_terms.scss | 9 +-
assets/css/_partial/_fixed-button.scss | 10 +-
assets/css/_partial/_footer.scss | 23 +-
assets/css/_partial/_header.scss | 408 +++-
assets/css/_partial/_mask.scss | 16 +
assets/css/_partial/_pagination.scss | 14 +-
assets/css/_partial/_single/_admonition.scss | 4 +-
assets/css/_partial/_single/_code.scss | 18 +-
assets/css/_partial/_single/_footer.scss | 23 +-
assets/css/_partial/_single/_instagram.scss | 2 +-
assets/css/_partial/_single/_toc.scss | 18 +-
assets/css/_variables.scss | 17 +-
assets/js/theme.min.js | 3 +-
assets/js/theme.min.js.map | 2 +-
assets/lib/VERSION | 9 +-
.../algoliasearch-lite.umd.min.js | 2 +
assets/lib/aplayer/dark.scss | 2 +-
assets/lib/autocomplete/autocomplete.min.js | 7 +
assets/lib/lunr/lunr.fr.js | 703 +++++++
assets/lib/lunr/lunr.min.js | 6 +
assets/lib/lunr/lunr.segmentit.js | 174 ++
assets/lib/lunr/lunr.stemmer.support.js | 304 +++
assets/lib/lunr/lunr.zh.js | 141 ++
assets/lib/mermaid/mermaid.scss | 2 +-
assets/lib/polyfill.yml | 8 +
assets/lib/smooth-scroll/smooth-scroll.min.js | 2 +
.../smooth-scroll.polyfills.min.js | 2 -
assets/lib/valine/valine.scss | 2 +-
exampleSite/config.toml | 53 +-
exampleSite/content/about.en.md | 13 +-
exampleSite/content/about.fr.md | 13 +-
exampleSite/content/about.zh-cn.md | 7 +-
.../posts/theme-documentation-basics.en.md | 87 +-
.../posts/theme-documentation-basics.fr.md | 87 +-
.../posts/theme-documentation-basics.zh-cn.md | 84 +-
.../posts/theme-documentation-content.en.md | 6 +
.../posts/theme-documentation-content.fr.md | 6 +
.../theme-documentation-content.zh-cn.md | 13 +-
...documentation-extended-shortcodes.zh-cn.md | 14 -
i18n/en.toml | 15 +
i18n/fr.toml | 23 +
i18n/zh-CN.toml | 23 +
layouts/404.html | 13 +-
layouts/_default/baseof.html | 21 +-
layouts/_default/single.html | 2 +-
layouts/_default/summary.html | 2 +-
layouts/index.json | 15 +
layouts/partials/assets.html | 253 +--
layouts/partials/comment.html | 218 +--
.../{single => function}/content.html | 2 +-
layouts/partials/function/id.html | 2 +-
layouts/partials/head/link.html | 31 +-
layouts/partials/header.html | 100 +-
layouts/partials/plugin/script.html | 24 +-
layouts/partials/plugin/stylesheet.html | 28 +-
layouts/posts/single.html | 19 +-
layouts/shortcodes/mapbox.html | 2 +-
package-lock.json | 1723 +++++++++++++++--
package.json | 24 +-
...s_90197bdac482216ecaaaae0fb88517c1.content | 3 -
...s_b8ba9a60a151126bfcde1421dc0b972d.content | 3 +
...css_b8ba9a60a151126bfcde1421dc0b972d.json} | 0
...s_4fddb88d50abca04f2e7ef77f0bb1c3b.content | 3 -
...scss_4fddb88d50abca04f2e7ef77f0bb1c3b.json | 1 -
...s_be0d6bec1a51ff037db8cc74d6ec1271.content | 3 +
...scss_be0d6bec1a51ff037db8cc74d6ec1271.json | 1 +
...s_43d09a0fb297c4cc88d4122515a2e889.content | 3 +
...scss_43d09a0fb297c4cc88d4122515a2e889.json | 1 +
...s_4fddb88d50abca04f2e7ef77f0bb1c3b.content | 3 -
...scss_4fddb88d50abca04f2e7ef77f0bb1c3b.json | 1 -
...s_4fddb88d50abca04f2e7ef77f0bb1c3b.content | 3 -
...scss_4fddb88d50abca04f2e7ef77f0bb1c3b.json | 1 -
...s_c443f4e76f09daefa6d3fafd13c88b9c.content | 3 +
...scss_c443f4e76f09daefa6d3fafd13c88b9c.json | 1 +
src/js/theme.js | 847 +++++---
src/lib/lunr.segmentit.js | 8 +
92 files changed, 4823 insertions(+), 1194 deletions(-)
create mode 100644 assets/css/_mixin/_blur.scss
create mode 100644 assets/css/_mixin/_compatibility.scss
create mode 100644 assets/css/_partial/_mask.scss
create mode 100644 assets/lib/algoliasearch/algoliasearch-lite.umd.min.js
create mode 100644 assets/lib/autocomplete/autocomplete.min.js
create mode 100644 assets/lib/lunr/lunr.fr.js
create mode 100644 assets/lib/lunr/lunr.min.js
create mode 100644 assets/lib/lunr/lunr.segmentit.js
create mode 100644 assets/lib/lunr/lunr.stemmer.support.js
create mode 100644 assets/lib/lunr/lunr.zh.js
create mode 100644 assets/lib/polyfill.yml
create mode 100644 assets/lib/smooth-scroll/smooth-scroll.min.js
delete mode 100755 assets/lib/smooth-scroll/smooth-scroll.polyfills.min.js
create mode 100644 layouts/index.json
rename layouts/partials/{single => function}/content.html (92%)
delete mode 100644 resources/_gen/assets/scss/css/style.template.scss_90197bdac482216ecaaaae0fb88517c1.content
create mode 100644 resources/_gen/assets/scss/css/style.template.scss_b8ba9a60a151126bfcde1421dc0b972d.content
rename resources/_gen/assets/scss/css/{style.template.scss_90197bdac482216ecaaaae0fb88517c1.json => style.template.scss_b8ba9a60a151126bfcde1421dc0b972d.json} (100%)
delete mode 100644 resources/_gen/assets/scss/lib/aplayer/dark.scss_4fddb88d50abca04f2e7ef77f0bb1c3b.content
delete mode 100644 resources/_gen/assets/scss/lib/aplayer/dark.scss_4fddb88d50abca04f2e7ef77f0bb1c3b.json
create mode 100644 resources/_gen/assets/scss/lib/aplayer/dark.scss_be0d6bec1a51ff037db8cc74d6ec1271.content
create mode 100644 resources/_gen/assets/scss/lib/aplayer/dark.scss_be0d6bec1a51ff037db8cc74d6ec1271.json
create mode 100644 resources/_gen/assets/scss/lib/mermaid/mermaid.scss_43d09a0fb297c4cc88d4122515a2e889.content
create mode 100644 resources/_gen/assets/scss/lib/mermaid/mermaid.scss_43d09a0fb297c4cc88d4122515a2e889.json
delete mode 100644 resources/_gen/assets/scss/lib/mermaid/mermaid.scss_4fddb88d50abca04f2e7ef77f0bb1c3b.content
delete mode 100644 resources/_gen/assets/scss/lib/mermaid/mermaid.scss_4fddb88d50abca04f2e7ef77f0bb1c3b.json
delete mode 100644 resources/_gen/assets/scss/lib/valine/valine.scss_4fddb88d50abca04f2e7ef77f0bb1c3b.content
delete mode 100644 resources/_gen/assets/scss/lib/valine/valine.scss_4fddb88d50abca04f2e7ef77f0bb1c3b.json
create mode 100644 resources/_gen/assets/scss/lib/valine/valine.scss_c443f4e76f09daefa6d3fafd13c88b9c.content
create mode 100644 resources/_gen/assets/scss/lib/valine/valine.scss_c443f4e76f09daefa6d3fafd13c88b9c.json
create mode 100644 src/lib/lunr.segmentit.js
diff --git a/README.md b/README.md
index 3e756c2e..bec20604 100644
--- a/README.md
+++ b/README.md
@@ -32,9 +32,10 @@ Compared to the original LeaveIt theme and the KeepIt theme, the LoveIt theme ha
* Some beautiful **CSS animations**
* Easy-to-use and self-expanding **table of contents**
* More **social links**, **share sites** and **comment system**
-* Extended markdown syntax for **[Font Awesome](https://fontawesome.com/) icons**
-* Extended markdown syntax for **ruby annotation**
-* Extended markdown syntax for **fraction**
+* **Search** supported by [Lunr.js](https://lunrjs.com/) or [algolia](https://www.algolia.com/)
+* Extended Markdown syntax for **[Font Awesome](https://fontawesome.com/) icons**
+* Extended Markdown syntax for **ruby annotation**
+* Extended Markdown syntax for **fraction**
* **Mathematical formula** supported by [KaTeX](https://katex.org/)
* **Diagram syntax** shortcode supported by [mermaid](https://github.com/knsv/mermaid)
* **Interactive data visualization** shortcode supported by [ECharts](https://echarts.apache.org/)
@@ -89,11 +90,12 @@ I hope you will LoveIt ❤️!
### Extended Features
+* **Search** supported by [Lunr.js](https://lunrjs.com/) or [algolia](https://www.algolia.com/)
* Automatically **highlighting** code
* **Images gallery** supported by [lightgallery.js](https://github.com/sachinchoolur/lightgallery.js)
-* Extended markdown syntax for **[Font Awesome](https://fontawesome.com/) icons**
-* Extended markdown syntax for **ruby annotation**
-* Extended markdown syntax for **fraction**
+* Extended Markdown syntax for **[Font Awesome](https://fontawesome.com/) icons**
+* Extended Markdown syntax for **ruby annotation**
+* Extended Markdown syntax for **fraction**
* **Mathematical formula** supported by [KaTeX](https://katex.org/)
* **Diagrams** shortcode supported by [mermaid](https://github.com/knsv/mermaid)
* **Interactive data visualization** shortcode supported by [ECharts](https://echarts.apache.org/)
@@ -128,9 +130,13 @@ Thanks to the authors of following resources included in the theme:
* [Font Awesome](https://fontawesome.com/)
* [Fork Awesome](https://forkaweso.me/Fork-Awesome/)
* [Animate.css](https://daneden.github.io/animate.css/)
+* [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll)
+* [autocomplete.js](https://github.com/algolia/autocomplete.js)
+* [Lunr.js](https://lunrjs.com/)
+* [algoliasearch](https://github.com/algolia/algoliasearch-client-javascript)
+* [Sharer.js](https://github.com/ellisonleao/sharer.js)
* [lazysizes](https://github.com/aFarkas/lazysizes)
* [lightgallery.js](https://github.com/sachinchoolur/lightgallery.js)
-* [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll)
* [TypeIt](https://typeitjs.com/)
* [KaTeX](https://katex.org/)
* [mermaid](https://github.com/knsv/mermaid)
diff --git a/README.zh-cn.md b/README.zh-cn.md
index b0f57320..539806a0 100644
--- a/README.zh-cn.md
+++ b/README.zh-cn.md
@@ -31,6 +31,7 @@
* 一些美观的 **CSS 动画**
* 易用和自动展开的**文章目录**
* 支持更多的**社交链接**、**网站分享**和**评论系统**
+* 支持基于 [Lunr.js](https://lunrjs.com/) 或 [algolia](https://www.algolia.com/) 的**搜索**
* 支持基于 **[Font Awesome](https://fontawesome.com/) 图标**的扩展 Markdown 语法
* 支持**上标注释**的扩展 Markdown 语法
* 支持**分数**的扩展 Markdown 语法
@@ -84,6 +85,7 @@
### 扩展功能
+* 支持基于 [Lunr.js](https://lunrjs.com/) 或 [algolia](https://www.algolia.com/) 的**搜索**
* 支持**代码高亮**
* 支持基于 [lightgallery.js](https://github.com/sachinchoolur/lightgallery.js) 的**图片画廊**
* 支持 **[Font Awesome](https://fontawesome.com/) 图标**的扩展 Markdown 语法
@@ -123,9 +125,13 @@ LoveIt 主题中用到了以下项目,感谢它们的作者:
* [Font Awesome](https://fontawesome.com/)
* [Fork Awesome](https://forkaweso.me/Fork-Awesome/)
* [Animate.css](https://daneden.github.io/animate.css/)
+* [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll)
+* [autocomplete.js](https://github.com/algolia/autocomplete.js)
+* [Lunr.js](https://lunrjs.com/)
+* [algoliasearch](https://github.com/algolia/algoliasearch-client-javascript)
+* [Sharer.js](https://github.com/ellisonleao/sharer.js)
* [lazysizes](https://github.com/aFarkas/lazysizes)
* [lightgallery.js](https://github.com/sachinchoolur/lightgallery.js)
-* [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll)
* [TypeIt](https://typeitjs.com/)
* [KaTeX](https://katex.org/)
* [mermaid](https://github.com/knsv/mermaid)
diff --git a/archetypes/default.md b/archetypes/default.md
index 6036b1f5..fc3ba0dd 100644
--- a/archetypes/default.md
+++ b/archetypes/default.md
@@ -12,6 +12,7 @@ license: ""
tags: []
categories: []
hiddenFromHomePage: false
+hiddenFromSearch: false
featuredImage: ""
featuredImagePreview: ""
diff --git a/assets/css/_core/_base.scss b/assets/css/_core/_base.scss
index 9bd8e342..de905e94 100644
--- a/assets/css/_core/_base.scss
+++ b/assets/css/_core/_base.scss
@@ -9,8 +9,8 @@ html {
/* scrollbar, only support webkit */
::-webkit-scrollbar {
- width: 6px;
- height: 6px;
+ width: .5rem;
+ height: .5rem;
}
::-webkit-scrollbar-thumb {
@@ -22,44 +22,26 @@ html {
}
::selection {
- background: $selection-color;
+ background-color: $selection-color;
- .dark-theme & {
- background: $selection-color-dark;
+ .dark & {
+ background-color: $selection-color-dark;
}
}
body {
- -webkit-font-smoothing: subpixel-antialiased;
background-color: $global-background-color;
color: $global-font-color;
overflow-wrap: break-word;
- &::before {
- content: "";
- background-repeat: no-repeat;
- background-position: center;
- opacity: 0.05;
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- z-index: -1;
- -webkit-filter: grayscale(100%);
- -moz-filter: grayscale(100%);
- -ms-filter: grayscale(100%);
- -o-filter: grayscale(100%);
- filter: grayscale(100%);
- filter: gray;
- }
-
- &.dark-theme {
+ &.dark {
color: $global-font-color-dark;
background-color: $global-background-color-dark;
}
}
+@import "../_partial/mask";
+
a {
text-decoration: none;
}
diff --git a/assets/css/_core/_layout.scss b/assets/css/_core/_layout.scss
index 03206e88..d2e92f76 100644
--- a/assets/css/_core/_layout.scss
+++ b/assets/css/_core/_layout.scss
@@ -14,11 +14,3 @@
}
}
}
-
-.footer {
- height: 2rem;
- width: 100%;
- text-align: center;
- line-height: 1.5rem;
- padding-top: 2rem;
-}
diff --git a/assets/css/_core/_media.scss b/assets/css/_core/_media.scss
index e2113a44..4d02c4e0 100644
--- a/assets/css/_core/_media.scss
+++ b/assets/css/_core/_media.scss
@@ -11,16 +11,16 @@
}
@media only screen and (max-width: 960px) {
- .page {
- max-width: 80%;
+ #toc-auto {
+ display: none;
+ }
- #toc-auto {
- display: none;
- }
+ #toc-static {
+ display: block;
+ }
- #toc-static {
- display: block;
- }
+ .page {
+ max-width: 80%;
}
}
@@ -33,6 +33,10 @@
display: block;
}
+ body.blur {
+ overflow: hidden;
+ }
+
.page {
max-width: 100%;
padding-top: $page-padding-top-mobile;
diff --git a/assets/css/_mixin/_blur.scss b/assets/css/_mixin/_blur.scss
new file mode 100644
index 00000000..d68ac171
--- /dev/null
+++ b/assets/css/_mixin/_blur.scss
@@ -0,0 +1,5 @@
+@mixin blur {
+ .blur & {
+ @include filter(blur(1.5px));
+ }
+}
diff --git a/assets/css/_mixin/_compatibility.scss b/assets/css/_mixin/_compatibility.scss
new file mode 100644
index 00000000..8e1e4d33
--- /dev/null
+++ b/assets/css/_mixin/_compatibility.scss
@@ -0,0 +1,69 @@
+@mixin border-radius($value) {
+ -webkit-border-radius: $value;
+ -moz-border-radius: $value;
+ border-radius: $value;
+}
+
+@mixin box-shadow($value) {
+ -webkit-box-shadow: $value;
+ box-shadow: $value;
+}
+
+@mixin transition($values...) {
+ -webkit-transition: $values;
+ -moz-transition: $values;
+ -o-transition: $values;
+ transition: $values;
+}
+
+@mixin transform($value) {
+ -webkit-transform: $value;
+ -moz-transform: $value;
+ -ms-transform: $value;
+ -o-transform: $value;
+ transform: $value;
+}
+
+@mixin filter($value) {
+ -webkit-filter: $value;
+ -moz-filter: $value;
+ -ms-filter: $value;
+ filter: $value;
+}
+
+@mixin flex($value) {
+ -webkit-flex: $value;
+ flex: $value;
+}
+
+@mixin box($orient) {
+ display: -moz-box;
+ display: -webkit-box;
+ display: box;
+
+ -moz-box-orient: $orient;
+ -webkit-box-orient: $orient;
+ box-orient: $orient;
+}
+
+@mixin placeholder($color) {
+ input::-webkit-input-placeholder{
+ color: $color;
+ }
+
+ input:-moz-placeholder{
+ color: $color;
+ }
+
+ input::-moz-placeholder{
+ color: $color;
+ }
+
+ input:-ms-input-placeholder{
+ color: $color;
+ }
+
+ input::placeholder {
+ color: $color;
+ }
+}
diff --git a/assets/css/_mixin/_index.scss b/assets/css/_mixin/_index.scss
index 34ffd188..63e1ab32 100644
--- a/assets/css/_mixin/_index.scss
+++ b/assets/css/_mixin/_index.scss
@@ -1,2 +1,4 @@
+@import "_compatibility";
@import "_link";
+@import "_blur";
@import "_summary";
diff --git a/assets/css/_mixin/_link.scss b/assets/css/_mixin/_link.scss
index 057949f6..1ee219a2 100644
--- a/assets/css/_mixin/_link.scss
+++ b/assets/css/_mixin/_link.scss
@@ -2,7 +2,7 @@
a {
color: if($light, $global-link-color, $single-link-color);
- .dark-theme & {
+ .dark & {
color: if($dark, $global-link-color-dark, $single-link-color-dark);
}
@@ -10,7 +10,7 @@
&:hover {
color: if($light, $global-link-hover-color, $single-link-hover-color);
- .dark-theme & {
+ .dark & {
color: if($dark, $global-link-hover-color-dark, $single-link-hover-color-dark);
}
}
diff --git a/assets/css/_mixin/_summary.scss b/assets/css/_mixin/_summary.scss
index 82b28dcc..904abfc3 100644
--- a/assets/css/_mixin/_summary.scss
+++ b/assets/css/_mixin/_summary.scss
@@ -5,7 +5,7 @@
color: $global-font-color;
border-bottom: 1px dashed $global-border-color;
- .dark-theme & {
+ .dark & {
color: $global-font-color-dark;
border-bottom: 1px dashed $global-border-color-dark;
}
@@ -33,10 +33,7 @@
}
.content {
- display: -moz-box;
- display: -webkit-box;
- -moz-box-orient: vertical;
- -webkit-box-orient: vertical;
+ @include box(vertical);
-webkit-line-clamp: 3;
margin-top: .3rem;
width: 100%;
@@ -45,7 +42,7 @@
overflow-wrap: break-word;
color: $global-font-secondary-color;
- .dark-theme & {
+ .dark & {
color: $global-font-secondary-color-dark;
}
@@ -76,7 +73,7 @@
margin-right: .3125rem;
color: $global-link-color;
- .dark-theme & {
+ .dark & {
color: $global-link-color-dark;
}
}
@@ -93,7 +90,7 @@
@include link(true, true);
b, strong {
- .dark-theme & {
+ .dark & {
color: $global-font-secondary-color-dark;
}
}
diff --git a/assets/css/_page/_404.scss b/assets/css/_page/_404.scss
index 4b2790f0..774c7dd2 100644
--- a/assets/css/_page/_404.scss
+++ b/assets/css/_page/_404.scss
@@ -1,6 +1,6 @@
#content-404 {
font-size: 1.8rem;
line-height: 3rem;
- transform: translateY(30vh);
+ @include transform(translateY(30vh));
text-align: center;
}
diff --git a/assets/css/_page/_home.scss b/assets/css/_page/_home.scss
index 3e74babb..247b3831 100644
--- a/assets/css/_page/_home.scss
+++ b/assets/css/_page/_home.scss
@@ -1,13 +1,8 @@
-/** Home **/
@mixin page-home($profile, $posts) {
.home {
@if $profile {
.home-profile {
- -webkit-transform: translateY(if($posts, 0, 16vh));
- -moz-transform: translateY(if($posts, 0, 16vh));
- -ms-transform: translateY(if($posts, 0, 16vh));
- -o-transform: translateY(if($posts, 0, 16vh));
- transform: translateY(if($posts, 0, 16vh));
+ @include transform(translateY(if($posts, 0, 16vh)));
padding: if($posts, 2rem, 0) 0 .5rem;
text-align: center;
@@ -15,27 +10,18 @@
padding: 0.6rem;
img {
+ display: inline-block;
width: if($posts, 6rem, 8rem);
height: auto;
- display: inline-block;
- -webkit-border-radius: 100%;
- border-radius: 100%;
- -webkit-box-shadow: 0 0 0 0.3618em rgba(0, 0, 0, 0.05);
- box-shadow: 0 0 0 0.3618em rgba(0, 0, 0, 0.05);
margin: 0 auto;
- -webkit-transition: all ease 0.4s;
- -moz-transition: all ease 0.4s;
- -o-transition: all ease 0.4s;
- transition: all ease 0.4s;
+ @include border-radius(100%);
+ @include box-shadow(0 0 0 .3618em rgba(0, 0, 0, .05));
+ @include transition(all 0.4s ease);
cursor: pointer;
&:hover {
position: relative;
- -webkit-transform: translateY(-0.75rem);
- -moz-transform: translateY(-0.75rem);
- -ms-transform: translateY(-0.75rem);
- -o-transform: translateY(-0.75rem);
- transform: translateY(-0.75rem);
+ @include transform(translateY(-.75rem));
cursor: pointer;
}
}
@@ -70,7 +56,7 @@
padding: .4rem;
color: $global-font-secondary-color;
- .dark-theme & {
+ .dark & {
color: $global-font-secondary-color-dark;
}
}
diff --git a/assets/css/_page/_index.scss b/assets/css/_page/_index.scss
index ed901f89..c4b46366 100644
--- a/assets/css/_page/_index.scss
+++ b/assets/css/_page/_index.scss
@@ -4,6 +4,8 @@
max-width: 60%;
margin: 0 auto;
padding-top: $page-padding-top-desktop;
+
+ @include blur;
}
@import "_single";
diff --git a/assets/css/_page/_single.scss b/assets/css/_page/_single.scss
index 3f75ac4a..043687ae 100644
--- a/assets/css/_page/_single.scss
+++ b/assets/css/_page/_single.scss
@@ -1,4 +1,5 @@
-/** Single **/
+@import "../_partial/_single/toc";
+
.single {
.single-title {
margin: 1rem 0 .5rem;
@@ -22,7 +23,7 @@
display: inline-block;
}
- .dark-theme & {
+ .dark & {
color: $global-font-secondary-color-dark;
}
@@ -45,8 +46,6 @@
}
}
- @import "../_partial/_single/toc";
-
.content {
> h2 {
font-size: 1.5rem;
@@ -88,7 +87,7 @@
font-weight: bold;
margin: 1.2rem 0;
- .dark-theme & {
+ .dark & {
font-weight: bolder;
}
}
@@ -103,7 +102,7 @@
margin-right: .3125rem;
color: $single-link-color;
- .dark-theme & {
+ .dark & {
color: $single-link-color-dark;
}
}
@@ -120,7 +119,7 @@
b, strong {
font-weight: bold;
- .dark-theme & {
+ .dark & {
color: #ddd;
}
}
@@ -131,12 +130,12 @@
word-break: break-all;
word-break: break-word;
- .dark-theme & b, .dark-theme & strong {
+ .dark & b, .dark & strong {
color: $single-link-color-dark;
}
}
- .dark-theme a:hover b, .dark-theme a:hover strong {
+ .dark a:hover b, .dark a:hover strong {
color: $single-link-hover-color-dark;
}
@@ -153,7 +152,7 @@
color: $global-font-secondary-color;
}
- .dark-theme & {
+ .dark & {
background: $code-background-color-dark;
rt {
@@ -168,7 +167,7 @@
&::-webkit-scrollbar {
background-color: $table-background-color;
- .dark-theme & {
+ .dark & {
background-color: $table-background-color-dark;
}
}
@@ -181,14 +180,14 @@
background: $table-background-color;
border-collapse: collapse;
- .dark-theme & {
+ .dark & {
background: $table-background-color-dark;
}
thead {
background: $table-thead-color;
- .dark-theme & {
+ .dark & {
background-color: $table-thead-color-dark;
}
}
@@ -197,7 +196,7 @@
padding: .3rem 1rem;
border: 1px double $global-border-color;
- .dark-theme & {
+ .dark & {
border: 1px double $global-border-color-dark;
}
}
@@ -249,14 +248,14 @@
position: absolute;
top: 0em;
left: 50%;
- transform: translate(-50%, -50%);
+ @include transform(translate(-50%, -50%));
width: 3rem;
height: 2rem;
font: 6em/1.08em 'PT Sans', sans-serif;
color: $single-link-color;
text-align: center;
- .dark-theme & {
+ .dark & {
color: $single-link-color-dark;
}
}
@@ -268,12 +267,12 @@
font-size: 0.875em;
color: $single-link-color;
- .dark-theme & {
+ .dark & {
color: $single-link-color-dark;
}
}
- .dark-theme & {
+ .dark & {
border-color: $global-border-color-dark;
}
}
@@ -281,7 +280,7 @@
.footnotes {
color: $global-font-secondary-color;
- .dark-theme & {
+ .dark & {
color: $global-font-secondary-color-dark;
}
@@ -304,7 +303,7 @@
border-top: 1px dashed $global-border-color;
border-bottom: none;
- .dark-theme & {
+ .dark & {
border-top: 1px dashed $global-border-color-dark;
}
}
@@ -315,19 +314,17 @@
background-color: $global-background-color;
border: 1px solid $global-border-color;
border-bottom-color: $global-border-color;
- border-radius: 3px;
- -webkit-box-shadow: inset 0 -1px 0 $global-border-color;
- box-shadow: inset 0 -1px 0 $global-border-color;
+ @include border-radius(3px);
+ @include box-shadow(inset 0 -1px 0 $global-border-color);
font-size: .8rem;
font-family: $code-font-family;
color: $code-color;
- .dark-theme & {
+ .dark & {
background-color: $global-background-color-dark;
border: 1px solid $global-border-color-dark;
border-bottom-color: $global-border-color-dark;
- -webkit-box-shadow: inset 0 -1px 0 $global-border-color-dark;
- box-shadow: inset 0 -1px 0 $global-border-color-dark;
+ @include box-shadow(inset 0 -1px 0 $global-border-color-dark);
color: $code-color-dark;
}
}
diff --git a/assets/css/_partial/_archive/_tags.scss b/assets/css/_partial/_archive/_tags.scss
index 17d5eec1..21d9055c 100644
--- a/assets/css/_partial/_archive/_tags.scss
+++ b/assets/css/_partial/_archive/_tags.scss
@@ -8,25 +8,18 @@
position: relative;
margin: 5px 10px;
overflow-wrap: break-word;
- -webkit-transition: all ease-out .3s;
- -moz-transition: all ease-out .3s;
- -o-transition: all ease-out .3s;
- transition: all ease-out .3s;
+ @include transition(all ease-out 0.3s);
&:active,
&:focus,
&:hover {
- -webkit-transform: scale(1.2);
- -moz-transform: scale(1.2);
- -ms-transform: scale(1.2);
- -o-transform: scale(1.2);
- transform: scale(1.2);
+ @include transform(scale(1.2));
}
sup {
color: $global-font-secondary-color;
- .dark-theme & {
+ .dark & {
color: $global-font-secondary-color-dark;
}
}
diff --git a/assets/css/_partial/_archive/_terms.scss b/assets/css/_partial/_archive/_terms.scss
index 0288256d..d47b1a3a 100644
--- a/assets/css/_partial/_archive/_terms.scss
+++ b/assets/css/_partial/_archive/_terms.scss
@@ -44,7 +44,6 @@
.archive-item-link {
display: inline-block;
- text-decoration: none;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@@ -55,15 +54,11 @@
background-color: transparent;
}
- .dark-theme & {
+ .dark & {
color: $global-link-color-dark;
- text-decoration: none;
- transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease;
&:hover {
color: $global-link-hover-color-dark;
- text-decoration: none;
- transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}
}
}
@@ -73,7 +68,7 @@
text-align: right;
color: $global-font-secondary-color;
- .dark-theme & {
+ .dark & {
color: $global-font-secondary-color-dark;
}
}
diff --git a/assets/css/_partial/_fixed-button.scss b/assets/css/_partial/_fixed-button.scss
index b5ec515e..531c3e1b 100644
--- a/assets/css/_partial/_fixed-button.scss
+++ b/assets/css/_partial/_fixed-button.scss
@@ -13,7 +13,9 @@
color: $global-font-secondary-color;
background: $header-background-color;
border: 1px solid darken($global-border-color, 10%);
- border-radius: 2rem;
+ @include border-radius(2rem);
+
+ @include blur;
&:hover, &:active {
color: $global-font-color;
@@ -24,7 +26,7 @@
outline: none;
}
- .dark-theme & {
+ .dark & {
color: $global-font-secondary-color-dark;
background: $header-background-color-dark;
border-color: darken($global-border-color-dark, 10%);
@@ -35,11 +37,11 @@
}
}
-#top-button {
+#back-to-top {
display: block;
bottom: 1.5rem;
}
-#comment-button {
+#view-comments {
bottom: 4.5rem;
}
diff --git a/assets/css/_partial/_footer.scss b/assets/css/_partial/_footer.scss
index fe17fe02..8e51b361 100644
--- a/assets/css/_partial/_footer.scss
+++ b/assets/css/_partial/_footer.scss
@@ -1,12 +1,21 @@
-/**Footer**/
-.copyright {
- font-size: .875rem;
+footer {
+ height: 2rem;
+ width: 100%;
+ text-align: center;
+ line-height: 1.5rem;
+ padding-top: 2rem;
- .copyright-line {
- width: 100%;
+ .copyright {
+ font-size: .875rem;
- .icp-br {
- display: none;
+ .copyright-line {
+ width: 100%;
+
+ .icp-br {
+ display: none;
+ }
}
}
+
+ @include blur;
}
diff --git a/assets/css/_partial/_header.scss b/assets/css/_partial/_header.scss
index 6a1bbb23..74fe1d0b 100644
--- a/assets/css/_partial/_header.scss
+++ b/assets/css/_partial/_header.scss
@@ -1,73 +1,169 @@
header {
width: 100%;
- z-index: 100;
+ z-index: 150;
background-color: $header-background-color;
- .dark-theme & {
+ .dark & {
background-color: $header-background-color-dark;
}
+}
- .header-title {
- font-family: $header-title-font-family;
- font-weight: bold;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
+.header-wrapper {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ box-sizing: border-box;
+ width: 100%;
+}
+
+.header-title {
+ font-family: $header-title-font-family;
+ font-weight: bold;
+ margin-right: .5rem;
+ min-width: 10%;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ @include flex(10);
+}
+
+.menu .menu-item {
+ position: relative;
+}
+
+.language-select {
+ position: absolute;
+ opacity: 0;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 100%;
+
+ &:hover {
+ cursor: pointer;
}
+}
+
+.search {
+ position: relative;
+
+ input {
+ color: transparent;
+ box-sizing: border-box;
+ height: 2.5rem;
+ width: 2.5rem;
+ @include border-radius(.5rem);
+ border: none;
+ outline: none;
+ background-color: $header-background-color;
+ vertical-align: baseline !important;
+ @include transition(width 0.3s ease 0s);
- .menu .menu-item {
- position: relative;
+ .dark & {
+ background-color: $header-background-color-dark;
+ }
}
- .language-select {
+ @include placeholder(transparent);
+
+ .search-button {
+ margin: 0;
position: absolute;
- opacity: 0;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
+ left: auto;
+ right: 1rem;
+ }
- &:hover {
- cursor: pointer;
- }
+ .search-toggle {
+ left: .5rem;
+ right: auto;
+ }
+
+ .search-loading {
+ display: none;
}
- .theme-switch i {
- -webkit-transform: rotate(225deg);
- -moz-transform: rotate(225deg);
- -ms-transform: rotate(225deg);
- -o-transform: rotate(225deg);
- transform: rotate(225deg);
+ .search-clear {
+ display: none;
+ }
+
+ .open &, &.mobile {
+ input {
+ color: $global-font-color;
+ background-color: $search-background-color;
+ padding: 0 2rem 0 2rem;
+ }
+
+ .dark & {
+ input {
+ color: $global-font-color-dark;
+ background-color: $search-background-color-dark;
+ }
+
+ @include placeholder($global-font-secondary-color-dark);
+ }
+
+ @include placeholder($global-font-secondary-color);
+
+ .search-button {
+ color: $global-font-secondary-color;
+
+ .dark & {
+ color: $global-font-secondary-color-dark;
+ }
+ }
+
+ .search-clear:hover {
+ color: #ff6b6b;
+ }
+
+ .search-toggle:hover {
+ cursor: default;
+ }
}
}
+.theme-switch i {
+ @include transform(rotate(225deg));
+}
+
#header-desktop {
display: block;
position: $header-position-desktop;
- height: $header-height-desktop;
- line-height: $header-height-desktop;
+ height: $header-height;
+ line-height: $header-height;
.header-wrapper {
- width: auto;
- text-align: center;
- padding: 0 3%;
- display: flex;
- justify-content: space-between;
+ padding: 0 1.5rem;
.header-title {
font-size: $header-title-font-size-desktop;
- max-width: 30%;
}
.menu {
overflow: hidden;
white-space: nowrap;
+ .menu-inner {
+ float: right;
+ }
+
.menu-item {
margin: 0 .5rem;
- &.theme-switch {
- margin: 0 .3rem;
+ &.delimiter {
+ border-left: 1.5px solid $global-font-color;
+
+ .dark & {
+ border-left-color: $global-border-color-dark;
+ }
+ }
+
+ &.language {
+ margin-right: 0;
+ }
+
+ &.search {
+ margin: 0 -.5rem 0 0;
}
}
@@ -75,58 +171,56 @@ header {
font-weight: 900;
color: $header-hover-color;
- .dark-theme & {
+ .dark & {
color: $header-hover-color-dark;
}
}
}
}
+
+ &.open .header-wrapper .menu .menu-item.search {
+ margin: 0 .25rem 0 .5rem;
+
+ input {
+ width: 24rem;
+ }
+ }
}
#header-mobile {
display: none;
position: $header-position-mobile;
- height: $header-height-mobile;
- line-height: $header-height-mobile;
+ height: $header-height;
+ line-height: $header-height;
- .header-wrapper {
+ .header-container {
padding: 0;
margin: 0;
- transition: all 0.3s ease 0s;
- .header-container {
- display: flex;
- justify-content: space-between;
- align-items: center;
- width: 100%;
+ .header-wrapper {
+ padding: 0 1rem;
font-size: 1.125rem;
- padding-right: 1rem;
- padding-left: 1rem;
- box-sizing: border-box;
+ @include transition(margin-top 0.3s ease 0s);
.header-title {
- max-width: 80%;
font-size: $header-title-font-size-mobile;
+ max-width: 80%;
}
.menu-toggle {
- cursor: pointer;
line-height: 4rem;
+ cursor: pointer;
+ @include transition(width 0.3s ease 0s);
span {
display: block;
background: $global-font-color;
width: 1.5rem;
height: 2px;
- -webkit-border-radius: 3px;
- -moz-border-radius: 3px;
- border-radius: 3px;
- -webkit-transition: .1s margin .1s, .1s transform;
- -moz-transition: .1s margin .1s, .1s transform;
- -o-transition: .1s margin .1s, .1s transform;
- transition: .1s margin .1s, .1s transform;
-
- .dark-theme & {
+ @include border-radius(3px);
+ @include transition(all 0.3s ease-in-out);
+
+ .dark & {
background: $global-font-color-dark;
}
}
@@ -140,19 +234,8 @@ header {
}
&.active {
- span {
- -webkit-transition: .1s margin, .1s transform .1s;
- -moz-transition: .1s margin, .1s transform .1s;
- -o-transition: .1s margin, .1s transform .1s;
- transition: .1s margin, .1s transform .1s;
- }
-
span:nth-child(1) {
- -webkit-transform: rotate(45deg) translate(.4rem, .5rem);
- -moz-transform: rotate(45deg) translate(.4rem, .5rem);
- -ms-transform: rotate(45deg) translate(.4rem, .5rem);
- -o-transform: rotate(45deg) translate(.4rem, .5rem);
- transform: rotate(45deg) translate(.4rem, .5rem);
+ @include transform(rotate(45deg) translate(.4rem, .5rem));
}
span:nth-child(2) {
@@ -160,11 +243,7 @@ header {
}
span:nth-child(3) {
- -moz-transform: rotate(-45deg) translate(.4rem, -.5rem);
- -ms-transform: rotate(-45deg) translate(.4rem, -.5rem);
- -webkit-transform: rotate(-45deg) translate(.4rem, -.5rem);
- -o-transform: rotate(-45deg) translate(.4rem, -.5rem);
- transform: rotate(-45deg) translate(.4rem, -.5rem);
+ @include transform(rotate(-45deg) translate(.4rem, -.5rem));
}
}
}
@@ -172,12 +251,35 @@ header {
.menu {
text-align: center;
- background: $global-background-color;
- border-top: 2px solid $global-font-color;
+ background: $header-background-color;
+ border-top: 2px solid $global-border-color;
display: none;
- box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1), 0px 4px 8px rgba(0, 0, 0, 0.1);
+ padding-top: .5rem;
+ @include box-shadow(0 .125rem .25rem rgba(0, 0, 0, .1));
- a {
+ .search-wrapper {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ box-sizing: border-box;
+ padding: ($header-height - 2.5rem) / 2 1rem;
+ line-height: 2.5rem;
+ }
+
+ .search {
+ flex-grow: 10;
+
+ .algolia-autocomplete, input {
+ width: 100%;
+ }
+ }
+
+ .search-cancel {
+ display: none;
+ margin-left: .75rem;
+ }
+
+ .menu-item {
display: block;
line-height: 2.5rem;
}
@@ -186,9 +288,149 @@ header {
display: block;
}
- .dark-theme & {
- background: $global-background-color-dark;
- border-top: 2px solid $global-font-color-dark;
+ .dark & {
+ background: $header-background-color-dark;
+ border-top-color: $global-border-color-dark;
+ }
+ }
+ }
+
+ &.open {
+ .header-wrapper {
+ margin-top: -$header-height;
+ }
+
+ .menu {
+ padding-top: 0;
+ border-top: none;
+
+ .menu-item {
+ display: none;
+ }
+
+ .search-cancel {
+ display: inline;
+ }
+ }
+ }
+}
+
+.search-dropdown {
+ position: fixed;
+ z-index: 200;
+ top: $header-height;
+ @include box-shadow(0 .125rem .25rem rgba(0, 0, 0, .1));
+
+ &.desktop {
+ right: 1.5rem;
+ width: 30rem;
+ }
+
+ &.mobile {
+ right: 0;
+ width: 100%;
+ }
+
+ .dropdown-menu {
+ right: 0 !important;
+ background-color: $global-background-color;
+
+ .dark & {
+ background-color: $global-background-color-dark;
+ }
+
+ .suggestions {
+ overflow-y: auto;
+ max-height: calc(100vh - #{$header-height});
+
+ .suggestion {
+ padding: .75rem 1rem;
+
+ .suggestion-title {
+ display: inline-block;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ font-size: 1rem;
+ font-weight: bold;
+ max-width: 75%;
+ }
+
+ .suggestion-date {
+ font-size: .875rem;
+ float: right;
+ text-align: right;
+ color: $global-font-secondary-color;
+
+ .dark & {
+ color: $global-font-secondary-color-dark;
+ }
+ }
+
+ .suggestion-context {
+ line-height: 1.25rem;
+ @include box(vertical);
+ -webkit-line-clamp: 2;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ overflow-wrap: break-word;
+ color: $global-font-secondary-color;
+
+ .dark & {
+ color: $global-font-secondary-color-dark;
+ }
+ }
+
+ em {
+ font-style: normal;
+ background-color: $selection-color;
+
+ .dark & {
+ background-color: $selection-color-dark;
+ }
+ }
+
+ &.cursor {
+ background: darken($code-background-color, 5%);
+
+ .dark & {
+ background: lighten($code-background-color-dark, 5%);
+ }
+ }
+
+ &:hover {
+ cursor: pointer;
+ }
+ }
+ }
+
+ .search-empty {
+ padding: 1rem;
+ text-align: center;
+
+ .search-query {
+ font-weight: bold;
+
+ .dark & {
+ color: #ddd;
+ }
+ }
+ }
+
+ .search-footer {
+ padding: .5rem 1rem;
+ float: right;
+ font-size: .8rem;
+ color: $global-font-secondary-color;
+
+ .dark {
+ color: $global-font-secondary-color-dark;
+ }
+
+ @include link(false, false);
+
+ a {
+ font-size: 1rem;
}
}
}
diff --git a/assets/css/_partial/_mask.scss b/assets/css/_partial/_mask.scss
new file mode 100644
index 00000000..65b5734a
--- /dev/null
+++ b/assets/css/_partial/_mask.scss
@@ -0,0 +1,16 @@
+#mask {
+ background-repeat: no-repeat;
+ background-position: center;
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ z-index: -1;
+ background-color: rgba(0, 0, 0, 0);
+
+ .blur & {
+ z-index: 100;
+ background-color: rgba(0, 0, 0, .25);
+ }
+}
diff --git a/assets/css/_partial/_pagination.scss b/assets/css/_partial/_pagination.scss
index 78e5030c..4e9a4858 100644
--- a/assets/css/_partial/_pagination.scss
+++ b/assets/css/_partial/_pagination.scss
@@ -1,4 +1,3 @@
-/** pagination **/
.pagination {
display: flex;
flex-direction: row;
@@ -9,14 +8,13 @@
padding: 1rem 0 0;
a {
- -webkit-font-smoothing: antialiased;
font-size: .8rem;
color: #bfbfbf;
letter-spacing: .1rem;
font-weight: 700;
padding: 5px 5px;
text-decoration: none;
- transition: 0.3s;
+ @include transition(0.3s);
}
li {
@@ -34,7 +32,7 @@
color: $pagination-link-hover-color;
}
- .dark-theme &:hover a {
+ .dark &:hover a {
color: $pagination-link-hover-color-dark;
}
@@ -45,12 +43,12 @@
width: 0;
height: 3px;
background: $pagination-link-hover-color;
- transition: 0.3s;
+ @include transition(0.3s);
bottom: 0px;
}
- .dark-theme &:before,
- .dark-theme &:after {
+ .dark &:before,
+ .dark &:after {
background: $pagination-link-hover-color-dark;
}
@@ -80,7 +78,7 @@
color: $pagination-link-hover-color;
}
- .dark-theme & a {
+ .dark & a {
color: $pagination-link-hover-color-dark;
}
diff --git a/assets/css/_partial/_single/_admonition.scss b/assets/css/_partial/_single/_admonition.scss
index 69a79133..0eb6c606 100644
--- a/assets/css/_partial/_single/_admonition.scss
+++ b/assets/css/_partial/_single/_admonition.scss
@@ -68,7 +68,7 @@ details.admonition {
right: .5rem;
color: $global-font-color;
- .dark-theme & {
+ .dark & {
color: $global-font-color-dark;
}
}
@@ -77,6 +77,6 @@ details.admonition {
details.admonition[open] {
i.details {
- transform: rotate(180deg);
+ @include transform(rotate(180deg));
}
}
diff --git a/assets/css/_partial/_single/_code.scss b/assets/css/_partial/_single/_code.scss
index 60289da1..c58d8e94 100644
--- a/assets/css/_partial/_single/_code.scss
+++ b/assets/css/_partial/_single/_code.scss
@@ -4,7 +4,7 @@ code {
padding: .2rem .4rem;
color: $code-color;
- .dark-theme & {
+ .dark & {
color: $code-color-dark;
}
}
@@ -12,7 +12,7 @@ code {
code, pre, .highlight table, .highlight tr, .highlight td {
background: $code-background-color;
- .dark-theme & {
+ .dark & {
background: $code-background-color-dark;
}
}
@@ -27,14 +27,14 @@ code, pre, .highlight table, .highlight tr, .highlight td {
&::before {
display: block;
- padding: .4rem;
+ padding: .2rem .4rem;
font-family: $global-font-family;
font-weight: bold;
color: $code-info-color;
background: darken($code-background-color, 3%);
content: 'Code';
- .dark-theme & {
+ .dark & {
color: $code-info-color-dark;
background: darken($code-background-color-dark, 3%);
}
@@ -56,7 +56,7 @@ code, pre, .highlight table, .highlight tr, .highlight td {
display: block;
background-color: darken($code-background-color, 5%);
- .dark-theme & {
+ .dark & {
background-color: darken($code-background-color-dark, 5%);
}
}
@@ -66,7 +66,7 @@ code, pre, .highlight table, .highlight tr, .highlight td {
.ln, .lnt {
color: $global-font-secondary-color;
- .dark-theme & {
+ .dark & {
color: $global-font-secondary-color-dark;
}
}
@@ -89,7 +89,7 @@ code, pre, .highlight table, .highlight tr, .highlight td {
.#{$class} { color: $color; }
}
- .dark-theme & {
+ .dark & {
@each $class, $color in $code-highlight-color-map-dark {
.#{$class} { color: $color; }
}
@@ -119,12 +119,12 @@ code, pre, .highlight table, .highlight tr, .highlight td {
@include link(false, false);
- .dark-theme & {
+ .dark & {
background-color: darken($code-background-color-dark, 5%);
}
}
- .dark-theme & {
+ .dark & {
// imported from https://github.com/lonekorean/gist-syntax-themes/blob/master/stylesheets/one-dark.css
.highlight {
background: #141414;
diff --git a/assets/css/_partial/_single/_footer.scss b/assets/css/_partial/_single/_footer.scss
index 3cadeff2..b02fa643 100644
--- a/assets/css/_partial/_single/_footer.scss
+++ b/assets/css/_partial/_single/_footer.scss
@@ -5,7 +5,7 @@
border-bottom: 1px solid $global-border-color;
padding: 1rem 0 0.3rem;
- .dark-theme & {
+ .dark & {
border-bottom: 1px solid $global-border-color-dark;
}
@@ -17,7 +17,7 @@
font-size: 0.8em;
color: $global-font-secondary-color;
- .dark-theme & {
+ .dark & {
color: $global-font-secondary-color-dark;
}
@@ -28,7 +28,7 @@
font-size: 0.8em;
color: $global-font-secondary-color;
- .dark-theme & {
+ .dark & {
color: $global-font-secondary-color-dark;
}
}
@@ -68,10 +68,7 @@
& a.next {
font-size: 1rem;
font-weight: 600;
- -webkit-transition: all ease-out .3s;
- -moz-transition: all ease-out .3s;
- -o-transition: all ease-out .3s;
- transition: all ease-out .3s;
+ @include transition(all 0.3s ease-out);
}
& a.prev {
@@ -79,11 +76,7 @@
}
& a.prev:hover {
- -webkit-transform: translateX(-4px);
- -moz-transform: translateX(-4px);
- -ms-transform: translateX(-4px);
- -o-transform: translateX(-4px);
- transform: translateX(-4px);
+ @include transform(translateX(-4px));
}
& a.next {
@@ -91,11 +84,7 @@
}
& a.next:hover {
- -webkit-transform: translateX(4px);
- -moz-transform: translateX(4px);
- -ms-transform: translateX(4px);
- -o-transform: translateX(4px);
- transform: translateX(4px);
+ @include transform(translateX(4px));
}
}
}
diff --git a/assets/css/_partial/_single/_instagram.scss b/assets/css/_partial/_single/_instagram.scss
index 49c08867..0a41417d 100644
--- a/assets/css/_partial/_single/_instagram.scss
+++ b/assets/css/_partial/_single/_instagram.scss
@@ -1,5 +1,5 @@
iframe.instagram-media {
- .dark-theme & {
+ .dark & {
border: none !important;
}
}
diff --git a/assets/css/_partial/_single/_toc.scss b/assets/css/_partial/_single/_toc.scss
index df15b8c4..139a5b3f 100644
--- a/assets/css/_partial/_single/_toc.scss
+++ b/assets/css/_partial/_single/_toc.scss
@@ -9,7 +9,9 @@
top: if($header-normal-mode-desktop, 5rem, 10rem);
left: 10000px;
- .dark-theme & {
+ @include blur;
+
+ .dark & {
border-left: 1px solid $global-border-color-dark;
}
@@ -39,7 +41,7 @@
margin-right: .5rem;
color: $single-link-color;
- .dark-theme & {
+ .dark & {
color: $single-link-color-dark;
}
}
@@ -58,14 +60,14 @@
font-weight: bold;
color: $single-link-color;
- .dark-theme & {
+ .dark & {
color: $single-link-color-dark;
}
&::before {
color: $single-link-hover-color;
- .dark-theme & {
+ .dark & {
color: $single-link-hover-color-dark;
}
}
@@ -82,7 +84,7 @@
list-style: none;
background: darken($code-background-color, 3%);
- .dark-theme & {
+ .dark & {
background: darken($code-background-color-dark, 3%);
}
@@ -111,7 +113,7 @@
details[open] {
i.details {
- transform: rotate(180deg);
+ @include transform(rotate(180deg));
}
}
@@ -131,7 +133,7 @@
}
}
- .dark-theme & {
+ .dark & {
background-color: $code-background-color-dark;
}
}
@@ -153,7 +155,7 @@
color: $global-font-secondary-color;
}
- .dark-theme & {
+ .dark & {
background: $code-background-color-dark;
rt {
diff --git a/assets/css/_variables.scss b/assets/css/_variables.scss
index 2bfe3033..2049aa2d 100644
--- a/assets/css/_variables.scss
+++ b/assets/css/_variables.scss
@@ -30,7 +30,7 @@ $global-link-hover-color: #2d96bd !default;
$global-link-hover-color-dark: #fff !default;
// Color of the border
-$global-border-color: #dcdcdc !default;
+$global-border-color: #cacaca !default;
$global-border-color-dark: #4a4b50 !default;
// ========== Global ========== //
@@ -44,14 +44,13 @@ $scrollbar-hover-color: #a9a9b3 !default;
// ========== Selection ========== //
// Color of the selected text
-$selection-color: rgba(38, 139, 211, 0.2) !default;
-$selection-color-dark: rgba(38, 139, 211, 0.3) !default;
+$selection-color: rgba(53, 166, 247, 0.25) !default;
+$selection-color-dark: rgba(50, 112, 194, 0.4) !default;
// ========== Selection ========== //
// ========== Header ========== //
// Height of the header
-$header-height-desktop: 3.5rem !default;
-$header-height-mobile: 3.5rem !default;
+$header-height: 3.5rem !default;
// Color of the header background
$header-background-color: #f8f8f8 !default;
@@ -68,12 +67,16 @@ $header-position-desktop: if($header-normal-mode-desktop, static, fixed) !defaul
$header-position-mobile: if($header-normal-mode-mobile, static, fixed) !default;
// Top of the page padding
-$page-padding-top-desktop: if($header-normal-mode-desktop, 0, $header-height-desktop) !default;
-$page-padding-top-mobile: if($header-normal-mode-mobile, 0, $header-height-mobile) !default;
+$page-padding-top-desktop: if($header-normal-mode-desktop, 0, $header-height) !default;
+$page-padding-top-mobile: if($header-normal-mode-mobile, 0, $header-height) !default;
// Color of the hover header item
$header-hover-color: #161209 !default;
$header-hover-color-dark: #fff !default;
+
+// Color of the search background
+$search-background-color: #e9e9e9 !default;
+$search-background-color-dark: #363636 !default;
// ========== Header ========== //
// ========== Single Content ========== //
diff --git a/assets/js/theme.min.js b/assets/js/theme.min.js
index 6950908b..b5f2e50a 100644
--- a/assets/js/theme.min.js
+++ b/assets/js/theme.min.js
@@ -1,3 +1,4 @@
-"use strict";function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d .chroma"),function(a){var b=a.querySelectorAll("pre.chroma > code"),c=b[b.length-1],d=c?c.className.toLowerCase():"";a.className+=" "+d}),this.util.forEach(document.querySelectorAll(".highlight > pre.chroma"),function(a){var b=document.createElement("div");b.className=a.className;var c=document.createElement("table");b.appendChild(c);var d=document.createElement("tbody");c.appendChild(d);var e=document.createElement("tr");d.appendChild(e);var f=document.createElement("td");e.appendChild(f),a.parentElement.replaceChild(b,a),f.appendChild(a)})}},{key:"initTable",value:function initTable(){this.util.forEach(document.querySelectorAll(".content table"),function(a){var b=document.createElement("div");b.className="table-wrapper",a.parentElement.replaceChild(b,a),b.appendChild(a)})}},{key:"initHeaderLink",value:function initHeaderLink(){for(var a=1;6>=a;a++)this.util.forEach(document.querySelectorAll(".page.single .content > h"+a),function(a){a.classList.add("headerLink"),a.innerHTML="").concat(a.innerHTML)})}},{key:"initToc",value:function initToc(){var a=this,b=document.getElementById("TableOfContents");if(null!==b)if(this.util.isTocStatic()){var k=document.getElementById("toc-content-static");b.parentElement!==k&&(b.parentElement.removeChild(b),k.appendChild(b)),this._tocOnScroll&&this.scrollEventSet.delete(this._tocOnScroll)}else{var l=document.getElementById("toc-content-auto");b.parentElement!==l&&(b.parentElement.removeChild(b),l.appendChild(b));var c=document.getElementById("toc-auto"),d=document.getElementsByClassName("page")[0];c.style.maxWidth="".concat(d.getBoundingClientRect().left-20,"px"),this._tocLinks=this._tocLinks||b.getElementsByTagName("a"),this._tocLis=this._tocLis||b.getElementsByTagName("li"),this._headerLinks=this._headerLinks||document.getElementsByClassName("headerLink");var e="normal"!==window.desktopHeaderMode,f=document.getElementById("header-desktop").offsetHeight,g=20+(e?f:0),h=c.offsetTop,j=h-g+(e?0:f);this._tocOnScroll=this._tocOnScroll||function(){var k=document.getElementById("post-footer").offsetTop,l=k-c.getBoundingClientRect().height,m=l-g+(e?0:f),n=d.getBoundingClientRect();a.newScrollTopm?(c.style.position="absolute",c.style.top="".concat(l,"px"),c.style.left="".concat(n.width+20,"px")):(c.style.position="fixed",c.style.top="".concat(g,"px"),c.style.left="".concat(n.left+n.width+20,"px")),a.util.forEach(a._tocLinks,function(a){a.classList.remove("active")}),a.util.forEach(a._tocLis,function(a){a.classList.remove("has-active")});for(var o=20+(e?f:0),p=a._headerLinks.length-1,q=0;qo||r<=o&&s>o){p=q;break}}if(-1!==p){a._tocLinks[p].classList.add("active");for(var t=a._tocLinks[p].parentElement;t!==b;)t.classList.add("has-active"),t=t.parentElement.parentElement}},this._tocOnScroll(),this.scrollEventSet.add(this._tocOnScroll)}}},{key:"initMermaid",value:function initMermaid(){var a=document.getElementsByClassName("mermaid");a.length&&(mermaid.initialize({startOnLoad:!1,theme:"null"}),this.util.forEach(a,function(a){mermaid.mermaidAPI.render("svg-"+a.id,window.contentMap[a.id],function(b){a.innerHTML=b},a)}))}},{key:"initEcharts",value:function initEcharts(){var a=this;this._echartsOnSwitchTheme=this._echartsOnSwitchTheme||function(){a._echartsArr=a._echartsArr||[];for(var b=0;be?(a.classList.remove("fadeInDown"),a.classList.add("fadeOutUp")):c<-e&&(a.classList.remove("fadeOutUp"),a.classList.add("fadeInDown"))}),20e?(d.classList.remove("fadeIn"),d.classList.add("fadeOut")):c<-e&&(d.style.display="block",d.classList.remove("fadeOut"),d.classList.add("fadeIn")):d.style.display="none",a._scrollTimeout||(a._scrollTimeout=window.setTimeout(function(){a._scrollTimeout=null;var b=!0,c=!1,d=void 0;try{for(var e,f,g=a.scrollEventSet[Symbol.iterator]();!(b=(e=g.next()).done);b=!0)f=e.value,f()}catch(a){c=!0,d=a}finally{try{b||null==g.return||g.return()}finally{if(c)throw d}}},10)),a.oldScrollTop=a.newScrollTop},!1)}},{key:"onResize",value:function onResize(){var a=this;window.addEventListener("resize",function(){a._resizeTimeout||(a._resizeTimeout=window.setTimeout(function(){a._resizeTimeout=null;var b=!0,c=!1,d=void 0;try{for(var e,f,g=a.resizeEventSet[Symbol.iterator]();!(b=(e=g.next()).done);b=!0)f=e.value,f()}catch(a){c=!0,d=a}finally{try{b||null==g.return||g.return()}finally{if(c)throw d}}a.initMenuMobile(),a.initToc(),a.initSmoothScroll(),a.initMermaid()},100))},!1)}},{key:"init",value:function init(){this.initMenuMobile(),this.initSwitchTheme(),this.initHighlight(),this.initTable(),this.initHeaderLink(),this.initMermaid(),this.initEcharts(),this.initMapbox(),this.initTypeit(),this.initToc(),this.initSmoothScroll(),this.onScroll(),this.onResize()}}]),b}(),c=function(){var a=new b;a.init()};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",c,!1):c()})();
+"use strict";function _objectDestructuringEmpty(a){if(null==a)throw new TypeError("Cannot destructure undefined")}function _createForOfIteratorHelper(a){if("undefined"==typeof Symbol||null==a[Symbol.iterator]){if(Array.isArray(a)||(a=_unsupportedIterableToArray(a))){var b=0,c=function(){};return{s:c,n:function n(){return b>=a.length?{done:!0}:{done:!1,value:a[b++]}},e:function e(a){throw a},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var d,e,f=!0,g=!1;return{s:function s(){d=a[Symbol.iterator]()},n:function n(){var a=d.next();return f=a.done,a},e:function e(a){g=!0,e=a},f:function f(){try{f||null==d.return||d.return()}finally{if(g)throw e}}}}function _unsupportedIterableToArray(a,b){if(a){if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(c):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c$1"),g=g.replace(new RegExp("(".concat(a,")"),"gi"),"$1")}),{uri:e.uri,title:f,date:e.date,context:g}})};a._index?e(f()):fetch(b.lunrIndexURL).then(function(a){return a.json()}).then(function(c){var d={};a._index=lunr(function(){var a=this;b.lunrLanguageCode&&this.use(lunr[b.lunrLanguageCode]),this.ref("uri"),this.field("title",{boost:50}),this.field("tags",{boost:20}),this.field("description",{boost:10}),this.field("content",{boost:5}),this.metadataWhitelist=["position"],c.forEach(function(b){d[b.uri]=b,a.add(b)})}),a._indexData=d,e(f())}).catch(function(a){console.error(a),e([])})}else"algolia"===b.type&&(h.style.display="inline",i.style.display="none",a._algoliaIndex=a._algoliaIndex||algoliasearch(b.algoliaAppID,b.algoliaSearchKey).initIndex(b.algoliaIndex),a._algoliaIndex.search(c,{offset:0,length:12,attributesToHighlight:["title","content"]}).then(function(a){var b=a.hits;e(b.map(function(a){var b=a.uri,c=a.date,d=a._highlightResult,e=d.title,f=d.content;return{uri:b,title:e.value,date:c,context:f.value}}))}).catch(function(a){console.error(a),e([])}))},templates:{suggestion:function suggestion(a){var b=a.title,c=a.date,d=a.context;return"".concat(b,"").concat(c,"
").concat(d,"
")},empty:function empty(a){var c=a.query;return"".concat(b.noResultsFound,": \"").concat(c,"\"
")},footer:function footer(a){_objectDestructuringEmpty(a);var c="algolia"===b.type?{searchType:"algolia",icon:"",href:"https://www.algolia.com/"}:{searchType:"Lunr.js",icon:"",href:"https://lunrjs.com/"},d=c.searchType,e=c.icon,f=c.href;return"")}}});e.on("autocomplete:selected",function(a,b){window.location.assign(b.uri)}),c?a._searchMobile=e:a._searchDesktop=e};if(b.lunrSegmentitURL&&!document.getElementById("lunr-segmentit")){var k=document.createElement("script");k.id="lunr-segmentit",k.type="text/javascript",k.src=b.lunrSegmentitURL,k.async=!0,k.readyState?k.onreadystatechange=function(){("loaded"==k.readyState||"complete"==k.readyState)&&(k.onreadystatechange=null,j())}:k.onload=function(){j()},document.body.appendChild(k)}else j()}}},{key:"initLightGallery",value:function initLightGallery(){this.config.lightGallery&&lightGallery(document.getElementById("content"),this.config.lightGallery)}},{key:"initHighlight",value:function initHighlight(){this.util.forEach(document.querySelectorAll(".highlight > .chroma"),function(a){var b=a.querySelectorAll("pre.chroma > code"),c=b[b.length-1],d=c?c.className.toLowerCase():"";a.className+=" "+d}),this.util.forEach(document.querySelectorAll(".highlight > pre.chroma"),function(a){var b=document.createElement("div");b.className=a.className;var c=document.createElement("table");b.appendChild(c);var d=document.createElement("tbody");c.appendChild(d);var e=document.createElement("tr");d.appendChild(e);var f=document.createElement("td");e.appendChild(f),a.parentElement.replaceChild(b,a),f.appendChild(a)})}},{key:"initTable",value:function initTable(){this.util.forEach(document.querySelectorAll(".content table"),function(a){var b=document.createElement("div");b.className="table-wrapper",a.parentElement.replaceChild(b,a),b.appendChild(a)})}},{key:"initHeaderLink",value:function initHeaderLink(){for(var a=1;6>=a;a++)this.util.forEach(document.querySelectorAll(".page.single .content > h"+a),function(a){a.classList.add("headerLink"),a.innerHTML="").concat(a.innerHTML)})}},{key:"initToc",value:function initToc(){var a=this,b=document.getElementById("TableOfContents");if(null!==b)if(this.util.isTocStatic()){var o=document.getElementById("toc-content-static");b.parentElement!==o&&(b.parentElement.removeChild(b),o.appendChild(b)),this._tocOnScroll&&this.scrollEventSet.delete(this._tocOnScroll)}else{var p=document.getElementById("toc-content-auto");b.parentElement!==p&&(b.parentElement.removeChild(b),p.appendChild(b));var c=document.getElementById("toc-auto"),d=document.getElementsByClassName("page")[0],e=d.getBoundingClientRect();c.style.left="".concat(e.left+e.width+20,"px"),c.style.maxWidth="".concat(d.getBoundingClientRect().left-20,"px");var f=b.getElementsByTagName("a"),g=b.getElementsByTagName("li"),h=document.getElementsByClassName("headerLink"),j="normal"!==this.config.desktopHeaderMode,k=document.getElementById("header-desktop").offsetHeight,l=20+(j?k:0),m=c.offsetTop,n=m-l+(j?0:k);this._tocOnScroll=this._tocOnScroll||function(){var d=document.getElementById("post-footer").offsetTop,e=d-c.getBoundingClientRect().height,o=e-l+(j?0:k);a.newScrollTopo?(c.style.position="absolute",c.style.top="".concat(e,"px")):(c.style.position="fixed",c.style.top="".concat(l,"px")),a.util.forEach(f,function(a){a.classList.remove("active")}),a.util.forEach(g,function(a){a.classList.remove("has-active")});for(var p=20+(j?k:0),q=h.length-1,r=0;rp||s<=p&&t>p){q=r;break}}if(-1!==q){f[q].classList.add("active");for(var u=f[q].parentElement;u!==b;)u.classList.add("has-active"),u=u.parentElement.parentElement}},this._tocOnScroll(),this.scrollEventSet.add(this._tocOnScroll)}}},{key:"initMath",value:function initMath(){this.config.math&&renderMathInElement(document.body,this.config.math)}},{key:"initMermaid",value:function initMermaid(){var a=this,b=document.getElementsByClassName("mermaid");b.length&&(mermaid.initialize({startOnLoad:!1,theme:"null"}),this.util.forEach(b,function(b){mermaid.mermaidAPI.render("svg-"+b.id,a.contentData[b.id],function(a){b.innerHTML=a},b)}))}},{key:"initEcharts",value:function initEcharts(){var a=this;this._echartsOnSwitchTheme=this._echartsOnSwitchTheme||function(){a._echartsArr=a._echartsArr||[];for(var b=0;bd?(a.classList.remove("fadeInDown"),a.classList.add("fadeOutUp")):e<-d&&(a.classList.remove("fadeOutUp"),a.classList.add("fadeInDown"))}),a.newScrollTop>d?e>d?(c.classList.remove("fadeIn"),c.classList.add("fadeOut")):e<-d&&(c.style.display="block",c.classList.remove("fadeOut"),c.classList.add("fadeIn")):c.style.display="none";var f,g=_createForOfIteratorHelper(a.scrollEventSet);try{for(g.s();!(f=g.n()).done;){var h=f.value;h()}}catch(a){g.e(a)}finally{g.f()}a.oldScrollTop=a.newScrollTop},!1)}},{key:"onResize",value:function onResize(){var a=this;window.addEventListener("resize",function(){a._resizeTimeout||(a._resizeTimeout=window.setTimeout(function(){a._resizeTimeout=null;var b,c=_createForOfIteratorHelper(a.resizeEventSet);try{for(c.s();!(b=c.n()).done;){var d=b.value;d()}}catch(a){c.e(a)}finally{c.f()}a.initToc(),a.initSmoothScroll(),a.initMermaid(),a.initSearch()},100))},!1)}},{key:"onClickMask",value:function onClickMask(){var a=this;document.getElementById("mask").addEventListener("click",function(){var b,c=_createForOfIteratorHelper(a.clickMaskEventSet);try{for(c.s();!(b=c.n()).done;){var d=b.value;d()}}catch(a){c.e(a)}finally{c.f()}document.body.classList.remove("blur")},!1)}},{key:"init",value:function init(){this.initMenuMobile(),this.initSwitchTheme(),this.initSearch(),this.initLightGallery(),this.initHighlight(),this.initTable(),this.initHeaderLink(),this.initMath(),this.initMermaid(),this.initEcharts(),this.initMapbox(),this.initTypeit(),this.initToc(),this.initComment(),this.initSmoothScroll(),this.onScroll(),this.onResize(),this.onClickMask()}}]),a}(),themeInit=function(){var a=new Theme;a.init()};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",themeInit,!1):themeInit();
//# sourceMappingURL=theme.min.js.map
\ No newline at end of file
diff --git a/assets/js/theme.min.js.map b/assets/js/theme.min.js.map
index 4418e166..4e0629f0 100644
--- a/assets/js/theme.min.js.map
+++ b/assets/js/theme.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["../../src/js/theme.js"],"names":[],"mappings":"+YAAA,CAAC,UAAM,CACH,aADG,GAGG,CAAA,CAHH,2HAIS,CAJT,CAImB,CAJnB,CAI4B,CACvB,CAAQ,CAAG,CAAQ,EAAI,EADA,CAEvB,IAAK,GAAI,CAAA,CAAC,CAAG,CAAb,CAAgB,CAAC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C,UAAM,CAC/B,CAAI,CAAC,cAD0B,GAEhC,CAAI,CAAC,cAAL,CAAsB,MAAM,CAAC,UAAP,CAAkB,UAAM,CAC1C,CAAI,CAAC,cAAL,CAAsB,IADoB,4BAE1C,UAAS,CAAT,GAAkB,CAAI,CAAC,cAAvB,gDAAS,CAAT,SAAuC,CAAK,EAFF,mFAG1C,CAAI,CAAC,cAAL,EAH0C,CAI1C,CAAI,CAAC,OAAL,EAJ0C,CAK1C,CAAI,CAAC,gBAAL,EAL0C,CAM1C,CAAI,CAAC,WAAL,EACH,CAPqB,CAOnB,GAPmB,CAFU,CAWvC,CAXD,IAYH,CAnWF,mCAqWQ,CACH,KAAK,cAAL,EADG,CAEH,KAAK,eAAL,EAFG,CAGH,KAAK,aAAL,EAHG,CAIH,KAAK,SAAL,EAJG,CAKH,KAAK,cAAL,EALG,CAMH,KAAK,WAAL,EANG,CAOH,KAAK,WAAL,EAPG,CAQH,KAAK,UAAL,EARG,CASH,KAAK,UAAL,EATG,CAUH,KAAK,OAAL,EAVG,CAWH,KAAK,gBAAL,EAXG,CAaH,KAAK,QAAL,EAbG,CAcH,KAAK,QAAL,EACH,CApXF,SAuXG,CAAS,CAAG,UAAM,CACpB,GAAM,CAAA,CAAK,CAAG,GAAI,CAAA,CAAlB,CACA,CAAK,CAAC,IAAN,EACH,CA1XE,CA4XyB,SAAxB,GAAA,QAAQ,CAAC,UA5XV,CA+XC,QAAQ,CAAC,gBAAT,CAA0B,kBAA1B,CAA8C,CAA9C,IA/XD,CA6XC,CAAS,EAIhB,CAjYD,G","file":"theme.min.js","sourcesContent":["(() => {\n 'use strict';\n\n class Util {\n forEach(elements, handler) {\n elements = elements || [];\n for (let i = 0; i < elements.length; i++) {\n handler(elements[i]);\n }\n }\n\n getScrollTop() {\n return (document.documentElement && document.documentElement.scrollTop) || document.body.scrollTop;\n }\n\n isMobile() {\n return window.matchMedia('only screen and (max-width: 680px)').matches;\n }\n\n isTocStatic() {\n return window.matchMedia('only screen and (max-width: 960px)').matches;\n }\n }\n\n class Theme {\n constructor() {\n this.util = new Util();\n this.newScrollTop = this.util.getScrollTop();\n this.oldScrollTop = this.newScrollTop;\n this.scrollEventSet = new Set();\n this.resizeEventSet = new Set();\n this.switchThemeEventSet = new Set();\n }\n\n initMenuMobile() {\n const menuToggleMobile = document.getElementById('menu-toggle-mobile');\n const menuMobile = document.getElementById('menu-mobile');\n this._menuMobileOnScroll = this._menuMobileOnScroll || (() => {\n menuToggleMobile.classList.remove('active');\n menuMobile.classList.remove('active');\n });\n if (this.util.isMobile()) {\n menuToggleMobile.onclick = () => {\n menuToggleMobile.classList.toggle('active');\n menuMobile.classList.toggle('active');\n };\n this.scrollEventSet.add(this._menuMobileOnScroll);\n } else {\n this.scrollEventSet.delete(this._menuMobileOnScroll);\n }\n }\n\n initSwitchTheme() {\n this.util.forEach(document.getElementsByClassName('theme-switch'), (button) => {\n button.onclick = () => {\n document.body.classList.toggle('dark-theme');\n window.isDark = !window.isDark;\n window.localStorage && window.localStorage.setItem('theme', window.isDark ? 'dark' : 'light');\n for (let event of this.switchThemeEventSet) event();\n };\n });\n }\n\n initHighlight() {\n this.util.forEach(document.querySelectorAll('.highlight > .chroma'), (block) => {\n const codes = block.querySelectorAll('pre.chroma > code');\n const code = codes[codes.length - 1];\n const lang = code ? code.className.toLowerCase() : '';\n block.className += ' ' + lang;\n });\n this.util.forEach(document.querySelectorAll('.highlight > pre.chroma'), (block) => {\n const chroma = document.createElement('div');\n chroma.className = block.className;\n const table = document.createElement('table');\n chroma.appendChild(table);\n const tbody = document.createElement('tbody');\n table.appendChild(tbody);\n const tr = document.createElement('tr');\n tbody.appendChild(tr);\n const td = document.createElement('td');\n tr.appendChild(td);\n block.parentElement.replaceChild(chroma, block);\n td.appendChild(block);\n });\n }\n\n initTable() {\n this.util.forEach(document.querySelectorAll('.content table'), (table) => {\n const wrapper = document.createElement('div');\n wrapper.className = 'table-wrapper';\n table.parentElement.replaceChild(wrapper, table);\n wrapper.appendChild(table);\n });\n }\n\n initHeaderLink() {\n for (let num = 1; num <= 6; num++) {\n this.util.forEach(document.querySelectorAll('.page.single .content > h' + num), (header) => {\n header.classList.add('headerLink');\n header.innerHTML = `${header.innerHTML}`;\n });\n }\n }\n\n initToc() {\n const tocCore = document.getElementById('TableOfContents');\n if (tocCore === null) return;\n if (this.util.isTocStatic()) {\n const tocContentStatic = document.getElementById('toc-content-static');\n if (tocCore.parentElement !== tocContentStatic) {\n tocCore.parentElement.removeChild(tocCore);\n tocContentStatic.appendChild(tocCore);\n }\n if (this._tocOnScroll) this.scrollEventSet.delete(this._tocOnScroll);\n } else {\n const tocContentAuto = document.getElementById('toc-content-auto');\n if (tocCore.parentElement !== tocContentAuto) {\n tocCore.parentElement.removeChild(tocCore);\n tocContentAuto.appendChild(tocCore);\n }\n const toc = document.getElementById('toc-auto');\n const page = document.getElementsByClassName('page')[0];\n toc.style.maxWidth = `${page.getBoundingClientRect().left - 20}px`;\n this._tocLinks = this._tocLinks || tocCore.getElementsByTagName('a');\n this._tocLis = this._tocLis || tocCore.getElementsByTagName('li');\n this._headerLinks = this._headerLinks || document.getElementsByClassName('headerLink');\n const headerIsFixed = window.desktopHeaderMode !== 'normal';\n const headerHeight = document.getElementById('header-desktop').offsetHeight;\n const TOP_SPACING = 20 + (headerIsFixed ? headerHeight : 0);\n const minTocTop = toc.offsetTop;\n const minScrollTop = minTocTop - TOP_SPACING + (headerIsFixed ? 0 : headerHeight);\n this._tocOnScroll = this._tocOnScroll || (() => {\n const footerTop = document.getElementById('post-footer').offsetTop;\n const maxTocTop = footerTop - toc.getBoundingClientRect().height;\n const maxScrollTop = maxTocTop - TOP_SPACING + (headerIsFixed ? 0 : headerHeight);\n const rect = page.getBoundingClientRect();\n if (this.newScrollTop < minScrollTop) {\n toc.style.position = 'absolute';\n toc.style.top = `${minTocTop}px`;\n toc.style.left = `${rect.width + 20}px`;\n } else if (this.newScrollTop > maxScrollTop) {\n toc.style.position = 'absolute';\n toc.style.top = `${maxTocTop}px`;\n toc.style.left = `${rect.width + 20}px`;\n } else {\n toc.style.position = 'fixed';\n toc.style.top = `${TOP_SPACING}px`;\n toc.style.left = `${rect.left + rect.width + 20}px`;\n }\n\n this.util.forEach(this._tocLinks, (link) => { link.classList.remove('active'); });\n this.util.forEach(this._tocLis, (link) => { link.classList.remove('has-active'); });\n const INDEX_SPACING = 20 + (headerIsFixed ? headerHeight : 0);\n let activeTocIndex = this._headerLinks.length - 1;\n for (let i = 0; i < this._headerLinks.length - 1; i++) {\n const thisTop = this._headerLinks[i].getBoundingClientRect().top;\n const nextTop = this._headerLinks[i + 1].getBoundingClientRect().top;\n if ((i == 0 && thisTop > INDEX_SPACING)\n || (thisTop <= INDEX_SPACING && nextTop > INDEX_SPACING)) {\n activeTocIndex = i;\n break;\n }\n }\n if (activeTocIndex !== -1) {\n this._tocLinks[activeTocIndex].classList.add('active');\n let parent = this._tocLinks[activeTocIndex].parentElement;\n while (parent !== tocCore) {\n parent.classList.add('has-active');\n parent = parent.parentElement.parentElement;\n }\n }\n });\n this._tocOnScroll();\n this.scrollEventSet.add(this._tocOnScroll);\n }\n }\n\n initMermaid() {\n const elements = document.getElementsByClassName('mermaid');\n if (elements.length) {\n mermaid.initialize({startOnLoad: false, theme: 'null'});\n this.util.forEach(elements, (element) => {\n mermaid.mermaidAPI.render('svg-' + element.id, window.contentMap[element.id], (svgCode) => {\n element.innerHTML = svgCode;\n }, element);\n });\n }\n }\n\n initEcharts() {\n this._echartsOnSwitchTheme = this._echartsOnSwitchTheme || (() => {\n this._echartsArr = this._echartsArr || [];\n for (let i = 0; i < this._echartsArr.length; i++) {\n this._echartsArr[i].dispose();\n }\n this._echartsArr = [];\n this.util.forEach(document.getElementsByClassName('echarts'), (element) => {\n const chart = echarts.init(element, window.isDark ? 'dark' : 'macarons', {renderer: 'svg'});\n chart.setOption(JSON.parse(window.contentMap[element.id]));\n this._echartsArr.push(chart);\n });\n });\n this.switchThemeEventSet.add(this._echartsOnSwitchTheme);\n this._echartsOnSwitchTheme();\n this._echartsOnResize = this._echartsOnResize || (() => {\n for (let i = 0; i < this._echartsArr.length; i++) {\n this._echartsArr[i].resize();\n }\n });\n this.resizeEventSet.add(this._echartsOnResize);\n }\n\n initMapbox() {\n this._mapboxArr = this._mapboxArr || [];\n this.util.forEach(document.getElementsByClassName('mapbox'), (element) => {\n const options = window.contentMap[element.id];\n const mapbox = new mapboxgl.Map({\n container: element,\n center: [options['lng'], options['lat']],\n zoom: options['zoom'],\n minZoom: .2,\n style: window.isDark ? options['dark-style'] : options['light-style'],\n attributionControl: false,\n });\n if (options['marked']) {\n new mapboxgl.Marker().setLngLat([options['lng'], options['lat']]).addTo(mapbox);\n }\n if (options['navigation']) {\n mapbox.addControl(new mapboxgl.NavigationControl(), 'bottom-right');\n }\n if (options['geolocate']) {\n mapbox.addControl(new mapboxgl.GeolocateControl({\n positionOptions: {\n enableHighAccuracy: true,\n },\n showUserLocation: true,\n trackUserLocation: true,\n }), 'bottom-right');\n }\n if (options['scale']) {\n mapbox.addControl(new mapboxgl.ScaleControl());\n }\n if (options['fullscreen']) {\n mapbox.addControl(new mapboxgl.FullscreenControl());\n }\n mapbox.addControl(new MapboxLanguage());\n this._mapboxArr.push(mapbox);\n });\n this._mapboxOnSwitchTheme = this._mapboxOnSwitchTheme || (() => {\n this.util.forEach(this._mapboxArr, (mapbox) => {\n const element = mapbox.getContainer();\n const options = window.contentMap[element.id];\n mapbox.setStyle(window.isDark ? options['dark-style'] : options['light-style']);\n mapbox.addControl(new MapboxLanguage());\n });\n });\n this.switchThemeEventSet.add(this._mapboxOnSwitchTheme);\n }\n\n initTypeit() {\n if (window.typeitArr) {\n for (let i = 0; i < window.typeitArr.length; i++) {\n const group = window.typeitArr[i];\n (function typeone(i) {\n const id = group[i];\n if (i === group.length - 1) {\n new TypeIt(`#${id}`, {\n strings: window.contentMap[id],\n }).go();\n return;\n }\n let instance = new TypeIt(`#${id}`, {\n strings: window.contentMap[id],\n afterComplete: () => {\n instance.destroy();\n typeone(i + 1);\n },\n }).go();\n })(0);\n }\n }\n }\n\n initSmoothScroll() {\n if ((!this.util.isMobile() && window.desktopHeaderMode === 'normal')\n || (this.util.isMobile() && window.mobileHeaderMode === 'normal')) {\n new SmoothScroll('[href^=\"#\"]', {speed: 300, speedAsDuration: true});\n } else {\n new SmoothScroll('[href^=\"#\"]', {speed: 300, speedAsDuration: true, header: '#header-desktop'});\n }\n }\n\n onScroll() {\n const headers = [];\n if (window.desktopHeaderMode === 'auto') headers.push(document.getElementById('header-desktop'));\n if (window.mobileHeaderMode === 'auto') headers.push(document.getElementById('header-mobile'));\n this.util.forEach(headers, (header) => {\n header.classList.add('animated');\n header.classList.add('faster');\n });\n const comments = document.getElementsByClassName('comment');\n if (comments.length) {\n const button = document.getElementById('comment-button');\n button.href = `#${comments[0].id}`;\n button.style.display = 'block';\n }\n const fixedButtons = document.getElementById('fixed-buttons');\n const MIN_SCROLL = 10;\n window.addEventListener('scroll', () => {\n this.newScrollTop = this.util.getScrollTop();\n const scroll = this.newScrollTop - this.oldScrollTop;\n this.util.forEach(headers, (header) => {\n if (scroll > MIN_SCROLL) {\n header.classList.remove('fadeInDown');\n header.classList.add('fadeOutUp');\n } else if (scroll < - MIN_SCROLL) {\n header.classList.remove('fadeOutUp');\n header.classList.add('fadeInDown');\n }\n });\n if (this.newScrollTop > 20) {\n if (scroll > MIN_SCROLL) {\n fixedButtons.classList.remove('fadeIn');\n fixedButtons.classList.add('fadeOut');\n } else if (scroll < - MIN_SCROLL) {\n fixedButtons.style.display = 'block';\n fixedButtons.classList.remove('fadeOut');\n fixedButtons.classList.add('fadeIn');\n }\n } else {\n fixedButtons.style.display = 'none';\n }\n if (!this._scrollTimeout) {\n this._scrollTimeout = window.setTimeout(() => {\n this._scrollTimeout = null;\n for (let event of this.scrollEventSet) event();\n }, 10);\n }\n this.oldScrollTop = this.newScrollTop;\n }, false);\n }\n\n onResize() {\n window.addEventListener('resize', () => {\n if (!this._resizeTimeout) {\n this._resizeTimeout = window.setTimeout(() => {\n this._resizeTimeout = null;\n for (let event of this.resizeEventSet) event();\n this.initMenuMobile();\n this.initToc();\n this.initSmoothScroll();\n this.initMermaid()\n }, 100);\n }\n }, false);\n }\n\n init() {\n this.initMenuMobile();\n this.initSwitchTheme();\n this.initHighlight();\n this.initTable();\n this.initHeaderLink();\n this.initMermaid();\n this.initEcharts();\n this.initMapbox();\n this.initTypeit();\n this.initToc();\n this.initSmoothScroll();\n\n this.onScroll();\n this.onResize();\n }\n }\n\n const themeInit = () => {\n const theme = new Theme();\n theme.init();\n };\n\n if (document.readyState !== 'loading') {\n themeInit();\n } else {\n document.addEventListener('DOMContentLoaded', themeInit, false);\n }\n})();\n"]}
\ No newline at end of file
+{"version":3,"sources":["../../src/js/theme.js"],"names":[],"mappings":"mlDAAM,CAAA,I,2HACM,C,CAAU,C,CAAS,CACvB,CAAQ,CAAG,CAAQ,EAAI,EADA,CAEvB,IAAK,GAAI,CAAA,CAAC,CAAG,CAAb,CAAgB,CAAC,CAAG,CAAQ,CAAC,MAA7B,CAAqC,CAAC,EAAtC,CACI,CAAO,CAAC,CAAQ,CAAC,CAAD,CAAT,CAEd,C,mDAEc,CACX,MAAQ,CAAA,QAAQ,CAAC,eAAT,EAA4B,QAAQ,CAAC,eAAT,CAAyB,SAAtD,EAAoE,QAAQ,CAAC,IAAT,CAAc,SAC5F,C,2CAEU,CACP,MAAO,CAAA,MAAM,CAAC,UAAP,CAAkB,oCAAlB,EAAwD,OAClE,C,iDAEa,CACV,MAAO,CAAA,MAAM,CAAC,UAAP,CAAkB,oCAAlB,EAAwD,OAClE,C,SAGC,K,yBACF,YAAc,yBACV,KAAK,MAAL,CAAc,MAAM,CAAC,MADX,CAEV,KAAK,WAAL,CAAmB,KAAK,MAAL,CAAY,OAFrB,CAGV,KAAK,MAAL,CAAc,QAAQ,CAAC,IAAT,CAAc,SAAd,CAAwB,QAAxB,CAAiC,MAAjC,CAHJ,CAIV,KAAK,IAAL,CAAY,GAAI,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,EAA/C,CAD4D,+BAE5D,QAAQ,CAAC,IAAT,CAAc,SAAd,CAAwB,MAAxB,CAA+B,MAA/B,CACH,CAHD,IAIH,C,mCAEM,CACH,KAAK,cAAL,EADG,CAEH,KAAK,eAAL,EAFG,CAGH,KAAK,UAAL,EAHG,CAIH,KAAK,gBAAL,EAJG,CAKH,KAAK,aAAL,EALG,CAMH,KAAK,SAAL,EANG,CAOH,KAAK,cAAL,EAPG,CAQH,KAAK,QAAL,EARG,CASH,KAAK,WAAL,EATG,CAUH,KAAK,WAAL,EAVG,CAWH,KAAK,UAAL,EAXG,CAYH,KAAK,UAAL,EAZG,CAaH,KAAK,OAAL,EAbG,CAcH,KAAK,WAAL,EAdG,CAeH,KAAK,gBAAL,EAfG,CAiBH,KAAK,QAAL,EAjBG,CAkBH,KAAK,QAAL,EAlBG,CAmBH,KAAK,WAAL,EACH,C,SAGC,SAAS,CAAG,UAAM,CACpB,GAAM,CAAA,CAAK,CAAG,GAAI,CAAA,KAAlB,CACA,CAAK,CAAC,IAAN,EACH,C,CAE2B,SAAxB,GAAA,QAAQ,CAAC,U,CAGT,QAAQ,CAAC,gBAAT,CAA0B,kBAA1B,CAA8C,SAA9C,I,CAFA,SAAS,E","file":"theme.min.js","sourcesContent":["class Util {\n forEach(elements, handler) {\n elements = elements || [];\n for (let i = 0; i < elements.length; i++) {\n handler(elements[i]);\n }\n }\n\n getScrollTop() {\n return (document.documentElement && document.documentElement.scrollTop) || document.body.scrollTop;\n }\n\n isMobile() {\n return window.matchMedia('only screen and (max-width: 680px)').matches;\n }\n\n isTocStatic() {\n return window.matchMedia('only screen and (max-width: 960px)').matches;\n }\n}\n\nclass Theme {\n constructor() {\n this.config = window.config;\n this.contentData = this.config.content;\n this.isDark = document.body.classList.contains('dark');\n this.util = new Util();\n this.newScrollTop = this.util.getScrollTop();\n this.oldScrollTop = this.newScrollTop;\n this.scrollEventSet = new Set();\n this.resizeEventSet = new Set();\n this.switchThemeEventSet = new Set();\n this.clickMaskEventSet = new Set();\n }\n\n initMenuMobile() {\n const $menuToggleMobile = document.getElementById('menu-toggle-mobile');\n const $menuMobile = document.getElementById('menu-mobile');\n $menuToggleMobile.addEventListener('click', () => {\n document.body.classList.toggle('blur');\n $menuToggleMobile.classList.toggle('active');\n $menuMobile.classList.toggle('active');\n }, false);\n this._menuMobileOnClickMask = this._menuMobileOnClickMask || (() => {\n $menuToggleMobile.classList.remove('active');\n $menuMobile.classList.remove('active');\n });\n this.clickMaskEventSet.add(this._menuMobileOnClickMask);\n }\n\n initSwitchTheme() {\n this.util.forEach(document.getElementsByClassName('theme-switch'), $themeSwitch => {\n $themeSwitch.addEventListener('click', () => {\n document.body.classList.toggle('dark');\n this.isDark = !this.isDark;\n window.localStorage && localStorage.setItem('theme', this.isDark ? 'dark' : 'light');\n for (let event of this.switchThemeEventSet) event();\n }, false);\n });\n }\n\n initSearch() {\n const searchConfig = this.config.search;\n const isMobile = this.util.isMobile();\n if (!searchConfig || isMobile && this._searchMobileOnce || !isMobile && this._searchDesktopOnce) return;\n const classSuffix = isMobile ? 'mobile' : 'desktop';\n const $header = document.getElementById(`header-${classSuffix}`);\n const $searchInput = document.getElementById(`search-input-${classSuffix}`);\n const $searchToggle = document.getElementById(`search-toggle-${classSuffix}`);\n const $searchLoading = document.getElementById(`search-loading-${classSuffix}`);\n const $searchClear = document.getElementById(`search-clear-${classSuffix}`);\n if (isMobile) {\n this._searchMobileOnce = true;\n $searchInput.addEventListener('focus', () => {\n document.body.classList.add('blur');\n $header.classList.add('open');\n }, false);\n document.getElementById('search-cancel-mobile').addEventListener('click', () => {\n $header.classList.remove('open');\n document.body.classList.remove('blur');\n document.getElementById('menu-toggle-mobile').classList.remove('active');\n document.getElementById('menu-mobile').classList.remove('active');\n $searchLoading.style.display = 'none';\n $searchClear.style.display = 'none';\n this._searchMobile && this._searchMobile.autocomplete.setVal('');\n }, false);\n $searchClear.addEventListener('click', () => {\n $searchClear.style.display = 'none';\n this._searchMobile && this._searchMobile.autocomplete.setVal('');\n }, false);\n this._searchMobileOnClickMask = this._searchMobileOnClickMask || (() => {\n $header.classList.remove('open');\n $searchLoading.style.display = 'none';\n $searchClear.style.display = 'none';\n this._searchMobile && this._searchMobile.autocomplete.setVal('');\n });\n this.clickMaskEventSet.add(this._searchMobileOnClickMask);\n } else {\n this._searchDesktopOnce = true;\n $searchToggle.addEventListener('click', () => {\n document.body.classList.add('blur');\n $header.classList.add('open');\n $searchInput.focus();\n }, false);\n $searchClear.addEventListener('click', () => {\n $searchClear.style.display = 'none';\n this._searchDesktop && this._searchDesktop.autocomplete.setVal('');\n }, false);\n this._searchDesktopOnClickMask = this._searchDesktopOnClickMask || (() => {\n $header.classList.remove('open');\n $searchLoading.style.display = 'none';\n $searchClear.style.display = 'none';\n this._searchDesktop && this._searchDesktop.autocomplete.setVal('');\n });\n this.clickMaskEventSet.add(this._searchDesktopOnClickMask);\n }\n $searchInput.addEventListener('input', () => {\n if ($searchInput.value === '') $searchClear.style.display = 'none';\n else $searchClear.style.display = 'inline';\n }, false);\n\n const CONTEXT_LENGTH = 200;\n const initAutosearch = () => {\n const autosearch = autocomplete(`#search-input-${classSuffix}`, {\n hint: false,\n autoselect: true,\n dropdownMenuContainer: `#search-dropdown-${classSuffix}`,\n clearOnSelected: true,\n cssClasses: { noPrefix: true },\n // debug: true,\n }, {\n name: 'search',\n source: (query, callback) => {\n $searchLoading.style.display = 'inline';\n $searchClear.style.display = 'none';\n const finish = (results) => {\n $searchLoading.style.display = 'none';\n $searchClear.style.display = 'inline';\n callback(results);\n };\n if (searchConfig.type === 'lunr') {\n const search = () => {\n if (lunr.queryHandler) query = lunr.queryHandler(query);\n return this._index.search(query).slice(0, 12).map(({ ref, matchData: { metadata } }) => {\n const matchData = this._indexData[ref];\n let { title, content: context } = matchData;\n let position = 0;\n Object.values(metadata).forEach(({ description, content }) => {\n if (description) {\n context = matchData.description;\n position = -1;\n } else if (content) {\n const matchPosition = content.position[0][0];\n if (matchPosition < position || position === 0) position = matchPosition;\n }\n });\n position -= CONTEXT_LENGTH / 5;\n if (position > 0) {\n position += context.substr(position, 25).lastIndexOf(' ') + 1;\n context = '...' + context.substr(position, CONTEXT_LENGTH);\n } else {\n context = context.substr(0, CONTEXT_LENGTH);\n }\n Object.keys(metadata).forEach(key => {\n title = title.replace(new RegExp(`(${key})`, 'gi'), '$1');\n context = context.replace(new RegExp(`(${key})`, 'gi'), '$1');\n });\n return {\n 'uri': matchData.uri,\n 'title' : title,\n 'date' : matchData.date,\n 'context' : context,\n };\n });\n }\n if (!this._index) {\n fetch(searchConfig.lunrIndexURL)\n .then(response => response.json())\n .then(data => {\n const indexData = {};\n this._index = lunr(function () {\n if (searchConfig.lunrLanguageCode) this.use(lunr[searchConfig.lunrLanguageCode]);\n this.ref('uri');\n this.field('title', { boost: 50 });\n this.field('tags', { boost: 20 });\n this.field('description', { boost: 10 });\n this.field('content', { boost: 5 });\n this.metadataWhitelist = ['position'];\n data.forEach((record) => {\n indexData[record.uri] = record;\n this.add(record);\n });\n });\n this._indexData = indexData;\n finish(search());\n }).catch(err => {\n console.error(err);\n finish([]);\n });\n } else finish(search());\n } else if (searchConfig.type === 'algolia') {\n $searchLoading.style.display = 'inline';\n $searchClear.style.display = 'none';\n this._algoliaIndex = this._algoliaIndex || algoliasearch(searchConfig.algoliaAppID, searchConfig.algoliaSearchKey).initIndex(searchConfig.algoliaIndex);\n this._algoliaIndex\n .search(query, { offset: 0, length: 12, attributesToHighlight: ['title', 'content'] })\n .then(({ hits }) => {\n finish(hits.map(({ uri, date, _highlightResult: { title, content } }) => ({\n uri: uri,\n title: title.value,\n date: date,\n context: content.value,\n })));\n })\n .catch(err => {\n console.error(err);\n finish([]);\n });\n }\n },\n templates: {\n suggestion: ({ title, date, context }) => `${title}${date}
${context}
`,\n empty: ({ query }) => `${searchConfig.noResultsFound}: \"${query}\"
`,\n footer: ({}) => {\n const { searchType, icon, href } = searchConfig.type === 'algolia' ? {\n searchType: 'algolia',\n icon: '',\n href: 'https://www.algolia.com/',\n } : {\n searchType: 'Lunr.js',\n icon: '',\n href: 'https://lunrjs.com/',\n };\n return ``;},\n },\n });\n autosearch.on('autocomplete:selected', (event, suggestion, dataset, context) => {\n window.location.assign(suggestion.uri);\n });\n if (isMobile) this._searchMobile = autosearch;\n else this._searchDesktop = autosearch;\n };\n if (searchConfig.lunrSegmentitURL && !document.getElementById('lunr-segmentit')) {\n const script = document.createElement('script');\n script.id = 'lunr-segmentit';\n script.type = 'text/javascript';\n script.src = searchConfig.lunrSegmentitURL;\n script.async = true;\n if (script.readyState) {\n script.onreadystatechange = () => {\n if (script.readyState == 'loaded' || script.readyState == 'complete'){\n script.onreadystatechange = null;\n initAutosearch();\n }\n };\n } else {\n script.onload = () => {\n initAutosearch();\n };\n }\n document.body.appendChild(script);\n } else initAutosearch();\n }\n\n initLightGallery() {\n if (this.config.lightGallery) lightGallery(document.getElementById('content'), this.config.lightGallery);\n }\n\n initHighlight() {\n this.util.forEach(document.querySelectorAll('.highlight > .chroma'), $chroma => {\n const $codes = $chroma.querySelectorAll('pre.chroma > code');\n const $code = $codes[$codes.length - 1];\n const lang = $code ? $code.className.toLowerCase() : '';\n $chroma.className += ' ' + lang;\n });\n this.util.forEach(document.querySelectorAll('.highlight > pre.chroma'), $preChroma => {\n const $chroma = document.createElement('div');\n $chroma.className = $preChroma.className;\n const $table = document.createElement('table');\n $chroma.appendChild($table);\n const $tbody = document.createElement('tbody');\n $table.appendChild($tbody);\n const $tr = document.createElement('tr');\n $tbody.appendChild($tr);\n const $td = document.createElement('td');\n $tr.appendChild($td);\n $preChroma.parentElement.replaceChild($chroma, $preChroma);\n $td.appendChild($preChroma);\n });\n }\n\n initTable() {\n this.util.forEach(document.querySelectorAll('.content table'), $table => {\n const $wrapper = document.createElement('div');\n $wrapper.className = 'table-wrapper';\n $table.parentElement.replaceChild($wrapper, $table);\n $wrapper.appendChild($table);\n });\n }\n\n initHeaderLink() {\n for (let num = 1; num <= 6; num++) {\n this.util.forEach(document.querySelectorAll('.page.single .content > h' + num), $header => {\n $header.classList.add('headerLink');\n $header.innerHTML = `${$header.innerHTML}`;\n });\n }\n }\n\n initToc() {\n const $tocCore = document.getElementById('TableOfContents');\n if ($tocCore === null) return;\n if (this.util.isTocStatic()) {\n const $tocContentStatic = document.getElementById('toc-content-static');\n if ($tocCore.parentElement !== $tocContentStatic) {\n $tocCore.parentElement.removeChild($tocCore);\n $tocContentStatic.appendChild($tocCore);\n }\n if (this._tocOnScroll) this.scrollEventSet.delete(this._tocOnScroll);\n } else {\n const $tocContentAuto = document.getElementById('toc-content-auto');\n if ($tocCore.parentElement !== $tocContentAuto) {\n $tocCore.parentElement.removeChild($tocCore);\n $tocContentAuto.appendChild($tocCore);\n }\n const $toc = document.getElementById('toc-auto');\n const $page = document.getElementsByClassName('page')[0];\n const rect = $page.getBoundingClientRect();\n $toc.style.left = `${rect.left + rect.width + 20}px`;\n $toc.style.maxWidth = `${$page.getBoundingClientRect().left - 20}px`;\n const $tocLinkElements = $tocCore.getElementsByTagName('a');\n const $tocLiElements = $tocCore.getElementsByTagName('li');\n const $headerLinkElements = document.getElementsByClassName('headerLink');\n const headerIsFixed = this.config.desktopHeaderMode !== 'normal';\n const headerHeight = document.getElementById('header-desktop').offsetHeight;\n const TOP_SPACING = 20 + (headerIsFixed ? headerHeight : 0);\n const minTocTop = $toc.offsetTop;\n const minScrollTop = minTocTop - TOP_SPACING + (headerIsFixed ? 0 : headerHeight);\n this._tocOnScroll = this._tocOnScroll || (() => {\n const footerTop = document.getElementById('post-footer').offsetTop;\n const maxTocTop = footerTop - $toc.getBoundingClientRect().height;\n const maxScrollTop = maxTocTop - TOP_SPACING + (headerIsFixed ? 0 : headerHeight);\n if (this.newScrollTop < minScrollTop) {\n $toc.style.position = 'absolute';\n $toc.style.top = `${minTocTop}px`;\n } else if (this.newScrollTop > maxScrollTop) {\n $toc.style.position = 'absolute';\n $toc.style.top = `${maxTocTop}px`;\n } else {\n $toc.style.position = 'fixed';\n $toc.style.top = `${TOP_SPACING}px`;\n }\n\n this.util.forEach($tocLinkElements, link => { link.classList.remove('active'); });\n this.util.forEach($tocLiElements, link => { link.classList.remove('has-active'); });\n const INDEX_SPACING = 20 + (headerIsFixed ? headerHeight : 0);\n let activeTocIndex = $headerLinkElements.length - 1;\n for (let i = 0; i < $headerLinkElements.length - 1; i++) {\n const thisTop = $headerLinkElements[i].getBoundingClientRect().top;\n const nextTop = $headerLinkElements[i + 1].getBoundingClientRect().top;\n if ((i == 0 && thisTop > INDEX_SPACING)\n || (thisTop <= INDEX_SPACING && nextTop > INDEX_SPACING)) {\n activeTocIndex = i;\n break;\n }\n }\n if (activeTocIndex !== -1) {\n $tocLinkElements[activeTocIndex].classList.add('active');\n let $parent = $tocLinkElements[activeTocIndex].parentElement;\n while ($parent !== $tocCore) {\n $parent.classList.add('has-active');\n $parent = $parent.parentElement.parentElement;\n }\n }\n });\n this._tocOnScroll();\n this.scrollEventSet.add(this._tocOnScroll);\n }\n }\n\n initMath() {\n if (this.config.math) renderMathInElement(document.body, this.config.math);\n }\n\n initMermaid() {\n const $mermaidElements = document.getElementsByClassName('mermaid');\n if ($mermaidElements.length) {\n mermaid.initialize({startOnLoad: false, theme: 'null'});\n this.util.forEach($mermaidElements, element => {\n mermaid.mermaidAPI.render('svg-' + element.id, this.contentData[element.id], svgCode => {\n element.innerHTML = svgCode;\n }, element);\n });\n }\n }\n\n initEcharts() {\n this._echartsOnSwitchTheme = this._echartsOnSwitchTheme || (() => {\n this._echartsArr = this._echartsArr || [];\n for (let i = 0; i < this._echartsArr.length; i++) {\n this._echartsArr[i].dispose();\n }\n this._echartsArr = [];\n this.util.forEach(document.getElementsByClassName('echarts'), element => {\n const chart = echarts.init(element, this.isDark ? 'dark' : 'macarons', {renderer: 'svg'});\n chart.setOption(JSON.parse(this.contentData[element.id]));\n this._echartsArr.push(chart);\n });\n });\n this.switchThemeEventSet.add(this._echartsOnSwitchTheme);\n this._echartsOnSwitchTheme();\n this._echartsOnResize = this._echartsOnResize || (() => {\n for (let i = 0; i < this._echartsArr.length; i++) {\n this._echartsArr[i].resize();\n }\n });\n this.resizeEventSet.add(this._echartsOnResize);\n }\n\n initMapbox() {\n if (this.config.mapbox) {\n mapboxgl.accessToken = this.config.mapbox.accessToken;\n mapboxgl.setRTLTextPlugin(this.config.mapbox.RTLTextPlugin);\n this._mapboxArr = this._mapboxArr || [];\n this.util.forEach(document.getElementsByClassName('mapbox'), element => {\n const { lng, lat, zoom, lightStyle, darkStyle, marked, navigation, geolocate, scale, fullscreen } = this.contentData[element.id];\n const options = this.contentData[element.id];\n const mapbox = new mapboxgl.Map({\n container: element,\n center: [lng, lat],\n zoom: zoom,\n minZoom: .2,\n style: this.isDark ? darkStyle : lightStyle,\n attributionControl: false,\n });\n if (marked) {\n new mapboxgl.Marker().setLngLat([lng, lat]).addTo(mapbox);\n }\n if (navigation) {\n mapbox.addControl(new mapboxgl.NavigationControl(), 'bottom-right');\n }\n if (geolocate) {\n mapbox.addControl(new mapboxgl.GeolocateControl({\n positionOptions: {\n enableHighAccuracy: true,\n },\n showUserLocation: true,\n trackUserLocation: true,\n }), 'bottom-right');\n }\n if (scale) {\n mapbox.addControl(new mapboxgl.ScaleControl());\n }\n if (fullscreen) {\n mapbox.addControl(new mapboxgl.FullscreenControl());\n }\n mapbox.addControl(new MapboxLanguage());\n this._mapboxArr.push(mapbox);\n });\n this._mapboxOnSwitchTheme = this._mapboxOnSwitchTheme || (() => {\n this.util.forEach(this._mapboxArr, mapbox => {\n const element = mapbox.getContainer();\n const { lightStyle, darkStyle } = this.contentData[element.id];\n mapbox.setStyle(this.isDark ? darkStyle : lightStyle);\n mapbox.addControl(new MapboxLanguage());\n });\n });\n this.switchThemeEventSet.add(this._mapboxOnSwitchTheme);\n }\n }\n\n initTypeit() {\n if (this.config.typeit) {\n const typeitData = this.config.typeit;\n for (let i = 0; i < typeitData.length; i++) {\n const group = typeitData[i];\n ((i) => {\n const id = group[i];\n if (i === group.length - 1) {\n new TypeIt(`#${id}`, {\n strings: this.contentData[id],\n }).go();\n return;\n }\n let instance = new TypeIt(`#${id}`, {\n strings: this.contentData[id],\n afterComplete: () => {\n instance.destroy();\n typeone(i + 1);\n },\n }).go();\n })(0);\n }\n }\n }\n\n initComment() {\n if (this.config.comment && this.config.comment.gitalk) {\n this.config.comment.gitalk.body = decodeURI(window.location.href);\n const gitalk = new Gitalk(this.config.comment.gitalk.body);\n gitalk.render('gitalk');\n }\n if (this.config.comment && this.config.comment.valine) new Valine(this.config.comment.valine);\n }\n\n initSmoothScroll() {\n if ((!this.util.isMobile() && this.config.desktopHeaderMode === 'normal')\n || (this.util.isMobile() && this.config.mobileHeaderMode === 'normal')) {\n new SmoothScroll('[href^=\"#\"]', {speed: 300, speedAsDuration: true});\n } else {\n new SmoothScroll('[href^=\"#\"]', {speed: 300, speedAsDuration: true, header: '#header-desktop'});\n }\n }\n\n onScroll() {\n const $headers = [];\n if (this.config.desktopHeaderMode === 'auto') $headers.push(document.getElementById('header-desktop'));\n if (this.config.mobileHeaderMode === 'auto') $headers.push(document.getElementById('header-mobile'));\n this.util.forEach($headers, $header => {\n $header.classList.add('animated');\n $header.classList.add('faster');\n });\n if (document.getElementById('comments')) {\n const $viewComments = document.getElementById('view-comments');\n $viewComments.href = `#comments`;\n $viewComments.style.display = 'block';\n }\n const $fixedButtons = document.getElementById('fixed-buttons');\n const MIN_SCROLL = 20;\n window.addEventListener('scroll', () => {\n this.newScrollTop = this.util.getScrollTop();\n const scroll = this.newScrollTop - this.oldScrollTop;\n this.util.forEach($headers, header => {\n if (scroll > MIN_SCROLL) {\n header.classList.remove('fadeInDown');\n header.classList.add('fadeOutUp');\n } else if (scroll < - MIN_SCROLL) {\n header.classList.remove('fadeOutUp');\n header.classList.add('fadeInDown');\n }\n });\n if (this.newScrollTop > MIN_SCROLL) {\n if (scroll > MIN_SCROLL) {\n $fixedButtons.classList.remove('fadeIn');\n $fixedButtons.classList.add('fadeOut');\n } else if (scroll < - MIN_SCROLL) {\n $fixedButtons.style.display = 'block';\n $fixedButtons.classList.remove('fadeOut');\n $fixedButtons.classList.add('fadeIn');\n }\n } else {\n $fixedButtons.style.display = 'none';\n }\n for (let event of this.scrollEventSet) event();\n this.oldScrollTop = this.newScrollTop;\n }, false);\n }\n\n onResize() {\n window.addEventListener('resize', () => {\n if (!this._resizeTimeout) {\n this._resizeTimeout = window.setTimeout(() => {\n this._resizeTimeout = null;\n for (let event of this.resizeEventSet) event();\n this.initToc();\n this.initSmoothScroll();\n this.initMermaid();\n this.initSearch();\n }, 100);\n }\n }, false);\n }\n\n onClickMask() {\n document.getElementById('mask').addEventListener('click', () => {\n for (let event of this.clickMaskEventSet) event();\n document.body.classList.remove('blur');\n }, false);\n }\n\n init() {\n this.initMenuMobile();\n this.initSwitchTheme();\n this.initSearch();\n this.initLightGallery();\n this.initHighlight();\n this.initTable();\n this.initHeaderLink();\n this.initMath();\n this.initMermaid();\n this.initEcharts();\n this.initMapbox();\n this.initTypeit();\n this.initToc();\n this.initComment();\n this.initSmoothScroll();\n\n this.onScroll();\n this.onResize();\n this.onClickMask();\n }\n}\n\nconst themeInit = () => {\n const theme = new Theme();\n theme.init();\n};\n\nif (document.readyState !== 'loading') {\n themeInit();\n} else {\n document.addEventListener('DOMContentLoaded', themeInit, false);\n}\n"]}
\ No newline at end of file
diff --git a/assets/lib/VERSION b/assets/lib/VERSION
index 1137724b..c869132b 100644
--- a/assets/lib/VERSION
+++ b/assets/lib/VERSION
@@ -2,16 +2,19 @@ fontawesome-free@5.12.1 https://fontawesome.com/
forkawesome@1.1.7 https://forkaweso.me/Fork-Awesome/
animate.css@3.7.2 https://github.com/daneden/animate.css
smooth-scroll@16.1.2 https://github.com/cferdinandi/smooth-scroll
+autocomplete.js@0.37.1 https://github.com/algolia/autocomplete.js
+lunr.js@2.3.8 https://lunrjs.com/
+algoliasearch@4.1.0 https://github.com/algolia/algoliasearch-client-javascript
sharer@0.4.0 https://github.com/ellisonleao/sharer.js
lazysizes@5.2.0 https://github.com/aFarkas/lazysizes
lightgallery@1.1.3 lg-thumbnail@1.1.0 lg-zoom@1.1.0 https://github.com/sachinchoolur/lightgallery.js
typeit@6.5.1 https://github.com/alexmacarthur/typeit
-katex@0.11.1 https://github.com/KaTeX/KaTeX
+katex@0.11.1 https://katex.org/
mermaid@8.4.8 https://github.com/knsv/mermaid
-aplayer@1.10.1 https://github.com/MoePlayer/APlayer
-meting@2.0.1 https://github.com/metowolf/MetingJS
echarts@4.6.0 https://echarts.apache.org/
mapbox-gl@1.8.1 https://github.com/mapbox/mapbox-gl-js
+aplayer@1.10.1 https://github.com/MoePlayer/APlayer
+meting@2.0.1 https://github.com/metowolf/MetingJS
gitalk@1.6.2 https://github.com/gitalk/gitalk
valine@1.3.10 https://valine.js.org/
iconfont https://www.iconfont.cn/
diff --git a/assets/lib/algoliasearch/algoliasearch-lite.umd.min.js b/assets/lib/algoliasearch/algoliasearch-lite.umd.min.js
new file mode 100644
index 00000000..181ba051
--- /dev/null
+++ b/assets/lib/algoliasearch/algoliasearch-lite.umd.min.js
@@ -0,0 +1,2 @@
+/*! algoliasearch-lite.umd.js | 4.1.0 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).algoliasearch=t()}(this,(function(){"use strict";function e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function r(r){for(var n=1;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var r=[],n=!0,o=!1,a=void 0;try{for(var u,i=e[Symbol.iterator]();!(n=(u=i.next()).done)&&(r.push(u.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==i.return||i.return()}finally{if(o)throw a}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function a(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then((function(){var r=JSON.stringify(e),n=a()[r];return Promise.all([n||t(),void 0!==n])})).then((function(e){var t=o(e,2),n=t[0],a=t[1];return Promise.all([n,a||r.miss(n)])})).then((function(e){return o(e,1)[0]}))},set:function(e,t){return Promise.resolve().then((function(){var o=a();return o[JSON.stringify(e)]=t,n().setItem(r,JSON.stringify(o)),t}))},delete:function(e){return Promise.resolve().then((function(){var t=a();delete t[JSON.stringify(e)],n().setItem(r,JSON.stringify(t))}))},clear:function(){return Promise.resolve().then((function(){n().removeItem(r)}))}}}function i(e){var t=a(e.caches),r=t.shift();return void 0===r?{get:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},n=t();return n.then((function(e){return Promise.all([e,r.miss(e)])})).then((function(e){return o(e,1)[0]}))},set:function(e,t){return Promise.resolve(t)},delete:function(e){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return r.get(e,n,o).catch((function(){return i({caches:t}).get(e,n,o)}))},set:function(e,n){return r.set(e,n).catch((function(){return i({caches:t}).set(e,n)}))},delete:function(e){return r.delete(e).catch((function(){return i({caches:t}).delete(e)}))},clear:function(){return r.clear().catch((function(){return i({caches:t}).clear()}))}}}function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{serializable:!0},t={};return{get:function(r,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},a=JSON.stringify(r);if(a in t)return Promise.resolve(e.serializable?JSON.parse(t[a]):t[a]);var u=n(),i=o&&o.miss||function(){return Promise.resolve()};return u.then((function(e){return i(e)})).then((function(){return u}))},set:function(r,n){return t[JSON.stringify(r)]=e.serializable?JSON.stringify(n):n,Promise.resolve(n)},delete:function(e){return delete t[JSON.stringify(e)],Promise.resolve()},clear:function(){return t={},Promise.resolve()}}}function c(e){for(var t=e.length-1;t>0;t--){var r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}function l(e,t){return Object.keys(void 0!==t?t:{}).forEach((function(r){e[r]=t[r](e)})),e}function f(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n0?n:void 0,timeout:r.timeout||t,headers:r.headers||{},queryParameters:r.queryParameters||{},cacheable:r.cacheable}}var m={Read:1,Write:2,Any:3},p=1,v=2,g=3;function y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;return r({},e,{status:t,lastUpdate:Date.now()})}function b(e){return{protocol:e.protocol||"https",url:e.url,accept:e.accept||m.Any}}var O="GET",P="POST";function q(e,t){return Promise.all(t.map((function(t){return e.get(t,(function(){return Promise.resolve(y(t))}))}))).then((function(e){var r=e.filter((function(e){return function(e){return e.status===p||Date.now()-e.lastUpdate>12e4}(e)})),n=e.filter((function(e){return function(e){return e.status===g&&Date.now()-e.lastUpdate<=12e4}(e)})),o=[].concat(a(r),a(n));return{getTimeout:function(e,t){return(0===n.length&&0===e?1:n.length+3+e)*t},statelessHosts:o.length>0?o.map((function(e){return b(e)})):t}}))}function j(e,t,n,o){var u=[],i=function(e,t){if(e.method===O||void 0===e.data&&void 0===t.data)return;var n=Array.isArray(e.data)?e.data:r({},e.data,{},t.data);return JSON.stringify(n)}(n,o),s=function(e,t){var n=r({},e.headers,{},t.headers),o={};return Object.keys(n).forEach((function(e){var t=n[e];o[e.toLowerCase()]=t})),o}(e,o),c=n.method,l=n.method!==O?{}:r({},n.data,{},o.data),f=r({"x-algolia-agent":e.userAgent.value},e.queryParameters,{},l,{},o.queryParameters),h=0,d=function t(r,a){var l=r.pop();if(void 0===l)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:A(u)};var d={data:i,headers:s,method:c,url:w(l,n.path,f),connectTimeout:a(h,e.timeouts.connect),responseTimeout:a(h,o.timeout)},m=function(e){var t={request:d,response:e,host:l,triesLeft:r.length};return u.push(t),t},p={onSucess:function(e){return function(e){try{return JSON.parse(e.content)}catch(t){throw function(e,t){return{name:"DeserializationError",message:e,response:t}}(t.message,e)}}(e)},onRetry:function(n){var o=m(n);return n.isTimedOut&&h++,Promise.all([e.logger.info("Retryable failure",x(o)),e.hostsCache.set(l,y(l,n.isTimedOut?g:v))]).then((function(){return t(r,a)}))},onFail:function(e){throw m(e),function(e,t){var r=e.content,n=e.status,o=r;try{o=JSON.parse(r).message}catch(e){}return function(e,t,r){return{name:"ApiError",message:e,status:t,transporterStackTrace:r}}(o,n,t)}(e,A(u))}};return e.requester.send(d).then((function(e){return function(e,t){return function(e){var t=e.status;return e.isTimedOut||function(e){var t=e.isTimedOut,r=e.status;return!t&&0==~~r}(e)||2!=~~(t/100)&&4!=~~(t/100)}(e)?t.onRetry(e):2==~~(e.status/100)?t.onSucess(e):t.onFail(e)}(e,p)}))};return q(e.hostsCache,t).then((function(e){return d(a(e.statelessHosts).reverse(),e.getTimeout)}))}function S(e){var t={value:"Algolia for JavaScript (".concat(e,")"),add:function(e){var r="; ".concat(e.segment).concat(void 0!==e.version?" (".concat(e.version,")"):"");return-1===t.value.indexOf(r)&&(t.value="".concat(t.value).concat(r)),t}};return t}function w(e,t,r){var n=T(r),o="".concat(e.protocol,"://").concat(e.url,"/").concat("/"===t.charAt(0)?t.substr(1):t);return n.length&&(o+="?".concat(n)),o}function T(e){return Object.keys(e).map((function(t){return f("%s=%s",t,(r=e[t],"[object Object]"===Object.prototype.toString.call(r)||"[object Array]"===Object.prototype.toString.call(r)?JSON.stringify(e[t]):e[t]));var r})).join("&")}function A(e){return e.map((function(e){return x(e)}))}function x(e){var t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return r({},e,{request:r({},e.request,{headers:r({},e.request.headers,{},t)})})}var C=function(e){var t=e.appId,n=function(e,t,r){var n={"x-algolia-api-key":r,"x-algolia-application-id":t};return{headers:function(){return e===h.WithinHeaders?n:{}},queryParameters:function(){return e===h.WithinQueryParameters?n:{}}}}(void 0!==e.authMode?e.authMode:h.WithinHeaders,t,e.apiKey),a=function(e){var t=e.hostsCache,r=e.logger,n=e.requester,a=e.requestsCache,u=e.responsesCache,i=e.timeouts,s=e.userAgent,c=e.hosts,l=e.queryParameters,f={hostsCache:t,logger:r,requester:n,requestsCache:a,responsesCache:u,timeouts:i,userAgent:s,headers:e.headers,queryParameters:l,hosts:c.map((function(e){return b(e)})),read:function(e,t){var r=d(t,f.timeouts.read),n=function(){return j(f,f.hosts.filter((function(e){return 0!=(e.accept&m.Read)})),e,r)};if(!0!==(void 0!==r.cacheable?r.cacheable:e.cacheable))return n();var a={request:e,mappedRequestOptions:r,transporter:{queryParameters:f.queryParameters,headers:f.headers}};return f.responsesCache.get(a,(function(){return f.requestsCache.get(a,(function(){return f.requestsCache.set(a,n()).then((function(e){return Promise.all([f.requestsCache.delete(a),e])}),(function(e){return Promise.all([f.requestsCache.delete(a),Promise.reject(e)])})).then((function(e){var t=o(e,2);t[0];return t[1]}))}))}),{miss:function(e){return f.responsesCache.set(a,e)}})},write:function(e,t){return j(f,f.hosts.filter((function(e){return 0!=(e.accept&m.Write)})),e,d(t,f.timeouts.write))}};return f}(r({hosts:[{url:"".concat(t,"-dsn.algolia.net"),accept:m.Read},{url:"".concat(t,".algolia.net"),accept:m.Write}].concat(c([{url:"".concat(t,"-1.algolianet.com")},{url:"".concat(t,"-2.algolianet.com")},{url:"".concat(t,"-3.algolianet.com")}]))},e,{headers:r({},n.headers(),{},{"content-type":"application/x-www-form-urlencoded"},{},e.headers),queryParameters:r({},n.queryParameters(),{},e.queryParameters)}));return l({transporter:a,appId:t,addAlgoliaAgent:function(e,t){a.userAgent.add({segment:e,version:t})},clearCache:function(){return Promise.all([a.requestsCache.clear(),a.responsesCache.clear()]).then((function(){}))}},e.methods)},N=function(e){return function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={transporter:e.transporter,appId:e.appId,indexName:t};return l(n,r.methods)}},k=function(e){return function(t,n){var o=t.map((function(e){return r({},e,{params:T(e.params||{})})}));return e.transporter.read({method:P,path:"1/indexes/*/queries",data:{requests:o},cacheable:!0},n)}},J=function(e){return function(t,o){return Promise.all(t.map((function(t){var a=t.params,u=a.facetName,i=a.facetQuery,s=n(a,["facetName","facetQuery"]);return N(e)(t.indexName,{methods:{searchForFacetValues:I}}).searchForFacetValues(u,i,r({},o,{},s))})))}},E=function(e){return function(t,r){return e.transporter.read({method:P,path:f("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},r)}},I=function(e){return function(t,r,n){return e.transporter.read({method:P,path:f("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:r},cacheable:!0},n)}},F=1,R=2,D=3;function W(e,t,n){var o,a={appId:e,apiKey:t,timeouts:{connect:1,read:2,write:30},requester:{send:function(e){return new Promise((function(t){var r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((function(t){return r.setRequestHeader(t,e.headers[t])}));var n,o=function(e,n){return setTimeout((function(){r.abort(),t({status:0,content:n,isTimedOut:!0})}),1e3*e)},a=o(e.connectTimeout,"Connection timeout");r.onreadystatechange=function(){r.readyState>r.OPENED&&void 0===n&&(clearTimeout(a),n=o(e.responseTimeout,"Socket timeout"))},r.onerror=function(){0===r.status&&(clearTimeout(a),clearTimeout(n),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=function(){clearTimeout(a),clearTimeout(n),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},logger:(o=D,{debug:function(e,t){return F>=o&&console.debug(e,t),Promise.resolve()},info:function(e,t){return R>=o&&console.info(e,t),Promise.resolve()},error:function(e,t){return console.error(e,t),Promise.resolve()}}),responsesCache:s(),requestsCache:s({serializable:!1}),hostsCache:i({caches:[u({key:"".concat("4.1.0","-").concat(e)}),s()]}),userAgent:S("4.1.0").add({segment:"Browser",version:"lite"}),authMode:h.WithinQueryParameters};return C(r({},a,{},n,{methods:{search:k,searchForFacetValues:J,multipleQueries:k,multipleSearchForFacetValues:J,initIndex:function(e){return function(t){return N(e)(t,{methods:{search:E,searchForFacetValues:I}})}}}}))}return W.version="4.1.0",W}));
\ No newline at end of file
diff --git a/assets/lib/aplayer/dark.scss b/assets/lib/aplayer/dark.scss
index 08d7bf14..4a26503e 100644
--- a/assets/lib/aplayer/dark.scss
+++ b/assets/lib/aplayer/dark.scss
@@ -1,4 +1,4 @@
-.dark-theme .aplayer {
+.dark .aplayer {
background: #212121;
&.aplayer-withlist {
diff --git a/assets/lib/autocomplete/autocomplete.min.js b/assets/lib/autocomplete/autocomplete.min.js
new file mode 100644
index 00000000..e115402f
--- /dev/null
+++ b/assets/lib/autocomplete/autocomplete.min.js
@@ -0,0 +1,7 @@
+/*!
+ * autocomplete.js 0.37.1
+ * https://github.com/algolia/autocomplete.js
+ * Copyright 2020 Algolia, Inc. and other contributors; Licensed MIT
+ */
+!function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b():"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?exports.autocomplete=b():a.autocomplete=b()}(this,function(){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b,c){"use strict";a.exports=c(1)},function(a,b,c){"use strict";function d(a,b,c,d){c=f.isArray(c)?c:[].slice.call(arguments,2);var j=e(a).each(function(a,f){var j=e(f),k=new i({el:j}),l=d||new h({input:j,eventBus:k,dropdownMenuContainer:b.dropdownMenuContainer,hint:void 0===b.hint||!!b.hint,minLength:b.minLength,autoselect:b.autoselect,autoselectOnBlur:b.autoselectOnBlur,tabAutocomplete:b.tabAutocomplete,openOnFocus:b.openOnFocus,templates:b.templates,debug:b.debug,clearOnSelected:b.clearOnSelected,cssClasses:b.cssClasses,datasets:c,keyboardShortcuts:b.keyboardShortcuts,appendTo:b.appendTo,autoWidth:b.autoWidth,ariaLabel:b.ariaLabel||f.getAttribute("aria-label")});j.data(g,l)});return j.autocomplete={},f.each(["open","close","getVal","setVal","destroy","getWrapper"],function(a){j.autocomplete[a]=function(){var b,c=arguments;return j.each(function(d,f){var h=e(f).data(g);b=h[a].apply(h,c)}),b}}),j}var e=c(2);c(3).element=e;var f=c(4);f.isArray=e.isArray,f.isFunction=e.isFunction,f.isObject=e.isPlainObject,f.bind=e.proxy,f.each=function(a,b){function c(a,c){return b(c,a)}e.each(a,c)},f.map=e.map,f.mixin=e.extend,f.Event=e.Event;var g="aaAutocomplete",h=c(5),i=c(6);d.sources=h.sources,d.escapeHighlightedString=f.escapeHighlightedString;var j="autocomplete"in window,k=window.autocomplete;d.noConflict=function(){return j?window.autocomplete=k:delete window.autocomplete,d},a.exports=d},function(a,b){!function(b,c){a.exports=function(a){var b=function(){function b(a){return null==a?String(a):V[W.call(a)]||"object"}function c(a){return"function"==b(a)}function d(a){return null!=a&&a==a.window}function e(a){return null!=a&&a.nodeType==a.DOCUMENT_NODE}function f(a){return"object"==b(a)}function g(a){return f(a)&&!d(a)&&Object.getPrototypeOf(a)==Object.prototype}function h(a){var b=!!a&&"length"in a&&a.length,c=z.type(a);return"function"!=c&&!d(a)&&("array"==c||0===b||"number"==typeof b&&b>0&&b-1 in a)}function i(a){return F.call(a,function(a){return null!=a})}function j(a){return a.length>0?z.fn.concat.apply([],a):a}function k(a){return a.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function l(a){return a in J?J[a]:J[a]=new RegExp("(^|\\s)"+a+"(\\s|$)")}function m(a,b){return"number"!=typeof b||K[k(a)]?b:b+"px"}function n(a){var b,c;return I[a]||(b=H.createElement(a),H.body.appendChild(b),c=getComputedStyle(b,"").getPropertyValue("display"),b.parentNode.removeChild(b),"none"==c&&(c="block"),I[a]=c),I[a]}function o(a){return"children"in a?G.call(a.children):z.map(a.childNodes,function(a){if(1==a.nodeType)return a})}function p(a,b){var c,d=a?a.length:0;for(c=0;c]*>/,M=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,N=/^(?:body|html)$/i,O=["val","css","html","text","data","width","height","offset"],P=["after","prepend","before","append"],Q=H.createElement("table"),R=H.createElement("tr"),S={tr:H.createElement("tbody"),tbody:Q,thead:Q,tfoot:Q,td:R,th:R,"*":H.createElement("div")},T=/complete|loaded|interactive/,U=/^[\w-]*$/,V={},W=V.toString,X={},Y=H.createElement("div"),Z={tabindex:"tabIndex",readonly:"readOnly",for:"htmlFor",class:"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},$=Array.isArray||function(a){return a instanceof Array};return X.matches=function(a,b){if(!b||!a||1!==a.nodeType)return!1;var c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.matchesSelector;if(c)return c.call(a,b);var d,e=a.parentNode,f=!e;return f&&(e=Y).appendChild(a),d=~X.qsa(e,b).indexOf(a),f&&Y.removeChild(a),d},B=function(a){return a.replace(/-+(.)?/g,function(a,b){return b?b.toUpperCase():""})},C=function(a){return F.call(a,function(b,c){return a.indexOf(b)==c})},X.fragment=function(a,b,c){var d,e,f;return M.test(a)&&(d=z(H.createElement(RegExp.$1))),d||(a.replace&&(a=a.replace(/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,"<$1>$2>")),b===x&&(b=L.test(a)&&RegExp.$1),b in S||(b="*"),f=S[b],f.innerHTML=""+a,d=z.each(G.call(f.childNodes),function(){f.removeChild(this)})),g(c)&&(e=z(d),z.each(c,function(a,b){O.indexOf(a)>-1?e[a](b):e.attr(a,b)})),d},X.Z=function(a,b){return new p(a,b)},X.isZ=function(a){return a instanceof X.Z},X.init=function(a,b){var d;if(!a)return X.Z();if("string"==typeof a)if(a=a.trim(),"<"==a[0]&&L.test(a))d=X.fragment(a,RegExp.$1,b),a=null;else{if(b!==x)return z(b).find(a);d=X.qsa(H,a)}else{if(c(a))return z(H).ready(a);if(X.isZ(a))return a;if($(a))d=i(a);else if(f(a))d=[a],a=null;else if(L.test(a))d=X.fragment(a.trim(),RegExp.$1,b),a=null;else{if(b!==x)return z(b).find(a);d=X.qsa(H,a)}}return X.Z(d,a)},z=function(a,b){return X.init(a,b)},z.extend=function(a){var b,c=G.call(arguments,1);return"boolean"==typeof a&&(b=a,a=c.shift()),c.forEach(function(c){q(a,c,b)}),a},X.qsa=function(a,b){var c,d="#"==b[0],e=!d&&"."==b[0],f=d||e?b.slice(1):b,g=U.test(f);return a.getElementById&&g&&d?(c=a.getElementById(f))?[c]:[]:1!==a.nodeType&&9!==a.nodeType&&11!==a.nodeType?[]:G.call(g&&!d&&a.getElementsByClassName?e?a.getElementsByClassName(f):a.getElementsByTagName(b):a.querySelectorAll(b))},z.contains=H.documentElement.contains?function(a,b){return a!==b&&a.contains(b)}:function(a,b){for(;b&&(b=b.parentNode);)if(b===a)return!0;return!1},z.type=b,z.isFunction=c,z.isWindow=d,z.isArray=$,z.isPlainObject=g,z.isEmptyObject=function(a){var b;for(b in a)return!1;return!0},z.isNumeric=function(a){var b=Number(a),c=typeof a;return null!=a&&"boolean"!=c&&("string"!=c||a.length)&&!isNaN(b)&&isFinite(b)||!1},z.inArray=function(a,b,c){return D.indexOf.call(b,a,c)},z.camelCase=B,z.trim=function(a){return null==a?"":String.prototype.trim.call(a)},z.uuid=0,z.support={},z.expr={},z.noop=function(){},z.map=function(a,b){var c,d,e,f=[];if(h(a))for(d=0;d=0?a:a+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(a){return D.every.call(this,function(b,c){return a.call(b,c,b)!==!1}),this},filter:function(a){return c(a)?this.not(this.not(a)):z(F.call(this,function(b){return X.matches(b,a)}))},add:function(a,b){return z(C(this.concat(z(a,b))))},is:function(a){return this.length>0&&X.matches(this[0],a)},not:function(a){var b=[];if(c(a)&&a.call!==x)this.each(function(c){a.call(this,c)||b.push(this)});else{var d="string"==typeof a?this.filter(a):h(a)&&c(a.item)?G.call(a):z(a);this.forEach(function(a){d.indexOf(a)<0&&b.push(a)})}return z(b)},has:function(a){return this.filter(function(){return f(a)?z.contains(this,a):z(this).find(a).size()})},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){var a=this[0];return a&&!f(a)?a:z(a)},last:function(){var a=this[this.length-1];return a&&!f(a)?a:z(a)},find:function(a){var b=this;return a?"object"==typeof a?z(a).filter(function(){var a=this;return D.some.call(b,function(b){return z.contains(b,a)})}):1==this.length?z(X.qsa(this[0],a)):this.map(function(){return X.qsa(this,a)}):z()},closest:function(a,b){var c=[],d="object"==typeof a&&z(a);return this.each(function(f,g){for(;g&&!(d?d.indexOf(g)>=0:X.matches(g,a));)g=g!==b&&!e(g)&&g.parentNode;g&&c.indexOf(g)<0&&c.push(g)}),z(c)},parents:function(a){for(var b=[],c=this;c.length>0;)c=z.map(c,function(a){if((a=a.parentNode)&&!e(a)&&b.indexOf(a)<0)return b.push(a),a});return r(b,a)},parent:function(a){return r(C(this.pluck("parentNode")),a)},children:function(a){return r(this.map(function(){return o(this)}),a)},contents:function(){return this.map(function(){return this.contentDocument||G.call(this.childNodes)})},siblings:function(a){return r(this.map(function(a,b){return F.call(o(b.parentNode),function(a){return a!==b})}),a)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(a){return z.map(this,function(b){return b[a]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=n(this.nodeName))})},replaceWith:function(a){return this.before(a).remove()},wrap:function(a){var b=c(a);if(this[0]&&!b)var d=z(a).get(0),e=d.parentNode||this.length>1;return this.each(function(c){z(this).wrapAll(b?a.call(this,c):e?d.cloneNode(!0):d)})},wrapAll:function(a){if(this[0]){z(this[0]).before(a=z(a));for(var b;(b=a.children()).length;)a=b.first();z(a).append(this)}return this},wrapInner:function(a){var b=c(a);return this.each(function(c){var d=z(this),e=d.contents(),f=b?a.call(this,c):a;e.length?e.wrapAll(f):d.append(f)})},unwrap:function(){return this.parent().each(function(){z(this).replaceWith(z(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(a){return this.each(function(){var b=z(this);(a===x?"none"==b.css("display"):a)?b.show():b.hide()})},prev:function(a){return z(this.pluck("previousElementSibling")).filter(a||"*")},next:function(a){return z(this.pluck("nextElementSibling")).filter(a||"*")},html:function(a){return 0 in arguments?this.each(function(b){var c=this.innerHTML;z(this).empty().append(s(this,a,b,c))}):0 in this?this[0].innerHTML:null},text:function(a){return 0 in arguments?this.each(function(b){var c=s(this,a,b,this.textContent);this.textContent=null==c?"":""+c}):0 in this?this.pluck("textContent").join(""):null},attr:function(a,b){var c;return"string"!=typeof a||1 in arguments?this.each(function(c){if(1===this.nodeType)if(f(a))for(y in a)t(this,y,a[y]);else t(this,a,s(this,b,c,this.getAttribute(a)))}):0 in this&&1==this[0].nodeType&&null!=(c=this[0].getAttribute(a))?c:x},removeAttr:function(a){return this.each(function(){1===this.nodeType&&a.split(" ").forEach(function(a){t(this,a)},this)})},prop:function(a,b){return a=Z[a]||a,1 in arguments?this.each(function(c){this[a]=s(this,b,c,this[a])}):this[0]&&this[0][a]},removeProp:function(a){return a=Z[a]||a,this.each(function(){delete this[a]})},data:function(a,b){var c="data-"+a.replace(/([A-Z])/g,"-$1").toLowerCase(),d=1 in arguments?this.attr(c,b):this.attr(c);return null!==d?v(d):x},val:function(a){return 0 in arguments?(null==a&&(a=""),this.each(function(b){this.value=s(this,a,b,this.value)})):this[0]&&(this[0].multiple?z(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value)},offset:function(b){if(b)return this.each(function(a){var c=z(this),d=s(this,b,a,c.offset()),e=c.offsetParent().offset(),f={top:d.top-e.top,left:d.left-e.left};"static"==c.css("position")&&(f.position="relative"),c.css(f)});if(!this.length)return null;if(H.documentElement!==this[0]&&!z.contains(H.documentElement,this[0]))return{top:0,left:0};var c=this[0].getBoundingClientRect();return{left:c.left+a.pageXOffset,top:c.top+a.pageYOffset,width:Math.round(c.width),height:Math.round(c.height)}},css:function(a,c){if(arguments.length<2){var d=this[0];if("string"==typeof a){if(!d)return;return d.style[B(a)]||getComputedStyle(d,"").getPropertyValue(a)}if($(a)){if(!d)return;var e={},f=getComputedStyle(d,"");return z.each(a,function(a,b){e[b]=d.style[B(b)]||f.getPropertyValue(b)}),e}}var g="";if("string"==b(a))c||0===c?g=k(a)+":"+m(a,c):this.each(function(){this.style.removeProperty(k(a))});else for(y in a)a[y]||0===a[y]?g+=k(y)+":"+m(y,a[y])+";":this.each(function(){this.style.removeProperty(k(y))});return this.each(function(){this.style.cssText+=";"+g})},index:function(a){return a?this.indexOf(z(a)[0]):this.parent().children().indexOf(this[0])},hasClass:function(a){return!!a&&D.some.call(this,function(a){return this.test(u(a))},l(a))},addClass:function(a){return a?this.each(function(b){if("className"in this){A=[];var c=u(this);s(this,a,b,c).split(/\s+/g).forEach(function(a){z(this).hasClass(a)||A.push(a)},this),A.length&&u(this,c+(c?" ":"")+A.join(" "))}}):this},removeClass:function(a){return this.each(function(b){if("className"in this){if(a===x)return u(this,"");A=u(this),s(this,a,b,A).split(/\s+/g).forEach(function(a){A=A.replace(l(a)," ")}),u(this,A.trim())}})},toggleClass:function(a,b){return a?this.each(function(c){var d=z(this);s(this,a,c,u(this)).split(/\s+/g).forEach(function(a){(b===x?!d.hasClass(a):b)?d.addClass(a):d.removeClass(a)})}):this},scrollTop:function(a){if(this.length){var b="scrollTop"in this[0];return a===x?b?this[0].scrollTop:this[0].pageYOffset:this.each(b?function(){this.scrollTop=a}:function(){this.scrollTo(this.scrollX,a)})}},scrollLeft:function(a){if(this.length){var b="scrollLeft"in this[0];return a===x?b?this[0].scrollLeft:this[0].pageXOffset:this.each(b?function(){this.scrollLeft=a}:function(){this.scrollTo(a,this.scrollY)})}},position:function(){if(this.length){var a=this[0],b=this.offsetParent(),c=this.offset(),d=N.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(z(a).css("margin-top"))||0,c.left-=parseFloat(z(a).css("margin-left"))||0,d.top+=parseFloat(z(b[0]).css("border-top-width"))||0,d.left+=parseFloat(z(b[0]).css("border-left-width"))||0,{top:c.top-d.top,left:c.left-d.left}}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||H.body;a&&!N.test(a.nodeName)&&"static"==z(a).css("position");)a=a.offsetParent;return a})}},z.fn.detach=z.fn.remove,["width","height"].forEach(function(a){var b=a.replace(/./,function(a){return a[0].toUpperCase()});z.fn[a]=function(c){var f,g=this[0];return c===x?d(g)?g["inner"+b]:e(g)?g.documentElement["scroll"+b]:(f=this.offset())&&f[a]:this.each(function(b){g=z(this),g.css(a,s(this,c,b,g[a]()))})}}),P.forEach(function(c,d){var e=d%2;z.fn[c]=function(){var c,f,g=z.map(arguments,function(a){var d=[];return c=b(a),"array"==c?(a.forEach(function(a){return a.nodeType!==x?d.push(a):z.zepto.isZ(a)?d=d.concat(a.get()):void(d=d.concat(X.fragment(a)))}),d):"object"==c||null==a?a:X.fragment(a)}),h=this.length>1;return g.length<1?this:this.each(function(b,c){f=e?c:c.parentNode,c=0==d?c.nextSibling:1==d?c.firstChild:2==d?c:null;var i=z.contains(H.documentElement,f);g.forEach(function(b){if(h)b=b.cloneNode(!0);else if(!f)return z(b).remove();f.insertBefore(b,c),i&&w(b,function(b){if(!(null==b.nodeName||"SCRIPT"!==b.nodeName.toUpperCase()||b.type&&"text/javascript"!==b.type||b.src)){var c=b.ownerDocument?b.ownerDocument.defaultView:a;c.eval.call(c,b.innerHTML)}})})})},z.fn[e?c+"To":"insert"+(d?"Before":"After")]=function(a){return z(a)[c](this),this}}),X.Z.prototype=p.prototype=z.fn,X.uniq=C,X.deserializeValue=v,z.zepto=X,z}();return function(b){function c(a){return a._zid||(a._zid=n++)}function d(a,b,d,g){if(b=e(b),b.ns)var h=f(b.ns);return(r[c(a)]||[]).filter(function(a){return a&&(!b.e||a.e==b.e)&&(!b.ns||h.test(a.ns))&&(!d||c(a.fn)===c(d))&&(!g||a.sel==g)})}function e(a){var b=(""+a).split(".");return{e:b[0],ns:b.slice(1).sort().join(" ")}}function f(a){return new RegExp("(?:^| )"+a.replace(" "," .* ?")+"(?: |$)")}function g(a,b){return a.del&&!t&&a.e in u||!!b}function h(a){return v[a]||t&&u[a]||a}function i(a,d,f,i,j,l,n){var o=c(a),p=r[o]||(r[o]=[]);d.split(/\s/).forEach(function(c){if("ready"==c)return b(document).ready(f);var d=e(c);d.fn=f,d.sel=j,d.e in v&&(f=function(a){var c=a.relatedTarget;if(!c||c!==this&&!b.contains(this,c))return d.fn.apply(this,arguments)}),d.del=l;var o=l||f;d.proxy=function(b){if(b=k(b),!b.isImmediatePropagationStopped()){try{var c=Object.getOwnPropertyDescriptor(b,"data");c&&!c.writable||(b.data=i)}catch(b){}var d=o.apply(a,b._args==m?[b]:[b].concat(b._args));return d===!1&&(b.preventDefault(),b.stopPropagation()),d}},d.i=p.length,p.push(d),"addEventListener"in a&&a.addEventListener(h(d.e),d.proxy,g(d,n))})}function j(a,b,e,f,i){var j=c(a);(b||"").split(/\s/).forEach(function(b){d(a,b,e,f).forEach(function(b){delete r[j][b.i],"removeEventListener"in a&&a.removeEventListener(h(b.e),b.proxy,g(b,i))})})}function k(a,c){if(c||!a.isDefaultPrevented){c||(c=a),b.each(z,function(b,d){var e=c[b];a[b]=function(){return this[d]=w,e&&e.apply(c,arguments)},a[d]=x});try{a.timeStamp||(a.timeStamp=Date.now())}catch(a){}(c.defaultPrevented!==m?c.defaultPrevented:"returnValue"in c?c.returnValue===!1:c.getPreventDefault&&c.getPreventDefault())&&(a.isDefaultPrevented=w)}return a}function l(a){var b,c={originalEvent:a};for(b in a)y.test(b)||a[b]===m||(c[b]=a[b]);return k(c,a)}var m,n=1,o=Array.prototype.slice,p=b.isFunction,q=function(a){return"string"==typeof a},r={},s={},t="onfocusin"in a,u={focus:"focusin",blur:"focusout"},v={mouseenter:"mouseover",mouseleave:"mouseout"};s.click=s.mousedown=s.mouseup=s.mousemove="MouseEvents",b.event={add:i,remove:j},b.proxy=function(a,d){var e=2 in arguments&&o.call(arguments,2);if(p(a)){var f=function(){return a.apply(d,e?e.concat(o.call(arguments)):arguments)};return f._zid=c(a),f}if(q(d))return e?(e.unshift(a[d],a),b.proxy.apply(null,e)):b.proxy(a[d],a);throw new TypeError("expected function")},b.fn.bind=function(a,b,c){return this.on(a,b,c)},b.fn.unbind=function(a,b){return this.off(a,b)},b.fn.one=function(a,b,c,d){return this.on(a,b,c,d,1)};var w=function(){return!0},x=function(){return!1},y=/^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/,z={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};b.fn.delegate=function(a,b,c){return this.on(b,a,c)},b.fn.undelegate=function(a,b,c){return this.off(b,a,c)},b.fn.live=function(a,c){return b(document.body).delegate(this.selector,a,c),this},b.fn.die=function(a,c){return b(document.body).undelegate(this.selector,a,c),this},b.fn.on=function(a,c,d,e,f){var g,h,k=this;return a&&!q(a)?(b.each(a,function(a,b){k.on(a,c,d,b,f)}),k):(q(c)||p(e)||e===!1||(e=d,d=c,c=m),e!==m&&d!==!1||(e=d,d=m),e===!1&&(e=x),k.each(function(k,m){f&&(g=function(a){return j(m,a.type,e),e.apply(this,arguments)}),c&&(h=function(a){var d,f=b(a.target).closest(c,m).get(0);if(f&&f!==m)return d=b.extend(l(a),{currentTarget:f,liveFired:m}),(g||e).apply(f,[d].concat(o.call(arguments,1)))}),i(m,a,e,d,c,h||g)}))},b.fn.off=function(a,c,d){var e=this;return a&&!q(a)?(b.each(a,function(a,b){e.off(a,c,b)}),e):(q(c)||p(d)||d===!1||(d=c,c=m),d===!1&&(d=x),e.each(function(){j(this,a,d,c)}))},b.fn.trigger=function(a,c){return a=q(a)||b.isPlainObject(a)?b.Event(a):k(a),a._args=c,this.each(function(){a.type in u&&"function"==typeof this[a.type]?this[a.type]():"dispatchEvent"in this?this.dispatchEvent(a):b(this).triggerHandler(a,c)})},b.fn.triggerHandler=function(a,c){var e,f;return this.each(function(g,h){e=l(q(a)?b.Event(a):a),e._args=c,e.target=h,b.each(d(h,a.type||a),function(a,b){if(f=b.proxy(e),e.isImmediatePropagationStopped())return!1})}),f},"focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(a){b.fn[a]=function(b){return 0 in arguments?this.bind(a,b):this.trigger(a)}}),b.Event=function(a,b){q(a)||(b=a,a=b.type);var c=document.createEvent(s[a]||"Events"),d=!0;if(b)for(var e in b)"bubbles"==e?d=!!b[e]:c[e]=b[e];return c.initEvent(a,d,!0),k(c)}}(b),function(a){var b,c=[];a.fn.remove=function(){return this.each(function(){this.parentNode&&("IMG"===this.tagName&&(c.push(this),this.src="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",b&&clearTimeout(b),b=setTimeout(function(){c=[]},6e4)),this.parentNode.removeChild(this))})}}(b),function(a){function b(b,d){var i=b[h],j=i&&e[i];if(void 0===d)return j||c(b);if(j){if(d in j)return j[d];var k=g(d);if(k in j)return j[k]}return f.call(a(b),d)}function c(b,c,f){var i=b[h]||(b[h]=++a.uuid),j=e[i]||(e[i]=d(b));return void 0!==c&&(j[g(c)]=f),j}function d(b){var c={};return a.each(b.attributes||i,function(b,d){0==d.name.indexOf("data-")&&(c[g(d.name.replace("data-",""))]=a.zepto.deserializeValue(d.value))}),c}var e={},f=a.fn.data,g=a.camelCase,h=a.expando="Zepto"+ +new Date,i=[];a.fn.data=function(d,e){return void 0===e?a.isPlainObject(d)?this.each(function(b,e){a.each(d,function(a,b){c(e,a,b)})}):0 in this?b(this[0],d):void 0:this.each(function(){c(this,d,e)})},a.data=function(b,c,d){return a(b).data(c,d)},a.hasData=function(b){var c=b[h],d=c&&e[c];return!!d&&!a.isEmptyObject(d)},a.fn.removeData=function(b){return"string"==typeof b&&(b=b.split(/\s+/)),this.each(function(){var c=this[h],d=c&&e[c];d&&a.each(b||d,function(a){delete d[b?g(this):a]})})},["remove","empty"].forEach(function(b){var c=a.fn[b];a.fn[b]=function(){var a=this.find("*");return"remove"===b&&(a=a.add(this)),a.removeData(),c.call(this)}})}(b),b}(b)}(window)},function(a,b){"use strict";a.exports={element:null}},function(a,b,c){"use strict";function d(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var e=c(3);a.exports={isArray:null,isFunction:null,isObject:null,bind:null,each:null,map:null,mixin:null,isMsie:function(a){if(void 0===a&&(a=navigator.userAgent),/(msie|trident)/i.test(a)){var b=a.match(/(msie |rv:)(\d+(.\d+)?)/i);if(b)return b[2]}return!1},escapeRegExChars:function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isNumber:function(a){return"number"==typeof a},toStr:function(a){return void 0===a||null===a?"":a+""},cloneDeep:function(a){var b=this.mixin({},a),c=this;return this.each(b,function(a,d){a&&(c.isArray(a)?b[d]=[].concat(a):c.isObject(a)&&(b[d]=c.cloneDeep(a)))}),b},error:function(a){throw new Error(a)},every:function(a,b){var c=!0;return a?(this.each(a,function(d,e){c&&(c=b.call(null,d,e,a)&&c)}),!!c):c},any:function(a,b){var c=!1;return a?(this.each(a,function(d,e){if(b.call(null,d,e,a))return c=!0,!1}),c):c},getUniqueId:function(){var a=0;return function(){return a++}}(),templatify:function(a){if(this.isFunction(a))return a;var b=e.element(a);return"SCRIPT"===b.prop("tagName")?function(){return b.text()}:function(){return String(a)}},defer:function(a){setTimeout(a,0)},noop:function(){},formatPrefix:function(a,b){return b?"":a+"-"},className:function(a,b,c){return(c?"":".")+a+b},escapeHighlightedString:function(a,b,c){b=b||"";var e=document.createElement("div");e.appendChild(document.createTextNode(b)),c=c||"";var f=document.createElement("div");f.appendChild(document.createTextNode(c));var g=document.createElement("div");return g.appendChild(document.createTextNode(a)),g.innerHTML.replace(RegExp(d(e.innerHTML),"g"),b).replace(RegExp(d(f.innerHTML),"g"),c)}}},function(a,b,c){"use strict";function d(a){var b,c;if(a=a||{},a.input||i.error("missing input"),this.isActivated=!1,this.debug=!!a.debug,this.autoselect=!!a.autoselect,this.autoselectOnBlur=!!a.autoselectOnBlur,this.openOnFocus=!!a.openOnFocus,this.minLength=i.isNumber(a.minLength)?a.minLength:1,this.autoWidth=void 0===a.autoWidth||!!a.autoWidth,this.clearOnSelected=!!a.clearOnSelected,this.tabAutocomplete=void 0===a.tabAutocomplete||!!a.tabAutocomplete,a.hint=!!a.hint,a.hint&&a.appendTo)throw new Error("[autocomplete.js] hint and appendTo options can't be used at the same time");this.css=a.css=i.mixin({},o,a.appendTo?o.appendTo:{}),this.cssClasses=a.cssClasses=i.mixin({},o.defaultClasses,a.cssClasses||{}),this.cssClasses.prefix=a.cssClasses.formattedPrefix=i.formatPrefix(this.cssClasses.prefix,this.cssClasses.noPrefix),this.listboxId=a.listboxId=[this.cssClasses.root,"listbox",i.getUniqueId()].join("-");var f=e(a);this.$node=f.wrapper;var g=this.$input=f.input;b=f.menu,c=f.hint,a.dropdownMenuContainer&&j.element(a.dropdownMenuContainer).css("position","relative").append(b.css("top","0")),g.on("blur.aa",function(a){var c=document.activeElement;i.isMsie()&&(b[0]===c||b[0].contains(c))&&(a.preventDefault(),a.stopImmediatePropagation(),i.defer(function(){g.focus()}))}),b.on("mousedown.aa",function(a){a.preventDefault()}),this.eventBus=a.eventBus||new k({el:g}),this.dropdown=new d.Dropdown({appendTo:a.appendTo,wrapper:this.$node,menu:b,datasets:a.datasets,templates:a.templates,cssClasses:a.cssClasses,minLength:this.minLength}).onSync("suggestionClicked",this._onSuggestionClicked,this).onSync("cursorMoved",this._onCursorMoved,this).onSync("cursorRemoved",this._onCursorRemoved,this).onSync("opened",this._onOpened,this).onSync("closed",this._onClosed,this).onSync("shown",this._onShown,this).onSync("empty",this._onEmpty,this).onSync("redrawn",this._onRedrawn,this).onAsync("datasetRendered",this._onDatasetRendered,this),this.input=new d.Input({input:g,hint:c}).onSync("focused",this._onFocused,this).onSync("blurred",this._onBlurred,this).onSync("enterKeyed",this._onEnterKeyed,this).onSync("tabKeyed",this._onTabKeyed,this).onSync("escKeyed",this._onEscKeyed,this).onSync("upKeyed",this._onUpKeyed,this).onSync("downKeyed",this._onDownKeyed,this).onSync("leftKeyed",this._onLeftKeyed,this).onSync("rightKeyed",this._onRightKeyed,this).onSync("queryChanged",this._onQueryChanged,this).onSync("whitespaceChanged",this._onWhitespaceChanged,this),this._bindKeyboardShortcuts(a),this._setLanguageDirection()}function e(a){var b,c,d,e;b=j.element(a.input),c=j.element(n.wrapper.replace("%ROOT%",a.cssClasses.root)).css(a.css.wrapper),a.appendTo||"block"!==b.css("display")||"table"!==b.parent().css("display")||c.css("display","table-cell");var g=n.dropdown.replace("%PREFIX%",a.cssClasses.prefix).replace("%DROPDOWN_MENU%",a.cssClasses.dropdownMenu);d=j.element(g).css(a.css.dropdown).attr({role:"listbox",id:a.listboxId}),a.templates&&a.templates.dropdownMenu&&d.html(i.templatify(a.templates.dropdownMenu)()),e=b.clone().css(a.css.hint).css(f(b)),e.val("").addClass(i.className(a.cssClasses.prefix,a.cssClasses.hint,!0)).removeAttr("id name placeholder required").prop("readonly",!0).attr({"aria-hidden":"true",autocomplete:"off",spellcheck:"false",tabindex:-1}),e.removeData&&e.removeData(),b.data(h,{"aria-autocomplete":b.attr("aria-autocomplete"),"aria-expanded":b.attr("aria-expanded"),"aria-owns":b.attr("aria-owns"),autocomplete:b.attr("autocomplete"),dir:b.attr("dir"),role:b.attr("role"),spellcheck:b.attr("spellcheck"),style:b.attr("style"),type:b.attr("type")}),b.addClass(i.className(a.cssClasses.prefix,a.cssClasses.input,!0)).attr({autocomplete:"off",spellcheck:!1,role:"combobox","aria-autocomplete":a.datasets&&a.datasets[0]&&a.datasets[0].displayKey?"both":"list","aria-expanded":"false","aria-label":a.ariaLabel,"aria-owns":a.listboxId}).css(a.hint?a.css.input:a.css.inputWithNoHint);try{b.attr("dir")||b.attr("dir","auto")}catch(a){}return c=a.appendTo?c.appendTo(j.element(a.appendTo).eq(0)).eq(0):b.wrap(c).parent(),c.prepend(a.hint?e:null).append(d),{wrapper:c,input:b,hint:e,menu:d}}function f(a){return{backgroundAttachment:a.css("background-attachment"),backgroundClip:a.css("background-clip"),backgroundColor:a.css("background-color"),backgroundImage:a.css("background-image"),backgroundOrigin:a.css("background-origin"),backgroundPosition:a.css("background-position"),backgroundRepeat:a.css("background-repeat"),backgroundSize:a.css("background-size")}}function g(a,b){var c=a.find(i.className(b.prefix,b.input));i.each(c.data(h),function(a,b){void 0===a?c.removeAttr(b):c.attr(b,a)}),c.detach().removeClass(i.className(b.prefix,b.input,!0)).insertAfter(a),c.removeData&&c.removeData(h),a.remove()}var h="aaAttrs",i=c(4),j=c(3),k=c(6),l=c(7),m=c(16),n=c(18),o=c(19);i.mixin(d.prototype,{_bindKeyboardShortcuts:function(a){if(a.keyboardShortcuts){var b=this.$input,c=[];i.each(a.keyboardShortcuts,function(a){"string"==typeof a&&(a=a.toUpperCase().charCodeAt(0)),c.push(a)}),j.element(document).keydown(function(a){var d=a.target||a.srcElement,e=d.tagName;if(!d.isContentEditable&&"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e){var f=a.which||a.keyCode;c.indexOf(f)!==-1&&(b.focus(),a.stopPropagation(),a.preventDefault())}})}},_onSuggestionClicked:function(a,b){var c,d={selectionMethod:"click"};(c=this.dropdown.getDatumForSuggestion(b))&&this._select(c,d)},_onCursorMoved:function(a,b){var c=this.dropdown.getDatumForCursor(),d=this.dropdown.getCurrentCursor().attr("id");this.input.setActiveDescendant(d),c&&(b&&this.input.setInputValue(c.value,!0),this.eventBus.trigger("cursorchanged",c.raw,c.datasetName))},_onCursorRemoved:function(){this.input.resetInputValue(),this._updateHint(),this.eventBus.trigger("cursorremoved")},_onDatasetRendered:function(){this._updateHint(),this.eventBus.trigger("updated")},_onOpened:function(){this._updateHint(),this.input.expand(),this.eventBus.trigger("opened")},_onEmpty:function(){this.eventBus.trigger("empty")},_onRedrawn:function(){this.$node.css("top","0px"),this.$node.css("left","0px");var a=this.$input[0].getBoundingClientRect();this.autoWidth&&this.$node.css("width",a.width+"px");var b=this.$node[0].getBoundingClientRect(),c=a.bottom-b.top;this.$node.css("top",c+"px");var d=a.left-b.left;this.$node.css("left",d+"px"),this.eventBus.trigger("redrawn")},_onShown:function(){this.eventBus.trigger("shown"),this.autoselect&&this.dropdown.cursorTopSuggestion()},_onClosed:function(){this.input.clearHint(),this.input.removeActiveDescendant(),this.input.collapse(),this.eventBus.trigger("closed")},_onFocused:function(){if(this.isActivated=!0,this.openOnFocus){var a=this.input.getQuery();a.length>=this.minLength?this.dropdown.update(a):this.dropdown.empty(),this.dropdown.open()}},_onBlurred:function(){var a,b;a=this.dropdown.getDatumForCursor(),b=this.dropdown.getDatumForTopSuggestion();var c={selectionMethod:"blur"};this.debug||(this.autoselectOnBlur&&a?this._select(a,c):this.autoselectOnBlur&&b?this._select(b,c):(this.isActivated=!1,this.dropdown.empty(),this.dropdown.close()))},_onEnterKeyed:function(a,b){var c,d
+;c=this.dropdown.getDatumForCursor(),d=this.dropdown.getDatumForTopSuggestion();var e={selectionMethod:"enterKey"};c?(this._select(c,e),b.preventDefault()):this.autoselect&&d&&(this._select(d,e),b.preventDefault())},_onTabKeyed:function(a,b){if(!this.tabAutocomplete)return void this.dropdown.close();var c,d={selectionMethod:"tabKey"};(c=this.dropdown.getDatumForCursor())?(this._select(c,d),b.preventDefault()):this._autocomplete(!0)},_onEscKeyed:function(){this.dropdown.close(),this.input.resetInputValue()},_onUpKeyed:function(){var a=this.input.getQuery();this.dropdown.isEmpty&&a.length>=this.minLength?this.dropdown.update(a):this.dropdown.moveCursorUp(),this.dropdown.open()},_onDownKeyed:function(){var a=this.input.getQuery();this.dropdown.isEmpty&&a.length>=this.minLength?this.dropdown.update(a):this.dropdown.moveCursorDown(),this.dropdown.open()},_onLeftKeyed:function(){"rtl"===this.dir&&this._autocomplete()},_onRightKeyed:function(){"ltr"===this.dir&&this._autocomplete()},_onQueryChanged:function(a,b){this.input.clearHintIfInvalid(),b.length>=this.minLength?this.dropdown.update(b):this.dropdown.empty(),this.dropdown.open(),this._setLanguageDirection()},_onWhitespaceChanged:function(){this._updateHint(),this.dropdown.open()},_setLanguageDirection:function(){var a=this.input.getLanguageDirection();this.dir!==a&&(this.dir=a,this.$node.css("direction",a),this.dropdown.setLanguageDirection(a))},_updateHint:function(){var a,b,c,d,e,f;a=this.dropdown.getDatumForTopSuggestion(),a&&this.dropdown.isVisible()&&!this.input.hasOverflow()?(b=this.input.getInputValue(),c=l.normalizeQuery(b),d=i.escapeRegExChars(c),e=new RegExp("^(?:"+d+")(.+$)","i"),f=e.exec(a.value),f?this.input.setHint(b+f[1]):this.input.clearHint()):this.input.clearHint()},_autocomplete:function(a){var b,c,d,e;b=this.input.getHint(),c=this.input.getQuery(),d=a||this.input.isCursorAtEnd(),b&&c!==b&&d&&(e=this.dropdown.getDatumForTopSuggestion(),e&&this.input.setInputValue(e.value),this.eventBus.trigger("autocompleted",e.raw,e.datasetName))},_select:function(a,b){void 0!==a.value&&this.input.setQuery(a.value),this.clearOnSelected?this.setVal(""):this.input.setInputValue(a.value,!0),this._setLanguageDirection(),this.eventBus.trigger("selected",a.raw,a.datasetName,b).isDefaultPrevented()===!1&&(this.dropdown.close(),i.defer(i.bind(this.dropdown.empty,this.dropdown)))},open:function(){if(!this.isActivated){var a=this.input.getInputValue();a.length>=this.minLength?this.dropdown.update(a):this.dropdown.empty()}this.dropdown.open()},close:function(){this.dropdown.close()},setVal:function(a){a=i.toStr(a),this.isActivated?this.input.setInputValue(a):(this.input.setQuery(a),this.input.setInputValue(a,!0)),this._setLanguageDirection()},getVal:function(){return this.input.getQuery()},destroy:function(){this.input.destroy(),this.dropdown.destroy(),g(this.$node,this.cssClasses),this.$node=null},getWrapper:function(){return this.dropdown.$container[0]}}),d.Dropdown=m,d.Input=l,d.sources=c(20),a.exports=d},function(a,b,c){"use strict";function d(a){a&&a.el||e.error("EventBus initialized without el"),this.$el=f.element(a.el)}var e=c(4),f=c(3);e.mixin(d.prototype,{trigger:function(a,b,c,d){var f=e.Event("autocomplete:"+a);return this.$el.trigger(f,[b,c,d]),f}}),a.exports=d},function(a,b,c){"use strict";function d(a){var b,c,d,f,g=this;a=a||{},a.input||i.error("input is missing"),b=i.bind(this._onBlur,this),c=i.bind(this._onFocus,this),d=i.bind(this._onKeydown,this),f=i.bind(this._onInput,this),this.$hint=j.element(a.hint),this.$input=j.element(a.input).on("blur.aa",b).on("focus.aa",c).on("keydown.aa",d),0===this.$hint.length&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=i.noop),i.isMsie()?this.$input.on("keydown.aa keypress.aa cut.aa paste.aa",function(a){h[a.which||a.keyCode]||i.defer(i.bind(g._onInput,g,a))}):this.$input.on("input.aa",f),this.query=this.$input.val(),this.$overflowHelper=e(this.$input)}function e(a){return j.element('').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:a.css("font-family"),fontSize:a.css("font-size"),fontStyle:a.css("font-style"),fontVariant:a.css("font-variant"),fontWeight:a.css("font-weight"),wordSpacing:a.css("word-spacing"),letterSpacing:a.css("letter-spacing"),textIndent:a.css("text-indent"),textRendering:a.css("text-rendering"),textTransform:a.css("text-transform")}).insertAfter(a)}function f(a,b){return d.normalizeQuery(a)===d.normalizeQuery(b)}function g(a){return a.altKey||a.ctrlKey||a.metaKey||a.shiftKey}var h;h={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"};var i=c(4),j=c(3),k=c(8);d.normalizeQuery=function(a){return(a||"").replace(/^\s*/g,"").replace(/\s{2,}/g," ")},i.mixin(d.prototype,k,{_onBlur:function(){this.resetInputValue(),this.$input.removeAttr("aria-activedescendant"),this.trigger("blurred")},_onFocus:function(){this.trigger("focused")},_onKeydown:function(a){var b=h[a.which||a.keyCode];this._managePreventDefault(b,a),b&&this._shouldTrigger(b,a)&&this.trigger(b+"Keyed",a)},_onInput:function(){this._checkInputValue()},_managePreventDefault:function(a,b){var c,d,e;switch(a){case"tab":d=this.getHint(),e=this.getInputValue(),c=d&&d!==e&&!g(b);break;case"up":case"down":c=!g(b);break;default:c=!1}c&&b.preventDefault()},_shouldTrigger:function(a,b){var c;switch(a){case"tab":c=!g(b);break;default:c=!0}return c},_checkInputValue:function(){var a,b,c;a=this.getInputValue(),b=f(a,this.query),c=!(!b||!this.query)&&this.query.length!==a.length,this.query=a,b?c&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query)},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getQuery:function(){return this.query},setQuery:function(a){this.query=a},getInputValue:function(){return this.$input.val()},setInputValue:function(a,b){void 0===a&&(a=this.query),this.$input.val(a),b?this.clearHint():this._checkInputValue()},expand:function(){this.$input.attr("aria-expanded","true")},collapse:function(){this.$input.attr("aria-expanded","false")},setActiveDescendant:function(a){this.$input.attr("aria-activedescendant",a)},removeActiveDescendant:function(){this.$input.removeAttr("aria-activedescendant")},resetInputValue:function(){this.setInputValue(this.query,!0)},getHint:function(){return this.$hint.val()},setHint:function(a){this.$hint.val(a)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var a,b,c,d;a=this.getInputValue(),b=this.getHint(),c=a!==b&&0===b.indexOf(a),(d=""!==a&&c&&!this.hasOverflow())||this.clearHint()},getLanguageDirection:function(){return(this.$input.css("direction")||"ltr").toLowerCase()},hasOverflow:function(){var a=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=a},isCursorAtEnd:function(){var a,b,c;return a=this.$input.val().length,b=this.$input[0].selectionStart,i.isNumber(b)?b===a:!document.selection||(c=document.selection.createRange(),c.moveStart("character",-a),a===c.text.length)},destroy:function(){this.$hint.off(".aa"),this.$input.off(".aa"),this.$hint=this.$input=this.$overflowHelper=null}}),a.exports=d},function(a,b,c){"use strict";function d(a,b,c,d){var e;if(!c)return this;for(b=b.split(l),c=d?j(c,d):c,this._callbacks=this._callbacks||{};e=b.shift();)this._callbacks[e]=this._callbacks[e]||{sync:[],async:[]},this._callbacks[e][a].push(c);return this}function e(a,b,c){return d.call(this,"async",a,b,c)}function f(a,b,c){return d.call(this,"sync",a,b,c)}function g(a){var b;if(!this._callbacks)return this;for(a=a.split(l);b=a.shift();)delete this._callbacks[b];return this}function h(a){var b,c,d,e,f;if(!this._callbacks)return this;for(a=a.split(l),d=[].slice.call(arguments,1);(b=a.shift())&&(c=this._callbacks[b]);)e=i(c.sync,this,[b].concat(d)),f=i(c.async,this,[b].concat(d)),e()&&k(f);return this}function i(a,b,c){function d(){for(var d,e=0,f=a.length;!d&&e1)for(var c=1;c1)for(var c=1;c'),this.$menu.append(this.$empty),this.$empty.hide()),this.datasets=f.map(a.datasets,function(b){return e(h.$menu,b,a.cssClasses)}),f.each(this.datasets,function(a){var b=a.getRoot();b&&0===b.parent().length&&h.$menu.append(b),a.onSync("rendered",h._onRendered,h)}),a.templates&&a.templates.footer&&(this.templates.footer=f.templatify(a.templates.footer),this.$menu.append(this.templates.footer()));var k=this;g.element(window).resize(function(){k._redraw()})}function e(a,b,c){return new d.Dataset(f.mixin({$menu:a,cssClasses:c},b))}var f=c(4),g=c(3),h=c(8),i=c(17),j=c(19);f.mixin(d.prototype,h,{_onSuggestionClick:function(a){this.trigger("suggestionClicked",g.element(a.currentTarget))},_onSuggestionMouseEnter:function(a){var b=g.element(a.currentTarget);if(!b.hasClass(f.className(this.cssClasses.prefix,this.cssClasses.cursor,!0))){this._removeCursor();var c=this;setTimeout(function(){c._setCursor(b,!1)},0)}},_onSuggestionMouseLeave:function(a){if(a.relatedTarget){if(g.element(a.relatedTarget).closest("."+f.className(this.cssClasses.prefix,this.cssClasses.cursor,!0)).length>0)return}this._removeCursor(),this.trigger("cursorRemoved")},_onRendered:function(a,b){function c(a){return a.isEmpty()}function d(a){return a.templates&&a.templates.empty}if(this.isEmpty=f.every(this.datasets,c),this.isEmpty)if(b.length>=this.minLength&&this.trigger("empty"),this.$empty)if(b.length=this.minLength?this._show():this._hide());this.trigger("datasetRendered")},_hide:function(){this.$container.hide()},_show:function(){this.$container.css("display","block"),this._redraw(),this.trigger("shown")},_redraw:function(){this.isOpen&&this.appendTo&&this.trigger("redrawn")},_getSuggestions:function(){return this.$menu.find(f.className(this.cssClasses.prefix,this.cssClasses.suggestion))},_getCursor:function(){return this.$menu.find(f.className(this.cssClasses.prefix,this.cssClasses.cursor)).first()},_setCursor:function(a,b){a.first().addClass(f.className(this.cssClasses.prefix,this.cssClasses.cursor,!0)).attr("aria-selected","true"),this.trigger("cursorMoved",b)},_removeCursor:function(){this._getCursor().removeClass(f.className(this.cssClasses.prefix,this.cssClasses.cursor,!0)).removeAttr("aria-selected")},_moveCursor:function(a){var b,c,d,e;if(this.isOpen){if(c=this._getCursor(),b=this._getSuggestions(),this._removeCursor(),d=b.index(c)+a,(d=(d+1)%(b.length+1)-1)===-1)return void this.trigger("cursorRemoved");d<-1&&(d=b.length-1),this._setCursor(e=b.eq(d),!0),this._ensureVisible(e)}},_ensureVisible:function(a){var b,c,d,e;b=a.position().top,c=b+a.height()+parseInt(a.css("margin-top"),10)+parseInt(a.css("margin-bottom"),10),d=this.$menu.scrollTop(),e=this.$menu.height()+parseInt(this.$menu.css("padding-top"),10)+parseInt(this.$menu.css("padding-bottom"),10),b<0?this.$menu.scrollTop(d+b):e0?l.element(a.$menu.find(b+"-"+this.name)[0]):l.element(m.dataset.replace("%CLASS%",this.name).replace("%PREFIX%",this.cssClasses.prefix).replace("%DATASET%",this.cssClasses.dataset)),this.$menu=a.$menu,this.clearCachedSuggestions()}function e(a){function b(b){return b[a]}return a=a||"value",k.isFunction(a)?a:b}function f(a,b){function c(a){return""+b(a)+"
"}return{empty:a.empty&&k.templatify(a.empty),header:a.header&&k.templatify(a.header),footer:a.footer&&k.templatify(a.footer),suggestion:a.suggestion||c}}function g(a){return/^[_a-zA-Z0-9-]+$/.test(a)}var h="aaDataset",i="aaValue",j="aaDatum",k=c(4),l=c(3),m=c(18),n=c(19),o=c(8);d.extractDatasetName=function(a){return l.element(a).data(h)},d.extractValue=function(a){return l.element(a).data(i)},d.extractDatum=function(a){var b=l.element(a).data(j);return"string"==typeof b&&(b=JSON.parse(b)),b},k.mixin(d.prototype,o,{_render:function(a,b){function c(){var b=[].slice.call(arguments,0);return b=[{query:a,isEmpty:!0}].concat(b),n.templates.empty.apply(this,b)}function d(){function a(a){var b,c=m.suggestion.replace("%PREFIX%",f.cssClasses.prefix).replace("%SUGGESTION%",f.cssClasses.suggestion);return b=l.element(c).attr({role:"option",id:["option",Math.floor(1e8*Math.random())].join("-")}).append(n.templates.suggestion.apply(this,[a].concat(e))),b.data(h,n.name),b.data(i,n.displayFn(a)||void 0),b.data(j,JSON.stringify(a)),b.children().each(function(){l.element(this).css(f.css.suggestionChild)}),b}var c,d,e=[].slice.call(arguments,0),f=this,g=m.suggestions.replace("%PREFIX%",this.cssClasses.prefix).replace("%SUGGESTIONS%",this.cssClasses.suggestions);return c=l.element(g).css(this.css.suggestions),d=k.map(b,a),c.append.apply(c,d),c}function e(){var b=[].slice.call(arguments,0);return b=[{query:a,isEmpty:!g}].concat(b),n.templates.header.apply(this,b)}function f(){var b=[].slice.call(arguments,0);return b=[{query:a,isEmpty:!g}].concat(b),n.templates.footer.apply(this,b)}if(this.$el){var g,n=this,o=[].slice.call(arguments,2);if(this.$el.empty(),g=b&&b.length,this._isEmpty=!g,!g&&this.templates.empty)this.$el.html(c.apply(this,o)).prepend(n.templates.header?e.apply(this,o):null).append(n.templates.footer?f.apply(this,o):null);else if(g)this.$el.html(d.apply(this,o)).prepend(n.templates.header?e.apply(this,o):null).append(n.templates.footer?f.apply(this,o):null);else if(b&&!Array.isArray(b))throw new TypeError("suggestions must be an array");this.$menu&&this.$menu.addClass(this.cssClasses.prefix+(g?"with":"without")+"-"+this.name).removeClass(this.cssClasses.prefix+(g?"without":"with")+"-"+this.name),this.trigger("rendered",a)}},getRoot:function(){return this.$el},update:function(a){function b(b){if(!this.canceled&&a===this.query){var c=[].slice.call(arguments,1);this.cacheSuggestions(a,b,c),this._render.apply(this,[a,b].concat(c))}}if(this.query=a,this.canceled=!1,this.shouldFetchFromCache(a))b.apply(this,[this.cachedSuggestions].concat(this.cachedRenderExtraArgs));else{var c=this,d=function(){c.canceled||c.source(a,b.bind(c))};if(this.debounce){var e=function(){c.debounceTimeout=null,d()};clearTimeout(this.debounceTimeout),this.debounceTimeout=setTimeout(e,this.debounce)}else d()}},cacheSuggestions:function(a,b,c){this.cachedQuery=a,this.cachedSuggestions=b,this.cachedRenderExtraArgs=c},shouldFetchFromCache:function(a){return this.cache&&this.cachedQuery===a&&this.cachedSuggestions&&this.cachedSuggestions.length},clearCachedSuggestions:function(){delete this.cachedQuery,delete this.cachedSuggestions,delete this.cachedRenderExtraArgs},cancel:function(){this.canceled=!0},clear:function(){this.$el&&(this.cancel(),this.$el.empty(),this.trigger("rendered",""))},isEmpty:function(){return this._isEmpty},destroy:function(){this.clearCachedSuggestions(),this.$el=null}}),a.exports=d},function(a,b){"use strict";a.exports={wrapper:'',dropdown:'',dataset:'',suggestions:'',suggestion:''}},function(a,b,c){"use strict";var d=c(4),e={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},dropdown:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},suggestions:{display:"block"},suggestion:{whiteSpace:"nowrap",cursor:"pointer"},suggestionChild:{whiteSpace:"normal"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:"0"},defaultClasses:{root:"algolia-autocomplete",prefix:"aa",noPrefix:!1,dropdownMenu:"dropdown-menu",input:"input",hint:"hint",suggestions:"suggestions",suggestion:"suggestion",cursor:"cursor",dataset:"dataset",empty:"empty"},appendTo:{wrapper:{position:"absolute",zIndex:"100",display:"none"},input:{},inputWithNoHint:{},dropdown:{display:"block"}}};d.isMsie()&&d.mixin(e.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),d.isMsie()&&d.isMsie()<=7&&d.mixin(e.input,{marginTop:"-1px"}),a.exports=e},function(a,b,c){"use strict";a.exports={hits:c(21),popularIn:c(24)}},function(a,b,c){"use strict";var d=c(4),e=c(22),f=c(23);a.exports=function(a,b){function c(c,e){a.search(c,b,function(a,b){if(a)return void d.error(a.message);e(b.hits,b)})}var g=f(a.as._ua);return g&&g[0]>=3&&g[1]>20&&(b=b||{},b.additionalUA="autocomplete.js "+e),c}},function(a,b){a.exports="0.37.1"},function(a,b){"use strict";a.exports=function(a){var b=a.match(/Algolia for JavaScript \((\d+\.)(\d+\.)(\d+)\)/)||a.match(/Algolia for vanilla JavaScript (\d+\.)(\d+\.)(\d+)/);if(b)return[b[1],b[2],b[3]]}},function(a,b,c){"use strict";var d=c(4),e=c(22),f=c(23);a.exports=function(a,b,c,g){function h(h,i){a.search(h,b,function(a,h){if(a)return void d.error(a.message);if(h.hits.length>0){var l=h.hits[0],m=d.mixin({hitsPerPage:0},c);delete m.source,delete m.index;var n=f(k.as._ua);return n&&n[0]>=3&&n[1]>20&&(b.additionalUA="autocomplete.js "+e),void k.search(j(l),m,function(a,b){if(a)return void d.error(a.message);var c=[];if(g.includeAll){var e=g.allTitle||"All departments";c.push(d.mixin({facet:{value:e,count:b.nbHits}},d.cloneDeep(l)))}d.each(b.facets,function(a,b){d.each(a,function(a,e){c.push(d.mixin({facet:{facet:b,value:e,count:a}},d.cloneDeep(l)))})});for(var f=1;f=3&&i[1]>20&&(b=b||{},b.additionalUA="autocomplete.js "+e),!c.source)return d.error("Missing 'source' key");var j=d.isFunction(c.source)?c.source:function(a){return a[c.source]};if(!c.index)return d.error("Missing 'index' key");var k=c.index;return g=g||{},h}}])});
\ No newline at end of file
diff --git a/assets/lib/lunr/lunr.fr.js b/assets/lib/lunr/lunr.fr.js
new file mode 100644
index 00000000..2de6d469
--- /dev/null
+++ b/assets/lib/lunr/lunr.fr.js
@@ -0,0 +1,703 @@
+/*!
+ * Lunr languages, `French` language
+ * https://github.com/MihaiValentin/lunr-languages
+ *
+ * Copyright 2014, Mihai Valentin
+ * http://www.mozilla.org/MPL/
+ */
+/*!
+ * based on
+ * Snowball JavaScript Library v0.3
+ * http://code.google.com/p/urim/
+ * http://snowball.tartarus.org/
+ *
+ * Copyright 2010, Oleg Mazko
+ * http://www.mozilla.org/MPL/
+ */
+
+/**
+ * export the module via AMD, CommonJS or as a browser global
+ * Export code from https://github.com/umdjs/umd/blob/master/returnExports.js
+ */
+;
+(function(root, factory) {
+ if (typeof define === 'function' && define.amd) {
+ // AMD. Register as an anonymous module.
+ define(factory)
+ } else if (typeof exports === 'object') {
+ /**
+ * Node. Does not work with strict CommonJS, but
+ * only CommonJS-like environments that support module.exports,
+ * like Node.
+ */
+ module.exports = factory()
+ } else {
+ // Browser globals (root is window)
+ factory()(root.lunr);
+ }
+}(this, function() {
+ /**
+ * Just return a value to define the module export.
+ * This example returns an object, but the module
+ * can return a function as the exported value.
+ */
+ return function(lunr) {
+ /* throw error if lunr is not yet included */
+ if ('undefined' === typeof lunr) {
+ throw new Error('Lunr is not present. Please include / require Lunr before this script.');
+ }
+
+ /* throw error if lunr stemmer support is not yet included */
+ if ('undefined' === typeof lunr.stemmerSupport) {
+ throw new Error('Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.');
+ }
+
+ /* register specific locale function */
+ lunr.fr = function() {
+ this.pipeline.reset();
+ this.pipeline.add(
+ lunr.fr.trimmer,
+ lunr.fr.stopWordFilter,
+ lunr.fr.stemmer
+ );
+
+ // for lunr version 2
+ // this is necessary so that every searched word is also stemmed before
+ // in lunr <= 1 this is not needed, as it is done using the normal pipeline
+ if (this.searchPipeline) {
+ this.searchPipeline.reset();
+ this.searchPipeline.add(lunr.fr.stemmer)
+ }
+ };
+
+ /* lunr trimmer function */
+ lunr.fr.wordCharacters = "A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A";
+ lunr.fr.trimmer = lunr.trimmerSupport.generateTrimmer(lunr.fr.wordCharacters);
+
+ lunr.Pipeline.registerFunction(lunr.fr.trimmer, 'trimmer-fr');
+
+ /* lunr stemmer function */
+ lunr.fr.stemmer = (function() {
+ /* create the wrapped stemmer object */
+ var Among = lunr.stemmerSupport.Among,
+ SnowballProgram = lunr.stemmerSupport.SnowballProgram,
+ st = new function FrenchStemmer() {
+ var a_0 = [new Among("col", -1, -1), new Among("par", -1, -1),
+ new Among("tap", -1, -1)
+ ],
+ a_1 = [new Among("", -1, 4),
+ new Among("I", 0, 1), new Among("U", 0, 2), new Among("Y", 0, 3)
+ ],
+ a_2 = [
+ new Among("iqU", -1, 3), new Among("abl", -1, 3),
+ new Among("I\u00E8r", -1, 4), new Among("i\u00E8r", -1, 4),
+ new Among("eus", -1, 2), new Among("iv", -1, 1)
+ ],
+ a_3 = [
+ new Among("ic", -1, 2), new Among("abil", -1, 1),
+ new Among("iv", -1, 3)
+ ],
+ a_4 = [new Among("iqUe", -1, 1),
+ new Among("atrice", -1, 2), new Among("ance", -1, 1),
+ new Among("ence", -1, 5), new Among("logie", -1, 3),
+ new Among("able", -1, 1), new Among("isme", -1, 1),
+ new Among("euse", -1, 11), new Among("iste", -1, 1),
+ new Among("ive", -1, 8), new Among("if", -1, 8),
+ new Among("usion", -1, 4), new Among("ation", -1, 2),
+ new Among("ution", -1, 4), new Among("ateur", -1, 2),
+ new Among("iqUes", -1, 1), new Among("atrices", -1, 2),
+ new Among("ances", -1, 1), new Among("ences", -1, 5),
+ new Among("logies", -1, 3), new Among("ables", -1, 1),
+ new Among("ismes", -1, 1), new Among("euses", -1, 11),
+ new Among("istes", -1, 1), new Among("ives", -1, 8),
+ new Among("ifs", -1, 8), new Among("usions", -1, 4),
+ new Among("ations", -1, 2), new Among("utions", -1, 4),
+ new Among("ateurs", -1, 2), new Among("ments", -1, 15),
+ new Among("ements", 30, 6), new Among("issements", 31, 12),
+ new Among("it\u00E9s", -1, 7), new Among("ment", -1, 15),
+ new Among("ement", 34, 6), new Among("issement", 35, 12),
+ new Among("amment", 34, 13), new Among("emment", 34, 14),
+ new Among("aux", -1, 10), new Among("eaux", 39, 9),
+ new Among("eux", -1, 1), new Among("it\u00E9", -1, 7)
+ ],
+ a_5 = [
+ new Among("ira", -1, 1), new Among("ie", -1, 1),
+ new Among("isse", -1, 1), new Among("issante", -1, 1),
+ new Among("i", -1, 1), new Among("irai", 4, 1),
+ new Among("ir", -1, 1), new Among("iras", -1, 1),
+ new Among("ies", -1, 1), new Among("\u00EEmes", -1, 1),
+ new Among("isses", -1, 1), new Among("issantes", -1, 1),
+ new Among("\u00EEtes", -1, 1), new Among("is", -1, 1),
+ new Among("irais", 13, 1), new Among("issais", 13, 1),
+ new Among("irions", -1, 1), new Among("issions", -1, 1),
+ new Among("irons", -1, 1), new Among("issons", -1, 1),
+ new Among("issants", -1, 1), new Among("it", -1, 1),
+ new Among("irait", 21, 1), new Among("issait", 21, 1),
+ new Among("issant", -1, 1), new Among("iraIent", -1, 1),
+ new Among("issaIent", -1, 1), new Among("irent", -1, 1),
+ new Among("issent", -1, 1), new Among("iront", -1, 1),
+ new Among("\u00EEt", -1, 1), new Among("iriez", -1, 1),
+ new Among("issiez", -1, 1), new Among("irez", -1, 1),
+ new Among("issez", -1, 1)
+ ],
+ a_6 = [new Among("a", -1, 3),
+ new Among("era", 0, 2), new Among("asse", -1, 3),
+ new Among("ante", -1, 3), new Among("\u00E9e", -1, 2),
+ new Among("ai", -1, 3), new Among("erai", 5, 2),
+ new Among("er", -1, 2), new Among("as", -1, 3),
+ new Among("eras", 8, 2), new Among("\u00E2mes", -1, 3),
+ new Among("asses", -1, 3), new Among("antes", -1, 3),
+ new Among("\u00E2tes", -1, 3), new Among("\u00E9es", -1, 2),
+ new Among("ais", -1, 3), new Among("erais", 15, 2),
+ new Among("ions", -1, 1), new Among("erions", 17, 2),
+ new Among("assions", 17, 3), new Among("erons", -1, 2),
+ new Among("ants", -1, 3), new Among("\u00E9s", -1, 2),
+ new Among("ait", -1, 3), new Among("erait", 23, 2),
+ new Among("ant", -1, 3), new Among("aIent", -1, 3),
+ new Among("eraIent", 26, 2), new Among("\u00E8rent", -1, 2),
+ new Among("assent", -1, 3), new Among("eront", -1, 2),
+ new Among("\u00E2t", -1, 3), new Among("ez", -1, 2),
+ new Among("iez", 32, 2), new Among("eriez", 33, 2),
+ new Among("assiez", 33, 3), new Among("erez", 32, 2),
+ new Among("\u00E9", -1, 2)
+ ],
+ a_7 = [new Among("e", -1, 3),
+ new Among("I\u00E8re", 0, 2), new Among("i\u00E8re", 0, 2),
+ new Among("ion", -1, 1), new Among("Ier", -1, 2),
+ new Among("ier", -1, 2), new Among("\u00EB", -1, 4)
+ ],
+ a_8 = [
+ new Among("ell", -1, -1), new Among("eill", -1, -1),
+ new Among("enn", -1, -1), new Among("onn", -1, -1),
+ new Among("ett", -1, -1)
+ ],
+ g_v = [17, 65, 16, 1, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 128, 130, 103, 8, 5
+ ],
+ g_keep_with_s = [1, 65, 20, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128
+ ],
+ I_p2, I_p1, I_pV, sbp = new SnowballProgram();
+ this.setCurrent = function(word) {
+ sbp.setCurrent(word);
+ };
+ this.getCurrent = function() {
+ return sbp.getCurrent();
+ };
+
+ function habr1(c1, c2, v_1) {
+ if (sbp.eq_s(1, c1)) {
+ sbp.ket = sbp.cursor;
+ if (sbp.in_grouping(g_v, 97, 251)) {
+ sbp.slice_from(c2);
+ sbp.cursor = v_1;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ function habr2(c1, c2, v_1) {
+ if (sbp.eq_s(1, c1)) {
+ sbp.ket = sbp.cursor;
+ sbp.slice_from(c2);
+ sbp.cursor = v_1;
+ return true;
+ }
+ return false;
+ }
+
+ function r_prelude() {
+ var v_1, v_2;
+ while (true) {
+ v_1 = sbp.cursor;
+ if (sbp.in_grouping(g_v, 97, 251)) {
+ sbp.bra = sbp.cursor;
+ v_2 = sbp.cursor;
+ if (habr1("u", "U", v_1))
+ continue;
+ sbp.cursor = v_2;
+ if (habr1("i", "I", v_1))
+ continue;
+ sbp.cursor = v_2;
+ if (habr2("y", "Y", v_1))
+ continue;
+ }
+ sbp.cursor = v_1;
+ sbp.bra = v_1;
+ if (!habr1("y", "Y", v_1)) {
+ sbp.cursor = v_1;
+ if (sbp.eq_s(1, "q")) {
+ sbp.bra = sbp.cursor;
+ if (habr2("u", "U", v_1))
+ continue;
+ }
+ sbp.cursor = v_1;
+ if (v_1 >= sbp.limit)
+ return;
+ sbp.cursor++;
+ }
+ }
+ }
+
+ function habr3() {
+ while (!sbp.in_grouping(g_v, 97, 251)) {
+ if (sbp.cursor >= sbp.limit)
+ return true;
+ sbp.cursor++;
+ }
+ while (!sbp.out_grouping(g_v, 97, 251)) {
+ if (sbp.cursor >= sbp.limit)
+ return true;
+ sbp.cursor++;
+ }
+ return false;
+ }
+
+ function r_mark_regions() {
+ var v_1 = sbp.cursor;
+ I_pV = sbp.limit;
+ I_p1 = I_pV;
+ I_p2 = I_pV;
+ if (sbp.in_grouping(g_v, 97, 251) && sbp.in_grouping(g_v, 97, 251) &&
+ sbp.cursor < sbp.limit)
+ sbp.cursor++;
+ else {
+ sbp.cursor = v_1;
+ if (!sbp.find_among(a_0, 3)) {
+ sbp.cursor = v_1;
+ do {
+ if (sbp.cursor >= sbp.limit) {
+ sbp.cursor = I_pV;
+ break;
+ }
+ sbp.cursor++;
+ } while (!sbp.in_grouping(g_v, 97, 251));
+ }
+ }
+ I_pV = sbp.cursor;
+ sbp.cursor = v_1;
+ if (!habr3()) {
+ I_p1 = sbp.cursor;
+ if (!habr3())
+ I_p2 = sbp.cursor;
+ }
+ }
+
+ function r_postlude() {
+ var among_var, v_1;
+ while (true) {
+ v_1 = sbp.cursor;
+ sbp.bra = v_1;
+ among_var = sbp.find_among(a_1, 4);
+ if (!among_var)
+ break;
+ sbp.ket = sbp.cursor;
+ switch (among_var) {
+ case 1:
+ sbp.slice_from("i");
+ break;
+ case 2:
+ sbp.slice_from("u");
+ break;
+ case 3:
+ sbp.slice_from("y");
+ break;
+ case 4:
+ if (sbp.cursor >= sbp.limit)
+ return;
+ sbp.cursor++;
+ break;
+ }
+ }
+ }
+
+ function r_RV() {
+ return I_pV <= sbp.cursor;
+ }
+
+ function r_R1() {
+ return I_p1 <= sbp.cursor;
+ }
+
+ function r_R2() {
+ return I_p2 <= sbp.cursor;
+ }
+
+ function r_standard_suffix() {
+ var among_var, v_1;
+ sbp.ket = sbp.cursor;
+ among_var = sbp.find_among_b(a_4, 43);
+ if (among_var) {
+ sbp.bra = sbp.cursor;
+ switch (among_var) {
+ case 1:
+ if (!r_R2())
+ return false;
+ sbp.slice_del();
+ break;
+ case 2:
+ if (!r_R2())
+ return false;
+ sbp.slice_del();
+ sbp.ket = sbp.cursor;
+ if (sbp.eq_s_b(2, "ic")) {
+ sbp.bra = sbp.cursor;
+ if (!r_R2())
+ sbp.slice_from("iqU");
+ else
+ sbp.slice_del();
+ }
+ break;
+ case 3:
+ if (!r_R2())
+ return false;
+ sbp.slice_from("log");
+ break;
+ case 4:
+ if (!r_R2())
+ return false;
+ sbp.slice_from("u");
+ break;
+ case 5:
+ if (!r_R2())
+ return false;
+ sbp.slice_from("ent");
+ break;
+ case 6:
+ if (!r_RV())
+ return false;
+ sbp.slice_del();
+ sbp.ket = sbp.cursor;
+ among_var = sbp.find_among_b(a_2, 6);
+ if (among_var) {
+ sbp.bra = sbp.cursor;
+ switch (among_var) {
+ case 1:
+ if (r_R2()) {
+ sbp.slice_del();
+ sbp.ket = sbp.cursor;
+ if (sbp.eq_s_b(2, "at")) {
+ sbp.bra = sbp.cursor;
+ if (r_R2())
+ sbp.slice_del();
+ }
+ }
+ break;
+ case 2:
+ if (r_R2())
+ sbp.slice_del();
+ else if (r_R1())
+ sbp.slice_from("eux");
+ break;
+ case 3:
+ if (r_R2())
+ sbp.slice_del();
+ break;
+ case 4:
+ if (r_RV())
+ sbp.slice_from("i");
+ break;
+ }
+ }
+ break;
+ case 7:
+ if (!r_R2())
+ return false;
+ sbp.slice_del();
+ sbp.ket = sbp.cursor;
+ among_var = sbp.find_among_b(a_3, 3);
+ if (among_var) {
+ sbp.bra = sbp.cursor;
+ switch (among_var) {
+ case 1:
+ if (r_R2())
+ sbp.slice_del();
+ else
+ sbp.slice_from("abl");
+ break;
+ case 2:
+ if (r_R2())
+ sbp.slice_del();
+ else
+ sbp.slice_from("iqU");
+ break;
+ case 3:
+ if (r_R2())
+ sbp.slice_del();
+ break;
+ }
+ }
+ break;
+ case 8:
+ if (!r_R2())
+ return false;
+ sbp.slice_del();
+ sbp.ket = sbp.cursor;
+ if (sbp.eq_s_b(2, "at")) {
+ sbp.bra = sbp.cursor;
+ if (r_R2()) {
+ sbp.slice_del();
+ sbp.ket = sbp.cursor;
+ if (sbp.eq_s_b(2, "ic")) {
+ sbp.bra = sbp.cursor;
+ if (r_R2())
+ sbp.slice_del();
+ else
+ sbp.slice_from("iqU");
+ break;
+ }
+ }
+ }
+ break;
+ case 9:
+ sbp.slice_from("eau");
+ break;
+ case 10:
+ if (!r_R1())
+ return false;
+ sbp.slice_from("al");
+ break;
+ case 11:
+ if (r_R2())
+ sbp.slice_del();
+ else if (!r_R1())
+ return false;
+ else
+ sbp.slice_from("eux");
+ break;
+ case 12:
+ if (!r_R1() || !sbp.out_grouping_b(g_v, 97, 251))
+ return false;
+ sbp.slice_del();
+ break;
+ case 13:
+ if (r_RV())
+ sbp.slice_from("ant");
+ return false;
+ case 14:
+ if (r_RV())
+ sbp.slice_from("ent");
+ return false;
+ case 15:
+ v_1 = sbp.limit - sbp.cursor;
+ if (sbp.in_grouping_b(g_v, 97, 251) && r_RV()) {
+ sbp.cursor = sbp.limit - v_1;
+ sbp.slice_del();
+ }
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ function r_i_verb_suffix() {
+ var among_var, v_1;
+ if (sbp.cursor < I_pV)
+ return false;
+ v_1 = sbp.limit_backward;
+ sbp.limit_backward = I_pV;
+ sbp.ket = sbp.cursor;
+ among_var = sbp.find_among_b(a_5, 35);
+ if (!among_var) {
+ sbp.limit_backward = v_1;
+ return false;
+ }
+ sbp.bra = sbp.cursor;
+ if (among_var == 1) {
+ if (!sbp.out_grouping_b(g_v, 97, 251)) {
+ sbp.limit_backward = v_1;
+ return false;
+ }
+ sbp.slice_del();
+ }
+ sbp.limit_backward = v_1;
+ return true;
+ }
+
+ function r_verb_suffix() {
+ var among_var, v_2, v_3;
+ if (sbp.cursor < I_pV)
+ return false;
+ v_2 = sbp.limit_backward;
+ sbp.limit_backward = I_pV;
+ sbp.ket = sbp.cursor;
+ among_var = sbp.find_among_b(a_6, 38);
+ if (!among_var) {
+ sbp.limit_backward = v_2;
+ return false;
+ }
+ sbp.bra = sbp.cursor;
+ switch (among_var) {
+ case 1:
+ if (!r_R2()) {
+ sbp.limit_backward = v_2;
+ return false;
+ }
+ sbp.slice_del();
+ break;
+ case 2:
+ sbp.slice_del();
+ break;
+ case 3:
+ sbp.slice_del();
+ v_3 = sbp.limit - sbp.cursor;
+ sbp.ket = sbp.cursor;
+ if (sbp.eq_s_b(1, "e")) {
+ sbp.bra = sbp.cursor;
+ sbp.slice_del();
+ } else
+ sbp.cursor = sbp.limit - v_3;
+ break;
+ }
+ sbp.limit_backward = v_2;
+ return true;
+ }
+
+ function r_residual_suffix() {
+ var among_var, v_1 = sbp.limit - sbp.cursor,
+ v_2, v_4, v_5;
+ sbp.ket = sbp.cursor;
+ if (sbp.eq_s_b(1, "s")) {
+ sbp.bra = sbp.cursor;
+ v_2 = sbp.limit - sbp.cursor;
+ if (sbp.out_grouping_b(g_keep_with_s, 97, 232)) {
+ sbp.cursor = sbp.limit - v_2;
+ sbp.slice_del();
+ } else
+ sbp.cursor = sbp.limit - v_1;
+ } else
+ sbp.cursor = sbp.limit - v_1;
+ if (sbp.cursor >= I_pV) {
+ v_4 = sbp.limit_backward;
+ sbp.limit_backward = I_pV;
+ sbp.ket = sbp.cursor;
+ among_var = sbp.find_among_b(a_7, 7);
+ if (among_var) {
+ sbp.bra = sbp.cursor;
+ switch (among_var) {
+ case 1:
+ if (r_R2()) {
+ v_5 = sbp.limit - sbp.cursor;
+ if (!sbp.eq_s_b(1, "s")) {
+ sbp.cursor = sbp.limit - v_5;
+ if (!sbp.eq_s_b(1, "t"))
+ break;
+ }
+ sbp.slice_del();
+ }
+ break;
+ case 2:
+ sbp.slice_from("i");
+ break;
+ case 3:
+ sbp.slice_del();
+ break;
+ case 4:
+ if (sbp.eq_s_b(2, "gu"))
+ sbp.slice_del();
+ break;
+ }
+ }
+ sbp.limit_backward = v_4;
+ }
+ }
+
+ function r_un_double() {
+ var v_1 = sbp.limit - sbp.cursor;
+ if (sbp.find_among_b(a_8, 5)) {
+ sbp.cursor = sbp.limit - v_1;
+ sbp.ket = sbp.cursor;
+ if (sbp.cursor > sbp.limit_backward) {
+ sbp.cursor--;
+ sbp.bra = sbp.cursor;
+ sbp.slice_del();
+ }
+ }
+ }
+
+ function r_un_accent() {
+ var v_1, v_2 = 1;
+ while (sbp.out_grouping_b(g_v, 97, 251))
+ v_2--;
+ if (v_2 <= 0) {
+ sbp.ket = sbp.cursor;
+ v_1 = sbp.limit - sbp.cursor;
+ if (!sbp.eq_s_b(1, "\u00E9")) {
+ sbp.cursor = sbp.limit - v_1;
+ if (!sbp.eq_s_b(1, "\u00E8"))
+ return;
+ }
+ sbp.bra = sbp.cursor;
+ sbp.slice_from("e");
+ }
+ }
+
+ function habr5() {
+ if (!r_standard_suffix()) {
+ sbp.cursor = sbp.limit;
+ if (!r_i_verb_suffix()) {
+ sbp.cursor = sbp.limit;
+ if (!r_verb_suffix()) {
+ sbp.cursor = sbp.limit;
+ r_residual_suffix();
+ return;
+ }
+ }
+ }
+ sbp.cursor = sbp.limit;
+ sbp.ket = sbp.cursor;
+ if (sbp.eq_s_b(1, "Y")) {
+ sbp.bra = sbp.cursor;
+ sbp.slice_from("i");
+ } else {
+ sbp.cursor = sbp.limit;
+ if (sbp.eq_s_b(1, "\u00E7")) {
+ sbp.bra = sbp.cursor;
+ sbp.slice_from("c");
+ }
+ }
+ }
+ this.stem = function() {
+ var v_1 = sbp.cursor;
+ r_prelude();
+ sbp.cursor = v_1;
+ r_mark_regions();
+ sbp.limit_backward = v_1;
+ sbp.cursor = sbp.limit;
+ habr5();
+ sbp.cursor = sbp.limit;
+ r_un_double();
+ sbp.cursor = sbp.limit;
+ r_un_accent();
+ sbp.cursor = sbp.limit_backward;
+ r_postlude();
+ return true;
+ }
+ };
+
+ /* and return a function that stems a word for the current locale */
+ return function(token) {
+ // for lunr version 2
+ if (typeof token.update === "function") {
+ return token.update(function(word) {
+ st.setCurrent(word);
+ st.stem();
+ return st.getCurrent();
+ })
+ } else { // for lunr version <= 1
+ st.setCurrent(token);
+ st.stem();
+ return st.getCurrent();
+ }
+ }
+ })();
+
+ lunr.Pipeline.registerFunction(lunr.fr.stemmer, 'stemmer-fr');
+
+ lunr.fr.stopWordFilter = lunr.generateStopWordFilter('ai aie aient aies ait as au aura aurai auraient aurais aurait auras aurez auriez aurions aurons auront aux avaient avais avait avec avez aviez avions avons ayant ayez ayons c ce ceci celà ces cet cette d dans de des du elle en es est et eu eue eues eurent eus eusse eussent eusses eussiez eussions eut eux eûmes eût eûtes furent fus fusse fussent fusses fussiez fussions fut fûmes fût fûtes ici il ils j je l la le les leur leurs lui m ma mais me mes moi mon même n ne nos notre nous on ont ou par pas pour qu que quel quelle quelles quels qui s sa sans se sera serai seraient serais serait seras serez seriez serions serons seront ses soi soient sois soit sommes son sont soyez soyons suis sur t ta te tes toi ton tu un une vos votre vous y à étaient étais était étant étiez étions été étée étées étés êtes'.split(' '));
+
+ lunr.Pipeline.registerFunction(lunr.fr.stopWordFilter, 'stopWordFilter-fr');
+ };
+}))
\ No newline at end of file
diff --git a/assets/lib/lunr/lunr.min.js b/assets/lib/lunr/lunr.min.js
new file mode 100644
index 00000000..3f2f2cc6
--- /dev/null
+++ b/assets/lib/lunr/lunr.min.js
@@ -0,0 +1,6 @@
+/**
+ * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.7
+ * Copyright (C) 2019 Oliver Nightingale
+ * @license MIT
+ */
+!function(){var e=function(t){var r=new e.Builder;return r.pipeline.add(e.trimmer,e.stopWordFilter,e.stemmer),r.searchPipeline.add(e.stemmer),t.call(r,r),r.build()};e.version="2.3.7",e.utils={},e.utils.warn=function(e){return function(t){e.console&&console.warn&&console.warn(t)}}(this),e.utils.asString=function(e){return void 0===e||null===e?"":e.toString()},e.utils.clone=function(e){if(null===e||void 0===e)return e;for(var t=Object.create(null),r=Object.keys(e),i=0;i0){var c=e.utils.clone(r)||{};c.position=[a,l],c.index=s.length,s.push(new e.Token(i.slice(a,o),c))}a=o+1}}return s},e.tokenizer.separator=/[\s\-]+/,e.Pipeline=function(){this._stack=[]},e.Pipeline.registeredFunctions=Object.create(null),e.Pipeline.registerFunction=function(t,r){r in this.registeredFunctions&&e.utils.warn("Overwriting existing registered function: "+r),t.label=r,e.Pipeline.registeredFunctions[t.label]=t},e.Pipeline.warnIfFunctionNotRegistered=function(t){var r=t.label&&t.label in this.registeredFunctions;r||e.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",t)},e.Pipeline.load=function(t){var r=new e.Pipeline;return t.forEach(function(t){var i=e.Pipeline.registeredFunctions[t];if(!i)throw new Error("Cannot load unregistered function: "+t);r.add(i)}),r},e.Pipeline.prototype.add=function(){var t=Array.prototype.slice.call(arguments);t.forEach(function(t){e.Pipeline.warnIfFunctionNotRegistered(t),this._stack.push(t)},this)},e.Pipeline.prototype.after=function(t,r){e.Pipeline.warnIfFunctionNotRegistered(r);var i=this._stack.indexOf(t);if(i==-1)throw new Error("Cannot find existingFn");i+=1,this._stack.splice(i,0,r)},e.Pipeline.prototype.before=function(t,r){e.Pipeline.warnIfFunctionNotRegistered(r);var i=this._stack.indexOf(t);if(i==-1)throw new Error("Cannot find existingFn");this._stack.splice(i,0,r)},e.Pipeline.prototype.remove=function(e){var t=this._stack.indexOf(e);t!=-1&&this._stack.splice(t,1)},e.Pipeline.prototype.run=function(e){for(var t=this._stack.length,r=0;r1&&(se&&(r=n),s!=e);)i=r-t,n=t+Math.floor(i/2),s=this.elements[2*n];return s==e?2*n:s>e?2*n:sa?l+=2:o==a&&(t+=r[u+1]*i[l+1],u+=2,l+=2);return t},e.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},e.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),t=1,r=0;t0){var o,a=s.str.charAt(0);a in s.node.edges?o=s.node.edges[a]:(o=new e.TokenSet,s.node.edges[a]=o),1==s.str.length&&(o["final"]=!0),n.push({node:o,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(0!=s.editsRemaining){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new e.TokenSet;s.node.edges["*"]=u}if(0==s.str.length&&(u["final"]=!0),n.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&n.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),1==s.str.length&&(s.node["final"]=!0),s.str.length>=1){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new e.TokenSet;s.node.edges["*"]=l}1==s.str.length&&(l["final"]=!0),n.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var c,h=s.str.charAt(0),d=s.str.charAt(1);d in s.node.edges?c=s.node.edges[d]:(c=new e.TokenSet,s.node.edges[d]=c),1==s.str.length&&(c["final"]=!0),n.push({node:c,editsRemaining:s.editsRemaining-1,str:h+s.str.slice(2)})}}}return i},e.TokenSet.fromString=function(t){for(var r=new e.TokenSet,i=r,n=0,s=t.length;n=e;t--){var r=this.uncheckedNodes[t],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r["char"]]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}},e.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},e.Index.prototype.search=function(t){return this.query(function(r){var i=new e.QueryParser(t,r);i.parse()})},e.Index.prototype.query=function(t){for(var r=new e.Query(this.fields),i=Object.create(null),n=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),u=0;u1?this._b=1:this._b=e},e.Builder.prototype.k1=function(e){this._k1=e},e.Builder.prototype.add=function(t,r){var i=t[this._ref],n=Object.keys(this._fields);this._documents[i]=r||{},this.documentCount+=1;for(var s=0;s=this.length)return e.QueryLexer.EOS;var t=this.str.charAt(this.pos);return this.pos+=1,t},e.QueryLexer.prototype.width=function(){return this.pos-this.start},e.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},e.QueryLexer.prototype.backup=function(){this.pos-=1},e.QueryLexer.prototype.acceptDigitRun=function(){var t,r;do t=this.next(),r=t.charCodeAt(0);while(r>47&&r<58);t!=e.QueryLexer.EOS&&this.backup()},e.QueryLexer.prototype.more=function(){return this.pos1&&(t.backup(),t.emit(e.QueryLexer.TERM)),t.ignore(),t.more())return e.QueryLexer.lexText},e.QueryLexer.lexEditDistance=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.EDIT_DISTANCE),e.QueryLexer.lexText},e.QueryLexer.lexBoost=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.BOOST),e.QueryLexer.lexText},e.QueryLexer.lexEOS=function(t){t.width()>0&&t.emit(e.QueryLexer.TERM)},e.QueryLexer.termSeparator=e.tokenizer.separator,e.QueryLexer.lexText=function(t){for(;;){var r=t.next();if(r==e.QueryLexer.EOS)return e.QueryLexer.lexEOS;if(92!=r.charCodeAt(0)){if(":"==r)return e.QueryLexer.lexField;if("~"==r)return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexEditDistance;if("^"==r)return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexBoost;if("+"==r&&1===t.width())return t.emit(e.QueryLexer.PRESENCE),e.QueryLexer.lexText;if("-"==r&&1===t.width())return t.emit(e.QueryLexer.PRESENCE),e.QueryLexer.lexText;if(r.match(e.QueryLexer.termSeparator))return e.QueryLexer.lexTerm}else t.escapeCharacter()}},e.QueryParser=function(t,r){this.lexer=new e.QueryLexer(t),this.query=r,this.currentClause={},this.lexemeIdx=0},e.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var t=e.QueryParser.parseClause;t;)t=t(this);return this.query},e.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},e.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},e.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},e.QueryParser.parseClause=function(t){var r=t.peekLexeme();if(void 0!=r)switch(r.type){case e.QueryLexer.PRESENCE:return e.QueryParser.parsePresence;case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expected either a field or a term, found "+r.type;throw r.str.length>=1&&(i+=" with value '"+r.str+"'"),new e.QueryParseError(i,r.start,r.end)}},e.QueryParser.parsePresence=function(t){var r=t.consumeLexeme();if(void 0!=r){switch(r.str){case"-":t.currentClause.presence=e.Query.presence.PROHIBITED;break;case"+":t.currentClause.presence=e.Query.presence.REQUIRED;break;default:var i="unrecognised presence operator'"+r.str+"'";throw new e.QueryParseError(i,r.start,r.end)}var n=t.peekLexeme();if(void 0==n){var i="expecting term or field, found nothing";throw new e.QueryParseError(i,r.start,r.end)}switch(n.type){case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expecting term or field, found '"+n.type+"'";throw new e.QueryParseError(i,n.start,n.end)}}},e.QueryParser.parseField=function(t){var r=t.consumeLexeme();if(void 0!=r){if(t.query.allFields.indexOf(r.str)==-1){var i=t.query.allFields.map(function(e){return"'"+e+"'"}).join(", "),n="unrecognised field '"+r.str+"', possible fields: "+i;throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.fields=[r.str];var s=t.peekLexeme();if(void 0==s){var n="expecting term, found nothing";throw new e.QueryParseError(n,r.start,r.end)}switch(s.type){case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var n="expecting term, found '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},e.QueryParser.parseTerm=function(t){var r=t.consumeLexeme();if(void 0!=r){t.currentClause.term=r.str.toLowerCase(),r.str.indexOf("*")!=-1&&(t.currentClause.usePipeline=!1);var i=t.peekLexeme();if(void 0==i)return void t.nextClause();switch(i.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+i.type+"'";throw new e.QueryParseError(n,i.start,i.end)}}},e.QueryParser.parseEditDistance=function(t){var r=t.consumeLexeme();if(void 0!=r){var i=parseInt(r.str,10);if(isNaN(i)){var n="edit distance must be numeric";throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.editDistance=i;var s=t.peekLexeme();if(void 0==s)return void t.nextClause();switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},e.QueryParser.parseBoost=function(t){var r=t.consumeLexeme();if(void 0!=r){var i=parseInt(r.str,10);if(isNaN(i)){var n="boost must be numeric";throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.boost=i;var s=t.peekLexeme();if(void 0==s)return void t.nextClause();switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.lunr=t()}(this,function(){return e})}();
diff --git a/assets/lib/lunr/lunr.segmentit.js b/assets/lib/lunr/lunr.segmentit.js
new file mode 100644
index 00000000..4c9c9ac2
--- /dev/null
+++ b/assets/lib/lunr/lunr.segmentit.js
@@ -0,0 +1,174 @@
+(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i[]{}=!@#$%^&*()~`。,、':∶;?‘’“”〝〞ˆˇ﹕︰﹔﹖﹑·¨….¸;!´?!~—ˉ|‖"〃`@﹫¡¿﹏﹋﹌︴々﹟#﹩$﹠&﹪%*﹡﹢﹦﹤‐ ̄¯―﹨ˆ˜﹍﹎+=<__-ˇ~﹉﹊()〈〉‹›﹛﹜『』〖〗[]《》〔〕{}「」【】︵︷︿︹︽_﹁﹃︻︶︸﹀︺︾ˉ﹂﹄︼+-×÷﹢﹣±/=≈≡≠∧∨∑∏∪∩∈⊙⌒⊥∥∠∽≌<>≤≥≮≯∧∨√﹙﹚[]﹛﹜∫∮∝∞⊙∏┌┬┐┏┳┓╒╤╕─│├┼┤┣╋┫╞╪╡━┃└┴┘┗┻┛╘╧╛┄┆┅┇╭─╮┏━┓╔╦╗┈┊│╳│┃┃╠╬╣┉┋╰─╯┗━┛╚╩╝╲╱┞┟┠┡┢┦┧┨┩┪╉╊┭┮┯┰┱┲┵┶┷┸╇╈┹┺┽┾┿╀╁╂╃╄╅╆○◇□△▽☆●◆■▲▼★♠♥♦♣☼☺◘♀√☻◙♂×▁▂▃▄▅▆▇█⊙◎۞卍卐╱╲▁▏↖↗↑←↔◤◥╲╱▔▕↙↘↓→↕◣◢∷▒░℡™"
+z=z.split("")
+var R={},U={}
+for(var I in z)if(""!==z[I]){var L=z[I].length
+U[R[z[I]]=L]||(U[L]={}),U[L][z[I]]=L}var j=function(){function s(){return r(this,s),u(this,i(s).apply(this,arguments))}return x(s,_),e(s,[{key:"split",value:function(n){for(var x,e=this.segment.POSTAG,c=[],f=0;x=n[f];f++)if(0= min) {
+ ch -= min;
+ if (s[ch >> 3] & (0X1 << (ch & 0X7))) {
+ this.cursor++;
+ return true;
+ }
+ }
+ }
+ return false;
+ },
+ in_grouping_b : function(s, min, max) {
+ if (this.cursor > this.limit_backward) {
+ var ch = current.charCodeAt(this.cursor - 1);
+ if (ch <= max && ch >= min) {
+ ch -= min;
+ if (s[ch >> 3] & (0X1 << (ch & 0X7))) {
+ this.cursor--;
+ return true;
+ }
+ }
+ }
+ return false;
+ },
+ out_grouping : function(s, min, max) {
+ if (this.cursor < this.limit) {
+ var ch = current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ this.cursor++;
+ return true;
+ }
+ ch -= min;
+ if (!(s[ch >> 3] & (0X1 << (ch & 0X7)))) {
+ this.cursor++;
+ return true;
+ }
+ }
+ return false;
+ },
+ out_grouping_b : function(s, min, max) {
+ if (this.cursor > this.limit_backward) {
+ var ch = current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ this.cursor--;
+ return true;
+ }
+ ch -= min;
+ if (!(s[ch >> 3] & (0X1 << (ch & 0X7)))) {
+ this.cursor--;
+ return true;
+ }
+ }
+ return false;
+ },
+ eq_s : function(s_size, s) {
+ if (this.limit - this.cursor < s_size)
+ return false;
+ for (var i = 0; i < s_size; i++)
+ if (current.charCodeAt(this.cursor + i) != s.charCodeAt(i))
+ return false;
+ this.cursor += s_size;
+ return true;
+ },
+ eq_s_b : function(s_size, s) {
+ if (this.cursor - this.limit_backward < s_size)
+ return false;
+ for (var i = 0; i < s_size; i++)
+ if (current.charCodeAt(this.cursor - s_size + i) != s
+ .charCodeAt(i))
+ return false;
+ this.cursor -= s_size;
+ return true;
+ },
+ find_among : function(v, v_size) {
+ var i = 0, j = v_size, c = this.cursor, l = this.limit, common_i = 0, common_j = 0, first_key_inspected = false;
+ while (true) {
+ var k = i + ((j - i) >> 1), diff = 0, common = common_i < common_j
+ ? common_i
+ : common_j, w = v[k];
+ for (var i2 = common; i2 < w.s_size; i2++) {
+ if (c + common == l) {
+ diff = -1;
+ break;
+ }
+ diff = current.charCodeAt(c + common) - w.s[i2];
+ if (diff)
+ break;
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0 || j == i || first_key_inspected)
+ break;
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ var w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = c + w.s_size;
+ if (!w.method)
+ return w.result;
+ var res = w.method();
+ this.cursor = c + w.s_size;
+ if (res)
+ return w.result;
+ }
+ i = w.substring_i;
+ if (i < 0)
+ return 0;
+ }
+ },
+ find_among_b : function(v, v_size) {
+ var i = 0, j = v_size, c = this.cursor, lb = this.limit_backward, common_i = 0, common_j = 0, first_key_inspected = false;
+ while (true) {
+ var k = i + ((j - i) >> 1), diff = 0, common = common_i < common_j
+ ? common_i
+ : common_j, w = v[k];
+ for (var i2 = w.s_size - 1 - common; i2 >= 0; i2--) {
+ if (c - common == lb) {
+ diff = -1;
+ break;
+ }
+ diff = current.charCodeAt(c - 1 - common) - w.s[i2];
+ if (diff)
+ break;
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0 || j == i || first_key_inspected)
+ break;
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ var w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = c - w.s_size;
+ if (!w.method)
+ return w.result;
+ var res = w.method();
+ this.cursor = c - w.s_size;
+ if (res)
+ return w.result;
+ }
+ i = w.substring_i;
+ if (i < 0)
+ return 0;
+ }
+ },
+ replace_s : function(c_bra, c_ket, s) {
+ var adjustment = s.length - (c_ket - c_bra), left = current
+ .substring(0, c_bra), right = current.substring(c_ket);
+ current = left + s + right;
+ this.limit += adjustment;
+ if (this.cursor >= c_ket)
+ this.cursor += adjustment;
+ else if (this.cursor > c_bra)
+ this.cursor = c_bra;
+ return adjustment;
+ },
+ slice_check : function() {
+ if (this.bra < 0 || this.bra > this.ket || this.ket > this.limit
+ || this.limit > current.length)
+ throw ("faulty slice operation");
+ },
+ slice_from : function(s) {
+ this.slice_check();
+ this.replace_s(this.bra, this.ket, s);
+ },
+ slice_del : function() {
+ this.slice_from("");
+ },
+ insert : function(c_bra, c_ket, s) {
+ var adjustment = this.replace_s(c_bra, c_ket, s);
+ if (c_bra <= this.bra)
+ this.bra += adjustment;
+ if (c_bra <= this.ket)
+ this.ket += adjustment;
+ },
+ slice_to : function() {
+ this.slice_check();
+ return current.substring(this.bra, this.ket);
+ },
+ eq_v_b : function(s) {
+ return this.eq_s_b(s.length, s);
+ }
+ };
+ }
+ };
+
+ lunr.trimmerSupport = {
+ generateTrimmer: function(wordCharacters) {
+ var startRegex = new RegExp("^[^" + wordCharacters + "]+")
+ var endRegex = new RegExp("[^" + wordCharacters + "]+$")
+
+ return function(token) {
+ // for lunr version 2
+ if (typeof token.update === "function") {
+ return token.update(function (s) {
+ return s
+ .replace(startRegex, '')
+ .replace(endRegex, '');
+ })
+ } else { // for lunr version 1
+ return token
+ .replace(startRegex, '')
+ .replace(endRegex, '');
+ }
+ };
+ }
+ }
+ }
+}));
diff --git a/assets/lib/lunr/lunr.zh.js b/assets/lib/lunr/lunr.zh.js
new file mode 100644
index 00000000..7c71d548
--- /dev/null
+++ b/assets/lib/lunr/lunr.zh.js
@@ -0,0 +1,141 @@
+/*!
+ * Lunr languages, `Chinese` language
+ * https://github.com/MihaiValentin/lunr-languages
+ *
+ * Copyright 2019, Felix Lian (repairearth)
+ * http://www.mozilla.org/MPL/
+ */
+/*!
+ * based on
+ * Snowball zhvaScript Library v0.3
+ * http://code.google.com/p/urim/
+ * http://snowball.tartarus.org/
+ *
+ * Copyright 2010, Oleg Mazko
+ * http://www.mozilla.org/MPL/
+ */
+
+/**
+ * export the module via AMD, CommonJS or as a browser global
+ * Export code from https://github.com/umdjs/umd/blob/master/returnExports.js
+ */
+;
+(function(root, factory) {
+ if (typeof define === 'function' && define.amd) {
+ // AMD. Register as an anonymous module.
+ define(factory)
+ } else if (typeof exports === 'object') {
+ /**
+ * Node. Does not work with strict CommonJS, but
+ * only CommonJS-like environments that support module.exports,
+ * like Node.
+ */
+ module.exports = factory()
+ } else {
+ // Browser globals (root is window)
+ factory()(root.lunr);
+ }
+}(this, function() {
+ /**
+ * Just return a value to define the module export.
+ * This example returns an object, but the module
+ * can return a function as the exported value.
+ */
+ return function(lunr) {
+ /* throw error if lunr is not yet included */
+ if ('undefined' === typeof lunr) {
+ throw new Error('Lunr is not present. Please include / require Lunr before this script.');
+ }
+
+ /* throw error if lunr stemmer support is not yet included */
+ if ('undefined' === typeof lunr.stemmerSupport) {
+ throw new Error('Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.');
+ }
+
+ /*
+ Chinese tokenization is trickier, since it does not
+ take into account spaces.
+ Since the tokenization function is represented different
+ internally for each of the Lunr versions, this had to be done
+ in order to try to try to pick the best way of doing this based
+ on the Lunr version
+ */
+ var isLunr2 = lunr.version[0] == "2";
+
+ /* register specific locale function */
+ lunr.zh = function() {
+ this.pipeline.reset();
+ this.pipeline.add(
+ lunr.zh.trimmer,
+ lunr.zh.stopWordFilter,
+ lunr.zh.stemmer
+ );
+
+ // change the tokenizer for Chinese one
+ if (isLunr2) { // for lunr version 2.0.0
+ this.tokenizer = lunr.zh.tokenizer;
+ } else {
+ if (lunr.tokenizer) { // for lunr version 0.6.0
+ lunr.tokenizer = lunr.zh.tokenizer;
+ }
+ if (this.tokenizerFn) { // for lunr version 0.7.0 -> 1.0.0
+ this.tokenizerFn = lunr.zh.tokenizer;
+ }
+ }
+ };
+
+ lunr.zh.tokenizer = function(obj) {
+ if (!arguments.length || obj == null || obj == undefined) return []
+ if (Array.isArray(obj)) return obj.map(function (t) { return isLunr2 ? new lunr.Token(t.toLowerCase()) : t.toLowerCase() })
+
+ var str = obj.toString().trim().toLowerCase();
+ var tokens = [];
+
+ lunr.segmentit && lunr.segmentit.doSegment(str).forEach(function (seg) {
+ tokens = tokens.concat(seg.w.split(' '));
+ });
+
+ tokens = tokens.filter(function (token) {
+ return !!token;
+ });
+
+ var fromIndex = 0
+
+ return tokens.map(function (token, index) {
+ if (isLunr2) {
+ var start = str.indexOf(token, fromIndex)
+
+ var tokenMetadata = {}
+ tokenMetadata["position"] = [start, token.length]
+ tokenMetadata["index"] = index
+
+ fromIndex = start
+
+ return new lunr.Token(token, tokenMetadata);
+ } else {
+ return token
+ }
+ });
+ }
+
+ /* lunr trimmer function */
+ lunr.zh.wordCharacters = "\\w\u4e00-\u9fa5";
+ lunr.zh.trimmer = lunr.trimmerSupport.generateTrimmer(lunr.zh.wordCharacters);
+ lunr.Pipeline.registerFunction(lunr.zh.trimmer, 'trimmer-zh');
+
+ /* lunr stemmer function */
+ lunr.zh.stemmer = (function() {
+
+ /* TODO Chinese stemmer */
+ return function(word) {
+ return word;
+ }
+ })();
+ lunr.Pipeline.registerFunction(lunr.zh.stemmer, 'stemmer-zh');
+
+ /* lunr stop word filter. see https://www.ranks.nl/stopwords/chinese-stopwords */
+ lunr.zh.stopWordFilter = lunr.generateStopWordFilter(
+ '的 一 不 在 人 有 是 为 以 于 上 他 而 后 之 来 及 了 因 下 可 到 由 这 与 也 此 但 并 个 其 已 无 小 我 们 起 最 再 今 去 好 只 又 或 很 亦 某 把 那 你 乃 它 吧 被 比 别 趁 当 从 到 得 打 凡 儿 尔 该 各 给 跟 和 何 还 即 几 既 看 据 距 靠 啦 了 另 么 每 们 嘛 拿 哪 那 您 凭 且 却 让 仍 啥 如 若 使 谁 虽 随 同 所 她 哇 嗡 往 哪 些 向 沿 哟 用 于 咱 则 怎 曾 至 致 着 诸 自'.split(' '));
+ lunr.Pipeline.registerFunction(lunr.zh.stopWordFilter, 'stopWordFilter-zh');
+ };
+}))
\ No newline at end of file
diff --git a/assets/lib/mermaid/mermaid.scss b/assets/lib/mermaid/mermaid.scss
index 7568095c..074d7c37 100644
--- a/assets/lib/mermaid/mermaid.scss
+++ b/assets/lib/mermaid/mermaid.scss
@@ -9,7 +9,7 @@
@import "themes/neutral/index";
- .dark-theme & {
+ .dark & {
@import "themes/dark/index";
}
}
diff --git a/assets/lib/polyfill.yml b/assets/lib/polyfill.yml
new file mode 100644
index 00000000..15000eb7
--- /dev/null
+++ b/assets/lib/polyfill.yml
@@ -0,0 +1,8 @@
+smooth-scroll:
+ - Element.prototype.closest
+ - requestAnimationFrame
+ - CustomEvent
+algoliasearch:
+ - Promise
+ - Object.entries
+ - Object.assign
diff --git a/assets/lib/smooth-scroll/smooth-scroll.min.js b/assets/lib/smooth-scroll/smooth-scroll.min.js
new file mode 100644
index 00000000..3899799e
--- /dev/null
+++ b/assets/lib/smooth-scroll/smooth-scroll.min.js
@@ -0,0 +1,2 @@
+/*! smooth-scroll v16.1.2 | (c) 2020 Chris Ferdinandi | MIT License | http://github.com/cferdinandi/smooth-scroll */
+!(function(e,t){"function"==typeof define&&define.amd?define([],(function(){return t(e)})):"object"==typeof exports?module.exports=t(e):e.SmoothScroll=t(e)})("undefined"!=typeof global?global:"undefined"!=typeof window?window:this,(function(w){"use strict";var L={ignore:"[data-scroll-ignore]",header:null,topOnEmptyHash:!0,speed:500,speedAsDuration:!1,durationMax:null,durationMin:null,clip:!0,offset:0,easing:"easeInOutCubic",customEasing:null,updateURL:!0,popstate:!0,emitEvents:!0},H=function(){var n={};return Array.prototype.forEach.call(arguments,(function(e){for(var t in e){if(!e.hasOwnProperty(t))return;n[t]=e[t]}})),n},r=function(e){"#"===e.charAt(0)&&(e=e.substr(1));for(var t,n=String(e),o=n.length,a=-1,r="",i=n.charCodeAt(0);++ao.durationMax?o.durationMax:o.durationMin&&a=v)return C.cancelScroll(!0),o=t,a=u,0===(n=i)&&document.body.focus(),a||(n.focus(),document.activeElement!==n&&(n.setAttribute("tabindex","-1"),n.focus(),n.style.outline="none"),w.scrollTo(0,o)),Q("scrollStop",c,i,s),!(A=d=null)},O=function(e){var t,n,o;d||(d=e),S+=e-d,f=l+y*(n=r=1<(r=0===E?0:S/E)?1:r,"easeInQuad"===(t=c).easing&&(o=n*n),"easeOutQuad"===t.easing&&(o=n*(2-n)),"easeInOutQuad"===t.easing&&(o=n<.5?2*n*n:(4-2*n)*n-1),"easeInCubic"===t.easing&&(o=n*n*n),"easeOutCubic"===t.easing&&(o=--n*n*n+1),"easeInOutCubic"===t.easing&&(o=n<.5?4*n*n*n:(n-1)*(2*n-2)*(2*n-2)+1),"easeInQuart"===t.easing&&(o=n*n*n*n),"easeOutQuart"===t.easing&&(o=1- --n*n*n*n),"easeInOutQuart"===t.easing&&(o=n<.5?8*n*n*n*n:1-8*--n*n*n*n),"easeInQuint"===t.easing&&(o=n*n*n*n*n),"easeOutQuint"===t.easing&&(o=1+--n*n*n*n*n),"easeInOutQuint"===t.easing&&(o=n<.5?16*n*n*n*n*n:1+16*--n*n*n*n*n),t.customEasing&&(o=t.customEasing(n)),o||n),w.scrollTo(0,Math.floor(f)),b(f,g)||(A=w.requestAnimationFrame(O),d=e)};0===w.pageYOffset&&w.scrollTo(0,0),m=i,h=c,u||history.pushState&&h.updateURL&&history.pushState({smoothScroll:JSON.stringify(h),anchor:m.id},document.title,m===document.documentElement?"#top":"#"+m.id),"matchMedia"in w&&w.matchMedia("(prefers-reduced-motion)").matches?w.scrollTo(0,Math.floor(g)):(Q("scrollStart",c,i,s),C.cancelScroll(!0),w.requestAnimationFrame(O))}};var t=function(e){if(!e.defaultPrevented&&!(0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey)&&"closest"in e.target&&(a=e.target.closest(o))&&"a"===a.tagName.toLowerCase()&&!e.target.closest(I.ignore)&&a.hostname===w.location.hostname&&a.pathname===w.location.pathname&&/#/.test(a.href)){var t,n;try{t=r(decodeURIComponent(a.hash))}catch(e){t=r(a.hash)}if("#"===t){if(!I.topOnEmptyHash)return;n=document.documentElement}else n=document.querySelector(t);(n=n||"#top"!==t?n:document.documentElement)&&(e.preventDefault(),(function(e){if(history.replaceState&&e.updateURL&&!history.state){var t=w.location.hash;t=t||"",history.replaceState({smoothScroll:JSON.stringify(e),anchor:t||w.pageYOffset},document.title,t||w.location.href)}})(I),C.animateScroll(n,a))}},n=function(e){if(null!==history.state&&history.state.smoothScroll&&history.state.smoothScroll===JSON.stringify(I)){var t=history.state.anchor;"string"==typeof t&&t&&!(t=document.querySelector(r(history.state.anchor)))||C.animateScroll(t,null,{updateURL:!1})}};C.destroy=function(){I&&(document.removeEventListener("click",t,!1),w.removeEventListener("popstate",n,!1),C.cancelScroll(),A=M=a=I=null)};return (function(){if(!("querySelector"in document&&"addEventListener"in w&&"requestAnimationFrame"in w&&"closest"in w.Element.prototype))throw"Smooth Scroll: This browser does not support the required JavaScript methods and browser APIs.";C.destroy(),I=H(L,e||{}),M=I.header?document.querySelector(I.header):null,document.addEventListener("click",t,!1),I.updateURL&&I.popstate&&w.addEventListener("popstate",n,!1)})(),C}}));
\ No newline at end of file
diff --git a/assets/lib/smooth-scroll/smooth-scroll.polyfills.min.js b/assets/lib/smooth-scroll/smooth-scroll.polyfills.min.js
deleted file mode 100755
index 311685af..00000000
--- a/assets/lib/smooth-scroll/smooth-scroll.polyfills.min.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! smooth-scroll v16.1.2 | (c) 2020 Chris Ferdinandi | MIT License | http://github.com/cferdinandi/smooth-scroll */
-window.Element&&!Element.prototype.closest&&(Element.prototype.closest=function(e){var t,n=(this.document||this.ownerDocument).querySelectorAll(e),o=this;do{for(t=n.length;0<=--t&&n.item(t)!==o;);}while(t<0&&(o=o.parentElement));return o}),(function(){if("function"==typeof window.CustomEvent)return;function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}e.prototype=window.Event.prototype,window.CustomEvent=e})(),(function(){for(var r=0,e=["ms","moz","webkit","o"],t=0;to.durationMax?o.durationMax:o.durationMin&&a=v)return M.cancelScroll(!0),o=t,a=u,0===(n=i)&&document.body.focus(),a||(n.focus(),document.activeElement!==n&&(n.setAttribute("tabindex","-1"),n.focus(),n.style.outline="none"),q.scrollTo(0,o)),H("scrollStop",s,i,c),!(C=m=null)},b=function(e){var t,n,o;m||(m=e),w+=e-m,d=l+y*(n=r=1<(r=0===S?0:w/S)?1:r,"easeInQuad"===(t=s).easing&&(o=n*n),"easeOutQuad"===t.easing&&(o=n*(2-n)),"easeInOutQuad"===t.easing&&(o=n<.5?2*n*n:(4-2*n)*n-1),"easeInCubic"===t.easing&&(o=n*n*n),"easeOutCubic"===t.easing&&(o=--n*n*n+1),"easeInOutCubic"===t.easing&&(o=n<.5?4*n*n*n:(n-1)*(2*n-2)*(2*n-2)+1),"easeInQuart"===t.easing&&(o=n*n*n*n),"easeOutQuart"===t.easing&&(o=1- --n*n*n*n),"easeInOutQuart"===t.easing&&(o=n<.5?8*n*n*n*n:1-8*--n*n*n*n),"easeInQuint"===t.easing&&(o=n*n*n*n*n),"easeOutQuint"===t.easing&&(o=1+--n*n*n*n*n),"easeInOutQuint"===t.easing&&(o=n<.5?16*n*n*n*n*n:1+16*--n*n*n*n*n),t.customEasing&&(o=t.customEasing(n)),o||n),q.scrollTo(0,Math.floor(d)),E(d,g)||(C=q.requestAnimationFrame(b),m=e)};0===q.pageYOffset&&q.scrollTo(0,0),f=i,h=s,u||history.pushState&&h.updateURL&&history.pushState({smoothScroll:JSON.stringify(h),anchor:f.id},document.title,f===document.documentElement?"#top":"#"+f.id),"matchMedia"in q&&q.matchMedia("(prefers-reduced-motion)").matches?q.scrollTo(0,Math.floor(g)):(H("scrollStart",s,i,c),M.cancelScroll(!0),q.requestAnimationFrame(b))}};var t=function(e){if(!e.defaultPrevented&&!(0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey)&&"closest"in e.target&&(a=e.target.closest(o))&&"a"===a.tagName.toLowerCase()&&!e.target.closest(A.ignore)&&a.hostname===q.location.hostname&&a.pathname===q.location.pathname&&/#/.test(a.href)){var t,n;try{t=r(decodeURIComponent(a.hash))}catch(e){t=r(a.hash)}if("#"===t){if(!A.topOnEmptyHash)return;n=document.documentElement}else n=document.querySelector(t);(n=n||"#top"!==t?n:document.documentElement)&&(e.preventDefault(),(function(e){if(history.replaceState&&e.updateURL&&!history.state){var t=q.location.hash;t=t||"",history.replaceState({smoothScroll:JSON.stringify(e),anchor:t||q.pageYOffset},document.title,t||q.location.href)}})(A),M.animateScroll(n,a))}},n=function(e){if(null!==history.state&&history.state.smoothScroll&&history.state.smoothScroll===JSON.stringify(A)){var t=history.state.anchor;"string"==typeof t&&t&&!(t=document.querySelector(r(history.state.anchor)))||M.animateScroll(t,null,{updateURL:!1})}};M.destroy=function(){A&&(document.removeEventListener("click",t,!1),q.removeEventListener("popstate",n,!1),M.cancelScroll(),C=O=a=A=null)};return (function(){if(!("querySelector"in document&&"addEventListener"in q&&"requestAnimationFrame"in q&&"closest"in q.Element.prototype))throw"Smooth Scroll: This browser does not support the required JavaScript methods and browser APIs.";M.destroy(),A=F(I,e||{}),O=A.header?document.querySelector(A.header):null,document.addEventListener("click",t,!1),A.updateURL&&A.popstate&&q.addEventListener("popstate",n,!1)})(),M}}));
\ No newline at end of file
diff --git a/assets/lib/valine/valine.scss b/assets/lib/valine/valine.scss
index 31c8f482..c68a0462 100644
--- a/assets/lib/valine/valine.scss
+++ b/assets/lib/valine/valine.scss
@@ -18,7 +18,7 @@ $single-link-color-dark: #55bde2 !default;
$code-background-color: #f5f5f5 !default;
$code-background-color-dark: #272C34 !default;
-.dark-theme {
+.dark {
// copied from https://github.com/xCss/Valine/issues/221
.v *,
.v .vwrap .vheader .vinput,
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index b4886a23..c1fd9db2 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -93,6 +93,17 @@ enableEmoji = true
keywords = ["Theme", "Hugo"]
# site default theme ("light", "dark", "auto")
defaultTheme = "auto"
+ # Search
+ [languages.en.params.search]
+ enable = true
+ # type of search engine ("lunr", "algolia")
+ type = "algolia"
+ # index length of the content
+ contentLength = 5000
+ [languages.en.params.search.algolia]
+ index = "index.en"
+ appID = "PASDMWALPK"
+ searchKey = "b42948e51daaa93df92381c8e2ac0f93"
# Home Page Info
[languages.en.params.home]
# Home Page Profile
@@ -327,6 +338,17 @@ enableEmoji = true
keywords = ["Theme", "Hugo"]
# 网站默认主题 ("light", "dark", "auto")
defaultTheme = "auto"
+ # 搜索
+ [languages.zh-cn.params.search]
+ enable = true
+ # 搜索引擎的类型 ("lunr", "algolia")
+ type = "algolia"
+ # 文章内容索引长度
+ contentLength = 5000
+ [languages.zh-cn.params.search.algolia]
+ index = "index.zh-cn"
+ appID = "PASDMWALPK"
+ searchKey = "b42948e51daaa93df92381c8e2ac0f93"
# 主页信息设置
[languages.zh-cn.params.home]
# 主页个人信息
@@ -561,6 +583,17 @@ enableEmoji = true
keywords = ["Thème", "Hugo"]
# site default theme ("light", "dark", "auto")
defaultTheme = "auto"
+ # Search
+ [languages.fr.params.search]
+ enable = true
+ # type of search engine ("lunr", "algolia")
+ type = "algolia"
+ # index length of the content
+ contentLength = 5000
+ [languages.fr.params.search.algolia]
+ index = "index.fr"
+ appID = "PASDMWALPK"
+ searchKey = "b42948e51daaa93df92381c8e2ac0f93"
# Home Page Info
[languages.fr.params.home]
# Home Page Profile
@@ -847,6 +880,12 @@ enableEmoji = true
animateCSS = ''
# smooth-scroll@16.1.2 https://github.com/cferdinandi/smooth-scroll
smoothScrollJS = ''
+ # autocomplete.js@0.37.1 https://github.com/algolia/autocomplete.js
+ autocompleteJS = ''
+ # lunr.js@2.3.8 https://lunrjs.com/
+ lunrJS = ''
+ # algoliasearch@4.1.0 https://github.com/algolia/algoliasearch-client-javascript
+ algoliasearchJS = ''
# sharer@0.4.0 https://github.com/ellisonleao/sharer.js
sharerJS = ''
# lazysizes@5.2.0 https://github.com/aFarkas/lazysizes
@@ -858,7 +897,7 @@ enableEmoji = true
lightgalleryZoomJS = ''
# typeit@6.5.1 https://github.com/alexmacarthur/typeit
typeitJS = ''
- # katex@0.11.1 https://github.com/KaTeX/KaTeX
+ # katex@0.11.1 https://katex.org/
katexCSS = ''
katexJS = ''
katexAutoRenderJS = ''
@@ -867,17 +906,17 @@ enableEmoji = true
katexMhchemJS = ''
# mermaid@8.4.8 https://github.com/knsv/mermaid
mermaidJS = ''
- # aplayer@1.10.1 https://github.com/MoePlayer/APlayer
- aplayerCSS = ''
- aplayerJS = ''
- # meting@2.0.1 https://github.com/metowolf/MetingJS
- metingJS = ''
# echarts@4.6.0 https://echarts.apache.org/
echartsJS = ''
echartsMacaronsJS = ''
# mapbox-gl@1.8.1 https://docs.mapbox.com/mapbox-gl-js
mapboxGLCSS = ''
mapboxGLJS = ''
+ # aplayer@1.10.1 https://github.com/MoePlayer/APlayer
+ aplayerCSS = ''
+ aplayerJS = ''
+ # meting@2.0.1 https://github.com/metowolf/MetingJS
+ metingJS = ''
# gitalk@1.6.2 https://github.com/gitalk/gitalk
gitalkCSS = ''
gitalkJS = ''
@@ -962,7 +1001,7 @@ enableEmoji = true
# Options to make hugo output files
# 用于 Hugo 输出文档的设置
[outputs]
- home = ["HTML", "RSS"]
+ home = ["HTML", "RSS", "JSON"]
page = ["HTML", "MarkDown"]
section = ["HTML", "RSS"]
taxonomy = ["HTML", "RSS"]
diff --git a/exampleSite/content/about.en.md b/exampleSite/content/about.en.md
index bdde2612..3ed7f317 100644
--- a/exampleSite/content/about.en.md
+++ b/exampleSite/content/about.en.md
@@ -54,11 +54,12 @@ It is based on the original [LeaveIt Theme](https://github.com/liuzc/LeaveIt/) a
#### Extended Features
+* :(fas fa-search): **Search** supported by [Lunr.js](https://lunrjs.com/) or [algolia](https://www.algolia.com/)
* :(fas fa-code): Automatically **highlighting** code
* :(far fa-images): **Images gallery** supported by [lightgallery.js](https://github.com/sachinchoolur/lightgallery.js)
-* :(fab fa-font-awesome): Extended markdown syntax for **[Font Awesome](https://fontawesome.com/) icons**
-* :(far fa-sticky-note): Extended markdown syntax for **ruby annotation**
-* :(fas fa-percentage): Extended markdown syntax for **fraction**
+* :(fab fa-font-awesome): Extended Markdown syntax for **[Font Awesome](https://fontawesome.com/) icons**
+* :(far fa-sticky-note): Extended Markdown syntax for **ruby annotation**
+* :(fas fa-percentage): Extended Markdown syntax for **fraction**
* :(fas fa-square-root-alt): **Mathematical formula** supported by [$ \KaTeX $](https://katex.org/)
* :(fas fa-project-diagram): **Diagrams** shortcode supported by [mermaid](https://github.com/knsv/mermaid)
* :(fas fa-chart-pie): **Interactive data visualization** shortcode supported by [ECharts](https://echarts.apache.org/)
@@ -82,9 +83,13 @@ Thanks to the authors of following resources included in the theme:
* [Font Awesome](https://fontawesome.com/)
* [Fork Awesome](https://forkaweso.me/Fork-Awesome/)
* [Animate.css](https://daneden.github.io/animate.css/)
+* [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll)
+* [autocomplete.js](https://github.com/algolia/autocomplete.js)
+* [Lunr.js](https://lunrjs.com/)
+* [algoliasearch](https://github.com/algolia/algoliasearch-client-javascript)
+* [Sharer.js](https://github.com/ellisonleao/sharer.js)
* [lazysizes](https://github.com/aFarkas/lazysizes)
* [lightgallery.js](https://github.com/sachinchoolur/lightgallery.js)
-* [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll)
* [TypeIt](https://typeitjs.com/)
* [$ \KaTeX $](https://katex.org/)
* [mermaid](https://github.com/knsv/mermaid)
diff --git a/exampleSite/content/about.fr.md b/exampleSite/content/about.fr.md
index 50e4c22d..bea1726c 100644
--- a/exampleSite/content/about.fr.md
+++ b/exampleSite/content/about.fr.md
@@ -59,11 +59,12 @@ It is based on the original [LeaveIt Theme](https://github.com/liuzc/LeaveIt/) a
#### Extended Features
+* :(fas fa-search): **Search** supported by [Lunr.js](https://lunrjs.com/) or [algolia](https://www.algolia.com/)
* :(fas fa-code): Automatically **highlighting** code
* :(far fa-images): **Images gallery** supported by [lightgallery.js](https://github.com/sachinchoolur/lightgallery.js)
-* :(fab fa-font-awesome): Extended markdown syntax for **[Font Awesome](https://fontawesome.com/) icons**
-* :(far fa-sticky-note): Extended markdown syntax for **ruby annotation**
-* :(fas fa-percentage): Extended markdown syntax for **fraction**
+* :(fab fa-font-awesome): Extended Markdown syntax for **[Font Awesome](https://fontawesome.com/) icons**
+* :(far fa-sticky-note): Extended Markdown syntax for **ruby annotation**
+* :(fas fa-percentage): Extended Markdown syntax for **fraction**
* :(fas fa-square-root-alt): **Mathematical formula** supported by [$ \KaTeX $](https://katex.org/)
* :(fas fa-project-diagram): **Diagrams** shortcode supported by [mermaid](https://github.com/knsv/mermaid)
* :(fas fa-chart-pie): **Interactive data visualization** shortcode supported by [ECharts](https://echarts.apache.org/)
@@ -87,9 +88,13 @@ Thanks to the authors of following resources included in the theme:
* [Font Awesome](https://fontawesome.com/)
* [Fork Awesome](https://forkaweso.me/Fork-Awesome/)
* [Animate.css](https://daneden.github.io/animate.css/)
+* [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll)
+* [autocomplete.js](https://github.com/algolia/autocomplete.js)
+* [Lunr.js](https://lunrjs.com/)
+* [algoliasearch](https://github.com/algolia/algoliasearch-client-javascript)
+* [Sharer.js](https://github.com/ellisonleao/sharer.js)
* [lazysizes](https://github.com/aFarkas/lazysizes)
* [lightgallery.js](https://github.com/sachinchoolur/lightgallery.js)
-* [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll)
* [TypeIt](https://typeitjs.com/)
* [$ \KaTeX $](https://katex.org/)
* [mermaid](https://github.com/knsv/mermaid)
diff --git a/exampleSite/content/about.zh-cn.md b/exampleSite/content/about.zh-cn.md
index cb423fbe..ef508aae 100644
--- a/exampleSite/content/about.zh-cn.md
+++ b/exampleSite/content/about.zh-cn.md
@@ -54,6 +54,7 @@ lightgallery: true
#### 扩展功能
+* :(fas fa-search): 支持基于 [Lunr.js](https://lunrjs.com/) 或 [algolia](https://www.algolia.com/) 的**搜索**
* :(fas fa-code): 支持**代码高亮**
* :(far fa-images): 支持基于 [lightgallery.js](https://github.com/sachinchoolur/lightgallery.js) 的**图片画廊**
* :(fab fa-font-awesome): 支持 **[Font Awesome](https://fontawesome.com/) 图标**的扩展 Markdown 语法
@@ -82,9 +83,13 @@ LoveIt 主题中用到了以下项目,感谢它们的作者:
* [Font Awesome](https://fontawesome.com/)
* [Fork Awesome](https://forkaweso.me/Fork-Awesome/)
* [Animate.css](https://daneden.github.io/animate.css/)
+* [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll)
+* [autocomplete.js](https://github.com/algolia/autocomplete.js)
+* [Lunr.js](https://lunrjs.com/)
+* [algoliasearch](https://github.com/algolia/algoliasearch-client-javascript)
+* [Sharer.js](https://github.com/ellisonleao/sharer.js)
* [lazysizes](https://github.com/aFarkas/lazysizes)
* [lightgallery.js](https://github.com/sachinchoolur/lightgallery.js)
-* [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll)
* [TypeIt](https://typeitjs.com/)
* [$ \KaTeX $](https://katex.org/)
* [mermaid](https://github.com/knsv/mermaid)
diff --git a/exampleSite/content/posts/theme-documentation-basics.en.md b/exampleSite/content/posts/theme-documentation-basics.en.md
index 5f65b90c..317b4cf6 100644
--- a/exampleSite/content/posts/theme-documentation-basics.en.md
+++ b/exampleSite/content/posts/theme-documentation-basics.en.md
@@ -204,6 +204,17 @@ Note that some of these parameters are explained in details in other sections of
# {{< version 0.1.1 new small >}} which hash function used for SRI, when empty, no SRI is used
# ("sha256", "sha384", "sha512", "md5")
fingerprint = ""
+ # {{< version 0.2.0 new small >}} Search
+ [params.search]
+ enable = true
+ # type of search engine ("lunr", "algolia")
+ type = "lunr"
+ # index length of the content
+ contentLength = 5000
+ [params.search.algolia]
+ index = ""
+ appID = ""
+ searchKey = ""
# Header info
[params.header]
# desktop header mode ("fixed", "normal", "auto")
@@ -455,6 +466,12 @@ Note that some of these parameters are explained in details in other sections of
animateCSS = ''
# {{< link "https://github.com/cferdinandi/smooth-scroll" "smooth-scroll" >}}@16.1.2
smoothScrollJS = ''
+ # {{< version 0.2.0 new small >}} {{< link "https://github.com/algolia/autocomplete.js" "autocomplete.js" >}}@0.37.1
+ autocompleteJS = ''
+ # {{< version 0.2.0 new small >}} {{< link "https://lunrjs.com/" "lunr.js" >}}@2.3.8
+ lunrJS = ''
+ # {{< version 0.2.0 new small >}} {{< link "https://github.com/algolia/algoliasearch-client-javascript" "algoliasearch" >}}@4.1.0
+ algoliasearchJS = ''
# {{< link "https://github.com/ellisonleao/sharer.js" "sharer" >}}@0.4.0
sharerJS = ''
# {{< link "https://github.com/aFarkas/lazysizes" "lazysizes" >}}@5.2.0
@@ -475,17 +492,17 @@ Note that some of these parameters are explained in details in other sections of
katexMhchemJS = ''
# {{< link "https://github.com/knsv/mermaid" "mermaid" >}}@8.4.8
mermaidJS = ''
- # {{< link "https://github.com/MoePlayer/APlayer" "aplayer" >}}@1.10.1
- aplayerCSS = ''
- aplayerJS = ''
- # {{< link "https://github.com/metowolf/MetingJS" "meting" >}}@2.0.1
- metingJS = ''
# {{< link "https://echarts.apache.org/" "echarts" >}}@4.6.0
echartsJS = ''
echartsMacaronsJS = ''
# {{< version 0.2.0 new small >}} {{< link "https://docs.mapbox.com/mapbox-gl-js" mapbox-gl >}}@1.8.1
mapboxGLCSS = ''
mapboxGLJS = ''
+ # {{< link "https://github.com/MoePlayer/APlayer" "aplayer" >}}@1.10.1
+ aplayerCSS = ''
+ aplayerJS = ''
+ # {{< link "https://github.com/metowolf/MetingJS" "meting" >}}@2.0.1
+ metingJS = ''
# {{< link "https://github.com/gitalk/gitalk" "gitalk" >}}@1.6.2
gitalkCSS = ''
gitalkJS = ''
@@ -558,13 +575,24 @@ Note that some of these parameters are explained in details in other sections of
# Options to make hugo output files
[outputs]
- home = ["HTML", "RSS"]
+ # {{< version 0.2.0 changed small >}}
+ home = ["HTML", "RSS", "JSON"]
page = ["HTML", "MarkDown"]
section = ["HTML", "RSS"]
taxonomy = ["HTML", "RSS"]
taxonomyTerm = ["HTML"]
```
+{{< admonition tip "Tips about CDN Configuration" >}}
+Full HTML tags or URLs are supported for CDN configuration:
+
+```toml
+smoothScrollJS = ''
+# Or
+smoothScrollJS = 'https://cdn.jsdelivr.net/npm/smooth-scroll@16/dist/smooth-scroll.min.js'
+```
+{{< /admonition >}}
+

### 3.2 Favicons, Browserconfig, Manifest
@@ -733,3 +761,50 @@ Translations strings are used for common default values used in the theme. Trans
To override these values, create a new file in your local i18n folder `i18n/.toml` and inspire yourself from `themes/LoveIt/i18n/en.toml`.
By the way, as these translations could be used by other people, please take the time to propose a translation by [making a PR](https://github.com/dillonzq/LoveIt/pulls) to the theme!
+
+## 5 Search
+
+{{< version 0.2.0 >}}
+
+Based on [Lunr.js](https://lunrjs.com/) or [algolia](https://www.algolia.com/), searching is supported in **LoveIt** theme.
+
+### 5.1 Output Configuration
+
+In order to generate `index.json` for searching, add `JSON` output file type to the `home` of the `outputs` part in your [site configuration](#site-configuration).
+
+```toml
+[outputs]
+ home = ["HTML", "RSS", "JSON"]
+```
+
+### 5.2 Search Configuration
+
+Based on `index.json` generated by Hugo, you could activate searching.
+
+Here is the search configuration in your [site configuration](#site-configuration):
+
+```toml
+[params.search]
+ enable = true
+ # type of search engine ("lunr", "algolia")
+ type = "lunr"
+ # index length of the content
+ contentLength = 5000
+ [params.search.algolia]
+ index = ""
+ appID = ""
+ searchKey = ""
+```
+
+{{< admonition note "How to choose the type of search engine?" >}}
+* `lunr`: simple, no need to synchronize `index.json`, no limit for `contentLength`,
+ but high bandwidth and low performance (Especially for Chinese which needs a large segmentit library)
+* `algolia`: high performance and low bandwidth, but need to synchronize `index.json` and limit for `contentLength`
+{{< /admonition >}}
+
+{{< admonition tip "Tips about algolia" >}}
+You need to upload `index.json` files to algolia to activate searching.
+You could upload the `index.json` files by browsers but a script may be a better choice.
+To be compatible with Hugo multilingual mode,
+you need to upload different `index.json` for each language to the different index of algolia, such as `zh-cn/index.json` or `fr/index.json`...
+{{< /admonition >}}
diff --git a/exampleSite/content/posts/theme-documentation-basics.fr.md b/exampleSite/content/posts/theme-documentation-basics.fr.md
index 41c13dcc..7d2bbbba 100644
--- a/exampleSite/content/posts/theme-documentation-basics.fr.md
+++ b/exampleSite/content/posts/theme-documentation-basics.fr.md
@@ -209,6 +209,17 @@ Note that some of these parameters are explained in details in other sections of
# {{< version 0.1.1 new small >}} which hash function used for SRI, when empty, no SRI is used
# ("sha256", "sha384", "sha512", "md5")
fingerprint = ""
+ # {{< version 0.2.0 new small >}} Search
+ [params.search]
+ enable = true
+ # type of search engine ("lunr", "algolia")
+ type = "lunr"
+ # index length of the content
+ contentLength = 5000
+ [params.search.algolia]
+ index = ""
+ appID = ""
+ searchKey = ""
# Header info
[params.header]
# desktop header mode ("fixed", "normal", "auto")
@@ -460,6 +471,12 @@ Note that some of these parameters are explained in details in other sections of
animateCSS = ''
# {{< link "https://github.com/cferdinandi/smooth-scroll" "smooth-scroll" >}}@16.1.2
smoothScrollJS = ''
+ # {{< version 0.2.0 new small >}} {{< link "https://github.com/algolia/autocomplete.js" "autocomplete.js" >}}@0.37.1
+ autocompleteJS = ''
+ # {{< version 0.2.0 new small >}} {{< link "https://lunrjs.com/" "lunr.js" >}}@2.3.8
+ lunrJS = ''
+ # {{< version 0.2.0 new small >}} {{< link "https://github.com/algolia/algoliasearch-client-javascript" "algoliasearch" >}}@4.1.0
+ algoliasearchJS = ''
# {{< link "https://github.com/ellisonleao/sharer.js" "sharer" >}}@0.4.0
sharerJS = ''
# {{< link "https://github.com/aFarkas/lazysizes" "lazysizes" >}}@5.2.0
@@ -480,17 +497,17 @@ Note that some of these parameters are explained in details in other sections of
katexMhchemJS = ''
# {{< link "https://github.com/knsv/mermaid" "mermaid" >}}@8.4.8
mermaidJS = ''
- # {{< link "https://github.com/MoePlayer/APlayer" "aplayer" >}}@1.10.1
- aplayerCSS = ''
- aplayerJS = ''
- # {{< link "https://github.com/metowolf/MetingJS" "meting" >}}@2.0.1
- metingJS = ''
# {{< link "https://echarts.apache.org/" "echarts" >}}@4.6.0
echartsJS = ''
echartsMacaronsJS = ''
# {{< version 0.2.0 new small >}} {{< link "https://docs.mapbox.com/mapbox-gl-js" mapbox-gl >}}@1.8.1
mapboxGLCSS = ''
mapboxGLJS = ''
+ # {{< link "https://github.com/MoePlayer/APlayer" "aplayer" >}}@1.10.1
+ aplayerCSS = ''
+ aplayerJS = ''
+ # {{< link "https://github.com/metowolf/MetingJS" "meting" >}}@2.0.1
+ metingJS = ''
# {{< link "https://github.com/gitalk/gitalk" "gitalk" >}}@1.6.2
gitalkCSS = ''
gitalkJS = ''
@@ -563,13 +580,24 @@ Note that some of these parameters are explained in details in other sections of
# Options to make hugo output files
[outputs]
- home = ["HTML", "RSS"]
+ # {{< version 0.2.0 changed small >}}
+ home = ["HTML", "RSS", "JSON"]
page = ["HTML", "MarkDown"]
section = ["HTML", "RSS"]
taxonomy = ["HTML", "RSS"]
taxonomyTerm = ["HTML"]
```
+{{< admonition tip "Tips about CDN Configuration" >}}
+Full HTML tags or URLs are supported for CDN configuration:
+
+```toml
+smoothScrollJS = ''
+# Or
+smoothScrollJS = 'https://cdn.jsdelivr.net/npm/smooth-scroll@16/dist/smooth-scroll.min.js'
+```
+{{< /admonition >}}
+

### 3.2 Favicons, Browserconfig, Manifest
@@ -738,3 +766,50 @@ Translations strings are used for common default values used in the theme. Trans
To override these values, create a new file in your local i18n folder `i18n/.toml` and inspire yourself from `themes/LoveIt/i18n/en.toml`.
By the way, as these translations could be used by other people, please take the time to propose a translation by [making a PR](https://github.com/dillonzq/LoveIt/pulls) to the theme!
+
+## 5 Search
+
+{{< version 0.2.0 >}}
+
+Based on [Lunr.js](https://lunrjs.com/) or [algolia](https://www.algolia.com/), searching is supported in **LoveIt** theme.
+
+### 5.1 Output Configuration
+
+In order to generate `index.json` for searching, add `JSON` output file type to the `home` of the `outputs` part in your [site configuration](#site-configuration).
+
+```toml
+[outputs]
+ home = ["HTML", "RSS", "JSON"]
+```
+
+### 5.2 Search Configuration
+
+Based on `index.json` generated by Hugo, you could activate searching.
+
+Here is the search configuration in your [site configuration](#site-configuration):
+
+```toml
+[params.search]
+ enable = true
+ # type of search engine ("lunr", "algolia")
+ type = "lunr"
+ # index length of the content
+ contentLength = 5000
+ [params.search.algolia]
+ index = ""
+ appID = ""
+ searchKey = ""
+```
+
+{{< admonition note "How to choose the type of search engine?" >}}
+* `lunr`: simple, no need to synchronize `index.json`, no limit for `contentLength`,
+ but high bandwidth and low performance (Especially for Chinese which needs a large segmentit library)
+* `algolia`: high performance and low bandwidth, but need to synchronize `index.json` and limit for `contentLength`
+{{< /admonition >}}
+
+{{< admonition tip "Tips about algolia" >}}
+You need to upload `index.json` files to algolia to activate searching.
+You could upload the `index.json` files by browsers but a script may be a better choice.
+To be compatible with Hugo multilingual mode,
+you need to upload different `index.json` for each language to the different index of algolia, such as `zh-cn/index.json` or `fr/index.json`...
+{{< /admonition >}}
diff --git a/exampleSite/content/posts/theme-documentation-basics.zh-cn.md b/exampleSite/content/posts/theme-documentation-basics.zh-cn.md
index aa6cc94a..d650424f 100644
--- a/exampleSite/content/posts/theme-documentation-basics.zh-cn.md
+++ b/exampleSite/content/posts/theme-documentation-basics.zh-cn.md
@@ -207,6 +207,17 @@ hugo
# {{< version 0.1.1 new small >}} 哪种哈希函数用来 SRI, 为空时表示不使用 SRI
# ("sha256", "sha384", "sha512", "md5")
fingerprint = ""
+ # {{< version 0.2.0 new small >}} 搜索
+ [params.search]
+ enable = true
+ # 搜索引擎的类型 ("lunr", "algolia")
+ type = "lunr"
+ # 文章内容索引长度
+ contentLength = 5000
+ [params.search.algolia]
+ index = ""
+ appID = ""
+ searchKey = ""
# 页面头部导航栏信息
[params.header]
# 桌面端导航栏模式 ("fixed", "normal", "auto")
@@ -457,6 +468,12 @@ hugo
animateCSS = ''
# {{< link "https://github.com/cferdinandi/smooth-scroll" "smooth-scroll" >}}@16.1.2
smoothScrollJS = ''
+ # {{< version 0.2.0 new small >}} {{< link "https://github.com/algolia/autocomplete.js" "autocomplete.js" >}}@0.37.1
+ autocompleteJS = ''
+ # {{< version 0.2.0 new small >}} {{< link "https://lunrjs.com/" "lunr.js" >}}@2.3.8
+ lunrJS = ''
+ # {{< version 0.2.0 new small >}} {{< link "https://github.com/algolia/algoliasearch-client-javascript" "algoliasearch" >}}@4.1.0
+ algoliasearchJS = ''
# {{< link "https://github.com/ellisonleao/sharer.js" "sharer" >}}@0.4.0
sharerJS = ''
# {{< link "https://github.com/aFarkas/lazysizes" "lazysizes" >}}@5.2.0
@@ -477,17 +494,17 @@ hugo
katexMhchemJS = ''
# {{< link "https://github.com/knsv/mermaid" "mermaid" >}}@8.4.8
mermaidJS = ''
- # {{< link "https://github.com/MoePlayer/APlayer" "aplayer" >}}@1.10.1
- aplayerCSS = ''
- aplayerJS = ''
- # {{< link "https://github.com/metowolf/MetingJS" "meting" >}}@2.0.1
- metingJS = ''
# {{< link "https://echarts.apache.org/" "echarts" >}}@4.6.0
echartsJS = ''
echartsMacaronsJS = ''
# {{< version 0.2.0 new small >}} {{< link "https://docs.mapbox.com/mapbox-gl-js" mapbox-gl >}}@1.8.1
mapboxGLCSS = ''
mapboxGLJS = ''
+ # {{< link "https://github.com/MoePlayer/APlayer" "aplayer" >}}@1.10.1
+ aplayerCSS = ''
+ aplayerJS = ''
+ # {{< link "https://github.com/metowolf/MetingJS" "meting" >}}@2.0.1
+ metingJS = ''
# {{< link "https://github.com/gitalk/gitalk" "gitalk" >}}@1.6.2
gitalkCSS = ''
gitalkJS = ''
@@ -560,13 +577,24 @@ hugo
# 用于 Hugo 输出文档的设置
[outputs]
- home = ["HTML", "RSS"]
+ # {{< version 0.2.0 changed small >}}
+ home = ["HTML", "RSS", "JSON"]
page = ["HTML", "MarkDown"]
section = ["HTML", "RSS"]
taxonomy = ["HTML", "RSS"]
taxonomyTerm = ["HTML"]
```
+{{< admonition tip "关于 CDN 配置的技巧" >}}
+在 CDN 的配置中, 完整的 HTML 标签和 URL 都是支持的:
+
+```toml
+smoothScrollJS = ''
+# 或者
+smoothScrollJS = 'https://cdn.jsdelivr.net/npm/smooth-scroll@16/dist/smooth-scroll.min.js'
+```
+{{< /admonition >}}
+

### 3.2 网站图标, 浏览器配置, 网站清单
@@ -736,3 +764,47 @@ defaultContentLanguage = "zh-cn"
要覆盖默认值, 请在项目的 i18n 目录 `i18n/.toml` 中创建一个新文件,并从 `themes/LoveIt/i18n/en.toml` 中获得提示.
另外, 由于你的翻译可能会帮助到其他人, 请花点时间通过 [创建一个 PR](https://github.com/dillonzq/LoveIt/pulls) 来贡献主题翻译, 谢谢!
+
+## 5 搜索
+
+{{< version 0.2.0 >}}
+
+基于 [Lunr.js](https://lunrjs.com/) 或 [algolia](https://www.algolia.com/), **LoveIt** 主支持搜索功能.
+
+### 5.1 输出配置
+
+为了生成搜索功能所需要的 `index.json`, 请在你的 [网站配置](#site-configuration) 中添加 `JSON` 输出文件类型到 `outputs` 部分的 `home` 字段中.
+
+```toml
+[outputs]
+ home = ["HTML", "RSS", "JSON"]
+```
+
+### 5.2 搜索配置
+
+基于 Hugo 生成的 `index.json` 文件, 你可以激活搜索功能.
+
+这是你的 [网站配置](#site-configuration) 中的搜索部分:
+
+```toml
+[params.search]
+ enable = true
+ # type of search engine ("lunr", "algolia")
+ type = "lunr"
+ # index length of the content
+ contentLength = 5000
+ [params.search.algolia]
+ index = ""
+ appID = ""
+ searchKey = ""
+```
+
+{{< admonition note "怎样选择搜索引擎的类型?" >}}
+* `lunr`: 简单, 无需同步 `index.json`, 没有 `contentLength` 的限制, 但占用带宽大且性能低 (特别是中文需要一个较大的分词依赖库)
+* `algolia`: 高性能并且占用带宽低, 但需要同步 `index.json` 且有 `contentLength` 的限制
+{{< /admonition >}}
+
+{{< admonition tip "关于 algolia 的使用技巧" >}}
+你需要上传 `index.json` 到 algolia 来激活搜索功能. 你可以使用浏览器来上传 `index.json` 文件但是一个自动化的脚本可能是更好的选择.
+为了兼容 Hugo 的多语言模式, 你需要上传不同语言的 `index.json` 文件到对应的 algolia index, 例如 `zh-cn/index.json` 或 `fr/index.json`...
+{{< /admonition >}}
diff --git a/exampleSite/content/posts/theme-documentation-content.en.md b/exampleSite/content/posts/theme-documentation-content.en.md
index 77e90b27..24212a92 100644
--- a/exampleSite/content/posts/theme-documentation-content.en.md
+++ b/exampleSite/content/posts/theme-documentation-content.en.md
@@ -68,6 +68,7 @@ license: ""
tags: []
categories: []
hiddenFromHomePage: false
+hiddenFromSearch: false
featuredImage: ""
featuredImagePreview: ""
@@ -103,6 +104,7 @@ comment: true
* **tags**: the tags for the content.
* **categories**: the categories for the content.
* **hiddenFromHomePage**: if `true`, the content will not be shown in the home page, but this behaviour is configurabl in the [site configuration](../theme-documentation-basics/#site-configuration).
+* **hiddenFromSearch**: {{< version 0.2.0 >}} if `true`, the content will not be shown in the search results.
* **featuredImage**: the featured image for the content.
* **featuredImagePreview**: the featured image for the content preview in the home page.
* **toc**: if `true`, the content will show the table of the contents.
@@ -114,6 +116,10 @@ comment: true
* **share**: the same as `params.share` in the [site configuration](../theme-documentation-basics/#site-configuration).
* **comment**: if `true`, the comment will be used.
+{{< admonition tip >}}
+Not all of the above front matters need to be set in each of your posts. It is necessary only if the front matters and your [site configuration](../theme-documentation-basics/#site-configuration) are inconsistent.
+{{< /admonition >}}
+
## 3 Content Summaries
**LoveIt** theme uses the summary of the content to display abstract information in the home page. Hugo can generate summaries of your content.
diff --git a/exampleSite/content/posts/theme-documentation-content.fr.md b/exampleSite/content/posts/theme-documentation-content.fr.md
index 77c9aeee..4d94f4af 100644
--- a/exampleSite/content/posts/theme-documentation-content.fr.md
+++ b/exampleSite/content/posts/theme-documentation-content.fr.md
@@ -73,6 +73,7 @@ license: ""
tags: []
categories: []
hiddenFromHomePage: false
+hiddenFromSearch: false
featuredImage: ""
featuredImagePreview: ""
@@ -108,6 +109,7 @@ comment: true
* **tags**: the tags for the content.
* **categories**: the categories for the content.
* **hiddenFromHomePage**: if `true`, the content will not be shown in the home page, but this behaviour is configurabl in the [site configuration](../theme-documentation-basics/#site-configuration).
+* **hiddenFromSearch**: {{< version 0.2.0 >}} if `true`, the content will not be shown in the search results.
* **featuredImage**: the featured image for the content.
* **featuredImagePreview**: the featured image for the content preview in the home page.
* **toc**: if `true`, the content will show the table of the contents.
@@ -119,6 +121,10 @@ comment: true
* **share**: the same as `params.share` in the [site configuration](../theme-documentation-basics/#site-configuration).
* **comment**: if `true`, the comment will be used.
+{{< admonition tip >}}
+Not all of the above front matters need to be set in each of your posts. It is necessary only if the front matters and your [site configuration](../theme-documentation-basics/#site-configuration) are inconsistent.
+{{< /admonition >}}
+
## 3 Content Summaries
**LoveIt** theme uses the summary of the content to display abstract information in the home page. Hugo can generate summaries of your content.
diff --git a/exampleSite/content/posts/theme-documentation-content.zh-cn.md b/exampleSite/content/posts/theme-documentation-content.zh-cn.md
index 892f5e19..7fcb812e 100644
--- a/exampleSite/content/posts/theme-documentation-content.zh-cn.md
+++ b/exampleSite/content/posts/theme-documentation-content.zh-cn.md
@@ -1,7 +1,6 @@
---
weight: 2
title: "主题文档 - 内容"
-subtitle: ""
date: 2020-03-05T16:30:05+08:00
lastmod: 2020-03-05T16:30:05+08:00
draft: false
@@ -12,18 +11,13 @@ license: ""
tags: ["内容", "markdown"]
categories: ["documentation"]
-hiddenFromHomePage: false
featuredImage: "/images/theme-documentation-content/featured-image.jpg"
-featuredImagePreview: ""
toc: true
autoCollapseToc: false
math: true
mapbox:
- accessToken: ""
- lightStyle: ""
- darkStyle: ""
navigation: true
geolocate: true
scale: true
@@ -68,6 +62,7 @@ license: ""
tags: []
categories: []
hiddenFromHomePage: false
+hiddenFromSearch: false
featuredImage: ""
featuredImagePreview: ""
@@ -103,6 +98,7 @@ comment: true
* **tags**: 文章的标签.
* **categories**: 文章所属的类别.
* **hiddenFromHomePage**: 如果设为 `true`, 这篇文章将不会显示在主页上, 但是此行为可以在 [网站配置](../theme-documentation-basics/#site-configuration) 中设置的.
+* **hiddenFromSearch**: {{< version 0.2.0 >}} 如果设为 `true`, 这篇文章将不会显示在搜索结果中.
* **featuredImage**: 文章的特色图片.
* **featuredImagePreview**: 用在主页预览的文章特色图片.
* **toc**: 如果设为 `true`, 这篇文章会显示右侧目录.
@@ -114,6 +110,11 @@ comment: true
* **share**: 和 [网站配置](../theme-documentation-basics/#site-configuration) 中的 `params.share` 对象相同.
* **comment**: 如果设为 `true`, 将启用评论系统.
+{{< admonition tip >}}
+不是所有的上述前置参数都必须在你的每篇文章中设置.
+只有在文章的参数和你的 [网站设置](../theme-documentation-basics/#site-configuration) 不一致时才有必要这么做.
+{{< /admonition >}}
+
## 3 内容摘要
**LoveIt** 主题使用内容摘要在主页中显示大致文章信息。Hugo 支持生成文章的摘要.
diff --git a/exampleSite/content/posts/theme-documentation-extended-shortcodes.zh-cn.md b/exampleSite/content/posts/theme-documentation-extended-shortcodes.zh-cn.md
index df80bccc..51f57fff 100644
--- a/exampleSite/content/posts/theme-documentation-extended-shortcodes.zh-cn.md
+++ b/exampleSite/content/posts/theme-documentation-extended-shortcodes.zh-cn.md
@@ -12,7 +12,6 @@ license: ""
tags: ["shortcodes"]
categories: ["documentation"]
-hiddenFromHomePage: false
featuredImage: "/images/theme-documentation-extended-shortcodes/featured-image.jpg"
featuredImagePreview: "/images/theme-documentation-extended-shortcodes/featured-image-preview.jpg"
@@ -20,19 +19,6 @@ featuredImagePreview: "/images/theme-documentation-extended-shortcodes/featured-
toc: true
autoCollapseToc: true
math: false
-mapbox:
- accessToken: ""
- lightStyle: ""
- darkStyle: ""
- navigation: true
- geolocate: true
- scale: true
- fullscreen: true
-lightgallery: true
-linkToMarkdown: true
-share:
- enable: true
-comment: true
---
**LoveIt** 主题在 Hugo 内置的 shortcode 的基础上提供多个扩展的 shortcode.
diff --git a/i18n/en.toml b/i18n/en.toml
index 6768b1ea..1a62316c 100644
--- a/i18n/en.toml
+++ b/i18n/en.toml
@@ -40,6 +40,21 @@ other = "More"
[selectLanguage]
other = "Select Language"
+[search]
+other = "Search"
+
+[searchPlaceholder]
+other = "Search titles or contents..."
+
+[clear]
+other = "Clear"
+
+[cancel]
+other = "Cancel"
+
+[noResultsFound]
+other = "No results found"
+
[switchTheme]
other = "Switch Theme"
# === partials/header.html ===
diff --git a/i18n/fr.toml b/i18n/fr.toml
index 89f82951..349d862d 100644
--- a/i18n/fr.toml
+++ b/i18n/fr.toml
@@ -40,6 +40,21 @@ other = "Plus"
[selectLanguage]
other = "Choisir la langue"
+[search]
+other = "Chercher"
+
+[searchPlaceholder]
+other = "Rechercher des titres, des contenus..."
+
+[clear]
+other = "Clair"
+
+[cancel]
+other = "Annuler"
+
+[noResultsFound]
+other = "Aucun résultat trouvé"
+
[switchTheme]
other = "Changer de Thème"
# === partials/header.html ===
@@ -52,6 +67,14 @@ other = "Propulsé par %s"
other = "Thème"
# === partials/footer.html ===
+# === partials/assets.html ===
+[lunrLanguageLib]
+other = "lib/lunr/lunr.fr.js"
+
+[lunrLanguageCode]
+other = "fr"
+# === partials/assets.html ===
+
# === partials/plugin/share.html ===
[shareOn]
other = "Partager sur"
diff --git a/i18n/zh-CN.toml b/i18n/zh-CN.toml
index 1ea516b0..1037e2bc 100644
--- a/i18n/zh-CN.toml
+++ b/i18n/zh-CN.toml
@@ -40,6 +40,21 @@ other = "更多"
[selectLanguage]
other = "选择语言"
+[search]
+other = "搜索"
+
+[searchPlaceholder]
+other = "搜索文章标题或内容..."
+
+[clear]
+other = "清空"
+
+[cancel]
+other = "取消"
+
+[noResultsFound]
+other = "没有找到结果"
+
[switchTheme]
other = "切换主题"
# === partials/header.html ===
@@ -52,6 +67,14 @@ other = "由 %s 强力驱动"
other = "主题"
# === partials/footer.html ===
+# === partials/assets.html ===
+[lunrLanguageLib]
+other = "lib/lunr/lunr.zh.js"
+
+[lunrLanguageCode]
+other = "zh"
+# === partials/assets.html ===
+
# === partials/plugin/share.html ===
[shareOn]
other = "分享到"
diff --git a/layouts/404.html b/layouts/404.html
index fbc5d7ff..213fa92e 100644
--- a/layouts/404.html
+++ b/layouts/404.html
@@ -10,13 +10,10 @@
↩︎
-
{{- end -}}
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 4a945a04..d953768a 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -33,19 +33,10 @@
{{- /* Check theme isDark before body rendering */ -}}
-
+ {{- $theme := .Site.Params.defaultTheme -}}
+
+
+
{{- /* Body wrapper */ -}}
@@ -60,12 +51,12 @@
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 8687942e..4f19da8f 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -12,7 +12,7 @@
{{ . }}
{{- /* Content */ -}}
- {{- partial "single/content.html" .Content -}}
+ {{- partial "function/content.html" .Content | safeHTML -}}
{{- end -}}
diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html
index 0c75db25..df7ef025 100644
--- a/layouts/_default/summary.html
+++ b/layouts/_default/summary.html
@@ -45,7 +45,7 @@
{{- /* Summary content */ -}}
{{- with .Summary -}}
- {{- partial "single/content.html" . -}}
+ {{- partial "function/content.html" . | safeHTML -}}
{{- else -}}
{{- .Description | safeHTML -}}
{{- end -}}
diff --git a/layouts/index.json b/layouts/index.json
new file mode 100644
index 00000000..dc052dca
--- /dev/null
+++ b/layouts/index.json
@@ -0,0 +1,15 @@
+{{- $index := slice -}}
+{{- range where .Site.RegularPages ".Params.hiddenfromsearch" "!=" true -}}
+ {{- $one := dict "uri" .RelPermalink "title" .Title "description" (.Description | default "") -}}
+ {{- $tags := .Params.tags | default slice -}}
+ {{- $one = delimit $tags "\n" | dict "tags" | merge $one -}}
+ {{- $publish_date := .PublishDate.Format (.Site.Params.dateFormatToUse | default "2006-01-02") -}}
+ {{- $one = dict "date" $publish_date | merge $one -}}
+ {{- $content := partial "function/content.html" .Content | plainify -}}
+ {{- if gt .Site.Params.search.contentLength 0 -}}
+ {{- $content = substr $content 0 .Site.Params.search.contentLength -}}
+ {{- end -}}
+ {{- $one = dict "content" $content | merge $one -}}
+ {{- $index = $index | append $one -}}
+{{- end -}}
+{{- $index | jsonify | safeJS -}}
diff --git a/layouts/partials/assets.html b/layouts/partials/assets.html
index 27735b43..b4788afd 100644
--- a/layouts/partials/assets.html
+++ b/layouts/partials/assets.html
@@ -1,219 +1,241 @@
{{- $scratch := .Scratch.Get "scratch" -}}
{{- $CDN := $scratch.Get "CDN" -}}
+{{- $fingerprint := $scratch.Get "fingerprint" -}}
+{{- $config := dict "desktopHeaderMode" .Site.Params.header.desktopMode "mobileHeaderMode" .Site.Params.header.mobileMode -}}
+{{- with $scratch.Get "contentData" -}}
+ {{- $config = dict "content" . | merge $config -}}
+{{- end -}}
+{{- with $scratch.Get "comment" -}}
+ {{- $config = dict "comment" . | merge $config -}}
+{{- end -}}
{{- /* Fork Awesome */ -}}
{{- if $scratch.Get "forkawesome" -}}
- {{- slice "lib/forkawesome/fork-awesome.scss" | $scratch.Add "linkLocal" -}}
+ {{- $options := dict "targetPath" "lib/forkawesome/fork-awesome.min.css" -}}
+ {{- dict "source" "lib/forkawesome/fork-awesome.scss" "toCSS" $options "fingerprint" $fingerprint | slice | $scratch.Add "stylesheet" -}}
{{- end -}}
{{- /* iconfont */ -}}
{{- if $scratch.Get "iconfont" -}}
{{- with $CDN.iconfontCSS -}}
- {{- slice . | $scratch.Add "linkCDN" -}}
+ {{- dict "source" . "crossorigin" true | slice | $scratch.Add "stylesheet" -}}
{{- else -}}
- {{- slice "lib/iconfont/iconfont.css" | $scratch.Add "linkLocal" -}}
+ {{- dict "source" "lib/iconfont/iconfont.css" "minify" true "fingerprint" $fingerprint | slice | $scratch.Add "stylesheet" -}}
{{- end -}}
{{- end -}}
{{- /* Smooth Scroll */ -}}
{{- with $CDN.smoothScrollJS -}}
- {{- slice . | $scratch.Add "scriptCDN" -}}
+ {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
{{- else -}}
- {{- slice "lib/smooth-scroll/smooth-scroll.polyfills.min.js" | $scratch.Add "scriptLocal" -}}
+ {{- dict "source" "lib/smooth-scroll/smooth-scroll.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
{{- end -}}
-{{- /* Sharer.js */ -}}
-{{- if $scratch.Get "share" -}}
- {{- with $CDN.sharerJS -}}
- {{- slice . | $scratch.Add "scriptCDN" -}}
+{{- /* Search */ -}}
+{{- if .Site.Params.search.enable -}}
+ {{- with $CDN.autocompleteJS -}}
+ {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
{{- else -}}
- {{- slice "lib/sharer/sharer.min.js" | $scratch.Add "scriptLocal" -}}
+ {{- dict "source" "lib/autocomplete/autocomplete.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
+ {{- end -}}
+ {{- $searchConfig := dict "noResultsFound" (T "noResultsFound") -}}
+ {{- if eq .Site.Params.search.type "lunr" -}}
+ {{- with .Site.Home.OutputFormats.Get "json" -}}
+ {{- $searchConfig = dict "type" "lunr" "lunrIndexURL" .RelPermalink | merge $searchConfig -}}
+ {{- end -}}
+ {{- with $CDN.lunrJS -}}
+ {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
+ {{- else -}}
+ {{- dict "source" "lib/lunr/lunr.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
+ {{- end -}}
+ {{- if ne .Language.Lang "en" -}}
+ {{- $searchConfig = T "lunrLanguageCode" | dict "lunrLanguageCode" | merge $searchConfig -}}
+ {{- if eq .Language.Lang "zh-cn" -}}
+ {{- $searchConfig = dict "lunrSegmentitURL" (resources.Get "lib/lunr/lunr.segmentit.js").RelPermalink | merge $searchConfig -}}
+ {{- end -}}
+ {{- dict "source" "lib/lunr/lunr.stemmer.support.js" "minify" true "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
+ {{- dict "source" (T "lunrLanguageLib") "minify" true "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
+ {{- end -}}
+ {{- else if eq .Site.Params.search.type "algolia" -}}
+ {{- with $CDN.algoliasearchJS -}}
+ {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
+ {{- else -}}
+ {{- dict "source" "lib/algoliasearch/algoliasearch-lite.umd.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
+ {{- end -}}
+ {{- $searchConfig = dict "type" "algolia" "algoliaIndex" .Site.Params.search.algolia.index "algoliaAppID" .Site.Params.search.algolia.appID "algoliaSearchKey" .Site.Params.search.algolia.searchKey | merge $searchConfig -}}
{{- end -}}
+ {{- $config = dict "search" $searchConfig | merge $config -}}
{{- end -}}
{{- /* lazysizes */ -}}
{{- with $CDN.lazysizesJS -}}
- {{- slice . | $scratch.Add "scriptCDN" -}}
+ {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
{{- else -}}
- {{- slice "lib/lazysizes/lazysizes.min.js" | $scratch.Add "scriptLocal" -}}
+ {{- dict "source" "lib/lazysizes/lazysizes.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
{{- end -}}
{{- /* lightgallery.js */ -}}
{{- if ne .Site.Params.page.lightgallery false | and (ne .Params.lightgallery false) -}}
{{- with $CDN.lightgalleryCSS -}}
- {{- slice . | $scratch.Add "linkCDN" -}}
+ {{- dict "source" . "crossorigin" true | slice | $scratch.Add "stylesheet" -}}
{{- else -}}
- {{- slice "lib/lightgallery/lightgallery.min.css" | $scratch.Add "linkLocal" -}}
+ {{- dict "source" "lib/lightgallery/lightgallery.min.css" "fingerprint" $fingerprint | slice | $scratch.Add "stylesheet" -}}
{{- end -}}
{{- with $CDN.lightgalleryJS -}}
- {{- slice . | $scratch.Add "scriptCDN" -}}
+ {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
{{- else -}}
- {{- slice "lib/lightgallery/lightgallery.min.js" | $scratch.Add "scriptLocal" -}}
+ {{- dict "source" "lib/lightgallery/lightgallery.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
{{- end -}}
{{- with $CDN.lightgalleryThumbnailJS -}}
- {{- slice . | $scratch.Add "scriptCDN" -}}
+ {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
{{- else -}}
- {{- slice "lib/lightgallery/lg-thumbnail.min.js" | $scratch.Add "scriptLocal" -}}
+ {{- dict "source" "lib/lightgallery/lg-thumbnail.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
{{- end -}}
{{- with $CDN.lightgalleryZoomJS -}}
- {{- slice . | $scratch.Add "scriptCDN" -}}
+ {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
+ {{- else -}}
+ {{- dict "source" "lib/lightgallery/lg-zoom.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
+ {{- end -}}
+ {{- $lightGalleryConfig := dict "selector" ".lightgallery" "speed" 400 "hideBarsDelay" 2000 "thumbnail" true "exThumbImage" "data-thumbnail" "thumbWidth" 80 "thumbContHeight" 80 "actualSize" false -}}
+ {{- $config = dict "lightGallery" $lightGalleryConfig | merge $config -}}
+{{- end -}}
+
+{{- /* Sharer.js */ -}}
+{{- if $scratch.Get "share" -}}
+ {{- with $CDN.sharerJS -}}
+ {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
{{- else -}}
- {{- slice "lib/lightgallery/lg-zoom.min.js" | $scratch.Add "scriptLocal" -}}
+ {{- dict "source" "lib/sharer/sharer.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
{{- end -}}
-
{{- end -}}
{{- /* TypeIt */ -}}
{{- with $scratch.Get "typeitMap" -}}
{{- with $CDN.typeitJS -}}
- {{- slice . | $scratch.Add "scriptCDN" -}}
+ {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
{{- else -}}
- {{- slice "lib/typeit/typeit.min.js" | $scratch.Add "scriptLocal" -}}
+ {{- dict "source" "lib/typeit/typeit.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
{{- end -}}
+ {{- $typeitConfig := slice -}}
{{- range $key, $val := . -}}
- {{- slice $val | $scratch.Add "typeitArr" -}}
+ {{- $typeitConfig = $typeitConfig | append (slice $val) -}}
{{- end -}}
-
+ {{- $config = dict "typeit" $typeitConfig | merge $config -}}
{{- end -}}
{{- /* KaTeX */ -}}
{{- if ne .Site.Params.math.enable false | and .Params.math -}}
{{- with $CDN.katexCSS -}}
- {{- slice . | $scratch.Add "linkCDN" -}}
+ {{- dict "source" . "crossorigin" true | slice | $scratch.Add "stylesheet" -}}
{{- else -}}
- {{- slice "lib/katex/katex.min.css" | $scratch.Add "linkLocal" -}}
+ {{- dict "source" "lib/katex/katex.min.css" "fingerprint" $fingerprint | slice | $scratch.Add "stylesheet" -}}
{{- end -}}
{{- with $CDN.katexJS -}}
- {{- slice . | $scratch.Add "scriptCDN" -}}
+ {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
{{- else -}}
- {{- slice "lib/katex/katex.min.js" | $scratch.Add "scriptLocal" -}}
+ {{- dict "source" "lib/katex/katex.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
{{- end -}}
{{- with $CDN.katexAutoRenderJS -}}
- {{- slice . | $scratch.Add "scriptCDN" -}}
+ {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
{{- else -}}
- {{- slice "lib/katex/auto-render.min.js" | $scratch.Add "scriptLocal" -}}
+ {{- dict "source" "lib/katex/auto-render.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
{{- end -}}
{{- $math := .Site.Params.math -}}
{{- if $math.copyTex -}}
{{- with $CDN.katexCopyTexCSS -}}
- {{- slice . | $scratch.Add "linkCDN" -}}
+ {{- dict "source" . "crossorigin" true | slice | $scratch.Add "stylesheet" -}}
{{- else -}}
- {{- slice "lib/katex/copy-tex.min.css" | $scratch.Add "linkLocal" -}}
+ {{- dict "source" "lib/katex/copy-tex.min.css" "fingerprint" $fingerprint | slice | $scratch.Add "stylesheet" -}}
{{- end -}}
{{- with $CDN.katexCopyTexJS -}}
- {{- slice . | $scratch.Add "scriptCDN" -}}
+ {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
{{- else -}}
- {{- slice "lib/katex/copy-tex.min.js" | $scratch.Add "scriptLocal" -}}
+ {{- dict "source" "lib/katex/copy-tex.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
{{- end -}}
{{- end -}}
{{- if $math.mhchem -}}
{{- with $CDN.katexMhchemJS -}}
- {{- slice . | $scratch.Add "scriptCDN" -}}
+ {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
{{- else -}}
- {{- slice "lib/katex/mhchem.min.js" | $scratch.Add "scriptLocal" -}}
+ {{- dict "source" "lib/katex/mhchem.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
{{- end -}}
{{- end -}}
-
+ {{- $mathConfig := dict "strict" false -}}
+ {{- $delimiters := slice (dict "left" "$$" "right" "$$" "display" true) (dict "left" "\\[" "right" "\\]" "display" true) -}}
+ {{- if and $math.blockLeftDelimiter $math.blockRightDelimiter -}}
+ {{- $delimiters = $delimiters | append (dict "left" $math.blockLeftDelimiter "right" $math.blockRightDelimiter "display" true) -}}
+ {{- end -}}
+ {{- $delimiters = $delimiters | append (dict "left" "$" "right" "$" "display" false) (dict "left" "\\(" "right" "\\)" "display" false) -}}
+ {{- if and $math.inlineLeftDelimiter $math.inlineRightDelimiter -}}
+ {{- $delimiters = $delimiters | append (dict "left" $math.inlineRightDelimiter "right" $math.inlineRightDelimiter "display" false) -}}
+ {{- end -}}
+ {{- $mathConfig = dict "delimiters" $delimiters | merge $mathConfig -}}
+ {{- $config = dict "math" $mathConfig | merge $config -}}
{{- end -}}
{{- /* mermaid */ -}}
{{- if $scratch.Get "mermaid" -}}
{{- with $CDN.mermaidJS -}}
- {{- slice . | $scratch.Add "scriptCDN" -}}
+ {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
{{- else -}}
- {{- slice "lib/mermaid/mermaid.min.js" | $scratch.Add "scriptLocal" -}}
+ {{- dict "source" "lib/mermaid/mermaid.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
{{- end -}}
- {{- slice "lib/mermaid/mermaid.scss" | $scratch.Add "linkLocal" -}}
+ {{- $options := dict "targetPath" "lib/mermaid/mermaid.min.css" -}}
+ {{- dict "source" "lib/mermaid/mermaid.scss" "toCSS" $options "fingerprint" $fingerprint | slice | $scratch.Add "stylesheet" -}}
{{- end -}}
{{- /* ECharts */ -}}
{{- if $scratch.Get "echarts" -}}
{{- with $CDN.echartsJS -}}
- {{- slice . | $scratch.Add "scriptCDN" -}}
+ {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
{{- else -}}
- {{- slice "lib/echarts/echarts.min.js" | $scratch.Add "scriptLocal" -}}
+ {{- dict "source" "lib/echarts/echarts.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
{{- end -}}
{{- with $CDN.echartsMacaronsJS -}}
- {{- slice . | $scratch.Add "scriptCDN" -}}
+ {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
{{- else -}}
- {{- slice "lib/echarts/macarons.js" | $scratch.Add "scriptLocal" -}}
+ {{- dict "source" "lib/echarts/macarons.js" "minify" true "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
{{- end -}}
{{- end -}}
{{- /* Mapbox GL */ -}}
{{- if $scratch.Get "mapbox" -}}
{{- with $CDN.mapboxGLCSS -}}
- {{- slice . | $scratch.Add "linkCDN" -}}
+ {{- dict "source" . "crossorigin" true | slice | $scratch.Add "stylesheet" -}}
{{- else -}}
- {{- slice "lib/mapbox-gl/mapbox-gl.min.css" | $scratch.Add "linkLocal" -}}
+ {{- dict "source" "lib/mapbox-gl/mapbox-gl.min.css" "fingerprint" $fingerprint | slice | $scratch.Add "stylesheet" -}}
{{- end -}}
{{- with $CDN.mapboxGLJS -}}
- {{- slice . | $scratch.Add "scriptCDN" -}}
+ {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
{{- else -}}
- {{- slice "lib/mapbox-gl/mapbox-gl.min.js" | $scratch.Add "scriptLocal" -}}
+ {{- dict "source" "lib/mapbox-gl/mapbox-gl.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
{{- end -}}
- {{- slice "lib/mapbox-gl/mapbox-gl-language.js" | $scratch.Add "scriptLocal" -}}
-
+ {{- dict "source" "lib/mapbox-gl/mapbox-gl-language.js" "minify" true "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
+ {{- $mapbox := dict "accessToken" (.Params.mapbox.accessToken | default .Site.Params.mapbox.accessToken) "RTLTextPlugin" "https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.0/mapbox-gl-rtl-text.js" -}}
+ {{- $config = dict "mapbox" $mapbox | merge $config -}}
{{- end -}}
{{- /* Music */ -}}
{{- if $scratch.Get "music" -}}
{{- /* APlayer */ -}}
{{- with $CDN.aplayerCSS -}}
- {{- slice . | $scratch.Add "linkCDN" -}}
+ {{- dict "source" . "crossorigin" true | slice | $scratch.Add "stylesheet" -}}
{{- else -}}
- {{- slice "lib/aplayer/APlayer.min.css" | $scratch.Add "linkLocal" -}}
+ {{- dict "source" "lib/aplayer/APlayer.min.css" "fingerprint" $fingerprint | slice | $scratch.Add "stylesheet" -}}
{{- end -}}
- {{- slice "lib/aplayer/dark.scss" | $scratch.Add "linkLocal" -}}
+ {{- $options := dict "targetPath" "lib/aplayer/dark.min.css" -}}
+ {{- dict "source" "lib/aplayer/dark.scss" "toCSS" $options "fingerprint" $fingerprint | slice | $scratch.Add "stylesheet" -}}
{{- with $CDN.aplayerJS -}}
- {{- slice . | $scratch.Add "scriptCDN" -}}
+ {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
{{- else -}}
- {{- slice "lib/aplayer/APlayer.min.js" | $scratch.Add "scriptLocal" -}}
+ {{- dict "source" "lib/aplayer/APlayer.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
{{- end -}}
{{- /* MetingJS */ -}}
{{- with $CDN.metingJS -}}
- {{- slice . | $scratch.Add "scriptCDN" -}}
+ {{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
{{- else -}}
- {{- slice "lib/meting/Meting.min.js" | $scratch.Add "scriptLocal" -}}
+ {{- dict "source" "lib/meting/Meting.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
{{- end -}}
{{- end -}}
@@ -221,41 +243,20 @@
{{- if .Params.dev -}}
{{- end -}}
-{{- with $scratch.Get "contentMap" -}}
-
-{{- end -}}
-
{{- /* Theme script */ -}}
-{{- slice "js/theme.min.js" | $scratch.Add "scriptLocal" -}}
+{{- dict "source" "js/theme.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
{{- $_ := (resources.Get "js/theme.min.js.map").RelPermalink -}}
-{{- range $scratch.Get "linkCDN" -}}
- {{- safeHTML . -}}
-{{- end -}}
-{{- range $scratch.Get "linkLocal" -}}
- {{- $res := resources.Get . -}}
- {{- if strings.HasSuffix . ".scss" -}}
- {{- $options := dict "outputStyle" "compressed" "enableSourceMap" true -}}
- {{- $res = toCSS $options $res -}}
- {{- else if not (strings.HasSuffix . ".min.css") -}}
- {{- $res = minify $res -}}
- {{- end -}}
- {{- $stylesheet := dict "resource" $res "fingerprint" ($scratch.Get "fingerprint") -}}
- {{- partial "plugin/stylesheet.html" $stylesheet -}}
+{{- range $scratch.Get "stylesheet" -}}
+ {{- partial "plugin/stylesheet.html" . -}}
{{- end -}}
-{{- range $scratch.Get "scriptCDN" -}}
- {{- safeHTML . -}}
-{{- end -}}
-{{- range $scratch.Get "scriptLocal" -}}
- {{- $res := resources.Get . -}}
- {{- if not (strings.HasSuffix . ".min.js") -}}
- {{- $res = minify $res -}}
- {{- end -}}
- {{- $script := dict "resource" $res "fingerprint" ($scratch.Get "fingerprint") -}}
- {{- partial "plugin/script.html" $script -}}
+
+
+{{- range $scratch.Get "script" -}}
+ {{- partial "plugin/script.html" . -}}
{{- end -}}
{{- /* Google analytics async */ -}}
diff --git a/layouts/partials/comment.html b/layouts/partials/comment.html
index 3abf75bc..d839174d 100644
--- a/layouts/partials/comment.html
+++ b/layouts/partials/comment.html
@@ -1,126 +1,112 @@
{{- $scratch := .Scratch.Get "scratch" -}}
+{{- $CDN := $scratch.Get "CDN" -}}
+{{- $fingerprint := $scratch.Get "fingerprint" -}}
{{- if eq hugo.Environment "production" | and (ne .Site.Params.comment.enable false) | and (ne .Params.comment false) -}}
- {{- $CDN := $scratch.Get "CDN" -}}
-
- {{- /* Disqus Comment System */ -}}
- {{- if .Site.Params.comment.disqus.enable -}}
-
- {{- $script := printf `` .Site.Params.comment.disqus.shortname -}}
- {{- slice $script | $scratch.Add "scriptCDN" -}}
-
- {{- end -}}
-
- {{- /* Gitalk Comment System */ -}}
- {{- if .Site.Params.comment.gitalk.enable -}}
- {{- $gitalk := .Site.Params.comment.gitalk -}}
-
- {{- with $CDN.gitalkCSS -}}
- {{- slice . | $scratch.Add "linkCDN" -}}
- {{- else -}}
- {{- slice "lib/gitalk/gitalk.css" | $scratch.Add "linkLocal" -}}
+
{{- end -}}
diff --git a/layouts/partials/single/content.html b/layouts/partials/function/content.html
similarity index 92%
rename from layouts/partials/single/content.html
rename to layouts/partials/function/content.html
index 13373162..3b81be48 100644
--- a/layouts/partials/single/content.html
+++ b/layouts/partials/function/content.html
@@ -10,4 +10,4 @@
{{- $content = partial "function/escape.html" $content -}}
-{{- $content | safeHTML -}}
+{{- return $content -}}
diff --git a/layouts/partials/function/id.html b/layouts/partials/function/id.html
index c7029083..b9e15ff0 100644
--- a/layouts/partials/function/id.html
+++ b/layouts/partials/function/id.html
@@ -3,6 +3,6 @@
{{- /* shuffle md5 as id */ -}}
{{- $id := delimit (split (md5 now.Unix) "" | shuffle | first 6) "" | printf "id-%s" -}}
{{- with .scratch -}}
- {{- .SetInMap "contentMap" $id $.content -}}
+ {{- .SetInMap "contentData" $id $.content -}}
{{- end -}}
{{- return $id -}}
diff --git a/layouts/partials/head/link.html b/layouts/partials/head/link.html
index cfec2850..c1d273a4 100644
--- a/layouts/partials/head/link.html
+++ b/layouts/partials/head/link.html
@@ -1,5 +1,6 @@
{{- $scratch := .Scratch.Get "scratch" -}}
{{- $CDN := $scratch.Get "CDN" -}}
+{{- $fingerprint := $scratch.Get "fingerprint" -}}
@@ -22,29 +23,17 @@
{{- end -}}
{{- /* Font Awesome */ -}}
-{{- with $CDN.fontawesomeFreeCSS -}}
- {{- . | safeHTML -}}
-{{- else -}}
- {{- $res := resources.Get "lib/fontawesome-free/all.min.css" -}}
- {{- $stylesheet := dict "resource" $res "fingerprint" ($scratch.Get "fingerprint") -}}
- {{- partial "plugin/stylesheet.html" $stylesheet -}}
-{{- end -}}
+{{- $source := $CDN.fontawesomeFreeCSS | default "lib/fontawesome-free/all.min.css" -}}
+{{- $stylesheet := dict "source" $source "fingerprint" $fingerprint -}}
+{{- partial "plugin/stylesheet.html" $stylesheet -}}
{{- /* Animate.css */ -}}
-{{- with $CDN.animateCSS -}}
- {{- . | safeHTML -}}
-{{- else -}}
- {{- $res := resources.Get "lib/animate/animate.min.css" -}}
- {{- $stylesheet := dict "resource" $res "fingerprint" ($scratch.Get "fingerprint") -}}
- {{- partial "plugin/stylesheet.html" $stylesheet -}}
-{{- end -}}
+{{- $source := $CDN.animateCSS | default "lib/animate/animate.min.css" -}}
+{{- $stylesheet := dict "source" $source "fingerprint" $fingerprint -}}
+{{- partial "plugin/stylesheet.html" $stylesheet -}}
{{- /* style.min.css */ -}}
-{{- $res := resources.Get "css/style.template.scss" -}}
-{{- $options := dict "targetPath" "css/style.min.css" -}}
-{{- $options = dict "includePaths" (slice "config/css") | merge $options -}}
-{{- $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 "source" "css/style.template.scss" "fingerprint" $fingerprint -}}
+{{- $options := dict "targetPath" "css/style.min.css" "includePaths" (slice "config/css") -}}
+{{- $stylesheet = dict "template" "style.scss" "context" . "toCSS" $options | merge $stylesheet -}}
{{- partial "plugin/stylesheet.html" $stylesheet -}}
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 1e4b0c89..e78a70a5 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -7,43 +7,59 @@
{{- /* Mobile header */ -}}