jekyll-text-theme 1.5.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -1,30 +0,0 @@
|
|
1
|
-
<script>
|
2
|
-
(function () {
|
3
|
-
var root = document.body
|
4
|
-
function classnames(classes) {
|
5
|
-
var i, cur, _classes = '';
|
6
|
-
if (window.isString(classes)) {
|
7
|
-
_classes = classes;
|
8
|
-
} else if (window.isArray(classes)) {
|
9
|
-
for (i = 0; i < classes.length; i++) {
|
10
|
-
cur = classes[i];
|
11
|
-
if (window.isString(cur)) {
|
12
|
-
_classes = _classes.concat(_classes ? ' ' + cur : cur);
|
13
|
-
}
|
14
|
-
}
|
15
|
-
} else {
|
16
|
-
return '';
|
17
|
-
}
|
18
|
-
return _classes;
|
19
|
-
}
|
20
|
-
function addClass(dom, classname) {
|
21
|
-
dom.setAttribute('class', classnames([dom.getAttribute('class'), classname]));
|
22
|
-
}
|
23
|
-
if (window.hasEvent('touchstart')) {
|
24
|
-
addClass(root, 'is-touch');
|
25
|
-
document.addEventListener("touchstart", function(){}, false);
|
26
|
-
} else {
|
27
|
-
addClass(root, 'not-touch');
|
28
|
-
}
|
29
|
-
})();
|
30
|
-
</script>
|
data/_includes/scripts/data.html
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
{%- assign __locale = site.data.locale.ARTICLE_LIST_DATE_FORMAT -%}
|
2
|
-
{%- include snippets/locale-to-string.html -%}
|
3
|
-
{%- assign _format = __return -%}
|
4
|
-
{%- assign post_count = site.posts | size -%}
|
5
|
-
{%- if post_count < 1 -%}
|
6
|
-
{}
|
7
|
-
{%- else -%}
|
8
|
-
{
|
9
|
-
{%- for post in site.posts -%}
|
10
|
-
{%- assign currentdate = post.date | date: '%Y' -%}
|
11
|
-
{%- if currentdate != date -%}
|
12
|
-
{%- unless forloop.first -%}],{%- endunless -%}
|
13
|
-
"{{ currentdate }}":[{
|
14
|
-
{%- assign date = currentdate -%}
|
15
|
-
{%- else -%},{
|
16
|
-
{%- endif -%}
|
17
|
-
"key":"{{ forloop.index }}","title":"{{ post.title | url_encode }}","tags":[
|
18
|
-
{%- for tag in post.tags -%}
|
19
|
-
"{{ tag | url_encode }}" {%- unless forloop.last -%},{%- endunless -%}
|
20
|
-
{%- endfor -%}
|
21
|
-
{%- assign __path = post.url -%}
|
22
|
-
{%- include snippets/prepend-baseurl.html -%}
|
23
|
-
{%- assign _url = __return -%}
|
24
|
-
],"url":"{{ _url }}","date":"{{ post.date | date: _format }}"}
|
25
|
-
{%- endfor -%}
|
26
|
-
]}
|
27
|
-
{%- endif -%}
|
data/_includes/scripts/home.html
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
{%- if site.leancloud.app_id and site.leancloud.app_key and site.leancloud.app_class and jekyll.environment != "development" -%}
|
2
|
-
{%- include snippets/get-sources.html -%}
|
3
|
-
{%- assign _sources = __return -%}
|
4
|
-
<script>
|
5
|
-
window.Lazyload.js(['{{ _sources.jquery }}', '{{ _sources.leancloud_js_sdk }}'], function() {
|
6
|
-
AV.init({
|
7
|
-
appId: '{{ site.leancloud.app_id }}',
|
8
|
-
appKey: '{{ site.leancloud.app_key }}'
|
9
|
-
});
|
10
|
-
$(".article-view").each(function() {
|
11
|
-
var curId = this.id;
|
12
|
-
var query = new AV.Query('{{ site.leancloud.app_class }}');
|
13
|
-
query.equalTo('key', curId.substr(9));
|
14
|
-
query.first().then(function(result) {
|
15
|
-
if (result) {
|
16
|
-
$('#' + curId).text(result.attributes.views);
|
17
|
-
}
|
18
|
-
}, function(error) {
|
19
|
-
if (error) {
|
20
|
-
throw error;
|
21
|
-
}
|
22
|
-
});
|
23
|
-
});
|
24
|
-
});
|
25
|
-
</script>
|
26
|
-
{%- endif -%}
|
@@ -1,32 +0,0 @@
|
|
1
|
-
{%- include snippets/get-sources.html -%}
|
2
|
-
{%- assign _sources = __return -%}
|
3
|
-
<script>
|
4
|
-
(function() {
|
5
|
-
function scrollAnimateTo(destination, duration, callback) {
|
6
|
-
var $body = $('html, body'), bodyScrollTop = $body.scrollTop();
|
7
|
-
if(bodyScrollTop === destination) { return; }
|
8
|
-
$body.animate({ scrollTop: destination }, duration, callback);
|
9
|
-
}
|
10
|
-
window.scrollTopAnchor = function(anchor, callback) {
|
11
|
-
scrollAnimateTo($(anchor).offset().top, 400, function() {
|
12
|
-
window.history.replaceState(null, '', window.location.href.split('#')[0] + anchor);
|
13
|
-
callback && callback();
|
14
|
-
});
|
15
|
-
}
|
16
|
-
})();
|
17
|
-
window.Lazyload.js('{{ _sources.jquery }}', function() {
|
18
|
-
var $articleContent = $('.m-post, .m-page').find('.m-article-content'), $this;
|
19
|
-
$articleContent.children('.highlight').each(function() {
|
20
|
-
$this = $(this);
|
21
|
-
$this.attr('data-lang', $this.find('code').attr('data-lang'));
|
22
|
-
});
|
23
|
-
|
24
|
-
$articleContent.children('h1, h2, h3, h4, h5, h6').each(function() {
|
25
|
-
$this = $(this);
|
26
|
-
$this.append($('<a class="anchor" aria-hidden="true"></a>').html('{%- include icon/link.svg -%}'));
|
27
|
-
});
|
28
|
-
$articleContent.on('click', '.anchor', function() {
|
29
|
-
window.scrollTopAnchor('#' + $(this).parent().attr('id'));
|
30
|
-
});
|
31
|
-
});
|
32
|
-
</script>
|
data/_includes/scripts/post.html
DELETED
@@ -1,183 +0,0 @@
|
|
1
|
-
{%- assign _toc_selectors = site.toc.selectors | default: site.data.variables.default.toc.selectors -%}
|
2
|
-
{%- include snippets/get-sources.html -%}
|
3
|
-
{%- assign _sources = __return -%}
|
4
|
-
<script>
|
5
|
-
window.Lazyload.js('{{ _sources.jquery }}', function() {
|
6
|
-
var $window = $(window);
|
7
|
-
var $pageStage = $('.js-page-stage');
|
8
|
-
var $pageMain = $('.js-main');
|
9
|
-
var $pageFooter = $('.js-page-footer');
|
10
|
-
var $articleContent = $('.js-article-content');
|
11
|
-
var $articleAside = $('.js-article-aside');
|
12
|
-
var $toc = $('.js-toc');
|
13
|
-
var $col2 = $('.js-col-2');
|
14
|
-
var hasTitle = $articleContent.find('{{ _toc_selectors }}').length > 0;
|
15
|
-
function asideSticky() {
|
16
|
-
return $col2.css('display') !== 'none' && $pageStage.hasClass('has-toc');
|
17
|
-
}
|
18
|
-
function setTocClass() {
|
19
|
-
if (hasTitle) {
|
20
|
-
!$pageStage.hasClass('has-toc') && $pageStage.addClass('has-toc');
|
21
|
-
}
|
22
|
-
}
|
23
|
-
function setAsideTOC() {
|
24
|
-
var asideTop, asideLeft, scrollBottom, asideBottomTop, lastScrollTop;
|
25
|
-
function init() {
|
26
|
-
var asideOffset = $articleAside.offset();
|
27
|
-
var footerOffset = $pageFooter.offset();
|
28
|
-
var mainOffset = $pageMain.offset();
|
29
|
-
asideTop = mainOffset.top;
|
30
|
-
asideHeight = $toc.outerHeight() + parseInt($articleAside.css('padding-top'), 10) + parseInt($articleAside.css('padding-bottom'), 10);
|
31
|
-
asideLeft = mainOffset.left + $pageMain.outerWidth() - $articleAside.outerWidth() - parseInt($pageMain.css('padding-right'), 10);
|
32
|
-
scrollBottom = footerOffset.top - asideHeight;
|
33
|
-
asideBottomTop = scrollBottom - mainOffset.top;
|
34
|
-
}
|
35
|
-
function setAside(force) {
|
36
|
-
force !== true && (force = false);
|
37
|
-
var scrollTop = $window.scrollTop();
|
38
|
-
if (scrollTop >= asideTop && scrollTop <= scrollBottom) {
|
39
|
-
(!force && lastScrollTop >= asideTop && lastScrollTop <= scrollBottom) ||
|
40
|
-
$articleAside.addClass('fixed').css({
|
41
|
-
left: asideLeft + 'px',
|
42
|
-
top: 0
|
43
|
-
});
|
44
|
-
} else if (scrollTop < asideTop) {
|
45
|
-
(!force && lastScrollTop < asideTop) ||
|
46
|
-
$articleAside.removeClass('fixed').css({
|
47
|
-
left: 0,
|
48
|
-
top: 0
|
49
|
-
});
|
50
|
-
} else {
|
51
|
-
(!force && lastScrollTop > scrollBottom) ||
|
52
|
-
$articleAside.removeClass('fixed').css({
|
53
|
-
left: 0,
|
54
|
-
top: asideBottomTop + 'px'
|
55
|
-
});
|
56
|
-
}
|
57
|
-
lastScrollTop = scrollTop;
|
58
|
-
}
|
59
|
-
asideSticky() && (init(), setAside());
|
60
|
-
$window.on('scroll', function() {
|
61
|
-
asideSticky() && setAside();
|
62
|
-
});
|
63
|
-
$window.on('resize', window.throttle(function() {
|
64
|
-
setTocClass();
|
65
|
-
asideSticky() && (init(), setAside(true));
|
66
|
-
}, 100));
|
67
|
-
setTimeout(init, 4000);
|
68
|
-
}
|
69
|
-
function toc() {
|
70
|
-
var $tocUl = $('<ul></ul>'), $tocLi, $headings = $articleContent.find('{{ _toc_selectors }}'), headingsTop = [],
|
71
|
-
scrolling, activeLast, activeCur, rendered = false;
|
72
|
-
function init() {
|
73
|
-
$headings.each(function() {
|
74
|
-
headingsTop.push(Math.floor($(this).offset().top));
|
75
|
-
});
|
76
|
-
}
|
77
|
-
function setActiveHeading(element, disabled) {
|
78
|
-
var scrollTop = $window.scrollTop(), i;
|
79
|
-
if (disabled || headingsTop.length < 1) { return; }
|
80
|
-
if (element) {
|
81
|
-
activeCur = element;
|
82
|
-
} else {
|
83
|
-
for (i = 0; i < headingsTop.length; i++) {
|
84
|
-
if (scrollTop >= headingsTop[i]) {
|
85
|
-
activeCur = $tocLi.eq(i);
|
86
|
-
} else {
|
87
|
-
activeCur || (activeCur = $tocLi.eq(i));
|
88
|
-
break;
|
89
|
-
}
|
90
|
-
}
|
91
|
-
}
|
92
|
-
activeLast && activeLast.removeClass('toc-active');
|
93
|
-
(activeLast = activeCur).addClass('toc-active');
|
94
|
-
}
|
95
|
-
function render() {
|
96
|
-
$toc.append($tocUl);
|
97
|
-
$headings.each(function() {
|
98
|
-
var $this = $(this);
|
99
|
-
$tocUl.append($('<li></li>').addClass('toc-' + $this.prop("tagName").toLowerCase())
|
100
|
-
.append($('<a></a>').text($this.text()).attr('href', '#' + $this.prop('id'))));
|
101
|
-
});
|
102
|
-
$tocLi = $tocUl.children('li');
|
103
|
-
$tocUl.on('click', 'a', function(e) {
|
104
|
-
e.preventDefault();
|
105
|
-
var $this = $(this);
|
106
|
-
scrolling = true;
|
107
|
-
setActiveHeading($this.parent());
|
108
|
-
window.scrollTopAnchor($this.attr('href'), function() {
|
109
|
-
scrolling = false;
|
110
|
-
});
|
111
|
-
});
|
112
|
-
rendered = true;
|
113
|
-
}
|
114
|
-
asideSticky() && (render(), $window.on('load', function() {
|
115
|
-
setTimeout(function() {
|
116
|
-
init();
|
117
|
-
setActiveHeading(null, scrolling);
|
118
|
-
}, 1000);
|
119
|
-
}));
|
120
|
-
$window.on('resize', window.throttle(function() {
|
121
|
-
if (asideSticky()) {
|
122
|
-
rendered || render();
|
123
|
-
init();
|
124
|
-
setActiveHeading(null, scrolling);
|
125
|
-
}
|
126
|
-
}));
|
127
|
-
$window.on('scroll', function() {
|
128
|
-
asideSticky() && setActiveHeading(null, scrolling);
|
129
|
-
});
|
130
|
-
}
|
131
|
-
setTocClass();
|
132
|
-
toc();
|
133
|
-
setTimeout(function() {
|
134
|
-
setAsideTOC();
|
135
|
-
}, 1000);
|
136
|
-
});
|
137
|
-
|
138
|
-
{%- if page.key and site.leancloud.app_id and site.leancloud.app_key and site.leancloud.app_class and jekyll.environment != "development" -%}
|
139
|
-
window.Lazyload.js(['{{ _sources.jquery }}', '{{ _sources.leancloud_js_sdk }}'], function() {
|
140
|
-
AV.init({
|
141
|
-
appId: '{{ site.leancloud.app_id }}',
|
142
|
-
appKey: '{{ site.leancloud.app_key }}'
|
143
|
-
});
|
144
|
-
var query = new AV.Query('{{ site.leancloud.app_class }}');
|
145
|
-
query.equalTo('key', '{{ page.key }}');
|
146
|
-
query.first().then(function(result) {
|
147
|
-
if (result) {
|
148
|
-
addOne(result)
|
149
|
-
} else {
|
150
|
-
var Blog = AV.Object.extend('{{ site.leancloud.app_class }}');
|
151
|
-
var blog = new Blog();
|
152
|
-
blog.set('title', '{{ page.title }}');
|
153
|
-
blog.set('key', '{{ page.key }}');
|
154
|
-
blog.set('views', 0);
|
155
|
-
blog.save().then(function(page) {
|
156
|
-
addOne(page)
|
157
|
-
}, function(error) {
|
158
|
-
if (error) {
|
159
|
-
throw error;
|
160
|
-
}
|
161
|
-
});
|
162
|
-
}
|
163
|
-
|
164
|
-
function addOne(page) {
|
165
|
-
page.increment('views', 1);
|
166
|
-
page.save(null, {
|
167
|
-
fetchWhenSave: true
|
168
|
-
}).then(function(page) {
|
169
|
-
$("#post-key-{{ page.key }}").text(page.attributes.views);
|
170
|
-
}, function(error) {
|
171
|
-
if (error) {
|
172
|
-
throw error;
|
173
|
-
}
|
174
|
-
});
|
175
|
-
}
|
176
|
-
}, function(error) {
|
177
|
-
if (error) {
|
178
|
-
throw error;
|
179
|
-
}
|
180
|
-
});
|
181
|
-
});
|
182
|
-
{%- endif -%}
|
183
|
-
</script>
|
@@ -1,19 +0,0 @@
|
|
1
|
-
{%- if site.disqus.shortname and page.key -%}
|
2
|
-
<div id="disqus_thread"></div>
|
3
|
-
<script>
|
4
|
-
/**
|
5
|
-
* RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
|
6
|
-
* LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/
|
7
|
-
var disqus_config = function () {
|
8
|
-
this.page.url = '{%- include snippets/page-url.html -%}';
|
9
|
-
this.page.identifier = '{{ page.key }}';
|
10
|
-
};
|
11
|
-
(function() { // DON'T EDIT BELOW THIS LINE
|
12
|
-
var d = document, s = d.createElement('script');
|
13
|
-
s.src = 'https://{{ site.disqus.shortname }}.disqus.com/embed.js';
|
14
|
-
s.setAttribute('data-timestamp', +new Date());
|
15
|
-
(d.head || d.body).appendChild(s);
|
16
|
-
})();
|
17
|
-
</script>
|
18
|
-
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
19
|
-
{%- endif -%}
|
@@ -1,25 +0,0 @@
|
|
1
|
-
{%- if site.disqus.shortname == nil and site.gitalk.clientID and site.gitalk.clientSecret and site.gitalk.repository and site.gitalk.owner and site.gitalk.admin and page.key -%}
|
2
|
-
{%- include snippets/get-sources.html -%}
|
3
|
-
{%- assign _sources = __return -%}
|
4
|
-
<div id="js-gitalk-container"></div>
|
5
|
-
{%- assign admin = '' -%}
|
6
|
-
{%- for adminId in site.gitalk.admin -%}
|
7
|
-
{%- assign admin = admin | append: ", '" | append: adminId | append: "'" -%}
|
8
|
-
{%- endfor -%}
|
9
|
-
{%- assign last = admin | size | minus: 1 -%}
|
10
|
-
{%- assign admin = admin | slice: 2, last -%}
|
11
|
-
<script>
|
12
|
-
window.Lazyload.css('{{ _sources.gitalk.css }}');
|
13
|
-
window.Lazyload.js('{{ _sources.gitalk.js }}', function() {
|
14
|
-
var gitalk = new Gitalk({
|
15
|
-
clientID: '{{ site.gitalk.clientID }}',
|
16
|
-
clientSecret: '{{ site.gitalk.clientSecret }}',
|
17
|
-
repo: '{{ site.gitalk.repository }}',
|
18
|
-
owner: '{{ site.gitalk.owner }}',
|
19
|
-
admin: [{{ admin }}],
|
20
|
-
id: '{{ page.key }}'
|
21
|
-
});
|
22
|
-
gitalk.render('js-gitalk-container');
|
23
|
-
});
|
24
|
-
</script>
|
25
|
-
{%- endif -%}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
{%- if site.ga_tracking_id -%}
|
2
|
-
<script>
|
3
|
-
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
4
|
-
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
5
|
-
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
6
|
-
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
7
|
-
|
8
|
-
ga('create', '{{ site.ga_tracking_id }}', 'auto');
|
9
|
-
ga('send', 'pageview');
|
10
|
-
</script>
|
11
|
-
{%- endif -%}
|
data/_layouts/all.html
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
---
|
2
|
-
layout: base
|
3
|
-
titles:
|
4
|
-
en: All Posts
|
5
|
-
zh: 归档
|
6
|
-
zh-Hans: 归档
|
7
|
-
zh-Hant: 歸檔
|
8
|
-
---
|
9
|
-
<div class="m-all js-all">
|
10
|
-
<div class="main">
|
11
|
-
<div class="m-search-box js-search-box">
|
12
|
-
<div class="icon-search">{%- include icon/search.svg -%}</div>
|
13
|
-
<input type="text" />
|
14
|
-
<div class="icon-clear">{%- include icon/clear.svg -%}</div>
|
15
|
-
</div>
|
16
|
-
{%- include components/tags.html -%}
|
17
|
-
<!--group by year: http://stackoverflow.com/questions/19086284/jekyll-liquid-templating-how-to-group-blog-posts-by-year-->
|
18
|
-
<div class="js-result m-result"></div>
|
19
|
-
</div>
|
20
|
-
</div>
|
data/_layouts/error-404.html
DELETED
data/_layouts/post.html
DELETED
@@ -1,60 +0,0 @@
|
|
1
|
-
---
|
2
|
-
layout: base
|
3
|
-
---
|
4
|
-
<div class="m-post">
|
5
|
-
<div class="main clearfix js-main">
|
6
|
-
<div class="col-2 js-col-2">
|
7
|
-
<aside class="js-article-aside"><div class="m-toc js-toc"></div></aside>
|
8
|
-
</div>
|
9
|
-
<div class="col-1">
|
10
|
-
<article class="js-article" itemscope itemtype="http://schema.org/BlogPosting">
|
11
|
-
<meta itemprop="mainEntityOfPage" itemscope itemType="https://schema.org/WebPage"/>
|
12
|
-
<header class="main-header">
|
13
|
-
{%- include snippets/page-title.html -%}
|
14
|
-
<h1 itemprop="headline" itemprop="name headline">{{ __return }}</h1>
|
15
|
-
{%- include components/article-data.html -%}
|
16
|
-
</header>
|
17
|
-
<div class="m-article-content js-article-content" itemprop="articleBody">{{ content }}</div>
|
18
|
-
<footer>
|
19
|
-
{%- if page.modify_date -%}
|
20
|
-
{%- assign __locale = site.data.locale.ARTICLE_DATE_FORMAT -%}
|
21
|
-
{%- include snippets/locale-to-string.html -%}
|
22
|
-
{%- assign date_format = __return -%}
|
23
|
-
{%- assign __locale = site.data.locale.LAST_UPDATED -%}
|
24
|
-
{%- include snippets/locale-to-string.html -%}
|
25
|
-
<span>{{ __return }}
|
26
|
-
<time datetime="{{ page.modify_date | date_to_xmlschema }}" itemprop="dateModified">{{ page.modify_date | date: date_format }}</time>
|
27
|
-
</span>
|
28
|
-
{%- else -%}
|
29
|
-
<meta itemprop="dateModified" content="{{ page.date | date_to_xmlschema }}">
|
30
|
-
{%- endif -%}
|
31
|
-
<div class="article-license">
|
32
|
-
{%- include components/license.html -%}
|
33
|
-
</div>
|
34
|
-
</footer>
|
35
|
-
</article>
|
36
|
-
<div class="article-previous-next clearfix">
|
37
|
-
{%- if page.next -%}
|
38
|
-
{%- assign __path = page.next.url -%}
|
39
|
-
{%- include snippets/prepend-baseurl.html -%}
|
40
|
-
{%- assign href = __return -%}
|
41
|
-
{%- assign __locale = site.data.locale.PREVIOUS -%}
|
42
|
-
{%- include snippets/locale-to-string.html -%}
|
43
|
-
<div class="article-previous"><span>{{ __return }}</span><a href="{{ href }}">{{ page.next.title }}</a></div>
|
44
|
-
{%- endif -%}
|
45
|
-
{%- if page.previous -%}
|
46
|
-
{%- assign __path = page.previous.url -%}
|
47
|
-
{%- include snippets/prepend-baseurl.html -%}
|
48
|
-
{%- assign href = __return -%}
|
49
|
-
{%- assign __locale = site.data.locale.NEXT -%}
|
50
|
-
{%- include snippets/locale-to-string.html -%}
|
51
|
-
<div class="article-next"><span>{{ __return }}</span><a href="{{ href }}">{{ page.previous.title }}</a></div>
|
52
|
-
{%- endif -%}
|
53
|
-
</div>
|
54
|
-
{%- if jekyll.environment != "development" and page.comment != false -%}
|
55
|
-
<section>{%- include utils/comment-disqus.html -%}</section>
|
56
|
-
<section>{%- include utils/comment-gitalk.html -%}</section>
|
57
|
-
{%- endif -%}
|
58
|
-
</div>
|
59
|
-
</div>
|
60
|
-
</div>
|