jekyll-theme-yat 1.5.5 → 1.6.4
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 +56 -6
- data/_includes/extensions/hashlocate.html +1 -1
- data/_includes/extensions/theme-toggle.html +103 -0
- data/_includes/sidebar/article-menu.html +5 -1
- data/_layouts/404.html +0 -1
- data/_layouts/default.html +2 -0
- data/_sass/misc/common-list.scss +1 -1
- data/_sass/misc/google-translate.scss +1 -1
- data/_sass/misc/theme-toggle.scss +79 -0
- data/_sass/yat.scss +3 -2
- data/_sass/yat/_base.scss +9 -4
- data/_sass/yat/_dark.scss +186 -0
- data/_sass/yat/_layout.scss +7 -8
- data/assets/js/main.js +9 -3
- metadata +8 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d16f89597b967a3dbf863b569304d660769634299e54c3b6d03b7e7501bcae0f
|
4
|
+
data.tar.gz: 2ea148e50b2f6a3df84ebbf0245aa7ce8d6cedc6e4d7fae6997bad6fb4d9539b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0133198787f1044e4334a89f6aa9f140f5d319a77f528533aa65798ecfd5744c494b267787cf641f9ff9ba5550c8be2e1c440f35a241f539867de0a0d40bfef
|
7
|
+
data.tar.gz: 1da4f0b6247b01e666457e114cca771cebfe0a65fedd9b191e2f9c6ec11b2de2dbf9a509318b9077f47216b3d10425e9b9624e425e1b174a0561e2c16676135b
|
data/README.md
CHANGED
@@ -18,8 +18,17 @@ Hey, nice to meet you, you found this Jekyll theme. Here the yet another theme i
|
|
18
18
|
|
19
19
|
</p>
|
20
20
|
|
21
|
+
<h3 align="center">Night Mode</h3>
|
22
|
+
|
23
|
+
<p align="center">
|
24
|
+
|
25
|
+
<img src="https://user-images.githubusercontent.com/9413601/94983351-760f6e00-0574-11eb-9494-5303ad6228dc.gif" alt="demo-screenshot" width="780px"/>
|
26
|
+
|
27
|
+
</p>
|
28
|
+
|
21
29
|
## Features
|
22
30
|
|
31
|
+
- Support beautiful __Night Mode__.
|
23
32
|
- Full layouts `home`, `post`, `tags`, `archive` and `about`.
|
24
33
|
- Uses font awesome 5 for icons.
|
25
34
|
- Beautiful Syntax Highlight using [hilight.js][hilight-js].
|
@@ -37,6 +46,14 @@ Also, visit the [Live Demo][yat-live-demo] site for the theme.
|
|
37
46
|
|
38
47
|
## Installation
|
39
48
|
|
49
|
+
There are three ways to install:
|
50
|
+
|
51
|
+
- As a [gem-based theme](https://jekyllrb.com/docs/themes/#understanding-gem-based-themes).
|
52
|
+
- As a [remote theme](https://blog.github.com/2017-11-29-use-any-theme-with-github-pages/) (GitHub Pages compatible).
|
53
|
+
- Forking/directly copying all of the theme files into your project.
|
54
|
+
|
55
|
+
### Gem-based Theme Method
|
56
|
+
|
40
57
|
Add this line to your Jekyll site's `Gemfile`:
|
41
58
|
|
42
59
|
```ruby
|
@@ -51,20 +68,53 @@ theme: jekyll-theme-yat
|
|
51
68
|
|
52
69
|
And then execute:
|
53
70
|
|
54
|
-
|
71
|
+
```bash
|
72
|
+
$ bundle
|
73
|
+
```
|
55
74
|
|
56
75
|
Or install it yourself as:
|
57
76
|
|
58
|
-
|
77
|
+
```bash
|
78
|
+
$ gem install jekyll-theme-yat
|
79
|
+
```
|
59
80
|
|
60
|
-
|
81
|
+
### Remote Theme Method with GitHub Pages
|
61
82
|
|
62
|
-
|
83
|
+
Remote themes are similar to Gem-based themes, but do not require `Gemfile` changes or whitelisting making them ideal for sites hosted with GitHub Pages.
|
84
|
+
|
85
|
+
To install:
|
86
|
+
|
87
|
+
Add this line to your Jekyll site's `Gemfile`:
|
88
|
+
|
89
|
+
```ruby
|
90
|
+
gem "github-pages", group: :jekyll_plugins
|
91
|
+
```
|
92
|
+
|
93
|
+
And add this line to your Jekyll site's `_config.yml`:
|
94
|
+
|
95
|
+
```yaml
|
96
|
+
# theme: owner/name --> Don't forget to remove/comment the gem-based theme option
|
97
|
+
remote_theme: "jeffreytse/jekyll-theme-yat"
|
98
|
+
```
|
99
|
+
|
100
|
+
And then execute:
|
101
|
+
|
102
|
+
```bash
|
103
|
+
$ bundle
|
104
|
+
```
|
105
|
+
|
106
|
+
## GitHub Pages without limitation
|
107
|
+
|
108
|
+
GitHub Pages runs in `safe` mode and only allows [a set of whitelisted plugins/themes](https://pages.github.com/versions/). __In other words, the third-party gems will not work normally__.
|
63
109
|
|
64
|
-
GitHub Pages runs in `safe` mode and only allows [a set of whitelisted plugins](https://pages.github.com/versions/).
|
65
110
|
To use the third-party gem in GitHub Pages without limitation:
|
66
111
|
|
67
|
-
|
112
|
+
Here is a GitHub Action named [jekyll-deploy-action](https://github.com/jeffreytse/jekyll-deploy-action) for Jekyll site deployment conveniently. 👍
|
113
|
+
|
114
|
+
|
115
|
+
## Usage
|
116
|
+
|
117
|
+
Add or update your available layouts, includes, sass and/or assets.
|
68
118
|
|
69
119
|
## Development
|
70
120
|
|
@@ -0,0 +1,103 @@
|
|
1
|
+
<div class="theme-toggle">
|
2
|
+
<input type="checkbox" id="theme-switch">
|
3
|
+
<label for="theme-switch">
|
4
|
+
<div class="toggle"></div>
|
5
|
+
<div class="names">
|
6
|
+
<p class="light">Light</p>
|
7
|
+
<p class="dark">Dark</p>
|
8
|
+
</div>
|
9
|
+
</label>
|
10
|
+
</div>
|
11
|
+
|
12
|
+
{%- assign name = 'night_mode' -%}
|
13
|
+
{%- include functions.html func='get_value' default='auto' -%}
|
14
|
+
{%- assign night_mode = return -%}
|
15
|
+
|
16
|
+
<script>
|
17
|
+
(function() {
|
18
|
+
var sw = document.getElementById('theme-switch');
|
19
|
+
var html = document.getElementsByTagName('html')[0];
|
20
|
+
var themeData = loadThemeData();
|
21
|
+
|
22
|
+
function saveThemeData(data) {
|
23
|
+
localStorage.setItem('theme', JSON.stringify(data));
|
24
|
+
}
|
25
|
+
|
26
|
+
function loadThemeData() {
|
27
|
+
var data = localStorage.getItem('theme');
|
28
|
+
try {
|
29
|
+
data = JSON.parse(data ? data : '');
|
30
|
+
} catch(e) {
|
31
|
+
data = { nightShift: false, autoToggleAt: 0 };
|
32
|
+
saveThemeData(data);
|
33
|
+
}
|
34
|
+
return data;
|
35
|
+
}
|
36
|
+
|
37
|
+
function handleThemeToggle(nightShift) {
|
38
|
+
themeData.nightShift = nightShift;
|
39
|
+
saveThemeData(themeData);
|
40
|
+
html.dataset.theme = nightShift ? 'dark' : 'light';
|
41
|
+
setTimeout(function() {
|
42
|
+
sw.checked = nightShift ? true : false;
|
43
|
+
}, 50);
|
44
|
+
}
|
45
|
+
|
46
|
+
function autoThemeToggle() {
|
47
|
+
// Next time point of theme toggle
|
48
|
+
var now = new Date();
|
49
|
+
var toggleAt = new Date();
|
50
|
+
var hours = now.getHours();
|
51
|
+
var nightShift = hours >= 19 || hours <=7;
|
52
|
+
|
53
|
+
if (nightShift) {
|
54
|
+
if (hours > 7) {
|
55
|
+
toggleAt.setDate(toggleAt.getDate() + 1);
|
56
|
+
}
|
57
|
+
toggleAt.setHours(7);
|
58
|
+
} else {
|
59
|
+
toggleAt.setHours(19);
|
60
|
+
}
|
61
|
+
|
62
|
+
toggleAt.setMinutes(0);
|
63
|
+
toggleAt.setSeconds(0);
|
64
|
+
toggleAt.setMilliseconds(0)
|
65
|
+
|
66
|
+
var delay = toggleAt.getTime() - now.getTime();
|
67
|
+
|
68
|
+
// auto toggle theme mode
|
69
|
+
setTimeout(function() {
|
70
|
+
handleThemeToggle(!nightShift);
|
71
|
+
}, delay);
|
72
|
+
|
73
|
+
return {
|
74
|
+
nightShift: nightShift,
|
75
|
+
toggleAt: toggleAt.getTime()
|
76
|
+
};
|
77
|
+
}
|
78
|
+
|
79
|
+
// Listen the theme toggle event
|
80
|
+
sw.addEventListener('change', function(event) {
|
81
|
+
handleThemeToggle(event.target.checked);
|
82
|
+
});
|
83
|
+
|
84
|
+
var nightModeOption = '{{ night_mode }}' || 'auto';
|
85
|
+
nightModeOption = nightModeOption.toLowerCase();
|
86
|
+
|
87
|
+
if (nightModeOption == 'auto') {
|
88
|
+
var data = autoThemeToggle();
|
89
|
+
|
90
|
+
// Toggle theme by local setting
|
91
|
+
if (data.toggleAt > themeData.autoToggleAt) {
|
92
|
+
themeData.autoToggleAt = data.toggleAt;
|
93
|
+
handleThemeToggle(data.nightShift);
|
94
|
+
} else {
|
95
|
+
handleThemeToggle(themeData.nightShift);
|
96
|
+
}
|
97
|
+
} else if (nightModeOption == 'manual') {
|
98
|
+
handleThemeToggle(themeData.nightShift);
|
99
|
+
} else {
|
100
|
+
handleThemeToggle(nightModeOption == 'on');
|
101
|
+
}
|
102
|
+
})();
|
103
|
+
</script>
|
@@ -36,9 +36,13 @@
|
|
36
36
|
// The header element
|
37
37
|
var header = document.querySelector('header.site-header');
|
38
38
|
|
39
|
-
function doMenuCollapse(index, over_items
|
39
|
+
function doMenuCollapse(index, over_items) {
|
40
40
|
var items = menuContent.firstChild.children;
|
41
41
|
|
42
|
+
if (over_items == undefined) {
|
43
|
+
over_items = 20;
|
44
|
+
}
|
45
|
+
|
42
46
|
if (items.length < over_items) {
|
43
47
|
return;
|
44
48
|
}
|
data/_layouts/404.html
CHANGED
data/_layouts/default.html
CHANGED
data/_sass/misc/common-list.scss
CHANGED
@@ -0,0 +1,79 @@
|
|
1
|
+
.theme-toggle {
|
2
|
+
position: relative;
|
3
|
+
width: $base-font-size * 7.65;
|
4
|
+
margin-top: 10px;
|
5
|
+
margin-right: 60px;
|
6
|
+
margin-left: auto;
|
7
|
+
transition: 0.1s all ease-in-out;
|
8
|
+
|
9
|
+
label, .toggle {
|
10
|
+
border-radius: 100px;
|
11
|
+
}
|
12
|
+
|
13
|
+
label {
|
14
|
+
display: block;
|
15
|
+
background-color: rgba(120,120,120,.15);
|
16
|
+
cursor: pointer;
|
17
|
+
}
|
18
|
+
|
19
|
+
.toggle {
|
20
|
+
position: absolute;
|
21
|
+
width: 50%;
|
22
|
+
height: 100%;
|
23
|
+
background-color: #fff;
|
24
|
+
box-shadow: 0 2px 15px rgba(0,0,0,.15);
|
25
|
+
transition: transform .2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
|
26
|
+
}
|
27
|
+
|
28
|
+
.names {
|
29
|
+
font-size: 1em;
|
30
|
+
font-weight: bolder;
|
31
|
+
width: 76%;
|
32
|
+
margin-left: 12%;
|
33
|
+
position: relative;
|
34
|
+
display: flex;
|
35
|
+
justify-content: space-between;
|
36
|
+
user-select: none;
|
37
|
+
}
|
38
|
+
|
39
|
+
.dark {
|
40
|
+
opacity: .5;
|
41
|
+
}
|
42
|
+
|
43
|
+
p {
|
44
|
+
color: #acacac;
|
45
|
+
margin-bottom: 0;
|
46
|
+
line-height: 24px;
|
47
|
+
}
|
48
|
+
|
49
|
+
[type="checkbox"] {
|
50
|
+
display: none;
|
51
|
+
}
|
52
|
+
|
53
|
+
/* Toggle */
|
54
|
+
[type="checkbox"]:checked ~ label .toggle {
|
55
|
+
transform: translateX(100%);
|
56
|
+
background-color: #34323D;
|
57
|
+
}
|
58
|
+
|
59
|
+
[type="checkbox"]:checked ~ label .dark{
|
60
|
+
opacity: 1;
|
61
|
+
}
|
62
|
+
|
63
|
+
[type="checkbox"]:checked ~ label .light{
|
64
|
+
opacity: .5;
|
65
|
+
}
|
66
|
+
|
67
|
+
@include media-query(1024px) {
|
68
|
+
margin-right: 35px;
|
69
|
+
}
|
70
|
+
|
71
|
+
@include media-query($on-palm) {
|
72
|
+
width: $base-font-size * 6.65;
|
73
|
+
margin-right: 20px;
|
74
|
+
|
75
|
+
.names {
|
76
|
+
font-size: .85em;
|
77
|
+
}
|
78
|
+
}
|
79
|
+
}
|
data/_sass/yat.scss
CHANGED
@@ -10,7 +10,7 @@ $base-line-height: 1.6 !default;
|
|
10
10
|
|
11
11
|
$spacing-unit: 30px !default;
|
12
12
|
|
13
|
-
$text-color: #
|
13
|
+
$text-color: #454545 !default;
|
14
14
|
$background-color: #fff !default;
|
15
15
|
$brand-color: #ff5100 !default;
|
16
16
|
|
@@ -61,7 +61,8 @@ $on-laptop: 800px !default;
|
|
61
61
|
@import
|
62
62
|
"yat/base",
|
63
63
|
"yat/layout",
|
64
|
-
|
64
|
+
"yat/dark",
|
65
|
+
"misc/theme-toggle",
|
65
66
|
"misc/article-menu",
|
66
67
|
"misc/common-list",
|
67
68
|
"misc/google-translate"
|
data/_sass/yat/_base.scss
CHANGED
@@ -148,10 +148,10 @@ code {
|
|
148
148
|
}
|
149
149
|
|
150
150
|
*:not(pre) > code {
|
151
|
-
padding:
|
151
|
+
padding: 3px 6px;
|
152
152
|
border-radius: 3px;
|
153
|
-
color: #
|
154
|
-
|
153
|
+
background-color: #eee;
|
154
|
+
margin: 0 5px;
|
155
155
|
}
|
156
156
|
|
157
157
|
pre {
|
@@ -160,7 +160,7 @@ pre {
|
|
160
160
|
background-color: #f0f0f0;
|
161
161
|
|
162
162
|
// code language badge
|
163
|
-
|
163
|
+
&::before {
|
164
164
|
content: attr(data-lang);
|
165
165
|
color: #fff;
|
166
166
|
background-color: #ff4e00;
|
@@ -174,6 +174,11 @@ pre {
|
|
174
174
|
right: 0;
|
175
175
|
}
|
176
176
|
|
177
|
+
// fix wrong badge display for firefox browser
|
178
|
+
code > table pre::before {
|
179
|
+
display: none;
|
180
|
+
}
|
181
|
+
|
177
182
|
> code {
|
178
183
|
display: inline-block;
|
179
184
|
padding: 20px!important;
|
@@ -0,0 +1,186 @@
|
|
1
|
+
$dark-background-color: #0e0e0e !default;
|
2
|
+
$dark-text-color: #bbb !default;
|
3
|
+
|
4
|
+
html[data-theme="dark"] {
|
5
|
+
|
6
|
+
&[data-scroll-status='top'] {
|
7
|
+
.site-footer-inner {
|
8
|
+
border-top: solid 1px #2f2f2f !important;
|
9
|
+
transition: 0s;
|
10
|
+
}
|
11
|
+
}
|
12
|
+
|
13
|
+
body {
|
14
|
+
color: $dark-text-color;
|
15
|
+
background-color: $dark-background-color;
|
16
|
+
}
|
17
|
+
|
18
|
+
*:not(pre) > code {
|
19
|
+
color: $dark-text-color;
|
20
|
+
background-color: #454545;
|
21
|
+
}
|
22
|
+
|
23
|
+
table {
|
24
|
+
color: #9d9d9d;
|
25
|
+
|
26
|
+
th {
|
27
|
+
background-color: #050505;
|
28
|
+
}
|
29
|
+
|
30
|
+
tr:nth-child(even) {
|
31
|
+
background-color: #080808;
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
.site-header {
|
36
|
+
background-color: #090909;
|
37
|
+
|
38
|
+
.site-brand {
|
39
|
+
.site-brand-inner {
|
40
|
+
&, &:visited {
|
41
|
+
color: #f8f8f8;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
}
|
45
|
+
|
46
|
+
.site-nav .page-link {
|
47
|
+
color: #f8f8f8;
|
48
|
+
}
|
49
|
+
|
50
|
+
.ct-language-dropdown {
|
51
|
+
color: #f8f8f8;
|
52
|
+
background-color: $dark-background-color;
|
53
|
+
}
|
54
|
+
|
55
|
+
.ct-language-selected, .ct-language-dropdown li:hover {
|
56
|
+
background-color: #222 !important;
|
57
|
+
}
|
58
|
+
}
|
59
|
+
|
60
|
+
.site-footer {
|
61
|
+
color: #fff;
|
62
|
+
background-color: #000;
|
63
|
+
}
|
64
|
+
|
65
|
+
.left-vsplit:before {
|
66
|
+
background-color: #9a9a9a;
|
67
|
+
}
|
68
|
+
|
69
|
+
.page-banner {
|
70
|
+
.page-banner-img {
|
71
|
+
& > *:first-child {
|
72
|
+
opacity: 0.8;
|
73
|
+
}
|
74
|
+
}
|
75
|
+
}
|
76
|
+
|
77
|
+
.pagination {
|
78
|
+
.post-link {
|
79
|
+
color: $dark-text-color;
|
80
|
+
}
|
81
|
+
|
82
|
+
.post-title {
|
83
|
+
a:visited:after {
|
84
|
+
background-color: $dark-background-color;
|
85
|
+
}
|
86
|
+
|
87
|
+
a:after {
|
88
|
+
color: $dark-background-color;
|
89
|
+
}
|
90
|
+
}
|
91
|
+
|
92
|
+
.post-list {
|
93
|
+
& > li:not(:last-child) {
|
94
|
+
border-bottom: 1px solid #545454;
|
95
|
+
}
|
96
|
+
}
|
97
|
+
|
98
|
+
.post-tags .post-tag:hover {
|
99
|
+
color: #d7d7d7;
|
100
|
+
}
|
101
|
+
}
|
102
|
+
|
103
|
+
.page-segments {
|
104
|
+
li {
|
105
|
+
a {
|
106
|
+
color: #ddd;
|
107
|
+
}
|
108
|
+
|
109
|
+
a:visited:after {
|
110
|
+
background-color: $dark-background-color;
|
111
|
+
}
|
112
|
+
|
113
|
+
a:after {
|
114
|
+
color: $dark-background-color;
|
115
|
+
}
|
116
|
+
}
|
117
|
+
}
|
118
|
+
|
119
|
+
.post .post-content {
|
120
|
+
img:not([raw]) {
|
121
|
+
background-color: #ffffff33;
|
122
|
+
}
|
123
|
+
}
|
124
|
+
|
125
|
+
.post-related {
|
126
|
+
& > *:first-child {
|
127
|
+
color: #d7d7d7;
|
128
|
+
}
|
129
|
+
|
130
|
+
a:visited:after {
|
131
|
+
background-color: $dark-background-color;
|
132
|
+
}
|
133
|
+
|
134
|
+
a:after {
|
135
|
+
color: $dark-background-color;
|
136
|
+
}
|
137
|
+
|
138
|
+
a:hover {
|
139
|
+
color: #aaa;
|
140
|
+
}
|
141
|
+
}
|
142
|
+
|
143
|
+
.common-list {
|
144
|
+
li {
|
145
|
+
border-bottom: solid 1px #40404088;
|
146
|
+
|
147
|
+
a {
|
148
|
+
color: #aaa;
|
149
|
+
}
|
150
|
+
|
151
|
+
a:hover {
|
152
|
+
background-color: #272727;
|
153
|
+
}
|
154
|
+
|
155
|
+
span {
|
156
|
+
background-color: #333;
|
157
|
+
}
|
158
|
+
}
|
159
|
+
}
|
160
|
+
|
161
|
+
.post-menu {
|
162
|
+
.post-menu-title {
|
163
|
+
color: #ddd;
|
164
|
+
}
|
165
|
+
|
166
|
+
.post-menu-content {
|
167
|
+
ul {
|
168
|
+
border-left: 1px solid #787878;
|
169
|
+
|
170
|
+
.active {
|
171
|
+
background-color: #2d2d2d;
|
172
|
+
border-left: 2px solid #aaa;
|
173
|
+
}
|
174
|
+
|
175
|
+
a {
|
176
|
+
color: $dark-text-color;
|
177
|
+
}
|
178
|
+
|
179
|
+
a:hover {
|
180
|
+
color: #fff !important;
|
181
|
+
}
|
182
|
+
}
|
183
|
+
}
|
184
|
+
}
|
185
|
+
}
|
186
|
+
|
data/_sass/yat/_layout.scss
CHANGED
@@ -11,7 +11,7 @@ html {
|
|
11
11
|
&[data-scroll-status='top'] {
|
12
12
|
header.site-header-transparent {
|
13
13
|
height: 0;
|
14
|
-
margin-top:
|
14
|
+
margin-top: 12px;
|
15
15
|
background-color: transparent;
|
16
16
|
transition: 0.1s height,background-color,box-shadow;
|
17
17
|
|
@@ -228,10 +228,10 @@ html {
|
|
228
228
|
}
|
229
229
|
|
230
230
|
.post-tags {
|
231
|
-
display: inline-block;
|
232
231
|
padding-right: 150px;
|
233
232
|
|
234
233
|
.post-tag {
|
234
|
+
display: inline-block;
|
235
235
|
margin: 0 12px 0 0;
|
236
236
|
}
|
237
237
|
}
|
@@ -244,6 +244,7 @@ html {
|
|
244
244
|
@extend %flex-1; /* <-- Keep footer on the bottom */
|
245
245
|
-ms-flex: none; /* <-- Fix IE footer issue */
|
246
246
|
padding: $spacing-unit * 2 0;
|
247
|
+
padding-top: 72px;
|
247
248
|
}
|
248
249
|
|
249
250
|
.page-heading {
|
@@ -326,7 +327,7 @@ html {
|
|
326
327
|
}
|
327
328
|
|
328
329
|
&:hover {
|
329
|
-
color: #
|
330
|
+
color: #787878;
|
330
331
|
}
|
331
332
|
}
|
332
333
|
|
@@ -359,10 +360,6 @@ html {
|
|
359
360
|
color: #b3b3b3;
|
360
361
|
}
|
361
362
|
|
362
|
-
a:hover {
|
363
|
-
color: #000;
|
364
|
-
}
|
365
|
-
|
366
363
|
.indicator {
|
367
364
|
padding: 0 15px;
|
368
365
|
}
|
@@ -392,6 +389,7 @@ html {
|
|
392
389
|
|
393
390
|
.post-content {
|
394
391
|
margin-bottom: $spacing-unit;
|
392
|
+
overflow-x: auto;
|
395
393
|
overflow-wrap: normal;
|
396
394
|
word-wrap: normal;
|
397
395
|
word-break: normal;
|
@@ -500,6 +498,7 @@ html {
|
|
500
498
|
@include relative-font-size(1.125);
|
501
499
|
line-height: 15px;
|
502
500
|
color: #666;
|
501
|
+
max-width: 50%;
|
503
502
|
}
|
504
503
|
|
505
504
|
.previous:before {
|
@@ -560,7 +559,6 @@ html {
|
|
560
559
|
height: $banner-height;
|
561
560
|
background-color: $banner-background;
|
562
561
|
transition: height 0.2s;
|
563
|
-
margin-bottom: 32px;
|
564
562
|
|
565
563
|
.page-banner-img {
|
566
564
|
position: absolute;
|
@@ -570,6 +568,7 @@ html {
|
|
570
568
|
|
571
569
|
& > *:first-child {
|
572
570
|
@include center-image;
|
571
|
+
transition: 0.1s all ease-in-out;
|
573
572
|
}
|
574
573
|
}
|
575
574
|
|
data/assets/js/main.js
CHANGED
@@ -58,10 +58,12 @@ function smoothScrollTo(y, time) {
|
|
58
58
|
|
59
59
|
// Init highlight js
|
60
60
|
document.addEventListener('DOMContentLoaded', function(event) {
|
61
|
-
document.querySelectorAll('pre code')
|
61
|
+
var els = document.querySelectorAll('pre code')
|
62
|
+
function handle(block) {
|
62
63
|
var outer = block.parentElement.parentElement.parentElement;
|
63
64
|
var lang = block.getAttribute('data-lang');
|
64
|
-
for (var
|
65
|
+
for (var i = 0; i < outer.classList.length; i++) {
|
66
|
+
var cls = outer.classList[i];
|
65
67
|
if (cls.startsWith('language-')) {
|
66
68
|
lang = cls;
|
67
69
|
break;
|
@@ -77,5 +79,9 @@ document.addEventListener('DOMContentLoaded', function(event) {
|
|
77
79
|
block.setAttribute('class', 'hljs ' + lang);
|
78
80
|
block.parentNode.setAttribute('data-lang', lang);
|
79
81
|
hljs.highlightBlock(block);
|
80
|
-
}
|
82
|
+
}
|
83
|
+
for (var i = 0; i < els.length; i++) {
|
84
|
+
var el = els[i];
|
85
|
+
handle(el);
|
86
|
+
}
|
81
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.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jeffreytse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -158,6 +158,7 @@ files:
|
|
158
158
|
- _includes/extensions/google-translate.html
|
159
159
|
- _includes/extensions/hashlocate.html
|
160
160
|
- _includes/extensions/mathjax.html
|
161
|
+
- _includes/extensions/theme-toggle.html
|
161
162
|
- _includes/extensions/trianglify.html
|
162
163
|
- _includes/functions.html
|
163
164
|
- _includes/functions/get_categories.html
|
@@ -196,8 +197,10 @@ files:
|
|
196
197
|
- _sass/misc/article-menu.scss
|
197
198
|
- _sass/misc/common-list.scss
|
198
199
|
- _sass/misc/google-translate.scss
|
200
|
+
- _sass/misc/theme-toggle.scss
|
199
201
|
- _sass/yat.scss
|
200
202
|
- _sass/yat/_base.scss
|
203
|
+
- _sass/yat/_dark.scss
|
201
204
|
- _sass/yat/_layout.scss
|
202
205
|
- assets/css/main.scss
|
203
206
|
- assets/images/banners/home.jpeg
|
@@ -222,8 +225,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
222
225
|
- !ruby/object:Gem::Version
|
223
226
|
version: '0'
|
224
227
|
requirements: []
|
225
|
-
rubygems_version: 3.
|
228
|
+
rubygems_version: 3.0.8
|
226
229
|
signing_key:
|
227
230
|
specification_version: 4
|
228
|
-
summary: Yet another theme for elegant writers with modern flat style
|
231
|
+
summary: Yet another theme for elegant writers with modern flat style and beautiful
|
232
|
+
night/dark mode.
|
229
233
|
test_files: []
|