jekyll-text-theme 1.5.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +41 -153
- data/_data/authors.yml +0 -0
- data/_data/licenses.yml +16 -0
- data/_data/locale.yml +4 -10
- data/_data/navigation.yml +13 -0
- data/_data/variables.yml +22 -6
- data/_includes/analytics-providers/custom.html +0 -0
- data/_includes/analytics-providers/google.html +16 -0
- data/_includes/analytics.html +7 -0
- data/_includes/article-footer/custom.html +1 -0
- data/_includes/article-footer/license.html +24 -0
- data/_includes/article-info.html +90 -0
- data/_includes/aside/toc.html +1 -0
- data/_includes/author-profile.html +50 -0
- data/_includes/comments-providers/custom.html +0 -0
- data/_includes/comments-providers/disqus.html +22 -0
- data/_includes/comments-providers/gitalk.html +32 -0
- data/_includes/comments.html +9 -0
- data/_includes/follow-me.html +84 -0
- data/_includes/footer.html +39 -0
- data/_includes/head.html +54 -0
- data/_includes/header.html +33 -0
- data/_includes/markdown-enhancements.html +32 -0
- data/_includes/{utils → markdown-enhancements}/chart.html +1 -3
- data/_includes/{utils → markdown-enhancements}/mathjax.html +11 -4
- data/_includes/{utils → markdown-enhancements}/mermaid.html +1 -3
- data/_includes/pageview-providers/custom.html +0 -0
- data/_includes/pageview-providers/custom/home.html +0 -0
- data/_includes/pageview-providers/custom/post.html +0 -0
- data/_includes/pageview-providers/leancloud/home.html +35 -0
- data/_includes/pageview-providers/leancloud/leancloud.js +71 -0
- data/_includes/pageview-providers/leancloud/post.html +31 -0
- data/_includes/pageview.html +31 -0
- data/_includes/scripts/archieve.js +238 -0
- data/_includes/scripts/article-list.html +27 -0
- data/_includes/scripts/article.js +24 -0
- data/_includes/scripts/aside/affix.js +26 -0
- data/_includes/scripts/aside/toc.js +37 -0
- data/_includes/scripts/common.js +3 -0
- data/_includes/scripts/home.js +3 -0
- data/_includes/scripts/lib/affix.js +103 -0
- data/_includes/scripts/{utils.html → lib/lazyload.js} +55 -92
- data/_includes/scripts/lib/scroll.js +13 -0
- data/_includes/scripts/lib/throttle.js +28 -0
- data/_includes/scripts/lib/toc.js +106 -0
- data/_includes/scripts/page.js +3 -0
- data/_includes/scripts/sidebar.js +14 -0
- data/_includes/scripts/utils.js +38 -0
- data/_includes/scripts/variables.html +27 -0
- data/_includes/sidebar/toc.html +27 -0
- data/_includes/snippets/assign.html +5 -0
- data/_includes/snippets/get-nav-url.html +3 -2
- data/_includes/snippets/page-title.html +11 -6
- data/_includes/snippets/page-url.html +3 -1
- data/_includes/snippets/to-boolean.html +7 -0
- data/_includes/{icon → svg/icon}/social/behance.svg +0 -0
- data/_includes/{icon → svg/icon}/social/douban.svg +0 -0
- data/_includes/{icon → svg/icon}/social/facebook.svg +0 -0
- data/_includes/{icon → svg/icon}/social/flicker.svg +0 -0
- data/_includes/{icon → svg/icon}/social/github.svg +0 -0
- data/_includes/{icon → svg/icon}/social/googleplus.svg +0 -0
- data/_includes/{icon → svg/icon}/social/linkedin.svg +0 -0
- data/_includes/{icon → svg/icon}/social/mail.svg +0 -0
- data/_includes/{icon → svg/icon}/social/pinterest.svg +0 -0
- data/_includes/{icon → svg/icon}/social/qq.svg +0 -0
- data/_includes/{icon → svg/icon}/social/twitter.svg +0 -0
- data/_includes/{icon → svg/icon}/social/weibo.svg +0 -0
- data/_includes/{icon → svg/icon}/social/weixin.svg +0 -0
- data/_includes/{icon → svg/icon}/social/zhihu.svg +0 -0
- data/_includes/{logo → svg}/logo.svg +1 -1
- data/_includes/tags.html +52 -0
- data/_layouts/404.html +12 -0
- data/_layouts/archive.html +25 -0
- data/_layouts/article.html +78 -0
- data/_layouts/base.html +13 -33
- data/_layouts/home.html +135 -121
- data/_layouts/landing.html +164 -0
- data/_layouts/page.html +157 -9
- data/_sass/additional/_alert.scss +25 -0
- data/_sass/additional/_photo-frame.scss +17 -0
- data/_sass/animate/_fade-in-down.scss +1 -1
- data/_sass/animate/_fade-in.scss +1 -1
- data/_sass/common/_classes.scss +5 -2
- data/_sass/common/_reset.scss +32 -22
- data/_sass/common/_variables.scss +87 -31
- data/_sass/common/classes/_animation.scss +9 -0
- data/_sass/common/classes/_clearfix.scss +8 -0
- data/_sass/common/classes/_grid.scss +48 -0
- data/_sass/common/classes/_horizontal-rules.scss +14 -0
- data/_sass/common/classes/_link.scss +18 -145
- data/_sass/common/classes/_media.scss +1 -2
- data/_sass/common/classes/_overflow.scss +8 -0
- data/_sass/common/classes/_pseudo.scss +26 -0
- data/_sass/common/classes/_shadow.scss +13 -5
- data/_sass/common/classes/_spacing.scss +52 -0
- data/_sass/common/components/_button.scss +179 -47
- data/_sass/common/components/_card.scss +18 -0
- data/_sass/common/components/_menu.scss +43 -0
- data/_sass/common/components/_toc.scss +125 -0
- data/_sass/components/_article.content.scss +37 -45
- data/_sass/components/_article.info.scss +25 -0
- data/_sass/components/_author-profile.scss +43 -0
- data/_sass/components/_follow-me.scss +16 -19
- data/_sass/components/_footer.scss +16 -6
- data/_sass/components/_header.scss +26 -18
- data/_sass/components/_license.scss +1 -25
- data/_sass/components/_main.scss +13 -11
- data/_sass/components/_tags.scss +17 -36
- data/_sass/layout/{_error-404.scss → _404.scss} +2 -2
- data/_sass/layout/_all.scss +72 -63
- data/_sass/layout/_article.scss +44 -0
- data/_sass/layout/_home.scss +61 -52
- data/_sass/layout/_landing.scss +104 -0
- data/_sass/layout/_page.scss +155 -0
- data/_sass/{colors → skins}/_chocolate.scss +17 -6
- data/_sass/skins/_dark.scss +56 -0
- data/_sass/{colors → skins}/_default.scss +16 -5
- data/_sass/{colors → skins}/_forest.scss +16 -5
- data/_sass/{colors → skins}/_ocean.scss +16 -5
- data/_sass/{colors → skins}/_orange.scss +20 -9
- data/assets/android-chrome-192x192.png +0 -0
- data/assets/android-chrome-512x512.png +0 -0
- data/assets/apple-touch-icon.png +0 -0
- data/assets/browserconfig.xml +9 -0
- data/assets/css/main.scss +46 -0
- data/assets/favicon-16x16.png +0 -0
- data/assets/favicon-32x32.png +0 -0
- data/assets/favicon.ico +0 -0
- data/assets/images/logo/logo.svg +1 -1
- data/assets/mstile-144x144.png +0 -0
- data/assets/mstile-150x150.png +0 -0
- data/assets/mstile-310x150.png +0 -0
- data/assets/mstile-310x310.png +0 -0
- data/assets/mstile-70x70.png +0 -0
- data/assets/safari-pinned-tab.svg +38 -0
- data/assets/site.webmanifest +19 -0
- metadata +108 -76
- data/_includes/common-head.html +0 -10
- data/_includes/components/article-data.html +0 -55
- data/_includes/components/follow-me.html +0 -78
- data/_includes/components/footer.html +0 -10
- data/_includes/components/header.html +0 -42
- data/_includes/components/license.html +0 -26
- data/_includes/components/tags.html +0 -52
- data/_includes/head-icons-rel.html +0 -38
- data/_includes/icon/clear.svg +0 -3
- data/_includes/icon/link.svg +0 -1
- data/_includes/icon/menu.svg +0 -3
- data/_includes/icon/next.svg +0 -3
- data/_includes/icon/omit.svg +0 -1
- data/_includes/icon/previous.svg +0 -3
- data/_includes/icon/search.svg +0 -3
- data/_includes/scripts/all.html +0 -244
- data/_includes/scripts/common.html +0 -30
- data/_includes/scripts/data.html +0 -27
- data/_includes/scripts/home.html +0 -26
- data/_includes/scripts/page-post.html +0 -32
- data/_includes/scripts/post.html +0 -183
- data/_includes/utils/comment-disqus.html +0 -19
- data/_includes/utils/comment-gitalk.html +0 -25
- data/_includes/utils/google-analytics.html +0 -11
- data/_layouts/all.html +0 -20
- data/_layouts/error-404.html +0 -9
- data/_layouts/post.html +0 -60
- data/_sass/colors/_dark.scss +0 -45
- data/_sass/common/classes/_shape.scss +0 -19
- data/_sass/common/classes/_space.scss +0 -40
- data/_sass/components/_article.content.extra.scss +0 -41
- data/_sass/components/_article.data.scss +0 -36
- data/_sass/components/_pagination.scss +0 -19
- data/_sass/components/_toc.scss +0 -72
- data/_sass/layout/_default.scss +0 -19
- data/_sass/layout/_post.scss +0 -80
- data/assets/css/blog.scss +0 -41
- data/assets/images/logo/icon-120x120.png +0 -0
- data/assets/images/logo/icon-128x128.png +0 -0
- data/assets/images/logo/icon-150x150.png +0 -0
- data/assets/images/logo/icon-152x152.png +0 -0
- data/assets/images/logo/icon-167x167.png +0 -0
- data/assets/images/logo/icon-16x16.png +0 -0
- data/assets/images/logo/icon-180x180.png +0 -0
- data/assets/images/logo/icon-192x192.png +0 -0
- data/assets/images/logo/icon-310x150.png +0 -0
- data/assets/images/logo/icon-310x310.png +0 -0
- data/assets/images/logo/icon-48x48.png +0 -0
- data/assets/images/logo/icon-70x70.png +0 -0
@@ -0,0 +1,14 @@
|
|
1
|
+
(function() {
|
2
|
+
var SOURCES = window.TEXT_VARIABLES.sources;
|
3
|
+
window.Lazyload.js(SOURCES.jquery, function() {
|
4
|
+
var $pageRoot = $('.js-page-root');
|
5
|
+
var $sidebarShow = $('.js-sidebar-show');
|
6
|
+
var $sidebarHide = $('.js-sidebar-hide');
|
7
|
+
$sidebarShow.on('click', function() {
|
8
|
+
$pageRoot.addClass('show-sidebar');
|
9
|
+
});
|
10
|
+
$sidebarHide.on('click', function() {
|
11
|
+
$pageRoot.removeClass('show-sidebar');
|
12
|
+
});
|
13
|
+
});
|
14
|
+
})();
|
@@ -0,0 +1,38 @@
|
|
1
|
+
(function() {
|
2
|
+
window.isArray = function(val) {
|
3
|
+
return Object.prototype.toString.call(val) === '[object Array]';
|
4
|
+
};
|
5
|
+
window.isString = function(val) {
|
6
|
+
return typeof val === 'string';
|
7
|
+
};
|
8
|
+
|
9
|
+
window.decodeUrl = function(str) {
|
10
|
+
return str ? decodeURIComponent(str.replace(/\+/g, '%20')) : '';
|
11
|
+
};
|
12
|
+
|
13
|
+
|
14
|
+
window.hasEvent = function(event) {
|
15
|
+
return 'on'.concat(event) in window.document;
|
16
|
+
};
|
17
|
+
|
18
|
+
window.isOverallScroller = function(node) {
|
19
|
+
return node === document.documentElement || node === document.body;
|
20
|
+
};
|
21
|
+
|
22
|
+
window.pageLoad = (function () {
|
23
|
+
var loaded = false, cbs = [];
|
24
|
+
window.addEventListener('load', function () {
|
25
|
+
var i, cb; loaded = true;
|
26
|
+
if (cbs.length > 0) {
|
27
|
+
for (i = 0; i < cbs.length; i++) {
|
28
|
+
cb = cbs[i]; cb();
|
29
|
+
}
|
30
|
+
}
|
31
|
+
});
|
32
|
+
return {
|
33
|
+
then: function(cb) {
|
34
|
+
cb && (loaded ? cb() : (cbs.push(cb)));
|
35
|
+
}
|
36
|
+
};
|
37
|
+
})();
|
38
|
+
})();
|
@@ -0,0 +1,27 @@
|
|
1
|
+
{%- include snippets/get-sources.html -%}
|
2
|
+
{%- assign _sources = __return -%}
|
3
|
+
|
4
|
+
<script>
|
5
|
+
(function() {
|
6
|
+
var TEXT_VARIABLES = {
|
7
|
+
sources: {
|
8
|
+
font_awesome: '{{ _sources.font_awesome }}',
|
9
|
+
jquery: '{{ _sources.jquery }}',
|
10
|
+
leancloud_js_sdk: '{{ _sources.leancloud_js_sdk }}',
|
11
|
+
chart: '{{ _sources.chart }}',
|
12
|
+
gitalk: {
|
13
|
+
js: '{{ _sources.gitalk.js }}',
|
14
|
+
css: '{{ _sources.gitalk.css }}'
|
15
|
+
},
|
16
|
+
mathjax: '{{ _sources.mathjax }}',
|
17
|
+
mermaid: '{{ _sources.mermaid }}'
|
18
|
+
},
|
19
|
+
site: {
|
20
|
+
toc: {
|
21
|
+
selectors: '{{ site.toc.selectors | default: site.data.variables.default.toc.selectors }}'
|
22
|
+
}
|
23
|
+
}
|
24
|
+
};
|
25
|
+
window.TEXT_VARIABLES = TEXT_VARIABLES;
|
26
|
+
})();
|
27
|
+
</script>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
{%- if page.sidebar.nav -%}
|
2
|
+
<div class="sidebar-toc">
|
3
|
+
{%- assign _sidebar_nav = site.data.navigation[page.sidebar.nav] -%}
|
4
|
+
{%- if _sidebar_nav -%}
|
5
|
+
<ul class="toc toc--navigator">
|
6
|
+
{%- for _item in _sidebar_nav -%}
|
7
|
+
<li class="toc-h1">{{ _item.title }}</li>
|
8
|
+
{%- if _item.children -%}
|
9
|
+
{%- for _child in _item.children -%}
|
10
|
+
{%- assign __path = _child.url -%}
|
11
|
+
{%- include snippets/get-nav-url.html -%}
|
12
|
+
{%- assign _nav_url = __return -%}
|
13
|
+
{%- assign __path = page.url -%}
|
14
|
+
{%- include snippets/get-nav-url.html -%}
|
15
|
+
{%- assign _page_url = __return -%}
|
16
|
+
{%- if _nav_url == _page_url -%}
|
17
|
+
<li class="toc-h2 active"><a href="{{ _nav_url }}">{{ _child.title }}</a></li>
|
18
|
+
{%- else -%}
|
19
|
+
<li class="toc-h2"><a href="{{ _nav_url }}">{{ _child.title }}</a></li>
|
20
|
+
{%- endif -%}
|
21
|
+
{%- endfor -%}
|
22
|
+
{%- endif -%}
|
23
|
+
{%- endfor -%}
|
24
|
+
</ul>
|
25
|
+
{%- endif -%}
|
26
|
+
</div>
|
27
|
+
{%- endif -%}
|
@@ -1,5 +1,6 @@
|
|
1
|
-
{%- assign
|
2
|
-
{%-
|
1
|
+
{%- assign _pre7 = __path | slice: 0, 7 -%}
|
2
|
+
{%- assign _pre8 = __path | slice: 0, 8 -%}
|
3
|
+
{%- if _pre7 == 'http://' or _pre8 == 'https://' -%}
|
3
4
|
{%- assign __return = __path -%}
|
4
5
|
{%- else -%}
|
5
6
|
{%- include snippets/prepend-baseurl.html -%}
|
@@ -1,8 +1,13 @@
|
|
1
|
-
{%- assign
|
2
|
-
{%-
|
3
|
-
|
4
|
-
{%- if
|
5
|
-
{%- assign __return =
|
6
|
-
{%-
|
1
|
+
{%- assign _title = page.title | default: layout.title -%}
|
2
|
+
{%- assign _titles = page.titles | default: layout.titles -%}
|
3
|
+
|
4
|
+
{%- if _title -%}
|
5
|
+
{%- assign __return = _title -%}
|
6
|
+
{%- elsif _titles -%}
|
7
|
+
{%- assign __locale = _titles -%}
|
8
|
+
{%- include snippets/locale-to-string.html -%}
|
9
|
+
{%- assign __localeTitle = __return -%}
|
7
10
|
{%- assign __return = __localeTitle -%}
|
11
|
+
{%- else -%}
|
12
|
+
{%- assign __return = nil -%}
|
8
13
|
{%- endif -%}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
2
2
|
width="24px" height="24px" viewBox="0 0 24 24">
|
3
3
|
<style type="text/css">
|
4
|
-
.st0{fill:#
|
4
|
+
.st0{fill:#515151;}
|
5
5
|
</style>
|
6
6
|
<path class="st0" d="M1.7,22.3c5.7-5.7,11.3-5.7,17,0c3.3-3.3,3.5-5.3,0.8-6c2.7,0.7,3.5-1.1,2.3-5.6s-3.3-5.2-6.3-2.1
|
7
7
|
c3-3,2.3-5.2-2.1-6.3S7,1.8,7.7,4.6C7,1.8,5,2.1,1.7,5.3C7.3,11,7.3,16.7,1.7,22.3"/>
|
data/_includes/tags.html
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
{%- assign _tag_max_size = 1 -%}
|
2
|
+
{%- assign _tag_min_size = 1 -%}
|
3
|
+
{%- assign _tag_cur_size = 1 -%}
|
4
|
+
{%- assign _tags = site.tags | sort -%}
|
5
|
+
{%- for _tag in _tags -%}
|
6
|
+
{%- assign _tag_cur_size = _tag[1].size -%}
|
7
|
+
{%- if _tag_cur_size > _tag_max_size -%}
|
8
|
+
{%- assign _tag_max_size = _tag_cur_size -%}
|
9
|
+
{%- endif -%}
|
10
|
+
{%- if _tag_cur_size < _tag_min_size -%}
|
11
|
+
{%- assign _tag_min_size = _tag_cur_size -%}
|
12
|
+
{%- endif -%}
|
13
|
+
{%- endfor -%}
|
14
|
+
{%- assign _tag_gap_size = _tag_max_size | minus: _tag_min_size | plus: 1 | divided_by: 4 -%}
|
15
|
+
{%- if _tag_gap_size < 1 -%}
|
16
|
+
{%- assign _tag_gap_size = 1 -%}
|
17
|
+
{%- endif -%}
|
18
|
+
<div class="site-tags js-tags">
|
19
|
+
<ul class="menu">
|
20
|
+
<li>
|
21
|
+
<button type="button" class="button button--secondary button--pill tag-button js-article-tag " data-encode="">
|
22
|
+
Show All<div class="tag-button__count">{{ site.posts | size }}</div>
|
23
|
+
</button>
|
24
|
+
</li>
|
25
|
+
{%- for _tag in _tags -%}
|
26
|
+
{%- assign _tag_cur_size = _tag[1].size -%}
|
27
|
+
{%- assign _tag_min_1 = _tag_min_size -%}
|
28
|
+
{%- assign _tag_max_1 = _tag_min_1 | plus: _tag_gap_size -%}
|
29
|
+
{%- assign _tag_min_2 = _tag_max_1 -%}
|
30
|
+
{%- assign _tag_max_2 = _tag_min_2 | plus: _tag_gap_size -%}
|
31
|
+
{%- assign _tag_min_3 = _tag_max_2 -%}
|
32
|
+
{%- assign _tag_max_3 = _tag_min_3 | plus: _tag_gap_size -%}
|
33
|
+
{%- assign _tag_min_4 = _tag_max_3 -%}
|
34
|
+
{%- assign _tag_max_4 = _tag_min_4 | plus: _tag_gap_size -%}
|
35
|
+
{%- if _tag_cur_size >= _tag_min_1 and _tag_cur_size < _tag_max_1 -%}
|
36
|
+
{%- assign _c_index = 1 -%}
|
37
|
+
{%- elsif _tag_cur_size >= _tag_min_2 and _tag_cur_size < _tag_max_2 -%}
|
38
|
+
{%- assign _c_index = 2 -%}
|
39
|
+
{%- elsif _tag_cur_size >= _tag_min_3 and _tag_cur_size < _tag_max_3 -%}
|
40
|
+
{%- assign _c_index = 3 -%}
|
41
|
+
{%- elsif _tag_cur_size >= _tag_min_4 and _tag_cur_size < _tag_max_4 -%}
|
42
|
+
{%- assign _c_index = 4 -%}
|
43
|
+
{%- else -%}
|
44
|
+
{%- assign _c_index = 4 -%}
|
45
|
+
{%- endif -%}
|
46
|
+
<li><button type="button" class="button button--pill tag-button tag-button-{{ _c_index }} js-article-tag" data-encode="{{ _tag[0] | strip | url_encode }}">
|
47
|
+
<span>{{ _tag[0] | strip }}</span><div class="tag-button__count">{{ _tag[1].size }}</div>
|
48
|
+
</button>
|
49
|
+
</li>
|
50
|
+
{%- endfor -%}
|
51
|
+
</ul>
|
52
|
+
</div>
|
data/_layouts/404.html
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
---
|
2
|
+
layout: page
|
3
|
+
titles:
|
4
|
+
en: Archive
|
5
|
+
zh: 归档
|
6
|
+
zh-Hans: 归档
|
7
|
+
zh-Hant: 歸檔
|
8
|
+
show_title: false
|
9
|
+
---
|
10
|
+
|
11
|
+
<div class="layout--all js-all">
|
12
|
+
<div class="search-box js-search-box">
|
13
|
+
<div class="icon-search"><i class="fas fa-search"></i></div>
|
14
|
+
<input type="text" />
|
15
|
+
<div class="button icon-clear"><i class="fas fa-times"></i></div>
|
16
|
+
</div>
|
17
|
+
{%- include tags.html -%}
|
18
|
+
<div class="js-result layout--all__result"></div>
|
19
|
+
</div>
|
20
|
+
|
21
|
+
<script>
|
22
|
+
{%- include scripts/archieve.js -%}
|
23
|
+
</script>
|
24
|
+
|
25
|
+
{{ content }}
|
@@ -0,0 +1,78 @@
|
|
1
|
+
---
|
2
|
+
layout: page
|
3
|
+
type: article
|
4
|
+
---
|
5
|
+
|
6
|
+
{%- assign __target = layout.show_author_profile -%}
|
7
|
+
{%- assign __source = page.show_author_profile -%}
|
8
|
+
{%- include snippets/assign.html -%}
|
9
|
+
{%- assign __target = site.data.variables.default.page.show_author_profile -%}
|
10
|
+
{%- assign __source = __return -%}
|
11
|
+
{%- include snippets/assign.html -%}
|
12
|
+
{%- assign _show_author_profile = __return -%}
|
13
|
+
|
14
|
+
<div class="layout--article">
|
15
|
+
|
16
|
+
{%- if _show_author_profile -%}
|
17
|
+
{%- if page.author -%}
|
18
|
+
{%- assign __author = site.data.authors[page.author] -%}
|
19
|
+
{%- else -%}
|
20
|
+
{%- assign __author = site.author -%}
|
21
|
+
{%- endif -%}
|
22
|
+
{%- include author-profile.html -%}
|
23
|
+
{%- endif -%}
|
24
|
+
|
25
|
+
<div class="article__content" itemprop="articleBody">{{ content }}</div>
|
26
|
+
|
27
|
+
<footer class="article__footer">
|
28
|
+
{%- if page.modify_date -%}
|
29
|
+
{%- assign __locale = site.data.locale.ARTICLE_DATE_FORMAT -%}
|
30
|
+
{%- include snippets/locale-to-string.html -%}
|
31
|
+
{%- assign _locale_date_format = __return -%}
|
32
|
+
|
33
|
+
{%- assign __locale = site.data.locale.LAST_UPDATED -%}
|
34
|
+
{%- include snippets/locale-to-string.html -%}
|
35
|
+
{%- assign _locale_last_update = __return -%}
|
36
|
+
<span>{{ _locale_last_update }}
|
37
|
+
<time itemprop="dateModified" datetime="{{ page.modify_date | date_to_xmlschema }}">{{ page.modify_date | date: _locale_date_format }}</time>
|
38
|
+
</span>
|
39
|
+
{%- elsif page.date -%}
|
40
|
+
<meta itemprop="dateModified" content="{{ page.date | date_to_xmlschema }}">
|
41
|
+
{%- endif -%}
|
42
|
+
{%- include article-footer/custom.html -%}
|
43
|
+
{%- if page.license -%}
|
44
|
+
<div class="article__license">{%- include article-footer/license.html -%}</div>
|
45
|
+
{%- endif -%}
|
46
|
+
</footer>
|
47
|
+
|
48
|
+
{%- if page.next or page.previous -%}
|
49
|
+
<div class="article__previous-next clearfix">
|
50
|
+
{%- if page.next -%}
|
51
|
+
|
52
|
+
{%- assign __path = page.next.url -%}
|
53
|
+
{%- include snippets/prepend-baseurl.html -%}
|
54
|
+
{%- assign _href = __return -%}
|
55
|
+
|
56
|
+
{%- assign __locale = site.data.locale.PREVIOUS -%}
|
57
|
+
{%- include snippets/locale-to-string.html -%}
|
58
|
+
{%- assign _locale_previous = __return -%}
|
59
|
+
|
60
|
+
<div class="previous"><span>{{ _locale_previous }}</span><a href="{{ _href }}">{{ page.next.title }}</a></div>
|
61
|
+
{%- endif -%}
|
62
|
+
{%- if page.previous -%}
|
63
|
+
{%- assign __path = page.previous.url -%}
|
64
|
+
{%- include snippets/prepend-baseurl.html -%}
|
65
|
+
{%- assign _href = __return -%}
|
66
|
+
{%- assign __locale = site.data.locale.NEXT -%}
|
67
|
+
{%- include snippets/locale-to-string.html -%}
|
68
|
+
{%- assign _locale_next = __return -%}
|
69
|
+
<div class="next"><span>{{ _locale_next }}</span><a href="{{ _href }}">{{ page.previous.title }}</a></div>
|
70
|
+
{%- endif -%}
|
71
|
+
</div>
|
72
|
+
{%- endif -%}
|
73
|
+
|
74
|
+
</div>
|
75
|
+
|
76
|
+
<script>
|
77
|
+
{%- include scripts/article.js -%}
|
78
|
+
</script>
|
data/_layouts/base.html
CHANGED
@@ -1,38 +1,18 @@
|
|
1
|
+
---
|
2
|
+
layout: none
|
3
|
+
---
|
1
4
|
<!DOCTYPE html>
|
2
5
|
{%- include snippets/get-lang.html -%}
|
3
6
|
<html lang="{{ __return }}">
|
4
7
|
<head>
|
5
|
-
{%- include
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
{%- include head.html -%}
|
9
|
+
<script>
|
10
|
+
{%- include scripts/utils.js -%}
|
11
|
+
{%- include scripts/lib/throttle.js -%}
|
12
|
+
{%- include scripts/lib/lazyload.js -%}
|
13
|
+
{%- include scripts/common.js -%}
|
14
|
+
</script>
|
15
|
+
{%- include scripts/variables.html -%}
|
11
16
|
</head>
|
12
|
-
<body>
|
13
|
-
|
14
|
-
<div class="m-page-content">
|
15
|
-
{%- include components/header.html -%}
|
16
|
-
<div class="m-page-main">{{ content }}</div>
|
17
|
-
</div>
|
18
|
-
</div>
|
19
|
-
{%- include components/footer.html -%}
|
20
|
-
{%- include scripts/common.html -%}
|
21
|
-
{%- if page.layout == "home" -%}
|
22
|
-
{%- include scripts/home.html -%}
|
23
|
-
{%- elsif page.layout == "page" -%}
|
24
|
-
{%- include scripts/page-post.html -%}
|
25
|
-
{%- elsif page.layout == "post" -%}
|
26
|
-
{%- include scripts/page-post.html -%}
|
27
|
-
{%- include scripts/post.html -%}
|
28
|
-
{%- elsif page.layout == "all" -%}
|
29
|
-
{%- include scripts/all.html -%}
|
30
|
-
{%- endif -%}
|
31
|
-
{%- include utils/mathjax.html -%}
|
32
|
-
{%- include utils/mermaid.html -%}
|
33
|
-
{%- include utils/chart.html -%}
|
34
|
-
{%- if jekyll.environment != "development" -%}
|
35
|
-
{%- include utils/google-analytics.html -%}
|
36
|
-
{%- endif -%}
|
37
|
-
</body>
|
38
|
-
</html>
|
17
|
+
<body>{{ content }}</body>
|
18
|
+
</html>
|
data/_layouts/home.html
CHANGED
@@ -1,135 +1,149 @@
|
|
1
1
|
---
|
2
|
-
layout:
|
2
|
+
layout: page
|
3
3
|
titles:
|
4
|
-
en:
|
5
|
-
zh:
|
6
|
-
zh-Hans:
|
7
|
-
zh-Hant:
|
4
|
+
en: Home
|
5
|
+
zh: 主页
|
6
|
+
zh-Hans: 主頁
|
7
|
+
zh-Hant: 主頁
|
8
|
+
show_title: false
|
8
9
|
---
|
9
|
-
<div class="
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
{%- assign
|
10
|
+
<div class="layout--home">
|
11
|
+
|
12
|
+
<div class="post-list">
|
13
|
+
{%- for post in paginator.posts -%}
|
14
|
+
<article itemscope itemtype="http://schema.org/BlogPosting">
|
15
|
+
|
16
|
+
{%- assign __path = post.url -%}
|
17
|
+
{%- include snippets/prepend-baseurl.html -%}
|
18
|
+
{%- assign _href = __return -%}
|
19
|
+
|
20
|
+
{%- assign __locale = site.data.locale.READMORE -%}
|
21
|
+
{%- include snippets/locale-to-string.html -%}
|
22
|
+
{%- assign _locale_readmore = __return -%}
|
23
|
+
|
24
|
+
<header class="article__header"><h2 itemprop="headline"><a href="{{ _href }}">{{ post.title }}</a></h2></header>
|
25
|
+
<div class="article__content" itemprop="description articleBody">
|
26
|
+
{%- assign _excerpt_type = site.excerpt_type | default: site.data.variables.default.excerpt_type -%}
|
27
|
+
{%- if _excerpt_type == 'html' -%}
|
28
|
+
{{ post.excerpt }}
|
29
|
+
{%- else -%}
|
30
|
+
{{ post.excerpt | strip_html | truncate: 350 }}
|
31
|
+
{%- endif -%}
|
32
|
+
</div>
|
33
|
+
|
34
|
+
<a href="{{ _href }}">{{ _locale_readmore }}</a>
|
35
|
+
{%- include article-info.html -%}
|
36
|
+
</article>
|
37
|
+
{%- endfor -%}
|
38
|
+
</div>
|
39
|
+
|
40
|
+
|
41
|
+
{%- if paginator.total_pages > 1 -%}
|
42
|
+
<nav class="pagination">
|
43
|
+
|
44
|
+
{%- assign __locale = site.data.locale.STATISTICS -%}
|
45
|
+
{%- include snippets/locale-to-string.html -%}
|
46
|
+
{%- assign _locale_statistics = __return -%}
|
47
|
+
|
48
|
+
{%- assign _post_count = site.posts | size -%}
|
49
|
+
{%- assign _page_count = paginator.total_pages -%}
|
50
|
+
<p>{{ _locale_statistics | replace: '[POST_COUNT]', _post_count | replace: '[PAGE_COUNT]', _page_count }}</p>
|
51
|
+
|
52
|
+
<ul class="menu menu--nowrap">
|
53
|
+
{%- assign _max_show = 5 -%}
|
54
|
+
{%- assign _max_show_modulo_two = _max_show | modulo: 2 -%}
|
55
|
+
{%- assign _length = paginator.total_pages -%}
|
56
|
+
{%- assign _length_mimus_one = _length | minus: 1 -%}
|
57
|
+
{%- assign _cur = paginator.page -%}
|
58
|
+
{%- assign _extra = _max_show | minus: 3 -%}
|
59
|
+
{%- assign _extra_half = _extra | divided_by: 2 -%}
|
60
|
+
|
61
|
+
{%- if _max_show > 4 and _max_show_modulo_two == 1 and paginator.total_pages > _max_show -%}
|
62
|
+
{%- assign _condition0 = _extra | divided_by: 2 | plus: 1 -%}
|
63
|
+
{%- assign _condition1 = _length | minus: _extra_half -%}
|
64
|
+
{%- if _cur <= _condition0 -%}
|
65
|
+
{%- assign _n0 = 2 -%}
|
66
|
+
{%- assign _n1 = _extra | plus: 2 -%}
|
67
|
+
{%- elsif _cur >= _condition1 -%}
|
68
|
+
{%- assign _n0 = _length | minus: _extra | minus: 1 -%}
|
69
|
+
{%- assign _n1 = _length | minus: 1 -%}
|
70
|
+
{%- else -%}
|
71
|
+
{%- assign _n0 = _cur | minus: _extra_half -%}
|
72
|
+
{%- assign _n1 = _cur | plus: _extra_half -%}
|
73
|
+
{%- endif -%}
|
74
|
+
{%- endif -%}
|
75
|
+
|
76
|
+
{%- if paginator.previous_page -%}
|
77
|
+
{%- assign __path = paginator.previous_page_path -%}
|
26
78
|
{%- include snippets/prepend-baseurl.html -%}
|
27
|
-
{%- assign
|
28
|
-
{
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
{%- assign __locale = site.data.locale.STATISTICS -%}
|
37
|
-
{%- include snippets/locale-to-string.html -%}
|
38
|
-
{%- assign post_count = site.posts | size -%}
|
39
|
-
{%- assign page_count = paginator.total_pages -%}
|
40
|
-
<p>{{ __return | replace: '[POST_COUNT]', post_count | replace: '[PAGE_COUNT]', page_count }}</p>
|
41
|
-
<ul>
|
42
|
-
{%- assign _max_show = 5 -%}
|
43
|
-
{%- assign _max_show_modulo_two = _max_show | modulo: 2 -%}
|
44
|
-
{%- assign _length = paginator.total_pages -%}
|
45
|
-
{%- assign _length_mimus_one = _length | minus: 1 -%}
|
46
|
-
{%- assign _cur = paginator.page -%}
|
47
|
-
{%- assign _extra = _max_show | minus: 3 -%}
|
48
|
-
{%- assign _extra_half = _extra | divided_by: 2 -%}
|
49
|
-
{%- if _max_show > 4 and _max_show_modulo_two == 1 and paginator.total_pages > _max_show -%}
|
50
|
-
{%- assign _condition0 = _extra | divided_by: 2 | plus: 1 -%}
|
51
|
-
{%- assign _condition1 = _length | minus: _extra_half -%}
|
52
|
-
{%- if _cur <= _condition0 -%}
|
53
|
-
{%- assign _n0 = 2 -%}
|
54
|
-
{%- assign _n1 = _extra | plus: 2 -%}
|
55
|
-
{%- elsif _cur >= _condition1 -%}
|
56
|
-
{%- assign _n0 = _length | minus: _extra | minus: 1 -%}
|
57
|
-
{%- assign _n1 = _length | minus: 1 -%}
|
58
|
-
{%- else -%}
|
59
|
-
{%- assign _n0 = _cur | minus: _extra_half -%}
|
60
|
-
{%- assign _n1 = _cur | plus: _extra_half -%}
|
61
|
-
{%- endif -%}
|
62
|
-
{%- endif -%}
|
63
|
-
{%- if paginator.previous_page -%}
|
64
|
-
{%- assign __path = paginator.previous_page_path -%}
|
65
|
-
{%- include snippets/prepend-baseurl.html -%}
|
66
|
-
{%- assign href = __return -%}
|
67
|
-
<li><a class="round-button" href="{{ href }}">
|
68
|
-
<div class="icon icon--previous">{%- include icon/previous.svg -%}</div></a>
|
69
|
-
</li>
|
70
|
-
{%- else -%}
|
71
|
-
<li><div class="round-button inactive">
|
72
|
-
<div class="icon icon--prrevious">{%- include icon/previous.svg -%}</div></div>
|
73
|
-
</li>
|
74
|
-
{%- endif -%}
|
79
|
+
{%- assign _href = __return -%}
|
80
|
+
<li><a class="button button--secondary button--circle" href="{{ _href }}">
|
81
|
+
<i class="fas fa-angle-left"></i>
|
82
|
+
</a></li>
|
83
|
+
{%- else -%}
|
84
|
+
<li><div class="button button--secondary button--circle disabled">
|
85
|
+
<i class="fas fa-angle-left"></i>
|
86
|
+
</div></li>
|
87
|
+
{%- endif -%}
|
75
88
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
89
|
+
{%- for page in (1.._length) -%}
|
90
|
+
{%- if page == _cur -%}
|
91
|
+
<li>
|
92
|
+
<div class="button button--primary button--circle"><span>{{ page }}</span></div>
|
93
|
+
</li>
|
94
|
+
|
95
|
+
{%- elsif page == 1 -%}
|
96
|
+
{%- assign __path = site.paths.home | default: site.data.variables.default.paths.home -%}
|
97
|
+
{%- include snippets/prepend-baseurl.html -%}
|
98
|
+
{%- assign _href = __return -%}
|
99
|
+
<li>
|
100
|
+
<a class="button button--secondary button--circle" href="{{ _href }}"><span>{{ page }}</span></a>
|
101
|
+
</li>
|
102
|
+
|
103
|
+
{%- else -%}
|
104
|
+
{%- if _n0 and _n1 -%}
|
105
|
+
{%- if page > 1 and page < _n0 -%}
|
106
|
+
{%- if page == 2 -%}<li><span class="pagination__omit"><i class="fas fa-ellipsis-h"></i></span></li>{%- endif -%}
|
107
|
+
{%- elsif page > _n1 and page < _length -%}
|
108
|
+
{%- if page == _length_mimus_one -%}<li><span class="omit"><i class="fas fa-ellipsis-h"></i></span></li>{%- endif -%}
|
109
|
+
{%- else -%}
|
110
|
+
{%- assign __path = site.paginate_path -%}
|
87
111
|
{%- include snippets/prepend-baseurl.html -%}
|
88
|
-
{%- assign
|
112
|
+
{%- assign _href = __return -%}
|
89
113
|
<li>
|
90
|
-
<a class="
|
114
|
+
<a class="button button--secondary button--circle" href="{{ _href | replace: ':num', page }}"><span>{{ page }}</span></a>
|
91
115
|
</li>
|
92
|
-
{%- else -%}
|
93
|
-
{%- if _n0 and _n1 -%}
|
94
|
-
{%- if page > 1 and page < _n0 -%}
|
95
|
-
{%- if page == 2 -%}<li><span class="omit">{%- include icon/omit.svg -%}</span></li>{%- endif -%}
|
96
|
-
{%- elsif page > _n1 and page < _length -%}
|
97
|
-
{%- if page == _length_mimus_one -%}<li><span class="omit">{%- include icon/omit.svg -%}</span></li>{%- endif -%}
|
98
|
-
{%- else -%}
|
99
|
-
{%- assign __path = site.paginate_path -%}
|
100
|
-
{%- include snippets/prepend-baseurl.html -%}
|
101
|
-
{%- assign href = __return -%}
|
102
|
-
<li>
|
103
|
-
<a class="round-button" href="{{ href | replace: ':num', page }}"><span>{{ page }}</span></a>
|
104
|
-
</li>
|
105
|
-
{%- endif -%}
|
106
|
-
{%- else -%}
|
107
|
-
{%- assign __path = site.paginate_path -%}
|
108
|
-
{%- include snippets/prepend-baseurl.html -%}
|
109
|
-
{%- assign href = __return -%}
|
110
|
-
<li>
|
111
|
-
<a class="round-button" href="{{ href | replace: ':num', page }}"><span>{{ page }}</span></a>
|
112
|
-
</li>
|
113
|
-
{%- endif -%}
|
114
116
|
{%- endif -%}
|
115
|
-
{%-
|
116
|
-
|
117
|
-
{%- assign __path = paginator.next_page_path -%}
|
117
|
+
{%- else -%}
|
118
|
+
{%- assign __path = site.paginate_path -%}
|
118
119
|
{%- include snippets/prepend-baseurl.html -%}
|
119
|
-
{%- assign
|
120
|
+
{%- assign _href = __return -%}
|
120
121
|
<li>
|
121
|
-
<a class="
|
122
|
-
<div class="icon icon--next">{%- include icon/next.svg -%}</div>
|
123
|
-
</a>
|
122
|
+
<a class="button button--secondary button--circle" href="{{ _href | replace: ':num', page }}"><span>{{ page }}</span></a>
|
124
123
|
</li>
|
125
|
-
{%- else -%}
|
126
|
-
<li><div class="round-button inactive">
|
127
|
-
<div class="icon icon--next">{%- include icon/next.svg -%}</div>
|
128
|
-
</div>
|
129
|
-
</li>
|
130
124
|
{%- endif -%}
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
125
|
+
{%- endif -%}
|
126
|
+
{%- endfor -%}
|
127
|
+
|
128
|
+
{%- if paginator.next_page -%}
|
129
|
+
{%- assign __path = paginator.next_page_path -%}
|
130
|
+
{%- include snippets/prepend-baseurl.html -%}
|
131
|
+
{%- assign _href = __return -%}
|
132
|
+
<li><a class="button button--secondary button--circle" href="{{ _href }}">
|
133
|
+
<i class="fas fa-angle-right"></i>
|
134
|
+
</a></li>
|
135
|
+
{%- else -%}
|
136
|
+
<li><div class="button button--secondary button--circle disabled">
|
137
|
+
<i class="fas fa-angle-right"></i>
|
138
|
+
</div></li>
|
139
|
+
{%- endif -%}
|
140
|
+
</ul>
|
141
|
+
</nav>
|
142
|
+
{%- endif -%}
|
135
143
|
</div>
|
144
|
+
|
145
|
+
<script>
|
146
|
+
{%- include scripts/home.js -%}
|
147
|
+
</script>
|
148
|
+
|
149
|
+
{{ content }}
|