jekyll-theme-chirpy 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/404.html +20 -0
- data/LICENSE +21 -0
- data/README.md +223 -0
- data/_config.yml +204 -0
- data/_data/contact.yml +30 -0
- data/_data/date_format.yml +7 -0
- data/_data/label.yml +19 -0
- data/_data/rights.yml +11 -0
- data/_data/share.yml +27 -0
- data/_includes/css-selector.html +10 -0
- data/_includes/disqus.html +25 -0
- data/_includes/favicons.html +32 -0
- data/_includes/footer.html +29 -0
- data/_includes/google-analytics.html +14 -0
- data/_includes/head.html +80 -0
- data/_includes/js-selector.html +39 -0
- data/_includes/lozad.html +10 -0
- data/_includes/mermaid.html +29 -0
- data/_includes/mode-toggle.html +145 -0
- data/_includes/no-linenos.html +10 -0
- data/_includes/panel.html +57 -0
- data/_includes/post-nav.html +28 -0
- data/_includes/post-paginator.html +80 -0
- data/_includes/post-sharing.html +23 -0
- data/_includes/read-time.html +19 -0
- data/_includes/refactor-content.html +66 -0
- data/_includes/related-posts.html +106 -0
- data/_includes/search-loader.html +28 -0
- data/_includes/search-results.html +19 -0
- data/_includes/sidebar.html +91 -0
- data/_includes/timeago.html +27 -0
- data/_includes/topbar.html +48 -0
- data/_includes/trending-tags.html +36 -0
- data/_includes/update-list.html +24 -0
- data/_layouts/archives.html +36 -0
- data/_layouts/categories.html +100 -0
- data/_layouts/category.html +24 -0
- data/_layouts/compress.html +10 -0
- data/_layouts/default.html +51 -0
- data/_layouts/home.html +96 -0
- data/_layouts/page.html +34 -0
- data/_layouts/post.html +130 -0
- data/_layouts/tag.html +24 -0
- data/_layouts/tags.html +21 -0
- data/_plugins/posts-lastmod-hook.rb +14 -0
- data/_sass/addon/commons.scss +1629 -0
- data/_sass/addon/module.scss +118 -0
- data/_sass/addon/syntax.scss +176 -0
- data/_sass/addon/variables.scss +27 -0
- data/_sass/colors/dark-syntax.scss +84 -0
- data/_sass/colors/dark-typography.scss +135 -0
- data/_sass/colors/light-syntax.scss +75 -0
- data/_sass/colors/light-typography.scss +76 -0
- data/_sass/jekyll-theme-chirpy.scss +22 -0
- data/_sass/layout/archives.scss +137 -0
- data/_sass/layout/categories.scss +64 -0
- data/_sass/layout/category-tag.scss +66 -0
- data/_sass/layout/home.scss +156 -0
- data/_sass/layout/post.scss +349 -0
- data/_sass/layout/tags.scss +18 -0
- data/_tabs/about.md +8 -0
- data/_tabs/archives.md +7 -0
- data/_tabs/categories.md +6 -0
- data/_tabs/tags.md +6 -0
- data/app.js +8 -0
- data/assets/css/style.scss +7 -0
- data/assets/img/favicons/android-icon-144x144.png +0 -0
- data/assets/img/favicons/android-icon-192x192.png +0 -0
- data/assets/img/favicons/android-icon-36x36.png +0 -0
- data/assets/img/favicons/android-icon-48x48.png +0 -0
- data/assets/img/favicons/android-icon-72x72.png +0 -0
- data/assets/img/favicons/android-icon-96x96.png +0 -0
- data/assets/img/favicons/apple-icon-114x114.png +0 -0
- data/assets/img/favicons/apple-icon-120x120.png +0 -0
- data/assets/img/favicons/apple-icon-144x144.png +0 -0
- data/assets/img/favicons/apple-icon-152x152.png +0 -0
- data/assets/img/favicons/apple-icon-180x180.png +0 -0
- data/assets/img/favicons/apple-icon-57x57.png +0 -0
- data/assets/img/favicons/apple-icon-60x60.png +0 -0
- data/assets/img/favicons/apple-icon-72x72.png +0 -0
- data/assets/img/favicons/apple-icon-76x76.png +0 -0
- data/assets/img/favicons/apple-icon-precomposed.png +0 -0
- data/assets/img/favicons/apple-icon.png +0 -0
- data/assets/img/favicons/browserconfig.xml +20 -0
- data/assets/img/favicons/favicon-16x16.png +0 -0
- data/assets/img/favicons/favicon-32x32.png +0 -0
- data/assets/img/favicons/favicon-96x96.png +0 -0
- data/assets/img/favicons/favicon.ico +0 -0
- data/assets/img/favicons/manifest.json +58 -0
- data/assets/img/favicons/ms-icon-144x144.png +0 -0
- data/assets/img/favicons/ms-icon-150x150.png +0 -0
- data/assets/img/favicons/ms-icon-310x310.png +0 -0
- data/assets/img/favicons/ms-icon-70x70.png +0 -0
- data/assets/js/data/cache-list.js +69 -0
- data/assets/js/data/search.json +17 -0
- data/assets/js/dist/categories.min.js +6 -0
- data/assets/js/dist/home.min.js +6 -0
- data/assets/js/dist/page.min.js +6 -0
- data/assets/js/dist/post.min.js +6 -0
- data/assets/js/dist/pvreport.min.js +6 -0
- data/assets/js/lib/jquery.disqusloader.min.js +8 -0
- data/feed.xml +60 -0
- data/index.html +4 -0
- data/robots.txt +10 -0
- data/sw.js +61 -0
- metadata +247 -0
@@ -0,0 +1,14 @@
|
|
1
|
+
<!--
|
2
|
+
The GA snippet
|
3
|
+
-->
|
4
|
+
<!-- Global site tag (gtag.js) - Google Analytics -->
|
5
|
+
<script defer src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics.id }}"></script>
|
6
|
+
<script>
|
7
|
+
document.addEventListener("DOMContentLoaded", function(event) {
|
8
|
+
window.dataLayer = window.dataLayer || [];
|
9
|
+
function gtag(){dataLayer.push(arguments);}
|
10
|
+
|
11
|
+
gtag('js', new Date());
|
12
|
+
gtag('config', '{{ site.google_analytics.id }}');
|
13
|
+
});
|
14
|
+
</script>
|
data/_includes/head.html
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
<!--
|
2
|
+
The Head
|
3
|
+
-->
|
4
|
+
|
5
|
+
<head>
|
6
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
8
|
+
|
9
|
+
{% if page.layout == 'home' or page.layout == 'post' %}
|
10
|
+
<meta name="pv-cache-enabled" content="{{ site.google_analytics.pv.enabled }}">
|
11
|
+
|
12
|
+
{% if site.google_analytics.pv.enabled %}
|
13
|
+
{% if site.google_analytics.pv.proxy_endpoint != ''
|
14
|
+
and site.google_analytics.pv.proxy_endpoint %}
|
15
|
+
<meta name="pv-proxy-endpoint" content="{{ site.google_analytics.pv.proxy_endpoint }}">
|
16
|
+
{% endif %}
|
17
|
+
|
18
|
+
{% if site.google_analytics.pv.cache %}
|
19
|
+
<meta name="pv-cache-data" content="{{ '/assets/js/data/pageviews.json' | relative_url }}">
|
20
|
+
{% endif %}
|
21
|
+
|
22
|
+
{% endif %}
|
23
|
+
{% endif %}
|
24
|
+
|
25
|
+
{% seo title=false %}
|
26
|
+
|
27
|
+
<title>
|
28
|
+
{%- unless page.layout == "home" -%}
|
29
|
+
{{ page.title | append: " | "}}
|
30
|
+
{%- endunless -%}
|
31
|
+
{{ site.title }}
|
32
|
+
</title>
|
33
|
+
|
34
|
+
{% include favicons.html %}
|
35
|
+
|
36
|
+
<!-- Google Fonts -->
|
37
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="anonymous">
|
38
|
+
<link rel="dns-prefetch" href="https://fonts.gstatic.com">
|
39
|
+
|
40
|
+
<!-- GA -->
|
41
|
+
{% if jekyll.environment == 'production' %}
|
42
|
+
<link rel="preconnect" href="https://www.google-analytics.com" crossorigin="use-credentials">
|
43
|
+
<link rel="dns-prefetch" href="https://www.google-analytics.com">
|
44
|
+
|
45
|
+
<link rel="preconnect" href="https://www.googletagmanager.com" crossorigin="anonymous">
|
46
|
+
<link rel="dns-prefetch" href="https://www.googletagmanager.com">
|
47
|
+
|
48
|
+
{% if site.google_analytics.pv.proxy_url and site.google_analytics.pv.enabled %}
|
49
|
+
<link rel="preconnect" href="{{ site.google_analytics.pv.proxy_url }}" crossorigin="use-credentials">
|
50
|
+
<link rel="dns-prefetch" href="{{ site.google_analytics.pv.proxy_url }}">
|
51
|
+
{% endif %}
|
52
|
+
{% endif %}
|
53
|
+
|
54
|
+
<!-- jsDelivr CDN -->
|
55
|
+
<link rel="preconnect" href="cdn.jsdelivr.net">
|
56
|
+
<link rel="dns-prefetch" href="cdn.jsdelivr.net">
|
57
|
+
|
58
|
+
<!-- Bootstrap -->
|
59
|
+
<link rel="stylesheet"
|
60
|
+
href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css"
|
61
|
+
integrity="sha256-LA89z+k9fjgMKQ/kq4OO2Mrf8VltYml/VES+Rg0fh20=" crossorigin="anonymous">
|
62
|
+
|
63
|
+
<!-- Font Awesome -->
|
64
|
+
<link rel="stylesheet"
|
65
|
+
href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.11.2/css/all.min.css"
|
66
|
+
integrity="sha256-+N4/V/SbAFiW1MPBCXnfnP9QSN3+Keu+NlB+0ev/YKQ="
|
67
|
+
crossorigin="anonymous">
|
68
|
+
|
69
|
+
{% include css-selector.html %}
|
70
|
+
|
71
|
+
<!-- JavaScripts -->
|
72
|
+
|
73
|
+
<script src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js"></script>
|
74
|
+
|
75
|
+
<script defer
|
76
|
+
src="https://cdn.jsdelivr.net/combine/npm/popper.js@1.15.0,npm/bootstrap@4/dist/js/bootstrap.min.js"></script>
|
77
|
+
|
78
|
+
{% include js-selector.html %}
|
79
|
+
|
80
|
+
</head>
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<!--
|
2
|
+
JS selector for site.
|
3
|
+
-->
|
4
|
+
|
5
|
+
{% if page.layout == 'home' or page.layout == 'post' %}
|
6
|
+
{% if site.google_analytics.pv.enabled %}
|
7
|
+
<!-- pv-report needs countup.js -->
|
8
|
+
<script async src="https://cdn.jsdelivr.net/npm/countup.js@1.9.3/dist/countUp.min.js"></script>
|
9
|
+
<script async src="{{ '/assets/js/dist/pvreport.min.js' | relative_url }}"></script>
|
10
|
+
{% endif %}
|
11
|
+
{% endif %}
|
12
|
+
|
13
|
+
{% if page.layout == 'home'
|
14
|
+
or page.layout == 'post'
|
15
|
+
or page.layout == 'categories' %}
|
16
|
+
{% assign type = page.layout %}
|
17
|
+
{% else %}
|
18
|
+
{% assign type = "page" %}
|
19
|
+
{% endif %}
|
20
|
+
|
21
|
+
{% assign js = type | prepend: '/assets/js/dist/' | append: '.min.js' %}
|
22
|
+
<script defer src="{{ js | relative_url }}"></script>
|
23
|
+
|
24
|
+
{% if page.math %}
|
25
|
+
<!-- MathJax -->
|
26
|
+
<script defer src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
|
27
|
+
<script defer src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
|
28
|
+
{% endif %}
|
29
|
+
|
30
|
+
{% if jekyll.environment == 'production' %}
|
31
|
+
<!-- PWA -->
|
32
|
+
<script defer src="{{ '/app.js' | relative_url }}"></script>
|
33
|
+
|
34
|
+
<!-- GA -->
|
35
|
+
{% if site.google_analytics.id %}
|
36
|
+
{% include google-analytics.html %}
|
37
|
+
{% endif %}
|
38
|
+
|
39
|
+
{% endif %}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<!--
|
2
|
+
image lazy load: https://github.com/ApoorvSaxena/lozad.js
|
3
|
+
-->
|
4
|
+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/lozad/dist/lozad.min.js"></script>
|
5
|
+
|
6
|
+
<script type="text/javascript">
|
7
|
+
const imgs = document.querySelectorAll('.post-content img');
|
8
|
+
const observer = lozad(imgs);
|
9
|
+
observer.observe();
|
10
|
+
</script>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<!--
|
2
|
+
mermaid-js loader
|
3
|
+
-->
|
4
|
+
|
5
|
+
<script src="https://cdn.jsdelivr.net/npm/mermaid@8/dist/mermaid.min.js"></script>
|
6
|
+
<script>
|
7
|
+
$(function() {
|
8
|
+
let initTheme = "default";
|
9
|
+
|
10
|
+
if ($("html[mode=dark]").length > 0
|
11
|
+
|| ($("html[mode]").length == 0
|
12
|
+
&& window.matchMedia("(prefers-color-scheme: dark)").matches ) ) {
|
13
|
+
initTheme = "dark";
|
14
|
+
}
|
15
|
+
|
16
|
+
let mermaidConf = {
|
17
|
+
theme: initTheme /* <default|dark|forest|neutral> */
|
18
|
+
};
|
19
|
+
|
20
|
+
/* Markdown converts to HTML */
|
21
|
+
$("pre").has("code.language-mermaid").each(function() {
|
22
|
+
let svgCode = $(this).children().html();
|
23
|
+
$(this).addClass("unloaded");
|
24
|
+
$(this).after(`<div class=\"mermaid\">${svgCode}</div>`);
|
25
|
+
});
|
26
|
+
|
27
|
+
mermaid.initialize(mermaidConf);
|
28
|
+
});
|
29
|
+
</script>
|
@@ -0,0 +1,145 @@
|
|
1
|
+
<!--
|
2
|
+
Switch the mode between dark and light.
|
3
|
+
-->
|
4
|
+
|
5
|
+
<i class="mode-toggle fas fa-adjust"></i>
|
6
|
+
|
7
|
+
<script type="text/javascript">
|
8
|
+
|
9
|
+
class ModeToggle {
|
10
|
+
static get MODE_KEY() { return "mode"; }
|
11
|
+
static get DARK_MODE() { return "dark"; }
|
12
|
+
static get LIGHT_MODE() { return "light"; }
|
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
|
+
var self = this;
|
28
|
+
|
29
|
+
/* always follow the system prefers */
|
30
|
+
this.sysDarkPrefers.addListener(function() {
|
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.updateMermaid();
|
47
|
+
});
|
48
|
+
|
49
|
+
} /* constructor() */
|
50
|
+
|
51
|
+
|
52
|
+
setDark() {
|
53
|
+
$('html').attr(ModeToggle.MODE_KEY, ModeToggle.DARK_MODE);
|
54
|
+
sessionStorage.setItem(ModeToggle.MODE_KEY, ModeToggle.DARK_MODE);
|
55
|
+
}
|
56
|
+
|
57
|
+
setLight() {
|
58
|
+
$('html').attr(ModeToggle.MODE_KEY, ModeToggle.LIGHT_MODE);
|
59
|
+
sessionStorage.setItem(ModeToggle.MODE_KEY, ModeToggle.LIGHT_MODE);
|
60
|
+
}
|
61
|
+
|
62
|
+
clearMode() {
|
63
|
+
$('html').removeAttr(ModeToggle.MODE_KEY);
|
64
|
+
sessionStorage.removeItem(ModeToggle.MODE_KEY);
|
65
|
+
}
|
66
|
+
|
67
|
+
get sysDarkPrefers() { return window.matchMedia("(prefers-color-scheme: dark)"); }
|
68
|
+
|
69
|
+
get isSysDarkPrefer() { return this.sysDarkPrefers.matches; }
|
70
|
+
|
71
|
+
get isDarkMode() { return this.mode == ModeToggle.DARK_MODE; }
|
72
|
+
|
73
|
+
get isLightMode() { return this.mode == ModeToggle.LIGHT_MODE; }
|
74
|
+
|
75
|
+
get hasMode() { return this.mode != null; }
|
76
|
+
|
77
|
+
get mode() { return sessionStorage.getItem(ModeToggle.MODE_KEY); }
|
78
|
+
|
79
|
+
/* get the current mode on screen */
|
80
|
+
get modeStatus() {
|
81
|
+
if (this.isDarkMode
|
82
|
+
|| (!this.hasMode && this.isSysDarkPrefer) ) {
|
83
|
+
return ModeToggle.DARK_MODE;
|
84
|
+
} else {
|
85
|
+
return ModeToggle.LIGHT_MODE;
|
86
|
+
}
|
87
|
+
}
|
88
|
+
|
89
|
+
updateMermaid() {
|
90
|
+
if (typeof mermaid !== "undefined") {
|
91
|
+
let expectedTheme = (this.modeStatus === ModeToggle.DARK_MODE? "dark" : "default");
|
92
|
+
let config = { theme: expectedTheme };
|
93
|
+
|
94
|
+
/* re-render the SVG › <https://github.com/mermaid-js/mermaid/issues/311#issuecomment-332557344> */
|
95
|
+
$(".mermaid").each(function() {
|
96
|
+
let svgCode = $(this).prev().children().html();
|
97
|
+
$(this).removeAttr("data-processed");
|
98
|
+
$(this).html(svgCode);
|
99
|
+
});
|
100
|
+
|
101
|
+
mermaid.initialize(config);
|
102
|
+
mermaid.init(undefined, ".mermaid");
|
103
|
+
}
|
104
|
+
}
|
105
|
+
|
106
|
+
flipMode() {
|
107
|
+
if (this.hasMode) {
|
108
|
+
if (this.isSysDarkPrefer) {
|
109
|
+
if (this.isLightMode) {
|
110
|
+
this.clearMode();
|
111
|
+
} else {
|
112
|
+
this.setLight();
|
113
|
+
}
|
114
|
+
|
115
|
+
} else {
|
116
|
+
if (this.isDarkMode) {
|
117
|
+
this.clearMode();
|
118
|
+
} else {
|
119
|
+
this.setDark();
|
120
|
+
}
|
121
|
+
}
|
122
|
+
|
123
|
+
} else {
|
124
|
+
if (this.isSysDarkPrefer) {
|
125
|
+
this.setLight();
|
126
|
+
} else {
|
127
|
+
this.setDark();
|
128
|
+
}
|
129
|
+
}
|
130
|
+
|
131
|
+
this.updateMermaid();
|
132
|
+
|
133
|
+
} /* flipMode() */
|
134
|
+
|
135
|
+
} /* ModeToggle */
|
136
|
+
|
137
|
+
let toggle = new ModeToggle();
|
138
|
+
|
139
|
+
$(".mode-toggle").click(function() {
|
140
|
+
|
141
|
+
toggle.flipMode();
|
142
|
+
|
143
|
+
});
|
144
|
+
|
145
|
+
</script>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
{% comment %}
|
2
|
+
Remove the line number of the code snippet.
|
3
|
+
{% endcomment %}
|
4
|
+
|
5
|
+
{% assign content = include.content %}
|
6
|
+
|
7
|
+
{% if content contains '<td class="rouge-gutter gl"><pre class="lineno">' %}
|
8
|
+
{% assign content = content | replace: '<td class="rouge-gutter gl"><pre class="lineno">', '<!-- <td class="rouge-gutter gl"><pre class="lineno">'%}
|
9
|
+
{% assign content = content | replace: '</td><td class="rouge-code">', '</td> --><td class="rouge-code">' %}
|
10
|
+
{% endif %}
|
@@ -0,0 +1,57 @@
|
|
1
|
+
<!--
|
2
|
+
The Pannel on right side (Desktop views)
|
3
|
+
-->
|
4
|
+
|
5
|
+
<div id="panel-wrapper" class="col-xl-3 pl-2 text-muted topbar-down">
|
6
|
+
|
7
|
+
<div class="access">
|
8
|
+
|
9
|
+
{% include update-list.html %}
|
10
|
+
|
11
|
+
{% if update_list.size > 0 %}
|
12
|
+
|
13
|
+
<div id="access-lastmod" class="post">
|
14
|
+
<span>{{- site.data.label.panel.lastmod | default: 'Recent Update' -}}</span>
|
15
|
+
<ul class="post-content pl-0 pb-1 ml-1 mt-2">
|
16
|
+
|
17
|
+
{% for item in update_list %}
|
18
|
+
{% assign index = item | split: "::" | last | plus: 0 %}
|
19
|
+
{% assign post = site.posts[index] %}
|
20
|
+
{% assign url = post.url | relative_url %}
|
21
|
+
<li><a href="{{ url }}">{{ post.title }}</a></li>
|
22
|
+
{% endfor %}
|
23
|
+
|
24
|
+
</ul>
|
25
|
+
</div> <!-- #access-lastmod -->
|
26
|
+
|
27
|
+
{% endif %}
|
28
|
+
|
29
|
+
{% include trending-tags.html %}
|
30
|
+
|
31
|
+
{% if trending_tags.size > 0 %}
|
32
|
+
<div id="access-tags">
|
33
|
+
<span>{{- site.data.label.panel.trending_tags | default: 'Trending Tags' -}}</span>
|
34
|
+
<div class="d-flex flex-wrap mt-3 mb-1 mr-3">
|
35
|
+
|
36
|
+
{% for tag_name in trending_tags %}
|
37
|
+
{% assign url = tag_name | slugify | url_encode | prepend: "/tags/" | append: "/" %}
|
38
|
+
<a class="post-tag" href="{{ url | relative_url }}">{{ tag_name }}</a>
|
39
|
+
{% endfor %}
|
40
|
+
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
{% endif %}
|
44
|
+
</div> <!-- .access -->
|
45
|
+
|
46
|
+
{% if include.toc %}
|
47
|
+
<!-- BS-toc.js will be loaded at medium priority -->
|
48
|
+
<script src="https://cdn.jsdelivr.net/gh/afeld/bootstrap-toc@1.0.1/dist/bootstrap-toc.min.js"></script>
|
49
|
+
<div id="toc-wrapper" class="pl-0 pr-4 mb-5">
|
50
|
+
<span class="pl-3 pt-2 mb-2">
|
51
|
+
{{- site.data.label.panel.toc | default: 'Contents' -}}
|
52
|
+
</span>
|
53
|
+
<nav id="toc" data-toggle="toc"></nav>
|
54
|
+
</div>
|
55
|
+
{% endif %}
|
56
|
+
|
57
|
+
</div> <!-- #panel-wrapper -->
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<!--
|
2
|
+
Navigation buttons at the bottom of the post.
|
3
|
+
-->
|
4
|
+
|
5
|
+
<div class="post-navigation d-flex justify-content-between">
|
6
|
+
{% if page.previous.url %}
|
7
|
+
<a href="{{ site.baseurl }}{{ page.previous.url }}" class="btn btn-outline-primary"
|
8
|
+
prompt="{{ site.data.label.post.button.previous | default: 'previous' }}">
|
9
|
+
<p>{{ page.previous.title }}</p>
|
10
|
+
</a>
|
11
|
+
{% else %}
|
12
|
+
<span class="btn btn-outline-primary disabled">
|
13
|
+
<p>-</p>
|
14
|
+
</span>
|
15
|
+
{% endif %}
|
16
|
+
|
17
|
+
{% if page.next.url %}
|
18
|
+
<a href="{{ site.baseurl }}{{page.next.url}}" class="btn btn-outline-primary"
|
19
|
+
prompt="{{ site.data.label.post.button.next | default: 'next' }}">
|
20
|
+
<p>{{ page.next.title }}</p>
|
21
|
+
</a>
|
22
|
+
{% else %}
|
23
|
+
<span class="btn btn-outline-primary disabled">
|
24
|
+
<p>-</p>
|
25
|
+
</span>
|
26
|
+
{% endif %}
|
27
|
+
|
28
|
+
</div>
|
@@ -0,0 +1,80 @@
|
|
1
|
+
<!--
|
2
|
+
The paginator for post list on HomgPage.
|
3
|
+
-->
|
4
|
+
|
5
|
+
<ul class="pagination mt-4 mb-0 pl-lg-2">
|
6
|
+
<!-- left arrow -->
|
7
|
+
{% if paginator.previous_page %}
|
8
|
+
{% assign prev_url = paginator.previous_page_path | relative_url %}
|
9
|
+
{% else %}
|
10
|
+
{% assign prev_url = "#" %}
|
11
|
+
{% endif %}
|
12
|
+
<li class="page-item {% unless paginator.previous_page %}disabled{% endunless %}">
|
13
|
+
<a class="page-link btn-box-shadow" href="{{ prev_url }}" aria-label="previous-page">
|
14
|
+
<i class="fas fa-angle-left"></i>
|
15
|
+
</a>
|
16
|
+
</li>
|
17
|
+
|
18
|
+
<!-- page numbers -->
|
19
|
+
{% assign left_ellipsis = false %}
|
20
|
+
{% assign right_ellipsis = false %}
|
21
|
+
|
22
|
+
{% for i in (1..paginator.total_pages) %}
|
23
|
+
|
24
|
+
{% assign pre = paginator.page | minus: 1 %}
|
25
|
+
{% assign next = paginator.page | plus: 1 %}
|
26
|
+
{% assign pre_less = pre | minus: 1 %}
|
27
|
+
{% assign next_more = next | plus: 1 %}
|
28
|
+
{% assign show = false %}
|
29
|
+
|
30
|
+
{% if paginator.page == 1 %}
|
31
|
+
{% if i <= 3 or i == paginator.total_pages %}
|
32
|
+
{% assign show = true %}
|
33
|
+
{% endif %}
|
34
|
+
{% elsif paginator.page == paginator.total_pages %}
|
35
|
+
{% if i == 1 or i >= pre_less %}
|
36
|
+
{% assign show = true %}
|
37
|
+
{% endif %}
|
38
|
+
{% else %}
|
39
|
+
{% if i == 1 or i == paginator.total_pages%}
|
40
|
+
{% assign show = true %}
|
41
|
+
{% elsif i >= pre and i <= next %}
|
42
|
+
{% assign show = true %}
|
43
|
+
{% endif %}
|
44
|
+
{% endif %}
|
45
|
+
|
46
|
+
{% if show %}
|
47
|
+
<!-- show number -->
|
48
|
+
<li class="page-item {% if i == paginator.page %} active{% endif %}">
|
49
|
+
<a class="page-link btn-box-shadow" href="{{ site.baseurl }}/{% if i > 1%}page{{ i }}/{% endif %}">{{ i }}</a>
|
50
|
+
</li>
|
51
|
+
{% else %}
|
52
|
+
<!-- hide number -->
|
53
|
+
{% if i < pre and left_ellipsis == false %}
|
54
|
+
<li class="page-item disabled">
|
55
|
+
<span class="page-link btn-box-shadow">...</span>
|
56
|
+
</li>
|
57
|
+
{% assign left_ellipsis = true %}
|
58
|
+
{% elsif i > next and right_ellipsis == false %}
|
59
|
+
<li class="page-item disabled">
|
60
|
+
<span class="page-link btn-box-shadow">...</span>
|
61
|
+
</li>
|
62
|
+
{% assign right_ellipsis = true %}
|
63
|
+
{% endif %}
|
64
|
+
{% endif %}
|
65
|
+
|
66
|
+
{% endfor %}
|
67
|
+
|
68
|
+
<!-- right arrow -->
|
69
|
+
{% if paginator.next_page_path %}
|
70
|
+
{% assign next_url = paginator.next_page_path | relative_url %}
|
71
|
+
{% else %}
|
72
|
+
{% assign next_url = "#" %}
|
73
|
+
{% endif %}
|
74
|
+
<li class="page-item {% unless paginator.next_page_path %}disabled{% endunless %}">
|
75
|
+
<a class="page-link btn-box-shadow" href="{{ next_url }}" aria-label="next-page">
|
76
|
+
<i class="fas fa-angle-right"></i>
|
77
|
+
</a>
|
78
|
+
</li>
|
79
|
+
|
80
|
+
</ul> <!-- .pagination -->
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<!--
|
2
|
+
Post sharing snippet
|
3
|
+
-->
|
4
|
+
|
5
|
+
<div class="share-wrapper">
|
6
|
+
<span class="share-label text-muted mr-1">{{ site.data.label.post.share | default: 'Share' }}</span>
|
7
|
+
<span class="share-icons">
|
8
|
+
{% capture title %}{{ page.title }} - {{ site.title }}{% endcapture %}
|
9
|
+
{% assign url = page.url | absolute_url %}
|
10
|
+
|
11
|
+
{% for share in site.data.share.platforms %}
|
12
|
+
{% assign link = share.link | replace: 'TITLE', title | replace: 'URL', url %}
|
13
|
+
<a href="{{ link }}" data-toggle="tooltip" data-placement="top"
|
14
|
+
title="{{ share.type }}" target="_blank" rel="noopener" aria-label="{{ share.type }}">
|
15
|
+
<i class="fa-fw {{ share.icon }}"></i>
|
16
|
+
</a>
|
17
|
+
{% endfor %}
|
18
|
+
|
19
|
+
<i class="fa-fw fas fa-link small" onclick="copyLink()"
|
20
|
+
data-toggle="tooltip" data-placement="top" title="Copy link"></i>
|
21
|
+
|
22
|
+
</span>
|
23
|
+
</div>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<!--
|
2
|
+
Calculate the post's reading time, and display the word count in tooltip
|
3
|
+
-->
|
4
|
+
{% assign words = include.content | strip_html | number_of_words: "auto" %}
|
5
|
+
|
6
|
+
<!-- words per minute -->
|
7
|
+
{% assign wpm = 180 %}
|
8
|
+
{% assign min_time = 1 %}
|
9
|
+
|
10
|
+
{% assign read_time = words | divided_by: wpm %}
|
11
|
+
|
12
|
+
{% unless read_time > 0 %}
|
13
|
+
{% assign read_time = min_time %}
|
14
|
+
{% endunless %}
|
15
|
+
|
16
|
+
<!-- return element -->
|
17
|
+
<span class="readtime" data-toggle="tooltip" data-placement="bottom" title="{{ words }} words">
|
18
|
+
{{- read_time -}}{{" "}}{{- site.data.label.read_time_unit | default: "min" -}}
|
19
|
+
</span>
|
@@ -0,0 +1,66 @@
|
|
1
|
+
<!--
|
2
|
+
Refactor the HTML structure.
|
3
|
+
-->
|
4
|
+
|
5
|
+
{% assign _content = include.content %}
|
6
|
+
|
7
|
+
<!--
|
8
|
+
In order to allow a wide table to scroll horizontally,
|
9
|
+
we suround the markdown table with `<div class="table-wrapper">` and `</div>`
|
10
|
+
-->
|
11
|
+
{% if _content contains '<table>' %}
|
12
|
+
{% assign _content = _content
|
13
|
+
| replace: '<table>', '<div class="table-wrapper"><table>'
|
14
|
+
| replace: '</table>', '</table></div>'
|
15
|
+
| replace: '</table></div></code>', '</table></code>'
|
16
|
+
%}
|
17
|
+
{% endif %}
|
18
|
+
|
19
|
+
<!--
|
20
|
+
Fixed kramdown code highlight rendering:
|
21
|
+
https://github.com/penibelst/jekyll-compress-html/issues/101
|
22
|
+
https://github.com/penibelst/jekyll-compress-html/issues/71#issuecomment-188144901
|
23
|
+
-->
|
24
|
+
{% if _content contains '<pre class="highlight">' %}
|
25
|
+
{% assign _content = _content
|
26
|
+
| replace: '<div class="highlight"><pre class="highlight"><code', '<div class="highlight"><code'
|
27
|
+
| replace: '</code></pre></div>', '</code></div>'
|
28
|
+
%}
|
29
|
+
{% endif %}
|
30
|
+
|
31
|
+
<!-- Add attribute 'hide-bullet' to the checkbox list -->
|
32
|
+
{% if _content contains '<li class="task-list-item"><' %}
|
33
|
+
{% assign _content = _content
|
34
|
+
| replace: '"task-list-item"><', '"task-list-item" hide-bullet><'
|
35
|
+
%}
|
36
|
+
{% endif %}
|
37
|
+
|
38
|
+
{% if _content contains '<img src="' %}
|
39
|
+
|
40
|
+
{% if site.img_cdn != '' %}
|
41
|
+
{% assign img_path_replacement = '<img src="' | append: site.img_cdn | append: '/' %}
|
42
|
+
{% else %}
|
43
|
+
{% assign img_path_replacement = '<img src="' | append: site.baseurl | append: '/' %}
|
44
|
+
{% endif %}
|
45
|
+
|
46
|
+
{% assign _content = _content | replace: '<img src="/', img_path_replacement %}
|
47
|
+
|
48
|
+
<!-- lazy-load images <https://github.com/ApoorvSaxena/lozad.js#usage> -->
|
49
|
+
{% assign lozad = true %}
|
50
|
+
{% assign img_placehodler
|
51
|
+
= 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7' %}
|
52
|
+
|
53
|
+
{% assign lozad_replacement = '<img src="'
|
54
|
+
| append: img_placehodler
|
55
|
+
| append: '" data-src="' %}
|
56
|
+
|
57
|
+
{% assign _content = _content | replace: '<img src="', lozad_replacement %}
|
58
|
+
|
59
|
+
{% endif %}
|
60
|
+
|
61
|
+
<!-- return -->
|
62
|
+
{{ _content }}
|
63
|
+
|
64
|
+
{% if lozad %}
|
65
|
+
{% include lozad.html %}
|
66
|
+
{% endif %}
|