redeyed-jekyll-theme 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +52 -0
- data/_config.yml +328 -0
- data/_data/assets/cross-origin.yml +65 -0
- data/_data/assets/self-host.yml +51 -0
- data/_data/authors.yml +12 -0
- data/_data/contact.yml +16 -0
- data/_data/locale/en.yml +78 -0
- data/_data/share.yml +16 -0
- data/_includes/back-to-top.html +2 -0
- data/_includes/breadcrumbs.html +1 -0
- data/_includes/comments.html +0 -0
- data/_includes/copyright.html +1 -0
- data/_includes/datetime.html +0 -0
- data/_includes/favicons.html +14 -0
- data/_includes/footer.html +1 -0
- data/_includes/ga-site-tag.html +8 -0
- data/_includes/google-tags-body.html +4 -0
- data/_includes/google-tags-head.html +6 -0
- data/_includes/head.html +72 -0
- data/_includes/header-banner.html +1 -0
- data/_includes/header-wide.html +1 -0
- data/_includes/header.html +1 -0
- data/_includes/javascript.html +89 -0
- data/_includes/jsdelivr-combine.html +18 -0
- data/_includes/lang.html +6 -0
- data/_includes/mermaid.html +1 -0
- data/_includes/mode-toggle.html +138 -0
- data/_includes/navbar.html +6 -0
- data/_includes/no-linenos.html +0 -0
- data/_includes/options.html +13 -0
- data/_includes/pagination.html +0 -0
- data/_includes/panel-bottom.html +1 -0
- data/_includes/panel-foot-2.html +1 -0
- data/_includes/panel-foot-3.html +1 -0
- data/_includes/panel-foot-4.html +1 -0
- data/_includes/panel-foot-full.html +1 -0
- data/_includes/panel-top-2.html +1 -0
- data/_includes/panel-top-3.html +1 -0
- data/_includes/panel-top-4.html +1 -0
- data/_includes/panel-top-full.html +1 -0
- data/_includes/post-nav.html +0 -0
- data/_includes/post-share.html +0 -0
- data/_includes/readtime.html +0 -0
- data/_includes/related-posts.html +0 -0
- data/_includes/search-loader.html +46 -0
- data/_includes/search-results.html +1 -0
- data/_includes/sidebar.html +0 -0
- data/_includes/toc.html +0 -0
- data/_javascript/common/back-to-top.js +20 -0
- data/_javascript/common/mode-toggle.js +13 -0
- data/_javascript/common/scroll-helper.js +36 -0
- data/_javascript/common/search-display.js +129 -0
- data/_javascript/common/sidebar.js +30 -0
- data/_javascript/common/tooltip-loader.js +6 -0
- data/_javascript/common/topbar-switcher.js +90 -0
- data/_javascript/common/topbar-title.js +67 -0
- data/_javascript/utils/category-collapse.js +30 -0
- data/_javascript/utils/checkbox.js +12 -0
- data/_javascript/utils/clipboard.js +133 -0
- data/_javascript/utils/img-extra.js +47 -0
- data/_javascript/utils/locale-datetime.js +45 -0
- data/_javascript/utils/pageviews.js +250 -0
- data/_javascript/utils/smooth-scroll.js +96 -0
- data/_layouts/archive.html +0 -0
- data/_layouts/categories.html +0 -0
- data/_layouts/category.html +0 -0
- data/_layouts/compress.html +10 -0
- data/_layouts/default.html +5 -0
- data/_layouts/page.html +5 -0
- data/_layouts/panel-both.html +14 -0
- data/_layouts/panel-left.html +14 -0
- data/_layouts/panel-none.html +81 -0
- data/_layouts/panel-right.html +14 -0
- data/_layouts/post.html +5 -0
- data/_layouts/tag.html +0 -0
- data/_layouts/tags.html +0 -0
- data/_sass/addon/common.scss +1630 -0
- data/_sass/addon/mixins.scss +144 -0
- data/_sass/addon/syntax.scss +0 -0
- data/_sass/addon/variables.scss +31 -0
- data/_sass/colors/brew-scheme.scss +7 -0
- data/_sass/colors/dark-scheme.scss +21 -0
- data/_sass/colors/dark-syntax.scss +88 -0
- data/_sass/colors/light-scheme.scss +7 -0
- data/_sass/colors/light-syntax.scss +84 -0
- data/_sass/layout/page.scss +0 -0
- data/_sass/layout/panel-both.scss +0 -0
- data/_sass/layout/panel-left.scss +0 -0
- data/_sass/layout/panel-none.scss +146 -0
- data/_sass/layout/panel-right.scss +0 -0
- data/_sass/layout/post.scss +0 -0
- data/_sass/redeyed-jekyll-theme.scss +26 -0
- data/_sass/variables-hook.scss +0 -0
- data/assets/css/style.scss +8 -0
- data/assets/img/d20R/d20R-128.png +0 -0
- data/assets/img/d20R/d20R-16.png +0 -0
- data/assets/img/d20R/d20R-200.png +0 -0
- data/assets/img/d20R/d20R-240.png +0 -0
- data/assets/img/d20R/d20R-32.png +0 -0
- data/assets/img/d20R/d20R-320.png +0 -0
- data/assets/img/d20R/d20R-48.png +0 -0
- data/assets/img/d20R/d20R-500.png +0 -0
- data/assets/img/d20R/d20R-600.png +0 -0
- data/assets/img/d20R/d20R-64.png +0 -0
- data/assets/img/d20R/d20R.svg +98 -0
- data/assets/img/d20RB/d20RB-128.png +0 -0
- data/assets/img/d20RB/d20RB-16.png +0 -0
- data/assets/img/d20RB/d20RB-200.png +0 -0
- data/assets/img/d20RB/d20RB-240.png +0 -0
- data/assets/img/d20RB/d20RB-32.png +0 -0
- data/assets/img/d20RB/d20RB-320.png +0 -0
- data/assets/img/d20RB/d20RB-48.png +0 -0
- data/assets/img/d20RB/d20RB-500.png +0 -0
- data/assets/img/d20RB/d20RB-600.png +0 -0
- data/assets/img/d20RB/d20RB-64.png +0 -0
- data/assets/img/d20RB/d20RB.svg +103 -0
- data/assets/img/favicons/android-chrome-192x192.png +0 -0
- data/assets/img/favicons/android-chrome-512x512.png +0 -0
- data/assets/img/favicons/apple-touch-icon.png +0 -0
- data/assets/img/favicons/browserconfig.xml +12 -0
- data/assets/img/favicons/favicon-16x16.png +0 -0
- data/assets/img/favicons/favicon-32x32.png +0 -0
- data/assets/img/favicons/favicon.ico +0 -0
- data/assets/img/favicons/mstile-150x150.png +0 -0
- data/assets/img/favicons/mstile-310x150.png +0 -0
- data/assets/img/favicons/mstile-310x310.png +0 -0
- data/assets/img/favicons/mstile-70x70.png +0 -0
- data/assets/img/favicons/safari-pinned-tab.svg +112 -0
- data/assets/img/favicons/site.webmanifest +19 -0
- data/assets/js/data/search.json +19 -0
- data/assets/js/data/swcache.js +54 -0
- data/assets/js/fetch.js +458 -0
- data/assets/js/pwa/app.js +47 -0
- data/assets/js/pwa/sw.js +89 -0
- data/assets/js/pwa/unregister.js +12 -0
- data/src/404.html +10 -0
- data/src/favicon.ico +0 -0
- data/src/feed.xml +61 -0
- data/src/index.md +22 -0
- data/src/robots.txt +10 -0
- data/src/style/html.md +7 -0
- data/src/style/index.md +11 -0
- data/src/style/markdown.md +108 -0
- metadata +375 -0
@@ -0,0 +1 @@
|
|
1
|
+
{% comment %} FOOTER {% endcomment %}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
{% comment %} Global site tag (gtag.js) - Google Analytics {% endcomment %}
|
2
|
+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-E941CYN0XY"></script>
|
3
|
+
<script>
|
4
|
+
window.dataLayer = window.dataLayer || [];
|
5
|
+
function gtag(){dataLayer.push(arguments);}
|
6
|
+
gtag('js', new Date());
|
7
|
+
gtag('config', 'G-E941CYN0XY');
|
8
|
+
</script>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
{% comment %} Google Tag Manager {% endcomment %}
|
2
|
+
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
3
|
+
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
4
|
+
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;
|
5
|
+
f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-58TMKPV');</script>
|
6
|
+
{% comment %} End Google Tag Manager {% endcomment %}
|
data/_includes/head.html
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
{% comment %} HEAD ELEMENT {% endcomment %}
|
2
|
+
<head>
|
3
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
4
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
5
|
+
{% if site.prefer_datetime_locale %}
|
6
|
+
<meta name="prefer-datetime-locale" content="{{ site.prefer_datetime_locale }}">
|
7
|
+
{% endif %}
|
8
|
+
{% capture seo_tags %}{% seo title=false %}{% endcapture %}
|
9
|
+
{% if site.img_cdn and seo_tags contains 'og:image' %}
|
10
|
+
{% assign properties = 'og:image,twitter:image' | split: ',' %}
|
11
|
+
{% for prop in properties %}
|
12
|
+
{% if site.img_cdn contains '//' %}
|
13
|
+
{% capture target %}<meta property="{{ prop }}" content="{{ site.url }}">{% endcapture %}
|
14
|
+
{% capture replacement %}<meta property="{{ prop }}" content="{{ site.img_cdn }}">{% endcapture %}
|
15
|
+
{% else %}
|
16
|
+
{% capture target %}<meta property="{{ prop }}" content="{{ site.url }}{{ site.baseurl }}">{% endcapture %}
|
17
|
+
{% assign replacement = target | append: site.img_cdn %}
|
18
|
+
{% endif %}
|
19
|
+
{% assign seo_tags = seo_tags | replace: target, replacement %}
|
20
|
+
{% endfor %}
|
21
|
+
{% endif %}
|
22
|
+
|
23
|
+
{{ seo_tags }}
|
24
|
+
|
25
|
+
<title>{% unless page.layout == "home" %}{{ page.title | append: " | "}}{% endunless %}{{ site.title }}</title>
|
26
|
+
|
27
|
+
{% include favicons.html %}
|
28
|
+
|
29
|
+
{% if site.resources.ignore_env != jekyll.environment and site.resources.self_hosted %}
|
30
|
+
<link href="{{ site.data.assets[origin].webfonts | relative_url }}" rel="stylesheet">
|
31
|
+
{% else %}
|
32
|
+
{% for cdn in site.data.assets[origin].cdns %}
|
33
|
+
<link rel="preconnect" href="{{ cdn.url }}" {{ cdn.args }}>
|
34
|
+
<link rel="dns-prefetch" href="{{ cdn.url }}" {{ cdn.args }}>
|
35
|
+
{% endfor %}
|
36
|
+
<link rel="stylesheet" href="{{ site.data.assets[origin].webfonts | relative_url }}">
|
37
|
+
{% endif %}
|
38
|
+
|
39
|
+
{% if jekyll.environment == 'production' and site.google_analytics.id != empty and site.google_analytics.id %}
|
40
|
+
{% include ga-site-tag.html %}
|
41
|
+
{% endif %}
|
42
|
+
|
43
|
+
<!-- Bootstrap -->
|
44
|
+
<link rel="stylesheet" href="{{ site.data.assets[origin].bootstrap.css | relative_url}}">
|
45
|
+
|
46
|
+
<!-- Font Awesome -->
|
47
|
+
<link rel="stylesheet" href="{{ site.data.assets[origin].fontawesome.css | relative_url }}">
|
48
|
+
|
49
|
+
<!-- Material Design -->
|
50
|
+
<link rel="stylesheet" href="{{ site.data.assets[origin].material-design.css | relative_url}}">
|
51
|
+
|
52
|
+
<!-- Main Site Stylesheet -->
|
53
|
+
<link rel="stylesheet" href="{{ '/assets/css/style.css' | relative_url }}">
|
54
|
+
|
55
|
+
{% if site.toc and page.toc %}
|
56
|
+
<!-- Bootstrap TOC -->
|
57
|
+
<link rel="stylesheet" href="{{ site.data.assets[origin].bootstrap-toc.css | relative_url }}">
|
58
|
+
{% endif %}
|
59
|
+
|
60
|
+
{% if page.layout == 'page' or page.layout == 'post' %}
|
61
|
+
<!-- Manific Popup -->
|
62
|
+
<link rel="stylesheet" href="{{ site.data.assets[origin].magnific-popup.css | relative_url }}">
|
63
|
+
{% endif %}
|
64
|
+
|
65
|
+
<!-- JQuery -->
|
66
|
+
<script src="{{ site.data.assets[origin].jquery.js | relative_url }}"></script>
|
67
|
+
|
68
|
+
{% unless site.theme_mode %}
|
69
|
+
{% include mode-toggle.html %}
|
70
|
+
{% endunless %}
|
71
|
+
|
72
|
+
</head>
|
@@ -0,0 +1 @@
|
|
1
|
+
{% comment %} HEADER-BANNER {% endcomment %}
|
@@ -0,0 +1 @@
|
|
1
|
+
{% comment %} HEADER-WIDE {% endcomment %}
|
@@ -0,0 +1 @@
|
|
1
|
+
{% comment %} HEADER-REGULAR {% endcomment %}
|
@@ -0,0 +1,89 @@
|
|
1
|
+
<!--
|
2
|
+
JS selector for site.
|
3
|
+
-->
|
4
|
+
{% if page.layout == 'post' %}
|
5
|
+
{% if site.google_analytics.pv.proxy_endpoint or site.google_analytics.pv.cache_path %}
|
6
|
+
<!-- pv-report needs countup.js -->
|
7
|
+
<script async src="{{ site.data.assets[origin].countup.js | relative_url }}"></script>
|
8
|
+
<script defer src="{{ '/assets/js/dist/pvreport.min.js' | relative_url }}"></script>
|
9
|
+
{% endif %}
|
10
|
+
{% endif %}
|
11
|
+
|
12
|
+
{% if page.layout == 'post' or page.layout == 'page' %}
|
13
|
+
<!-- image lazy-loading & popup & clipboard -->
|
14
|
+
{% assign _urls = site.data.assets[origin].magnific-popup.js
|
15
|
+
| append: ',' | append: site.data.assets[origin].lozad.js
|
16
|
+
| append: ',' | append: site.data.assets[origin].clipboard.js
|
17
|
+
%}
|
18
|
+
{% include jsdelivr-combine.html urls=_urls %}
|
19
|
+
{% endif %}
|
20
|
+
|
21
|
+
{% if page.layout == 'home'
|
22
|
+
or page.layout == 'post'
|
23
|
+
or page.layout == 'archives'
|
24
|
+
or page.layout == 'category'
|
25
|
+
or page.layout == 'tag' %}
|
26
|
+
{% if site.prefer_datetime_locale %}
|
27
|
+
{% assign locale = site.prefer_datetime_locale | downcase %}
|
28
|
+
{% else %}
|
29
|
+
{% assign locale = site.lang | split: '-' | first %}
|
30
|
+
{% endif %}
|
31
|
+
{% assign _urls = site.data.assets[origin].dayjs.js.common
|
32
|
+
| append: ',' | append: site.data.assets[origin].dayjs.js.locale
|
33
|
+
| replace: ':LOCALE', locale
|
34
|
+
| append: ',' | append: site.data.assets[origin].dayjs.js.relativeTime
|
35
|
+
| append: ',' | append: site.data.assets[origin].dayjs.js.localizedFormat
|
36
|
+
%}
|
37
|
+
{% include jsdelivr-combine.html urls=_urls %}
|
38
|
+
{% endif %}
|
39
|
+
|
40
|
+
{% if page.layout == 'home'
|
41
|
+
or page.layout == 'categories'
|
42
|
+
or page.layout == 'post'
|
43
|
+
or page.layout == 'page' %}
|
44
|
+
{% assign type = page.layout %}
|
45
|
+
{% elsif page.layout == 'archives'
|
46
|
+
or page.layout == 'category'
|
47
|
+
or page.layout == 'tag' %}
|
48
|
+
{% assign type = "misc" %}
|
49
|
+
{% else %}
|
50
|
+
{% assign type = "common" %}
|
51
|
+
{% endif %}
|
52
|
+
|
53
|
+
{% capture script %}/assets/js/dist/{{ type }}.min.js{% endcapture %}
|
54
|
+
<script defer src="{{ script | relative_url }}"></script>
|
55
|
+
|
56
|
+
{% if page.math %}
|
57
|
+
<!-- MathJax -->
|
58
|
+
<script>
|
59
|
+
/* see: <https://docs.mathjax.org/en/latest/options/input/tex.html#tex-options> */
|
60
|
+
MathJax = {
|
61
|
+
tex: {
|
62
|
+
inlineMath: [ /* start/end delimiter pairs for in-line math */
|
63
|
+
['$','$'],
|
64
|
+
['\\(','\\)']
|
65
|
+
],
|
66
|
+
displayMath: [ /* start/end delimiter pairs for display math */
|
67
|
+
['$$', '$$'],
|
68
|
+
['\\[', '\\]']
|
69
|
+
]
|
70
|
+
}
|
71
|
+
};
|
72
|
+
</script>
|
73
|
+
<script src="{{ site.data.assets[origin].polyfill.js | relative_url }}"></script>
|
74
|
+
<script id="MathJax-script" async src="{{ site.data.assets[origin].mathjax.js | relative_url }}">
|
75
|
+
</script>
|
76
|
+
{% endif %}
|
77
|
+
|
78
|
+
<!-- Bootstrap JS -->
|
79
|
+
<script src="{{ site.data.assets[origin].bootstrap.js | relative_url }}"></script>
|
80
|
+
|
81
|
+
{% if jekyll.environment == 'production' %}
|
82
|
+
<!-- PWA -->
|
83
|
+
{% if site.pwa.enabled %}
|
84
|
+
<script defer src="{{ '/app.js' | relative_url }}"></script>
|
85
|
+
{% else %}
|
86
|
+
<script defer src="{{ '/unregister.js' | relative_url }}"></script>
|
87
|
+
{% endif %}
|
88
|
+
|
89
|
+
{% endif %}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
{% assign urls = include.urls | split: ',' %}
|
2
|
+
{% assign combined_urls = nil %}
|
3
|
+
{% assign domain = 'https://cdn.jsdelivr.net/' %}
|
4
|
+
{% for url in urls %}
|
5
|
+
{% if url contains domain %}
|
6
|
+
{% assign url_snippet = url | slice: domain.size, url.size %}
|
7
|
+
{% if combined_urls %}
|
8
|
+
{% assign combined_urls = combined_urls | append: ',' | append: url_snippet %}
|
9
|
+
{% else %}
|
10
|
+
{% assign combined_urls = domain | append: 'combine/' | append: url_snippet %}
|
11
|
+
{% endif %}
|
12
|
+
{% elsif url contains '//' %}
|
13
|
+
<script src="{{ url }}"></script>
|
14
|
+
{% else %}
|
15
|
+
<script src="{{ url | relative_url }}"></script>
|
16
|
+
{% endif %}
|
17
|
+
{% endfor %}
|
18
|
+
{% if combined_urls %}<script src="{{ combined_urls }}"></script>{% endif %}
|
data/_includes/lang.html
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{% comment %} MERMAID {% endcomment %}
|
@@ -0,0 +1,138 @@
|
|
1
|
+
<!--
|
2
|
+
Switch the mode between dark and light.
|
3
|
+
-->
|
4
|
+
|
5
|
+
<script type="text/javascript">
|
6
|
+
class ModeToggle {
|
7
|
+
static get MODE_KEY() { return "mode"; }
|
8
|
+
static get MODE_ATTR() { return "data-mode"; }
|
9
|
+
static get DARK_MODE() { return "dark"; }
|
10
|
+
static get LIGHT_MODE() { return "light"; }
|
11
|
+
static get BREW_MODE() { return "brew"; }
|
12
|
+
static get ID() { return "mode-toggle"; }
|
13
|
+
|
14
|
+
constructor() {
|
15
|
+
if (this.hasMode) {
|
16
|
+
if (this.isDarkMode) {
|
17
|
+
if (!this.isSysDarkPrefer) {
|
18
|
+
this.setDark();
|
19
|
+
}
|
20
|
+
} else {
|
21
|
+
if (this.isSysDarkPrefer) {
|
22
|
+
this.setLight();
|
23
|
+
}
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
let self = this;
|
28
|
+
|
29
|
+
/* always follow the system prefers */
|
30
|
+
this.sysDarkPrefers.addEventListener("change", () => {
|
31
|
+
if (self.hasMode) {
|
32
|
+
if (self.isDarkMode) {
|
33
|
+
if (!self.isSysDarkPrefer) {
|
34
|
+
self.setDark();
|
35
|
+
}
|
36
|
+
|
37
|
+
} else {
|
38
|
+
if (self.isSysDarkPrefer) {
|
39
|
+
self.setLight();
|
40
|
+
}
|
41
|
+
}
|
42
|
+
|
43
|
+
self.clearMode();
|
44
|
+
}
|
45
|
+
|
46
|
+
self.notify();
|
47
|
+
|
48
|
+
});
|
49
|
+
|
50
|
+
} /* constructor() */
|
51
|
+
|
52
|
+
get sysDarkPrefers() { return window.matchMedia("(prefers-color-scheme: dark)"); }
|
53
|
+
|
54
|
+
get isSysDarkPrefer() { return this.sysDarkPrefers.matches; }
|
55
|
+
|
56
|
+
get isDarkMode() { return this.mode === ModeToggle.DARK_MODE; }
|
57
|
+
|
58
|
+
get isLightMode() { return this.mode === ModeToggle.LIGHT_MODE; }
|
59
|
+
|
60
|
+
get isBrewMode() { return this.mode === ModeToggle.BREW_MODE; }
|
61
|
+
|
62
|
+
get hasMode() { return this.mode != null; }
|
63
|
+
|
64
|
+
get mode() { return sessionStorage.getItem(ModeToggle.MODE_KEY); }
|
65
|
+
|
66
|
+
/* get the current mode on screen */
|
67
|
+
get modeStatus() {
|
68
|
+
if (this.isDarkMode || (!this.hasMode && this.isSysDarkPrefer)) {
|
69
|
+
return ModeToggle.DARK_MODE;
|
70
|
+
} else if (this.isBrewMode) {
|
71
|
+
return ModeToggle.BREW_MODE;
|
72
|
+
} else {
|
73
|
+
return ModeToggle.LIGHT_MODE;
|
74
|
+
}
|
75
|
+
}
|
76
|
+
|
77
|
+
setDark() {
|
78
|
+
$('html').attr(ModeToggle.MODE_ATTR, ModeToggle.DARK_MODE);
|
79
|
+
sessionStorage.setItem(ModeToggle.MODE_KEY, ModeToggle.DARK_MODE);
|
80
|
+
}
|
81
|
+
|
82
|
+
setLight() {
|
83
|
+
$('html').attr(ModeToggle.MODE_ATTR, ModeToggle.LIGHT_MODE);
|
84
|
+
sessionStorage.setItem(ModeToggle.MODE_KEY, ModeToggle.LIGHT_MODE);
|
85
|
+
}
|
86
|
+
|
87
|
+
setBrew() {
|
88
|
+
$('html').attr(ModeToggle.MODE_ATTR, ModeToggle.BREW_MODE);
|
89
|
+
sessionStorage.setItem(ModeToggle.MODE_KEY, ModeToggle.BREW_MODE);
|
90
|
+
}
|
91
|
+
|
92
|
+
clearMode() {
|
93
|
+
$('html').removeAttr(ModeToggle.MODE_ATTR);
|
94
|
+
sessionStorage.removeItem(ModeToggle.MODE_KEY);
|
95
|
+
}
|
96
|
+
|
97
|
+
/* Notify another plugins that the theme mode has changed */
|
98
|
+
notify() {
|
99
|
+
window.postMessage({
|
100
|
+
direction: ModeToggle.ID,
|
101
|
+
message: this.modeStatus
|
102
|
+
}, "*");
|
103
|
+
}
|
104
|
+
|
105
|
+
} /* ModeToggle */
|
106
|
+
|
107
|
+
const toggle = new ModeToggle();
|
108
|
+
|
109
|
+
function flipMode() {
|
110
|
+
if (toggle.hasMode) {
|
111
|
+
if (toggle.isSysDarkPrefer) {
|
112
|
+
if (toggle.isLightMode) {
|
113
|
+
toggle.clearMode();
|
114
|
+
} else {
|
115
|
+
toggle.setLight();
|
116
|
+
}
|
117
|
+
|
118
|
+
} else {
|
119
|
+
if (toggle.isDarkMode) {
|
120
|
+
toggle.clearMode();
|
121
|
+
} else {
|
122
|
+
toggle.setDark();
|
123
|
+
}
|
124
|
+
}
|
125
|
+
|
126
|
+
} else {
|
127
|
+
if (toggle.isSysDarkPrefer) {
|
128
|
+
toggle.setLight();
|
129
|
+
} else {
|
130
|
+
toggle.setDark();
|
131
|
+
}
|
132
|
+
}
|
133
|
+
|
134
|
+
toggle.notify();
|
135
|
+
|
136
|
+
} /* flipMode() */
|
137
|
+
|
138
|
+
</script>
|
File without changes
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{% comment %} Site static assets origin {% endcomment %}
|
2
|
+
|
3
|
+
{% assign origin = 'cross_origin' %}
|
4
|
+
|
5
|
+
{% if site.assets.self_host.enabled %}
|
6
|
+
{% if site.assets.self_host.env %}
|
7
|
+
{% if site.assets.self_host.env == jekyll.environment %}
|
8
|
+
{% assign origin = 'self_host' %}
|
9
|
+
{% endif %}
|
10
|
+
{% else %}
|
11
|
+
{% assign origin = 'self_host' %}
|
12
|
+
{% endif %}
|
13
|
+
{% endif %}
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
{% comment %} PANEL-BOTTOM {% endcomment %}
|
@@ -0,0 +1 @@
|
|
1
|
+
{% comment %} FOOTER PANEL, 2 COLUMN {% endcomment %}
|
@@ -0,0 +1 @@
|
|
1
|
+
{% comment %} FOOTER PANEL, 3 COLUMN {% endcomment %}
|
@@ -0,0 +1 @@
|
|
1
|
+
{% comment %} FOOTER PANEL, 4 COLUMN {% endcomment %}
|
@@ -0,0 +1 @@
|
|
1
|
+
{% comment %} FOOTER PANEL, FULL WIDTH {% endcomment %}
|
@@ -0,0 +1 @@
|
|
1
|
+
{% comment %} TOP PANEL, 2 COLUMN {% endcomment %}
|
@@ -0,0 +1 @@
|
|
1
|
+
{% comment %} TOP PANEL, 3 COLUMN {% endcomment %}
|
@@ -0,0 +1 @@
|
|
1
|
+
{% comment %} TOP PANEL, 4 COLUMN {% endcomment %}
|
@@ -0,0 +1 @@
|
|
1
|
+
{% comment %} FOOTER PANEL, FULL WIDTH {% endcomment %}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,46 @@
|
|
1
|
+
<!--
|
2
|
+
Jekyll Simple Search loader
|
3
|
+
See: <https://github.com/christian-fei/Simple-Jekyll-Search>
|
4
|
+
-->
|
5
|
+
|
6
|
+
{% capture result_elem %}
|
7
|
+
<div class="pl-1 pr-1 pl-sm-2 pr-sm-2 pl-lg-4 pr-lg-4 pl-xl-0 pr-xl-0">
|
8
|
+
<a href="{url}">{title}</a>
|
9
|
+
<div class="post-meta d-flex flex-column flex-sm-row text-muted mt-1 mb-1">
|
10
|
+
{categories}
|
11
|
+
{tags}
|
12
|
+
</div>
|
13
|
+
<p>{snippet}</p>
|
14
|
+
</div>
|
15
|
+
{% endcapture %}
|
16
|
+
|
17
|
+
{% capture not_found %}<p class="mt-5">{{ site.data.locales[lang].search.no_results }}</p>{% endcapture %}
|
18
|
+
|
19
|
+
<script src="{{ site.data.assets[origin].search.js | relative_url }}"></script>
|
20
|
+
|
21
|
+
<script>
|
22
|
+
SimpleJekyllSearch({
|
23
|
+
searchInput: document.getElementById('search-input'),
|
24
|
+
resultsContainer: document.getElementById('search-results'),
|
25
|
+
json: '{{ '/assets/js/data/search.json' | relative_url }}',
|
26
|
+
searchResultTemplate: '{{ result_elem | strip_newlines }}',
|
27
|
+
noResultsText: '{{ not_found }}',
|
28
|
+
templateMiddleware: function(prop, value, template) {
|
29
|
+
if (prop === 'categories') {
|
30
|
+
if (value === '') {
|
31
|
+
return `${value}`;
|
32
|
+
} else {
|
33
|
+
return `<div class="mr-sm-4"><i class="far fa-folder fa-fw"></i>${value}</div>`;
|
34
|
+
}
|
35
|
+
}
|
36
|
+
|
37
|
+
if (prop === 'tags') {
|
38
|
+
if (value === '') {
|
39
|
+
return `${value}`;
|
40
|
+
} else {
|
41
|
+
return `<div><i class="fa fa-tag fa-fw"></i>${value}</div>`;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
}
|
45
|
+
});
|
46
|
+
</script>
|
@@ -0,0 +1 @@
|
|
1
|
+
{% comment %} SEARCH RESULTS {% endcomment %}
|
File without changes
|
data/_includes/toc.html
ADDED
File without changes
|
@@ -0,0 +1,20 @@
|
|
1
|
+
/*
|
2
|
+
Reference: https://bootsnipp.com/snippets/featured/link-to-top-page
|
3
|
+
*/
|
4
|
+
$(function() {
|
5
|
+
$(window).scroll(() => {
|
6
|
+
if ($(this).scrollTop() > 50 &&
|
7
|
+
$("#sidebar-trigger").css("display") === "none") {
|
8
|
+
$("#back-to-top").fadeIn();
|
9
|
+
} else {
|
10
|
+
$("#back-to-top").fadeOut();
|
11
|
+
}
|
12
|
+
});
|
13
|
+
|
14
|
+
$("#back-to-top").click(() => {
|
15
|
+
$("body,html").animate({
|
16
|
+
scrollTop: 0
|
17
|
+
}, 800);
|
18
|
+
return false;
|
19
|
+
});
|
20
|
+
});
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/*
|
2
|
+
* Listener for theme mode toggle
|
3
|
+
*/
|
4
|
+
$(function() {
|
5
|
+
$(".mode-toggle").click((e) => {
|
6
|
+
const $target = $(e.target);
|
7
|
+
let $btn = ($target.prop("tagName") === "button".toUpperCase() ?
|
8
|
+
$target : $target.parent());
|
9
|
+
|
10
|
+
$btn.blur(); // remove the clicking outline
|
11
|
+
flipMode();
|
12
|
+
});
|
13
|
+
});
|
@@ -0,0 +1,36 @@
|
|
1
|
+
/**
|
2
|
+
* A tool for smooth scrolling and topbar switcher
|
3
|
+
*/
|
4
|
+
const ScrollHelper = (function () {
|
5
|
+
const $body = $("body");
|
6
|
+
const ATTR_TOPBAR_VISIBLE = "data-topbar-visible";
|
7
|
+
const topbarHeight = $("#topbar-wrapper").outerHeight();
|
8
|
+
|
9
|
+
let scrollUpCount = 0; // the number of times the scroll up was triggered by ToC or anchor
|
10
|
+
let topbarLocked = false;
|
11
|
+
let orientationLocked = false;
|
12
|
+
|
13
|
+
return {
|
14
|
+
hideTopbar: () => $body.attr(ATTR_TOPBAR_VISIBLE, false),
|
15
|
+
showTopbar: () => $body.attr(ATTR_TOPBAR_VISIBLE, true),
|
16
|
+
|
17
|
+
// scroll up
|
18
|
+
|
19
|
+
addScrollUpTask: () => {
|
20
|
+
scrollUpCount += 1;
|
21
|
+
if (!topbarLocked) { topbarLocked = true; }
|
22
|
+
},
|
23
|
+
popScrollUpTask: () => scrollUpCount -= 1,
|
24
|
+
hasScrollUpTask: () => scrollUpCount > 0,
|
25
|
+
topbarLocked: () => topbarLocked === true,
|
26
|
+
unlockTopbar: () => topbarLocked = false,
|
27
|
+
getTopbarHeight: () => topbarHeight,
|
28
|
+
|
29
|
+
// orientation change
|
30
|
+
|
31
|
+
orientationLocked: () => orientationLocked === true,
|
32
|
+
lockOrientation: () => orientationLocked = true,
|
33
|
+
unLockOrientation: () => orientationLocked = false
|
34
|
+
};
|
35
|
+
|
36
|
+
}());
|