jekyll-theme-yat 1.6.0 → 1.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b89d81bb145293e81ec3ce978f1edd21f7fc3d6f415582cfa96162f9f56db586
4
- data.tar.gz: 99a004e736ff24d67ea6e89f54b8cc166c6551517892d44660fdcaeec48152be
3
+ metadata.gz: 33ad64189dbb0e80834f1dec85a7327ea7fac4a20dcad45adfac9da1265a2ff6
4
+ data.tar.gz: e927ef2806d2d939b8c61e3fd0f7247a285d0d1d131177859a6516beba2d225b
5
5
  SHA512:
6
- metadata.gz: c75c4559995c0fe4766848031f1bc8d02335674e474e54fe1ffacaa6c7dafca04db93c8d277eae42169d3bea9f8c9cf7fecd6f10d7c5c13d7a172e4b62c0c034
7
- data.tar.gz: 82379c7e536507ac69df959573ff951cae42e36a023b7a9833a067736275500879bceb98507704f08f231cbd5d15c0690b28126e4dcc694a10364e86d89bb4c6
6
+ metadata.gz: 4ff46c013cf3e91f16542c871168641961d0949e0a4afa4112defb1c52a3ccdd76e0986efcab2ca9aa323deb69460dc4e92c8894997b07605395ae296af72ab8
7
+ data.tar.gz: 64cc10e3dde27ec64395fc0527f10c94f84b1f14b40d455b433faf3ed01c069d8bd3d94bea5471d0604127a27e4db2694920c5a96b77d55d94f39bdd4ce9b1d0
data/README.md CHANGED
@@ -46,6 +46,14 @@ Also, visit the [Live Demo][yat-live-demo] site for the theme.
46
46
 
47
47
  ## Installation
48
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
+
49
57
  Add this line to your Jekyll site's `Gemfile`:
50
58
 
51
59
  ```ruby
@@ -60,20 +68,53 @@ theme: jekyll-theme-yat
60
68
 
61
69
  And then execute:
62
70
 
63
- $ bundle
71
+ ```bash
72
+ $ bundle
73
+ ```
64
74
 
65
75
  Or install it yourself as:
66
76
 
67
- $ gem install jekyll-theme-yat
77
+ ```bash
78
+ $ gem install jekyll-theme-yat
79
+ ```
68
80
 
69
- ## Usage
81
+ ### Remote Theme Method with GitHub Pages
70
82
 
71
- Add or update your available layouts, includes, sass and/or assets.
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__.
72
109
 
73
- GitHub Pages runs in `safe` mode and only allows [a set of whitelisted plugins](https://pages.github.com/versions/).
74
110
  To use the third-party gem in GitHub Pages without limitation:
75
111
 
76
- * Here is a GitHub Action named [jekyll-deploy-action](https://github.com/jeffreytse/jekyll-deploy-action) for Jekyll site deployment conveniently. 👍
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.
77
118
 
78
119
  ## Development
79
120
 
@@ -9,6 +9,10 @@
9
9
  </label>
10
10
  </div>
11
11
 
12
+ {%- assign name = 'night_mode' -%}
13
+ {%- include functions.html func='get_value' default='auto' -%}
14
+ {%- assign night_mode = return -%}
15
+
12
16
  <script>
13
17
  (function() {
14
18
  var sw = document.getElementById('theme-switch');
@@ -24,7 +28,7 @@
24
28
  try {
25
29
  data = JSON.parse(data ? data : '');
26
30
  } catch(e) {
27
- data = { nightShift: null, autoToggleAt: 0 };
31
+ data = { nightShift: false, autoToggleAt: 0 };
28
32
  saveThemeData(data);
29
33
  }
30
34
  return data;
@@ -72,19 +76,28 @@
72
76
  };
73
77
  }
74
78
 
75
- var data = autoThemeToggle();
76
-
77
79
  // Listen the theme toggle event
78
80
  sw.addEventListener('change', function(event) {
79
81
  handleThemeToggle(event.target.checked);
80
82
  });
81
83
 
82
- // Toggle theme by local setting
83
- if (data.toggleAt > themeData.autoToggleAt) {
84
- themeData.autoToggleAt = data.toggleAt;
85
- handleThemeToggle(data.nightShift);
86
- } else {
84
+ var nightModeOption = '{{ night_mode }}';
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 == 'mannual') {
87
98
  handleThemeToggle(themeData.nightShift);
99
+ } else {
100
+ handleThemeToggle(nightModeOption == 'on');
88
101
  }
89
102
  })();
90
103
  </script>
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.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - jeffreytse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-03 00:00:00.000000000 Z
11
+ date: 2020-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -228,5 +228,6 @@ requirements: []
228
228
  rubygems_version: 3.1.4
229
229
  signing_key:
230
230
  specification_version: 4
231
- 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.
232
233
  test_files: []