jekyll-text-theme 1.3.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 +7 -0
- data/LICENSE +21 -0
- data/README.md +161 -0
- data/_includes/blog/article-data.html +43 -0
- data/_includes/blog/footer.html +14 -0
- data/_includes/blog/header.html +22 -0
- data/_includes/blog/license.html +17 -0
- data/_includes/blog/tags.html +49 -0
- data/_includes/common-head.html +7 -0
- data/_includes/head-icons-rel.html +25 -0
- data/_includes/icon/mail.svg +6 -0
- data/_includes/icon/menu.svg +3 -0
- data/_includes/icon/next.svg +3 -0
- data/_includes/icon/previous.svg +3 -0
- data/_includes/icon/social/behance.svg +3 -0
- data/_includes/icon/social/douban.svg +5 -0
- data/_includes/icon/social/facebook.svg +3 -0
- data/_includes/icon/social/flicker.svg +5 -0
- data/_includes/icon/social/github.svg +3 -0
- data/_includes/icon/social/googleplus.svg +3 -0
- data/_includes/icon/social/linkedin.svg +3 -0
- data/_includes/icon/social/pinterest.svg +3 -0
- data/_includes/icon/social/qq.svg +3 -0
- data/_includes/icon/social/twitter.svg +3 -0
- data/_includes/icon/social/weibo.svg +6 -0
- data/_includes/icon/social/weixin.svg +3 -0
- data/_includes/icon/social/zhihu.svg +3 -0
- data/_includes/info/follow-me.html +74 -0
- data/_includes/logo/logo.svg +8 -0
- data/_includes/snippets/page-url.html +1 -0
- data/_includes/snippets/rss-url.html +1 -0
- data/_includes/utils/comment-disqus.html +22 -0
- data/_includes/utils/google-analytics.html +13 -0
- data/_includes/utils/mathjax.html +5 -0
- data/_layouts/all.html +114 -0
- data/_layouts/blog-base.html +34 -0
- data/_layouts/blog-default.html +9 -0
- data/_layouts/error-404.html +9 -0
- data/_layouts/home-base.html +15 -0
- data/_layouts/home.html +92 -0
- data/_layouts/none.html +1 -0
- data/_layouts/page.html +15 -0
- data/_layouts/post.html +206 -0
- data/_sass/base/_animate.scss +19 -0
- data/_sass/base/_base.scss +55 -0
- data/_sass/base/_image&icon.scss +20 -0
- data/_sass/base/_links.scss +84 -0
- data/_sass/base/_text.scss +50 -0
- data/_sass/blog/_layout.base.scss +3 -0
- data/_sass/blog/_layout.default.scss +20 -0
- data/_sass/blog/_layout.page.scss +1 -0
- data/_sass/blog/_layout.post.scss +66 -0
- data/_sass/blog/_page.all.scss +35 -0
- data/_sass/blog/_page.error-404.scss +7 -0
- data/_sass/blog/_page.index.scss +45 -0
- data/_sass/colors/_colors.dark.scss +38 -0
- data/_sass/colors/_colors.default.scss +39 -0
- data/_sass/colors/_colors.forest.scss +39 -0
- data/_sass/colors/_colors.ocean.scss +39 -0
- data/_sass/components/_article.content.scss +140 -0
- data/_sass/components/_article.data.scss +35 -0
- data/_sass/components/_follow-me.scss +70 -0
- data/_sass/components/_footer.scss +36 -0
- data/_sass/components/_header.scss +44 -0
- data/_sass/components/_license.scss +27 -0
- data/_sass/components/_pagination.scss +7 -0
- data/_sass/components/_tags.scss +33 -0
- data/_sass/components/_toc.scss +61 -0
- data/_sass/components/_wrapper.scss +23 -0
- data/_sass/mixins/_flex.scss +394 -0
- data/_sass/mixins/_link.scss +60 -0
- data/_sass/mixins/_media.scss +12 -0
- data/_sass/mixins/_prefix.scss +14 -0
- data/_sass/settings/_base.scss +12 -0
- data/_sass/settings/_colors.scss +4 -0
- data/_sass/settings/_font.scss +32 -0
- data/_sass/settings/_highlighting.scss +72 -0
- data/assets/css/blog.scss +46 -0
- data/assets/images/license-cc4.png +0 -0
- 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
- data/assets/images/logo/logo.svg +8 -0
- data/assets/images/octocat.jpg +0 -0
- metadata +234 -0
data/_layouts/page.html
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
layout: blog-default
|
3
|
+
---
|
4
|
+
<div class="m-page">
|
5
|
+
<article class="main">
|
6
|
+
<h1>{{ page.title }}</h1>
|
7
|
+
|
8
|
+
<div class="m-article-content" itemprop="articleBody">
|
9
|
+
{{ content }}
|
10
|
+
</div>
|
11
|
+
{% if page.comment != false %}
|
12
|
+
<section>{% include utils/comment-disqus.html %}</section>
|
13
|
+
{% endif %}
|
14
|
+
</article>
|
15
|
+
</div>
|
data/_layouts/post.html
ADDED
@@ -0,0 +1,206 @@
|
|
1
|
+
---
|
2
|
+
layout: blog-default
|
3
|
+
---
|
4
|
+
<div class="m-post">
|
5
|
+
<div class="main js-main">
|
6
|
+
<div class="col-1">
|
7
|
+
<article itemscope itemtype="http://schema.org/BlogPosting">
|
8
|
+
<meta itemprop="mainEntityOfPage" itemscope itemType="https://schema.org/WebPage"/>
|
9
|
+
<header class="article-header">
|
10
|
+
<h1 itemprop="headline" itemprop="name headline">{{ page.title }}</h1>
|
11
|
+
{% include blog/article-data.html %}
|
12
|
+
</header>
|
13
|
+
<div class="m-article-content js-article-content" itemprop="articleBody">
|
14
|
+
{{ content }}
|
15
|
+
</div>
|
16
|
+
<footer>
|
17
|
+
{% if page.modify_date %}
|
18
|
+
<span>
|
19
|
+
Last updated
|
20
|
+
<time datetime="{{ page.modify_date | date_to_xmlschema }}" itemprop="dateModified">
|
21
|
+
{{ page.modify_date | date: "%b %-d, %Y" }}
|
22
|
+
</time>
|
23
|
+
</span>
|
24
|
+
{% else %}
|
25
|
+
<meta itemprop="dateModified" content="{{ page.date | date_to_xmlschema }}">
|
26
|
+
{% endif %}
|
27
|
+
<div class="article-license">
|
28
|
+
{% include blog/license.html %}
|
29
|
+
</div>
|
30
|
+
</footer>
|
31
|
+
{% if page.comment != false %}
|
32
|
+
<section>{% include utils/comment-disqus.html %}</section>
|
33
|
+
{% endif %}
|
34
|
+
</article>
|
35
|
+
</div>
|
36
|
+
<div class="col-2">
|
37
|
+
<aside class="js-article-aside">
|
38
|
+
<div class="m-toc js-toc"></div>
|
39
|
+
</aside>
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
|
44
|
+
<script src="//cdn.bootcss.com/toc/0.3.2/toc.min.js"></script>
|
45
|
+
<script type="text/javascript">
|
46
|
+
window.throttle = function(func, wait) {
|
47
|
+
var args,
|
48
|
+
result,
|
49
|
+
thisArg,
|
50
|
+
timeoutId,
|
51
|
+
lastCalled = 0;
|
52
|
+
|
53
|
+
function trailingCall() {
|
54
|
+
lastCalled = new Date;
|
55
|
+
timeoutId = null;
|
56
|
+
result = func.apply(thisArg, args);
|
57
|
+
}
|
58
|
+
return function() {
|
59
|
+
var now = new Date,
|
60
|
+
remaining = wait - (now - lastCalled);
|
61
|
+
|
62
|
+
args = arguments;
|
63
|
+
thisArg = this;
|
64
|
+
|
65
|
+
if (remaining <= 0) {
|
66
|
+
clearTimeout(timeoutId);
|
67
|
+
timeoutId = null;
|
68
|
+
lastCalled = now;
|
69
|
+
result = func.apply(thisArg, args);
|
70
|
+
}
|
71
|
+
else if (!timeoutId) {
|
72
|
+
timeoutId = setTimeout(trailingCall, remaining);
|
73
|
+
}
|
74
|
+
return result;
|
75
|
+
};
|
76
|
+
}
|
77
|
+
$(function() {
|
78
|
+
var $window = $(window);
|
79
|
+
var $pageStage = $('.js-page-stage');
|
80
|
+
var $pageMain = $('.js-main');
|
81
|
+
var $pageFooter = $('.js-page-footer');
|
82
|
+
var $articleContent = $('.js-article-content');
|
83
|
+
var $articleAside = $('.js-article-aside');
|
84
|
+
var $toc = $('.js-toc');
|
85
|
+
var hasTitle = $articleContent.find('h1, h2, h3').length > 0;
|
86
|
+
|
87
|
+
function asideSticky() {
|
88
|
+
return $window.outerWidth() > 1150 && $pageStage.hasClass('has-toc');
|
89
|
+
}
|
90
|
+
function setTocClass() {
|
91
|
+
if (hasTitle) {
|
92
|
+
!$pageStage.hasClass('has-toc') && $pageStage.addClass('has-toc');
|
93
|
+
}
|
94
|
+
}
|
95
|
+
|
96
|
+
setTocClass();
|
97
|
+
|
98
|
+
function setAsideTOC() {
|
99
|
+
var asideTop,
|
100
|
+
asideLeft,
|
101
|
+
scrollBottom,
|
102
|
+
asideBottomTop,
|
103
|
+
lastScrollTop;
|
104
|
+
|
105
|
+
function init() {
|
106
|
+
var asideOffset = $articleAside.offset();
|
107
|
+
var footerOffset = $pageFooter.offset();
|
108
|
+
var mainOffset = $pageMain.offset();
|
109
|
+
asideTop = mainOffset.top;
|
110
|
+
asideHeight = $toc.outerHeight() + parseInt($articleAside.css('padding-top'), 10) + parseInt($articleAside.css('padding-bottom'), 10);
|
111
|
+
asideLeft = mainOffset.left + $pageMain.outerWidth() - $articleAside.outerWidth() - parseInt($pageMain.css('padding-right'), 10);
|
112
|
+
scrollBottom = footerOffset.top - asideHeight;
|
113
|
+
asideBottomTop = scrollBottom - mainOffset.top;
|
114
|
+
}
|
115
|
+
function setAside(force) {
|
116
|
+
force !== true && (force = false);
|
117
|
+
var scrollTop = $window.scrollTop();
|
118
|
+
if (scrollTop >= asideTop && scrollTop <= scrollBottom) {
|
119
|
+
(!force && lastScrollTop >= asideTop && lastScrollTop <= scrollBottom) ||
|
120
|
+
$articleAside.addClass('fixed').css({
|
121
|
+
left: asideLeft + 'px',
|
122
|
+
top: 0
|
123
|
+
});
|
124
|
+
} else if (scrollTop < asideTop) {
|
125
|
+
(!force && lastScrollTop < asideTop) ||
|
126
|
+
$articleAside.removeClass('fixed').css({
|
127
|
+
left: 0,
|
128
|
+
top: 0
|
129
|
+
});
|
130
|
+
} else {
|
131
|
+
(!force && lastScrollTop > scrollBottom) ||
|
132
|
+
$articleAside.removeClass('fixed').css({
|
133
|
+
left: 0,
|
134
|
+
top: asideBottomTop + 'px'
|
135
|
+
});
|
136
|
+
}
|
137
|
+
lastScrollTop = scrollTop;
|
138
|
+
}
|
139
|
+
asideSticky() && (init(), setAside());
|
140
|
+
$window.on('scroll', function() {
|
141
|
+
asideSticky() && setAside();
|
142
|
+
});
|
143
|
+
$window.on('resize', throttle(function() {
|
144
|
+
setTocClass();
|
145
|
+
asideSticky() && (init(), setAside(true));
|
146
|
+
}, 100));
|
147
|
+
setTimeout(init, 4000);
|
148
|
+
}
|
149
|
+
setTimeout(setAsideTOC, 1000);
|
150
|
+
|
151
|
+
$toc.toc({
|
152
|
+
'selectors': 'h1,h2,h3',
|
153
|
+
'container': '.js-article-content',
|
154
|
+
});
|
155
|
+
});
|
156
|
+
</script>
|
157
|
+
{% if page.key and site.leancloud.app_id and site.leancloud.app_key and site.leancloud.app_class and site.isdebug == false %}
|
158
|
+
<script src="https://cdn1.lncld.net/static/js/av-min-1.2.1.js"></script>
|
159
|
+
<script type="text/javascript">
|
160
|
+
$(function() {
|
161
|
+
// 初始化
|
162
|
+
AV.init({
|
163
|
+
appId: '{{ site.leancloud.app_id }}',
|
164
|
+
appKey: '{{ site.leancloud.app_key }}'
|
165
|
+
});
|
166
|
+
// 查询
|
167
|
+
var query = new AV.Query('{{ site.leancloud.app_class }}');
|
168
|
+
query.equalTo('key', '{{ page.key }}');
|
169
|
+
query.first().then(function(result) {
|
170
|
+
if (result) {
|
171
|
+
addOne(result)
|
172
|
+
} else {
|
173
|
+
//新建
|
174
|
+
var Blog = AV.Object.extend('{{ site.leancloud.app_class }}');
|
175
|
+
var blog = new Blog();
|
176
|
+
blog.set('title', '{{ page.title }}');
|
177
|
+
blog.set('key', '{{ page.key }}');
|
178
|
+
blog.set('views', 0);
|
179
|
+
blog.save().then(function(page) {
|
180
|
+
addOne(page)
|
181
|
+
}, function(error) {
|
182
|
+
if (error) {
|
183
|
+
throw error;
|
184
|
+
}
|
185
|
+
});
|
186
|
+
}
|
187
|
+
|
188
|
+
function addOne(page) {
|
189
|
+
page.increment('views', 1);
|
190
|
+
page.fetchWhenSave(true);
|
191
|
+
page.save().then(function(page) {
|
192
|
+
$("#post-key-{{ page.key }}").text(page.attributes.views);
|
193
|
+
}, function(error) {
|
194
|
+
if (error) {
|
195
|
+
throw error;
|
196
|
+
}
|
197
|
+
});
|
198
|
+
}
|
199
|
+
}, function(error) {
|
200
|
+
if (error) {
|
201
|
+
throw error;
|
202
|
+
}
|
203
|
+
});
|
204
|
+
});
|
205
|
+
</script>
|
206
|
+
{% endif %}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
@keyframes fade-in {
|
2
|
+
from {
|
3
|
+
opacity: 0;
|
4
|
+
}
|
5
|
+
to {
|
6
|
+
opacity: 1;
|
7
|
+
}
|
8
|
+
}
|
9
|
+
|
10
|
+
@keyframes fade-in-down {
|
11
|
+
from {
|
12
|
+
opacity: 0;
|
13
|
+
@include transform(translateY(-$spacing-unit));
|
14
|
+
}
|
15
|
+
to {
|
16
|
+
opacity: 1;
|
17
|
+
@include transform(translateY(0));
|
18
|
+
}
|
19
|
+
}
|
@@ -0,0 +1,55 @@
|
|
1
|
+
/**
|
2
|
+
* Reset some basic elements
|
3
|
+
*/
|
4
|
+
body, h1, h2, h3, h4, h5, h6,
|
5
|
+
p, blockquote, pre, hr,
|
6
|
+
dl, dd, ol, ul, figure {
|
7
|
+
margin: 0;
|
8
|
+
padding: 0;
|
9
|
+
}
|
10
|
+
h1, h2, h3, h4, h5, h6,
|
11
|
+
p, blockquote, pre,
|
12
|
+
ul, ol, dl, figure,
|
13
|
+
%vertical-rhythm {
|
14
|
+
margin: $base-font-size / 2 0;
|
15
|
+
}
|
16
|
+
|
17
|
+
html {
|
18
|
+
height: 100%;
|
19
|
+
}
|
20
|
+
body {
|
21
|
+
height: 100%;
|
22
|
+
::-moz-selection {
|
23
|
+
background: $select-color;
|
24
|
+
}
|
25
|
+
::-webkit-selection {
|
26
|
+
background: $select-color;
|
27
|
+
}
|
28
|
+
::selection {
|
29
|
+
background: $select-color;
|
30
|
+
}
|
31
|
+
}
|
32
|
+
|
33
|
+
.clearfix {
|
34
|
+
&:after {
|
35
|
+
content: "";
|
36
|
+
display: table;
|
37
|
+
clear: both;
|
38
|
+
}
|
39
|
+
}
|
40
|
+
.left {
|
41
|
+
float: left;
|
42
|
+
}
|
43
|
+
.right {
|
44
|
+
float: right;
|
45
|
+
}
|
46
|
+
|
47
|
+
button {
|
48
|
+
cursor:pointer;
|
49
|
+
outline: none;
|
50
|
+
background-color: transparent;
|
51
|
+
padding: 0;
|
52
|
+
margin: 0;
|
53
|
+
border-width: 0;
|
54
|
+
font-size: $base-font-size;
|
55
|
+
}
|
@@ -0,0 +1,84 @@
|
|
1
|
+
%cursor-pointer {
|
2
|
+
cursor:pointer;
|
3
|
+
}
|
4
|
+
%cursor-default {
|
5
|
+
cursor: default;
|
6
|
+
}
|
7
|
+
%cursor-not-allowed {
|
8
|
+
cursor: not-allowed;
|
9
|
+
}
|
10
|
+
|
11
|
+
a {
|
12
|
+
font-weight: $bold-font-weight;
|
13
|
+
text-decoration: none;
|
14
|
+
@include link-normal {
|
15
|
+
color: $main-color-1;
|
16
|
+
}
|
17
|
+
@include link-emphasize {
|
18
|
+
text-decoration: underline;
|
19
|
+
color: $main-color-1;
|
20
|
+
}
|
21
|
+
@include transition(all .8s ease 0s);
|
22
|
+
}
|
23
|
+
|
24
|
+
.round-button {
|
25
|
+
font-weight: $bold-font-weight;
|
26
|
+
line-height: 1;
|
27
|
+
@include flexbox;
|
28
|
+
@include justify-content(center);
|
29
|
+
@include align-items(center);
|
30
|
+
box-sizing: border-box;
|
31
|
+
width: $base-font-size * 2;
|
32
|
+
height: $base-font-size * 2;
|
33
|
+
text-decoration: none;
|
34
|
+
border-radius: 50%;
|
35
|
+
@extend %cursor-pointer;
|
36
|
+
@include link-colors(
|
37
|
+
$text-color-3, $main-color-3,
|
38
|
+
$text-color-1, $main-color-1
|
39
|
+
);
|
40
|
+
@include link-normal {
|
41
|
+
text-decoration: none;
|
42
|
+
}
|
43
|
+
@include link-emphasize {
|
44
|
+
text-decoration: none;
|
45
|
+
}
|
46
|
+
@include transition(all .8s ease 0s);
|
47
|
+
svg {
|
48
|
+
width: $base-font-size;
|
49
|
+
height: $base-font-size;
|
50
|
+
}
|
51
|
+
&.inactive {
|
52
|
+
@extend %cursor-not-allowed;
|
53
|
+
@include link-colors(
|
54
|
+
rgba($text-color-3, .5), $main-color-3,
|
55
|
+
rgba($text-color-3, .5), $main-color-3
|
56
|
+
);
|
57
|
+
}
|
58
|
+
}
|
59
|
+
|
60
|
+
.round-rect-button {
|
61
|
+
font-weight: $bold-font-weight;
|
62
|
+
line-height: 1;
|
63
|
+
display: block;
|
64
|
+
box-sizing: border-box;
|
65
|
+
padding: $base-font-size * .4 $base-font-size * .6;
|
66
|
+
text-decoration: none;
|
67
|
+
border-radius: $base-font-size * 2;
|
68
|
+
@extend %cursor-pointer;
|
69
|
+
@include link-colors(
|
70
|
+
$text-color-3, $main-color-3,
|
71
|
+
$text-color-1, $main-color-1
|
72
|
+
);
|
73
|
+
@include link-normal {
|
74
|
+
text-decoration: none;
|
75
|
+
}
|
76
|
+
@include link-emphasize {
|
77
|
+
text-decoration: none;
|
78
|
+
}
|
79
|
+
@include transition(all .8s ease 0s);
|
80
|
+
svg {
|
81
|
+
width: $base-font-size;
|
82
|
+
height: $base-font-size;
|
83
|
+
}
|
84
|
+
}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
body {
|
2
|
+
font: $base-font-weight #{$base-font-size}/#{$base-line-height} $base-font-family;
|
3
|
+
color: $text-color;
|
4
|
+
}
|
5
|
+
|
6
|
+
h1, h2, h3, h4, h5, h6, strong {
|
7
|
+
font-weight: $bold-font-weight;
|
8
|
+
}
|
9
|
+
|
10
|
+
h1 {
|
11
|
+
font-size: $h1-font-size;
|
12
|
+
color: $text-color-d;
|
13
|
+
@include media-query($on-palm) {
|
14
|
+
font-size: $h1-font-size-palm;
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
h2 {
|
19
|
+
font-size: $h2-font-size;
|
20
|
+
color: $text-color-d;
|
21
|
+
@include media-query($on-palm) {
|
22
|
+
font-size: $h2-font-size-palm;
|
23
|
+
}
|
24
|
+
}
|
25
|
+
|
26
|
+
h3 {
|
27
|
+
font-size: $h3-font-size;
|
28
|
+
color: $text-color-d;
|
29
|
+
}
|
30
|
+
|
31
|
+
h4 {
|
32
|
+
font-size: $h4-font-size;
|
33
|
+
color: $text-color;
|
34
|
+
}
|
35
|
+
|
36
|
+
h5 {
|
37
|
+
font-size: $h5-font-size;
|
38
|
+
color: $text-color;
|
39
|
+
}
|
40
|
+
|
41
|
+
h6 {
|
42
|
+
font-size: $h6-font-size;
|
43
|
+
color: $text-color-l;
|
44
|
+
}
|
45
|
+
|
46
|
+
pre,
|
47
|
+
code {
|
48
|
+
font-family: $code-font-family;
|
49
|
+
font-size: $code-font-size;
|
50
|
+
}
|