jekyll-theme-kagami 0.1.12 → 0.2.0

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
- SHA1:
3
- metadata.gz: eb08384ae23f21cbcaa55cd047831fb0f1d6b5d6
4
- data.tar.gz: 051cd83887640fc3879fd88d2ad293fd5312e9d0
2
+ SHA256:
3
+ metadata.gz: 19895b30a3f5482123635a2a024a0bc5a643d95dc76c0076f2d0a302436c62e5
4
+ data.tar.gz: 8f26714b5bb4ae0c9ebb56df2541eb9d4d3a673cc4a2ed7838c19e2a36446b68
5
5
  SHA512:
6
- metadata.gz: 85de1f9a315b180f68f29b587e8e37495bff8debcb35a2e662ad74df78c5b48130dddecc3008b02555410f94237fd3a262ff74f152127db32c8c99970711cbbd
7
- data.tar.gz: 26013bcd56eb8280be3263b877d624eefb6ef098caa2822219d6977a17ffbce0c2c13186893bcd9c10851883142d7e40de78f9277ccbd19c5115876563154e1c
6
+ metadata.gz: c1e2358a12f50e7fb89cd8fe8fb161eeda4363af06a5d7b565d8ac9ce9c2c18e6df581b98e8ca8fb950563ca0e5e18799c7cd4b8e02462bd13103abec6511cfb
7
+ data.tar.gz: d80d68bd36f4c1fd7b0daaf91e43c3060715c568240cdbd19286893317cc90608fbc63691484834e2a18070ad4008599697eb2bbdeaab7ff855f899647461d31
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![Build Status](https://travis-ci.org/kamikat/jekyll-theme-kagami.svg?branch=master)](https://travis-ci.org/kamikat/jekyll-theme-kagami)
4
4
  [![Gem Version](https://badge.fury.io/rb/jekyll-theme-kagami.svg)](https://badge.fury.io/rb/jekyll-theme-kagami)
5
5
 
6
- A peaceful theme for Jekyll and GitHub Pages.
6
+ Simple and clean theme for Jekyll and GitHub Pages.
7
7
 
8
8
  ![Screenshot](https://s2.banana.moe/docs/kagami-preview@2x.png)
9
9
 
@@ -66,11 +66,9 @@ Add the following lines to choose a color scheme:
66
66
  color_scheme: github
67
67
  ```
68
68
 
69
- ### Enabling comments (via Disqus)
69
+ ### Comment service (Disqus or Gitalk)
70
70
 
71
- Optionally, if you have a Disqus account, you can tell Jekyll to use it to show a comments section below each post.
72
-
73
- To enable it, add the following lines to your Jekyll site:
71
+ Add the following lines to your Jekyll site to enable Disqus comment service:
74
72
 
75
73
  ```yaml
76
74
  disqus_shortname: my_disqus_shortname
@@ -78,11 +76,23 @@ disqus_shortname: my_disqus_shortname
78
76
 
79
77
  You can find out more about Disqus' shortnames [here](https://help.disqus.com/customer/portal/articles/466208).
80
78
 
81
- Comments are enabled by default and will only appear in production, i.e., `JEKYLL_ENV=production`
79
+ For [Gitalk](https://github.com/gitalk/gitalk#options):
80
+
81
+ ```yaml
82
+ gitalk:
83
+ id: <clientID>
84
+ secret: <clientSecret>
85
+ repo: <repo>
86
+ owner: <owner> # (optional) if not set, value of `github_username` will be used
87
+ admin: <admin> # (optional) if not set, value of `github_username` will be used
88
+ proxy: ... # (optional)
89
+ ```
90
+
91
+ By default, comment service will only be enabled in production mode, set an environment `JEKYLL_ENV=production` for local test.
82
92
 
83
- If you don't want to display comments for a particular post you can disable them by adding `comments: false` to that post's YAML Front Matter.
93
+ If you don't want to comments for particular posts you can disable that by adding `comments: false` to the post's YAML Front Matter.
84
94
 
85
- ### Enabling Google Analytics
95
+ ### Google Analytics
86
96
 
87
97
  To enable Google Anaytics, add the following lines to your Jekyll site:
88
98
 
@@ -92,16 +102,15 @@ google_analytics: UA-NNNNNNNN-N
92
102
 
93
103
  Google Analytics will only appear in production, i.e., `JEKYLL_ENV=production`
94
104
 
95
- ### Navigation
105
+ ### Navigation Bar
96
106
 
97
- Pages and posts can be listed as navigation item in header of pages. Add following frontmatter will make it
107
+ Pages and posts can be registered as navigation item with following frontmatter:
98
108
 
99
109
  ```yaml
100
- navlevel: header
101
- navtitle: Awesome Title # optional, specifies the text to display on navigation item
110
+ navbar_title: Awesome Title # specifies the text to display as navigation item
102
111
  ```
103
112
 
104
- Navigation items are ordered in alphabetical order by default in Jekyll. While you can adjust the order manually using
113
+ Navigation items are ordered in alphabetical order by default in Jekyll. Adjust the order manually with a `position` value:
105
114
 
106
115
  ```yaml
107
116
  position: 999
@@ -109,7 +118,7 @@ position: 999
109
118
 
110
119
  ### Tags and category
111
120
 
112
- Layout file `post-list` supports filters by tag or category. Create pages with following frontmatter will generate a filtered post list.
121
+ Layout file `post-list` supports filtering by tag or category. Create pages with following frontmatter will generate a filtered post list.
113
122
 
114
123
  ```yaml
115
124
  title: Title of Tag Page
@@ -130,7 +139,7 @@ Results from multiple filters are combined (logical 'or') into the result.
130
139
 
131
140
  A more flexible filter strategy is supported by supplying liquid expression to `by_expression` parameter in which post object can be referenced by the name `post`.
132
141
 
133
- ### Enabling MathJax
142
+ ### MathJax
134
143
 
135
144
  You can use MathJax with Kramdown's [built-in support](https://kramdown.gettalong.org/syntax.html#math-blocks).
136
145
 
@@ -141,6 +150,17 @@ or post's front matter stuff:
141
150
  mathjax: true
142
151
  ```
143
152
 
153
+ ### Mermaid
154
+
155
+ To enable [mermaid](https://mermaid-js.github.io/mermaid/), add following line to
156
+ the site configuration or post's front matter stuff:
157
+
158
+ ```yaml
159
+ mermaid: true
160
+ ```
161
+
162
+ Code blocks with `mermaid` language tag should be transformed into diagrams.
163
+
144
164
  ### Use `.side-note` and `.retina2x`
145
165
 
146
166
  Taking advantages of [Block/span IAL](https://kramdown.gettalong.org/syntax.html#block-ials),
@@ -166,7 +186,7 @@ Bug reports and pull requests are welcome on GitHub at <https://github.com/kamik
166
186
 
167
187
  To set up your environment to develop this theme, run `bundle install`.
168
188
 
169
- Your theme is setup just like a normal Jekyll site! To test your theme, run `bundle exec jekyll serve` and open your browser at `http://localhost:4000`. This starts a Jekyll server using your theme. Add pages, documents, data, etc. like normal to test your theme's contents. As you make modifications to your theme and to your content, your site will regenerate and you should see the changes in the browser after a refresh, just like normal.
189
+ Your theme is setup just like a normal Jekyll site! To test your theme, run `bundle exec jekyll serve -s example` and open your browser at `http://localhost:4000`. This starts a Jekyll server using your theme. Add pages, documents, data, etc. like normal to test your theme's contents. As you make modifications to your theme and to your content, your site will regenerate and you should see the changes in the browser after a refresh, just like normal.
170
190
 
171
191
  When your theme is released, only the files in `_layouts`, `_includes`, and `_sass` tracked with Git will be released.
172
192
 
@@ -0,0 +1,12 @@
1
+ <script>
2
+ (function(elements) {
3
+ var elements = Array.prototype.slice.call(document.getElementsByClassName('baseline-fix'));
4
+ for (var i = 0; i != elements.length; i++) {
5
+ var el = elements[i];
6
+ el.innerHTML = el.innerHTML.replace(/[\u2000-\u206e⸀-\u2e7e⺀-\u2efe⼀-\u2fde⿰-\u2ffe\u3000-〾\u3040-ゞ゠-ヾ\u3100-\u312e\u3130-ㆎ㆐-㆞ㆠ-\u31be㇀-\u31eeㇰ-ㇾ㈀-㋾㌀-㏾㐀-\u4dbe一-\u9ffe\ua960-\ua97e가-\ud7ae\ud7b0-\ud7fe豈-\ufafe︰-﹎\uff00-○]|[\ud840-\ud868\ud86a-\ud86c][\udc00-\udfff]|\ud82c[\udc00-\udcfe]|\ud869[\udc00-\udede\udf00-\udfff]|\ud86d[\udc00-\udf3e\udf40-\udfff]|\ud86e[\udc00-\udc1e]|\ud87e[\udc00-\ude1e]/g, function (ch) {
7
+ return '<span class="baseline-fix-block">' + ch + '<' + '/span>';
8
+ });
9
+ el.classList.remove('baseline-fix');
10
+ }
11
+ })(Array.prototype.slice.call(document.getElementsByClassName('baseline-fix')));
12
+ </script>
@@ -0,0 +1,18 @@
1
+ <div id="gitalk-container"></div>
2
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.css">
3
+ <script src="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js"></script>
4
+ <script>
5
+ var gitalk = new Gitalk({
6
+ id: '{{ page.title }}',
7
+ clientID: '{{ site.gitalk.id }}',
8
+ clientSecret: '{{ site.gitalk.secret }}',
9
+ repo: '{{ site.gitalk.repo | default: site.gitalk.repository }}',
10
+ owner: '{{ site.gitalk.owner | default: site.github_username }}',
11
+ admin: ['{{ site.gitalk.admin | default: site.github_username }}'],
12
+ body: location.href,
13
+ proxy: '{{ site.gitalk.proxy | default: "https://cors-anywhere.azm.workers.dev/https://github.com/login/oauth/access_token" }}',
14
+ language: '{{ site.lang | default: "en" }}',
15
+ distractionFreeMode: false
16
+ })
17
+ gitalk.render('gitalk-container')
18
+ </script>
@@ -1,6 +1,6 @@
1
1
  <header class="post-header">
2
2
  <a class="site-title" href="{{ "/" | relative_url }}">{{ site.title | escape }}</a>
3
- <h1 class="post-title" itemprop="name headline">{{ page.title | escape | replace: "​", "<wbr>" }}</h1>
3
+ <h1 class="post-title baseline-fix" itemprop="name headline">{{ page.title | escape | replace: "​", "<wbr>" }}</h1>
4
4
  </header>
5
5
 
6
6
  {% if page.cover_url %}
@@ -0,0 +1,14 @@
1
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
2
+ <script type="text/javascript">
3
+ (function () {
4
+ mermaid.init({ startOnLoad: true }, "pre code.language-mermaid", function () {
5
+ const codeBlock = document.querySelector('code.language-mermaid');
6
+ codeBlock.style.backgroundColor = 'initial';
7
+
8
+ const preBlock = codeBlock.parentNode;
9
+ preBlock.style.border = 'none';
10
+ preBlock.style.textAlign = 'center';
11
+ preBlock.style.backgroundColor = 'initial';
12
+ });
13
+ })();
14
+ </script>
@@ -1,6 +1,8 @@
1
1
  <nav class="site-nav">
2
- {% assign sorted_pages = site.pages | where_exp: "page", "page.navlevel == 'header'" | sort: "position" %}
3
- {% for my_page in sorted_pages %}
4
- <a class="page-link" href="{{ my_page.url | relative_url }}" >{{ my_page.navtitle | default: my_page.title | escape }}</a>
2
+ {% assign sorted_pages = site.pages | sort: "position" %}
3
+ {% for _page in sorted_pages %}
4
+ {% if _page.navbar_title or _page.navtitle or _page.navlevel == "header" or _page.navbar %}
5
+ <a class="page-link" href="{{ _page.url | relative_url }}" >{{ _page.navbar_title | default: _page.navtitle | default: _page.title | escape }}</a>
6
+ {% endif %}
5
7
  {% endfor %}
6
8
  </nav>
@@ -9,8 +9,13 @@ layout: blank
9
9
  {{ content }}
10
10
  </div>
11
11
  {% include retina-image.html %}
12
+ {% if site.mermaid or page.mermaid %}
13
+ {% include mermaid.html %}
14
+ {% endif %}
12
15
  </main>
13
16
 
14
17
  {% include footer.html %}
15
18
 
19
+ {% include font-fix.html %}
20
+
16
21
  </body>
@@ -30,24 +30,29 @@ layout: default
30
30
  {% endif %}
31
31
  {% for post in posts %}
32
32
  <li class="post-list-item" data-tags="{{ post.tags | join: " " }}">
33
- <a class="post-item-link" href="{{ post.url | relative_url }}" data-date="{{ post.date | date: "%m-%d" }}">
34
- {{ post.title | escape }}
35
- </a>
36
- {% if post.description %}
37
- <p class="post-description">{{ post.description }}</p>
33
+ {% if post.cover_url %}
34
+ <div class="post-item-cover" style="background-image: url('{{ post.cover_url }}')"></div>
38
35
  {% endif %}
39
- <div class="post-item-meta">
40
- {{ post.date | date: "%B %-d, %Y" }}
41
- /
42
- {% capture lang %}{{ post.lang | default: site.lang | default: "en" }}{% endcapture %}
43
- {% if lang == "en" %}
44
- {% capture words %}{{ post.content | strip_html | number_of_words }}{% endcapture %}
45
- {% else %}
46
- {% capture words %}{{ post.content | strip_html | size }}{% endcapture %}
36
+ <div class="post-item-label">
37
+ <a class="post-item-link baseline-fix" href="{{ post.url | relative_url }}" data-date="{{ post.date | date: "%m-%d" }}">
38
+ {{ post.title | escape }}
39
+ </a>
40
+ {% if post.description %}
41
+ <p class="post-description">{{ post.description }}</p>
47
42
  {% endif %}
48
- {% unless words contains "-" %}
49
- {{ words | plus: 250 | divided_by: 250 | append: " minute read" }}
50
- {% endunless %}
43
+ <div class="post-item-meta">
44
+ {{ post.date | date: "%B %-d, %Y" }}
45
+ /
46
+ {% capture lang %}{{ post.lang | default: site.lang | default: "en" }}{% endcapture %}
47
+ {% if lang == "en" %}
48
+ {% capture words %}{{ post.content | strip_html | number_of_words }}{% endcapture %}
49
+ {% else %}
50
+ {% capture words %}{{ post.content | strip_html | size }}{% endcapture %}
51
+ {% endif %}
52
+ {% unless words contains "-" %}
53
+ {{ words | plus: 250 | divided_by: 250 | append: " minute read" }}
54
+ {% endunless %}
55
+ </div>
51
56
  </div>
52
57
  </li>
53
58
  {% endfor %}
data/_layouts/post.html CHANGED
@@ -25,7 +25,12 @@ layout: default
25
25
  {% endif %}
26
26
  </footer>
27
27
 
28
- {% if jekyll.environment == 'production' and site.disqus_shortname and page.comments != false %}
28
+ {% if jekyll.environment == 'production' and page.comments != false %}
29
+ {% if site.disqus_shortname %}
29
30
  {% include disqus.html %}
31
+ {% elsif site.gitalk %}
32
+ {% include gitalk.html %}
30
33
  {% endif %}
34
+ {% endif %}
35
+
31
36
  </article>
@@ -41,7 +41,16 @@ article {
41
41
  margin-bottom: 0;
42
42
  }
43
43
 
44
- .highlight {
44
+ .task-list-item {
45
+ list-style-type: none;
46
+ }
47
+
48
+ .task-list-item-checkbox {
49
+ margin: 0 .5em .3em -1.6em;
50
+ vertical-align: middle;
51
+ }
52
+
53
+ pre {
45
54
  position: relative;
46
55
  overflow: hidden;
47
56
 
@@ -50,11 +59,11 @@ article {
50
59
  overflow-x: auto;
51
60
  }
52
61
 
53
- @include exdent-horizontally($hspacing);
54
- @include exdent-vertically(0.5 * $vspacing);
62
+ @include exdent-horizontally($hspacing, "code");
63
+ @include exdent-vertically(0.5 * $vspacing, "code");
55
64
 
56
65
  @media screen and (min-width: $content-width) {
57
- @include exdent-horizontally(2 * $hspacing);
66
+ @include exdent-horizontally(2 * $hspacing, "code");
58
67
  }
59
68
  }
60
69
 
@@ -166,10 +175,26 @@ article {
166
175
  }
167
176
 
168
177
  .post-list-item {
178
+ position: relative;
169
179
  margin-top: $spacing-unit;
170
180
  margin-bottom: $spacing-unit;
171
181
  }
172
182
 
183
+ .post-item-cover {
184
+ width: 100vw;
185
+ position: absolute;
186
+ top: -.5 * $spacing-unit;
187
+ bottom: -.5 * $spacing-unit;
188
+ margin-left: 50%;
189
+ transform: translateX(-50%);
190
+ background-size: cover;
191
+ background-position: center;
192
+ }
193
+
194
+ .post-item-label {
195
+ position: relative;
196
+ }
197
+
173
198
  .post-description {
174
199
  margin-top: 10px;
175
200
  margin-bottom: 10px;
@@ -96,8 +96,6 @@ article {
96
96
  color: lighten($content-color, 20%);
97
97
  background: $block-code-background;
98
98
  code {
99
- margin: 0;
100
- padding: 0;
101
99
  color: inherit;
102
100
  background: none;
103
101
  line-height: 1.6;
@@ -225,6 +223,16 @@ article {
225
223
  color: lighten($content-color, 40%);
226
224
  }
227
225
 
226
+ .post-list-item .post-item-cover {
227
+ opacity: 0.03;
228
+ transition: opacity 0.5s ease-out;
229
+ }
230
+
231
+ .post-list-item:hover .post-item-cover {
232
+ opacity: 0.15;
233
+ transition: opacity 0.5s ease-out;
234
+ }
235
+
228
236
  .cover-meta {
229
237
  font-family: "Press Start 2P", cursive;
230
238
  font-variant-caps: all-petite-caps;
@@ -245,3 +253,12 @@ article {
245
253
  h3 { margin-left: -2px; }
246
254
  }
247
255
 
256
+ .baseline-fix {
257
+ visibility: hidden;
258
+ }
259
+
260
+ .baseline-fix-block {
261
+ display: inline-block;
262
+ vertical-align: top;
263
+ font-size: 0.95em;
264
+ }
@@ -1,16 +1,16 @@
1
- @mixin exdent-horizontally($size) {
1
+ @mixin exdent-horizontally($size, $selector: "*") {
2
2
  margin-left: -$size;
3
3
  margin-right: -$size;
4
- & > * {
4
+ & > #{$selector} {
5
5
  padding-left: $size;
6
6
  padding-right: $size;
7
7
  }
8
8
  }
9
9
 
10
- @mixin exdent-vertically($size) {
10
+ @mixin exdent-vertically($size, $selector: "*") {
11
11
  margin-top: -$size;
12
12
  margin-bottom: -$size;
13
- & > * {
13
+ & > #{$selector} {
14
14
  padding-top: $size;
15
15
  padding-bottom: $size;
16
16
  }
metadata CHANGED
@@ -1,58 +1,30 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-theme-kagami
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kamikat
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-03 00:00:00.000000000 Z
11
+ date: 2021-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: jekyll
14
+ name: github-pages
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '3.3'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '3.3'
27
- - !ruby/object:Gem::Dependency
28
- name: bundler
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '1.12'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '1.12'
41
- - !ruby/object:Gem::Dependency
42
- name: rake
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '10.0'
19
+ version: '0'
48
20
  type: :development
49
21
  prerelease: false
50
22
  version_requirements: !ruby/object:Gem::Requirement
51
23
  requirements:
52
- - - "~>"
24
+ - - ">="
53
25
  - !ruby/object:Gem::Version
54
- version: '10.0'
55
- description:
26
+ version: '0'
27
+ description:
56
28
  email:
57
29
  - kamikat@banana.moe
58
30
  executables: []
@@ -62,10 +34,13 @@ files:
62
34
  - LICENSE.txt
63
35
  - README.md
64
36
  - _includes/disqus.html
37
+ - _includes/font-fix.html
65
38
  - _includes/footer.html
39
+ - _includes/gitalk.html
66
40
  - _includes/google-analytics.html
67
41
  - _includes/head.html
68
42
  - _includes/header.html
43
+ - _includes/mermaid.html
69
44
  - _includes/retina-image.html
70
45
  - _includes/site-nav.html
71
46
  - _layouts/blank.html
@@ -116,7 +91,7 @@ homepage: https://github.com/kamikat/jekyll-theme-kagami
116
91
  licenses:
117
92
  - MIT
118
93
  metadata: {}
119
- post_install_message:
94
+ post_install_message:
120
95
  rdoc_options: []
121
96
  require_paths:
122
97
  - lib
@@ -131,9 +106,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
106
  - !ruby/object:Gem::Version
132
107
  version: '0'
133
108
  requirements: []
134
- rubyforge_project:
135
- rubygems_version: 2.5.1
136
- signing_key:
109
+ rubygems_version: 3.1.2
110
+ signing_key:
137
111
  specification_version: 4
138
112
  summary: A peaceful theme for Jekyll and GitHub Pages.
139
113
  test_files: []