jekyll-theme-yat 1.6.4 → 1.7.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 +6 -2
- data/_includes/extensions/code-highlight.html +91 -0
- data/_includes/extensions/theme-toggle.html +12 -7
- data/_includes/functions/get_value.html +13 -0
- data/_includes/head.html +1 -6
- data/_includes/views/footer.html +1 -1
- data/_sass/misc/gitment.scss +12 -0
- data/_sass/misc/theme-toggle.scss +1 -1
- data/_sass/yat.scss +2 -1
- data/_sass/yat/_base.scss +2 -20
- data/_sass/yat/_dark.scss +11 -0
- data/_sass/yat/_layout.scss +0 -1
- data/assets/js/main.js +0 -29
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e64474766ce139b9a917d18a8a2fe0ff867b0bcc7c343349ab6819bd8990fbd
|
4
|
+
data.tar.gz: 279eeb6dd5e6a47244ae9516824fbf157e77b92c97a6ecf19604a1e04706c3c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28b59c6996eb0c3a95b8a6906c3aeb1647f77a34518f44a645a985217ce9965be55a4a5190564bceb704b8761ca4456b71fc37aad7f613d0b047be1af4c61c27
|
7
|
+
data.tar.gz: c08b686b732a4f146ad9ca5ff039ad4d8ca16f95b1ffb52c6b67c3b85599690274379490cca405f8108ed4aeb399aecd519e5168868da1dc567c8e82abb51d8b
|
data/README.md
CHANGED
@@ -9,7 +9,10 @@
|
|
9
9
|
alt="Donate (Ko-fi)" />
|
10
10
|
</a>
|
11
11
|
|
12
|
-
Hey, nice to meet you, you found this Jekyll theme. Here the
|
12
|
+
Hey, nice to meet you, you found this [Jekyll][jekyll] theme. Here the
|
13
|
+
**Yet Another Theme** is a modern responsive theme, and it's quiet clear,
|
14
|
+
clean and neat for writers and posts. **If you like the theme, give it
|
15
|
+
a star!**
|
13
16
|
|
14
17
|
|
15
18
|
<p align="center">
|
@@ -18,7 +21,7 @@ Hey, nice to meet you, you found this Jekyll theme. Here the yet another theme i
|
|
18
21
|
|
19
22
|
</p>
|
20
23
|
|
21
|
-
<h3 align="center"
|
24
|
+
<h3 align="center">🌌 Night Mode</h3>
|
22
25
|
|
23
26
|
<p align="center">
|
24
27
|
|
@@ -29,6 +32,7 @@ Hey, nice to meet you, you found this Jekyll theme. Here the yet another theme i
|
|
29
32
|
## Features
|
30
33
|
|
31
34
|
- Support beautiful __Night Mode__.
|
35
|
+
- Modern responsive web design.
|
32
36
|
- Full layouts `home`, `post`, `tags`, `archive` and `about`.
|
33
37
|
- Uses font awesome 5 for icons.
|
34
38
|
- Beautiful Syntax Highlight using [hilight.js][hilight-js].
|
@@ -0,0 +1,91 @@
|
|
1
|
+
<link rel="stylesheet"
|
2
|
+
href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/default.min.css">
|
3
|
+
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js"></script>
|
4
|
+
<!-- and it's easy to individually load additional languages -->
|
5
|
+
<script charset="UTF-8"
|
6
|
+
src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/languages/go.min.js"></script>
|
7
|
+
|
8
|
+
{%- assign name = 'code_badge.enabled' -%}
|
9
|
+
{%- include functions.html func='get_value' default='true' -%}
|
10
|
+
{%- assign badge_enabled = return -%}
|
11
|
+
|
12
|
+
{%- assign name = 'code_badge.color' -%}
|
13
|
+
{%- include functions.html func='get_value' default='#fff' -%}
|
14
|
+
{%- assign badge_color = return -%}
|
15
|
+
|
16
|
+
{%- assign name = 'code_badge.background_color' -%}
|
17
|
+
{%- include functions.html func='get_value' default='#ff4e00' -%}
|
18
|
+
{%- assign badge_background_color = return -%}
|
19
|
+
|
20
|
+
{%- assign name = 'code_badge.text_transform' -%}
|
21
|
+
{%- include functions.html func='get_value' default='uppercase' -%}
|
22
|
+
{%- assign badge_text_transform = return -%}
|
23
|
+
|
24
|
+
<script>
|
25
|
+
// Init highlight js
|
26
|
+
document.addEventListener('DOMContentLoaded', function(event) {
|
27
|
+
var els = document.querySelectorAll('pre code')
|
28
|
+
|
29
|
+
function addLangData(block) {
|
30
|
+
var outer = block.parentElement.parentElement.parentElement;
|
31
|
+
var lang = block.getAttribute('data-lang');
|
32
|
+
for (var i = 0; i < outer.classList.length; i++) {
|
33
|
+
var cls = outer.classList[i];
|
34
|
+
if (cls.startsWith('language-')) {
|
35
|
+
lang = cls;
|
36
|
+
break;
|
37
|
+
}
|
38
|
+
}
|
39
|
+
if (!lang) {
|
40
|
+
cls = block.getAttribute('class');
|
41
|
+
lang = cls ? cls.replace('hljs ', '') : '';
|
42
|
+
}
|
43
|
+
if (lang.startsWith('language-')) {
|
44
|
+
lang = lang.substr(9);
|
45
|
+
}
|
46
|
+
block.setAttribute('class', 'hljs ' + lang);
|
47
|
+
block.parentNode.setAttribute('data-lang', lang);
|
48
|
+
}
|
49
|
+
|
50
|
+
function addBadge(block) {
|
51
|
+
var enabled = ('{{ badge_enabled }}' || 'true').toLowerCase();
|
52
|
+
if (enabled == 'true') {
|
53
|
+
var pre = block.parentElement;
|
54
|
+
pre.classList.add('badge');
|
55
|
+
}
|
56
|
+
}
|
57
|
+
|
58
|
+
function handle(block) {
|
59
|
+
addLangData(block);
|
60
|
+
addBadge(block)
|
61
|
+
hljs.highlightBlock(block);
|
62
|
+
}
|
63
|
+
|
64
|
+
for (var i = 0; i < els.length; i++) {
|
65
|
+
var el = els[i];
|
66
|
+
handle(el);
|
67
|
+
}
|
68
|
+
});
|
69
|
+
</script>
|
70
|
+
|
71
|
+
<style>
|
72
|
+
/* code language badge */
|
73
|
+
pre.badge::before {
|
74
|
+
content: attr(data-lang);
|
75
|
+
color: {{badge_color}};
|
76
|
+
background-color: {{badge_background_color}};
|
77
|
+
padding: 0 .5em;
|
78
|
+
border-radius: 0 2px;
|
79
|
+
text-transform: {{badge_text_transform}};
|
80
|
+
text-align: center;
|
81
|
+
min-width: 32px;
|
82
|
+
display: inline-block;
|
83
|
+
position: absolute;
|
84
|
+
right: 0;
|
85
|
+
}
|
86
|
+
|
87
|
+
/* fix wrong badge display for firefox browser */
|
88
|
+
code > table pre::before {
|
89
|
+
display: none;
|
90
|
+
}
|
91
|
+
</style>
|
@@ -17,18 +17,22 @@
|
|
17
17
|
(function() {
|
18
18
|
var sw = document.getElementById('theme-switch');
|
19
19
|
var html = document.getElementsByTagName('html')[0];
|
20
|
+
var nightModeOption = ('{{ night_mode }}' || 'auto').toLowerCase();
|
21
|
+
var storage = nightModeOption === 'manual'
|
22
|
+
? localStorage
|
23
|
+
: sessionStorage;
|
20
24
|
var themeData = loadThemeData();
|
21
25
|
|
22
26
|
function saveThemeData(data) {
|
23
|
-
|
27
|
+
storage.setItem('theme', JSON.stringify(data));
|
24
28
|
}
|
25
29
|
|
26
30
|
function loadThemeData() {
|
27
|
-
var data =
|
31
|
+
var data = storage.getItem('theme');
|
28
32
|
try {
|
29
33
|
data = JSON.parse(data ? data : '');
|
30
34
|
} catch(e) {
|
31
|
-
data = { nightShift:
|
35
|
+
data = { nightShift: undefined, autoToggleAt: 0 };
|
32
36
|
saveThemeData(data);
|
33
37
|
}
|
34
38
|
return data;
|
@@ -81,9 +85,6 @@
|
|
81
85
|
handleThemeToggle(event.target.checked);
|
82
86
|
});
|
83
87
|
|
84
|
-
var nightModeOption = '{{ night_mode }}' || 'auto';
|
85
|
-
nightModeOption = nightModeOption.toLowerCase();
|
86
|
-
|
87
88
|
if (nightModeOption == 'auto') {
|
88
89
|
var data = autoThemeToggle();
|
89
90
|
|
@@ -97,7 +98,11 @@
|
|
97
98
|
} else if (nightModeOption == 'manual') {
|
98
99
|
handleThemeToggle(themeData.nightShift);
|
99
100
|
} else {
|
100
|
-
|
101
|
+
var nightShift = themeData.nightShift;
|
102
|
+
if (nightShift === undefined) {
|
103
|
+
nightShift = nightModeOption === 'on';
|
104
|
+
}
|
105
|
+
handleThemeToggle(nightShift);
|
101
106
|
}
|
102
107
|
})();
|
103
108
|
</script>
|
@@ -2,6 +2,9 @@
|
|
2
2
|
{%- assign name = include.params.name -%}
|
3
3
|
{%- endif -%}
|
4
4
|
|
5
|
+
{%- assign keys = name | split:'.'- %}
|
6
|
+
{%- assign name = keys.first -%}
|
7
|
+
|
5
8
|
{%- if page[name] != nil -%}
|
6
9
|
{%- assign return = page[name] -%}
|
7
10
|
{%- elsif site[name] != nil -%}
|
@@ -17,3 +20,13 @@
|
|
17
20
|
{%- else -%}
|
18
21
|
{%- assign return = include.params.default -%}
|
19
22
|
{%- endif -%}
|
23
|
+
|
24
|
+
{%- assign keys = keys | shift -%}
|
25
|
+
{%- for key in keys -%}
|
26
|
+
{%- assign return = return[key] -%}
|
27
|
+
{%- if return == nil -%}
|
28
|
+
{%- assign return = include.params.default -%}
|
29
|
+
{%- break -%}
|
30
|
+
{%- endif -%}
|
31
|
+
{%- endfor -%}
|
32
|
+
|
data/_includes/head.html
CHANGED
@@ -7,16 +7,11 @@
|
|
7
7
|
<link rel="shortcut icon" href="{{ site.favicon }}">
|
8
8
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
9
9
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/typeface-noto-sans@0.0.72/index.min.css">
|
10
|
-
<link rel="stylesheet"
|
11
|
-
href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/default.min.css">
|
12
|
-
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js"></script>
|
13
|
-
<!-- and it's easy to individually load additional languages -->
|
14
|
-
<script charset="UTF-8"
|
15
|
-
src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/languages/go.min.js"></script>
|
16
10
|
<link rel="stylesheet" href="{{ "/assets/css/main.css" | relative_url }}">
|
17
11
|
<script src="{{ "/assets/js/main.js" | relative_url }}"></script>
|
18
12
|
{%- feed_meta -%}
|
19
13
|
{%- if jekyll.environment == 'production' and site.google_analytics -%}
|
20
14
|
{%- include extensions/google-analytics.html -%}
|
21
15
|
{%- endif -%}
|
16
|
+
{%- include extensions/code-highlight.html -%}
|
22
17
|
</head>
|
data/_includes/views/footer.html
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
<div class="wrapper">
|
5
5
|
<div class="site-footer-inner">
|
6
|
-
<div>{{ site.copyright }} @{{ site.author | escape }}</div>
|
6
|
+
<div>{{ site.copyright }} {% if site.author %}@{{ site.author | escape }}{% endif %}</div>
|
7
7
|
<div>Powered by <a title="Jekyll is a simple, blog-aware, static site
|
8
8
|
generator." href="http://jekyllrb.com/">Jekyll</a> & <a title="Yat, yet
|
9
9
|
another theme." href="https://github.com/jeffreytse/jekyll-theme-yat">Yat Theme</a>.</div>
|
data/_sass/yat.scss
CHANGED
data/_sass/yat/_base.scss
CHANGED
@@ -159,26 +159,6 @@ pre {
|
|
159
159
|
position: relative;
|
160
160
|
background-color: #f0f0f0;
|
161
161
|
|
162
|
-
// code language badge
|
163
|
-
&::before {
|
164
|
-
content: attr(data-lang);
|
165
|
-
color: #fff;
|
166
|
-
background-color: #ff4e00;
|
167
|
-
padding: 0 .5em;
|
168
|
-
border-radius: 0 2px;
|
169
|
-
text-transform: uppercase;
|
170
|
-
text-align: center;
|
171
|
-
min-width: 32px;
|
172
|
-
display: inline-block;
|
173
|
-
position: absolute;
|
174
|
-
right: 0;
|
175
|
-
}
|
176
|
-
|
177
|
-
// fix wrong badge display for firefox browser
|
178
|
-
code > table pre::before {
|
179
|
-
display: none;
|
180
|
-
}
|
181
|
-
|
182
162
|
> code {
|
183
163
|
display: inline-block;
|
184
164
|
padding: 20px!important;
|
@@ -225,11 +205,13 @@ pre {
|
|
225
205
|
* Tables
|
226
206
|
*/
|
227
207
|
table {
|
208
|
+
display: block;
|
228
209
|
margin-bottom: $spacing-unit;
|
229
210
|
width: 100%;
|
230
211
|
text-align: $table-text-align;
|
231
212
|
color: lighten($text-color, 5%);
|
232
213
|
border-collapse: collapse;
|
214
|
+
overflow: auto;
|
233
215
|
|
234
216
|
tr {
|
235
217
|
&:nth-child(even) {
|
data/_sass/yat/_dark.scss
CHANGED
@@ -50,11 +50,22 @@ html[data-theme="dark"] {
|
|
50
50
|
.ct-language-dropdown {
|
51
51
|
color: #f8f8f8;
|
52
52
|
background-color: $dark-background-color;
|
53
|
+
box-shadow: 0 0 3px 1px #0000005b;
|
53
54
|
}
|
54
55
|
|
55
56
|
.ct-language-selected, .ct-language-dropdown li:hover {
|
56
57
|
background-color: #222 !important;
|
57
58
|
}
|
59
|
+
|
60
|
+
@include media-query($on-laptop) {
|
61
|
+
.menu-icon > svg {
|
62
|
+
fill: rgba($dark-text-color, 80%);
|
63
|
+
}
|
64
|
+
|
65
|
+
.site-nav input:checked ~ .trigger {
|
66
|
+
background-color: #090909;
|
67
|
+
}
|
68
|
+
}
|
58
69
|
}
|
59
70
|
|
60
71
|
.site-footer {
|
data/_sass/yat/_layout.scss
CHANGED
data/assets/js/main.js
CHANGED
@@ -56,32 +56,3 @@ function smoothScrollTo(y, time) {
|
|
56
56
|
}
|
57
57
|
}
|
58
58
|
|
59
|
-
// Init highlight js
|
60
|
-
document.addEventListener('DOMContentLoaded', function(event) {
|
61
|
-
var els = document.querySelectorAll('pre code')
|
62
|
-
function handle(block) {
|
63
|
-
var outer = block.parentElement.parentElement.parentElement;
|
64
|
-
var lang = block.getAttribute('data-lang');
|
65
|
-
for (var i = 0; i < outer.classList.length; i++) {
|
66
|
-
var cls = outer.classList[i];
|
67
|
-
if (cls.startsWith('language-')) {
|
68
|
-
lang = cls;
|
69
|
-
break;
|
70
|
-
}
|
71
|
-
}
|
72
|
-
if (!lang) {
|
73
|
-
cls = block.getAttribute('class');
|
74
|
-
lang = cls ? cls.replace('hljs ', '') : '';
|
75
|
-
}
|
76
|
-
if (lang.startsWith('language-')) {
|
77
|
-
lang = lang.substr(9);
|
78
|
-
}
|
79
|
-
block.setAttribute('class', 'hljs ' + lang);
|
80
|
-
block.parentNode.setAttribute('data-lang', lang);
|
81
|
-
hljs.highlightBlock(block);
|
82
|
-
}
|
83
|
-
for (var i = 0; i < els.length; i++) {
|
84
|
-
var el = els[i];
|
85
|
-
handle(el);
|
86
|
-
}
|
87
|
-
});
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-theme-yat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jeffreytse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -151,6 +151,7 @@ files:
|
|
151
151
|
- README.md
|
152
152
|
- _data/defaults.yml
|
153
153
|
- _data/translate_langs.yml
|
154
|
+
- _includes/extensions/code-highlight.html
|
154
155
|
- _includes/extensions/comments/disqus.html
|
155
156
|
- _includes/extensions/comments/gitment.html
|
156
157
|
- _includes/extensions/geopattern.html
|
@@ -196,6 +197,7 @@ files:
|
|
196
197
|
- _layouts/tags.html
|
197
198
|
- _sass/misc/article-menu.scss
|
198
199
|
- _sass/misc/common-list.scss
|
200
|
+
- _sass/misc/gitment.scss
|
199
201
|
- _sass/misc/google-translate.scss
|
200
202
|
- _sass/misc/theme-toggle.scss
|
201
203
|
- _sass/yat.scss
|