jekyll-theme-yat 1.3.0 → 1.4.3

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: 5e50a9c1dc813ef81f78d8657642ed0ad82e058b2a3d37431c2a2baf17ed99af
4
- data.tar.gz: 1280a0e558630797445e27b4852262aa3809b2f3d2ff60154b6a966fce34fd23
3
+ metadata.gz: e9f0c62601b83931b57a178d48a0e69d63210c27f65575a6e6e07c930b6338db
4
+ data.tar.gz: 1e5ff363a662f19b9b2743350a4f2809e157818db7933e1c461d071fa7b9a718
5
5
  SHA512:
6
- metadata.gz: 351e0b176594ebbbe3d70f05c91f0abd6d2b2d6d79e246050dfea541dc7335f3e88d999d7cd419c486fd92664819ee587f103615304269208db1f081984f3f82
7
- data.tar.gz: 076e94ae4d9b3c4c40af4f3fe66e08452d043e9423820f4684b5eb95f8b3a1c0488fe2cf0c851f8540cda31b0007471d8d302d9f1f1b0757df7c2bcb91a323f5
6
+ metadata.gz: 7e6e43e2802b0a5a870e6b930ac57d6d7eb5e24aadf9ef0b3a4f2baf88ab8d71f06bd5cdb8dae5f47947b32f11265e548b111b88cadec1798412c83a3a8d08f3
7
+ data.tar.gz: a3b1c644e0df40f4907fd1d9185450768d36a305dcd09b6cc2631c145c99873b73e976110acc4efd5c773af599dde0c4f3407b67e7bd7913f7aa0a1a90486ca2
data/README.md CHANGED
@@ -1,11 +1,21 @@
1
1
  # jekyll-theme-yat
2
+ [![Gem Version](https://badge.fury.io/rb/jekyll-theme-yat.svg)](http://badge.fury.io/rb/jekyll-theme-yat)
3
+ [![License: MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT)
4
+ [![Donate (Liberapay)](http://img.shields.io/liberapay/goal/jeffreytse.svg?logo=liberapay)](https://liberapay.com/jeffreytse)
5
+ [![Donate (Patreon)](https://img.shields.io/badge/support-patreon-F96854.svg?style=flat-square)](https://patreon.com/jeffreytse)
6
+ <a href="https://ko-fi.com/jeffreytse">
7
+ <img height="20" src="https://www.ko-fi.com/img/githubbutton_sm.svg"
8
+ alt="Donate (Ko-fi)" />
9
+ </a>
2
10
 
3
- Welcome to your new Jekyll theme! In this directory, you'll find the files you need to be able to package up your theme into a gem. Put your layouts in `_layouts`, your includes in `_includes`, your sass files in `_sass` and any other assets in `assets`.
11
+ Hey, nice to meet you, you found this Jekyll theme. Here the yet another theme is a modern theme, and it's quiet clear, clean and neat for writers and posts.
4
12
 
5
- To experiment with this code, add some sample content and run `bundle exec jekyll serve` – this directory is setup just like a Jekyll site!
6
13
 
7
- TODO: Delete this and the text above, and describe your gem
14
+ <p align="center">
8
15
 
16
+ <img src="https://user-images.githubusercontent.com/9413601/87244819-c34ada80-c472-11ea-9c67-5827dd55d3c7.png" alt="demo-screenshot" width="720px" style="box-shadow: 0px 0px 18px 5px #f2f2f2" />
17
+
18
+ </p>
9
19
 
10
20
  ## Installation
11
21
 
@@ -31,11 +41,12 @@ Or install it yourself as:
31
41
 
32
42
  ## Usage
33
43
 
34
- TODO: Write usage instructions here. Describe your available layouts, includes, sass and/or assets.
44
+ Add or update your available layouts, includes, sass and/or assets.
35
45
 
36
- ## Contributing
46
+ GitHub Pages runs in `safe` mode and only allows [a set of whitelisted plugins](https://pages.github.com/versions/).
47
+ To use the third-party gem in GitHub Pages without limitation:
37
48
 
38
- Bug reports and pull requests are welcome on GitHub at https://github.com/jeffreytse/jekyll-theme-yat. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
49
+ * Here is a GitHub Action named [jekyll-deploy-action](https://github.com/jeffreytse/jekyll-deploy-action) for Jekyll site deployment conveniently. 👍
39
50
 
40
51
  ## Development
41
52
 
@@ -46,7 +57,12 @@ Your theme is setup just like a normal Jekyll site! To test your theme, run `bun
46
57
  When your theme is released, only the files in `_data`, `_layouts`, `_includes`, `_sass` and `assets` tracked with Git will be bundled.
47
58
  To add a custom directory to your theme-gem, please edit the regexp in `jekyll-theme-yat.gemspec` accordingly.
48
59
 
49
- ## License
60
+ ## Contributing
50
61
 
51
- The theme is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
62
+ Issues and Pull Requests are greatly appreciated. If you've never contributed to an open source project before I'm more than happy to walk you through how to create a pull request.
63
+
64
+ You can start by [opening an issue](https://github.com/jeffreytse/jekyll-theme-yat/issues/new) describing the problem that you're looking to resolve and we'll go from there.
65
+
66
+ ## License
52
67
 
68
+ This theme is licensed under the [MIT license](https://opensource.org/licenses/mit-license.php) © JeffreyTse.
@@ -13,10 +13,6 @@
13
13
  img: https://www.countryflags.io/cn/flat/64.png
14
14
  text: Chinese(Simple)
15
15
 
16
- - lang: zh-TW
17
- img: https://www.countryflags.io/tw/flat/64.png
18
- text: Chinese(Traditional)
19
-
20
16
  - lang: ja
21
17
  img: https://www.countryflags.io/jp/flat/64.png
22
18
  text: Japan
@@ -1,6 +1,6 @@
1
1
  <div id="gitment_thread"></div>
2
- <link rel="stylesheet" href="https://imsun.github.io/gitment/style/default.css">
3
- <script src="https://imsun.github.io/gitment/dist/gitment.browser.js"></script>
2
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/theme-next/theme-next-gitment@1/default.css"/>
3
+ <script src="https://cdn.jsdelivr.net/gh/theme-next/theme-next-gitment@1/gitment.browser.js"></script>
4
4
  <script>
5
5
  var gitment = new Gitment({
6
6
  id: '{{ page.id }}',
@@ -0,0 +1,41 @@
1
+ {% if include.article %}
2
+ {% assign article = include.article %}
3
+ {% endif %}
4
+
5
+ {% if include.speed %}
6
+ {% assign speed = include.speed %}
7
+ {% else %}
8
+ {% assign speed = 160 %}
9
+ {% endif %}
10
+
11
+ {% assign total_mins = article
12
+ | number_of_words
13
+ | divided_by: speed
14
+ | at_least: 1 %}
15
+
16
+ {% assign hours = total_mins | divided_by: 60 %}
17
+ {% assign mins = total_mins | modulo: 60 %}
18
+
19
+ {% assign return = "About" %}
20
+
21
+ {% if hours > 0 %}
22
+ {% assign unit = "hour" %}
23
+ {% if hours > 1 %}
24
+ {% assign unit = unit | append: "s" %}
25
+ {% endif %}
26
+ {% assign return = return
27
+ | append: " "
28
+ | append: hours
29
+ | append: " "
30
+ | append: unit %}
31
+ {% endif %}
32
+
33
+ {% assign unit = "min" %}
34
+ {% if mins > 1 %}
35
+ {% assign unit = unit | append: "s" %}
36
+ {% endif %}
37
+ {% assign return = return
38
+ | append: " "
39
+ | append: mins
40
+ | append: " "
41
+ | append: unit %}
@@ -6,10 +6,17 @@
6
6
  {%- seo -%}
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
+ <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>
9
16
  <link rel="stylesheet" href="{{ "/assets/css/main.css" | relative_url }}">
10
17
  <script src="{{ "/assets/js/main.js" | relative_url }}"></script>
11
18
  {%- feed_meta -%}
12
19
  {%- if jekyll.environment == 'production' and site.google_analytics -%}
13
- {%- include extensions/google-analytics.html -%}
20
+ {%- include extensions/google-analytics.html -%}
14
21
  {%- endif -%}
15
22
  </head>
@@ -7,7 +7,7 @@
7
7
  </style>
8
8
 
9
9
  <div class="post-menu">
10
- <div class="post-menu-title">Contents</div>
10
+ <div class="post-menu-title">TOC</div>
11
11
  <div class="post-menu-content"></div>
12
12
  </div>
13
13
 
@@ -49,7 +49,8 @@
49
49
  var headerHeight = headerTop + headerHeight + 20;
50
50
  if (headingRect.top <= headerHeight) {
51
51
  var id = 'h-' + h.getAttribute('id');
52
- var curActive = menuContent.querySelector('a[href="#' + id + '"]');
52
+ var a = menuContent.querySelector('a[href="#' + id + '"]');
53
+ var curActive = a.parentNode;
53
54
  if (curActive) {
54
55
  curActive.classList.add('active');
55
56
  }
@@ -19,20 +19,9 @@
19
19
  {% assign subheading = return %}
20
20
 
21
21
  {% if banner %}
22
-
23
- {% assign auto_banner = true %}
24
- {% assign array = banner | split: '/' %}
25
- {% assign protocol = array[0] %}
26
-
27
- {% if array.size > 1 and (protocol == '' or protocol == 'http:' or protocol == 'https:') %}
28
- {% assign auto_banner = false %}
29
- {% endif %}
30
-
31
22
  <section class="page-banner">
32
23
  <div class="page-banner-img">
33
- {%- if auto_banner == false -%}
34
- <div style="background-image: url({{ banner }})"></div>
35
- {%- endif -%}
24
+ <div style="background-image: url({{ banner }})"></div>
36
25
  </div>
37
26
  <div class="wrapper">
38
27
  <div class="page-banner-inner">
@@ -48,36 +37,14 @@
48
37
  <h1 class="page-banner-heading">
49
38
  {{ heading | default: page.title | escape }}
50
39
  </h1>
51
- <h3 class="page-banner-subheading">
40
+ <h2 class="page-banner-subheading">
52
41
  {{ subheading | default: page.subtitle | escape }}
53
- </h3>
42
+ </h2>
54
43
  </div>
55
44
 
56
45
  {%- endif -%}
57
46
  </div>
58
47
  </div>
59
48
  </section>
60
-
61
- {%- if auto_banner -%}
62
-
63
- {%- assign selector = ".page-banner-img" -%}
64
-
65
- {%- if banner == "default" -%}
66
-
67
- {%- assign heading = page.heading | default: page.title | escape -%}
68
- {%- assign subheading = page.subheading | default: page.subtitle | escape -%}
69
- {%- assign seed = page.date | append: heading | append: subheading -%}
70
-
71
- {%- else -%}
72
-
73
- {%- assign seed = 'theme-' | append: banner -%}
74
-
75
- {%- endif -%}
76
-
77
- {%- assign zoom = 1.5 -%}
78
- {%- include extensions/trianglify.html -%}
79
-
80
- {%- endif -%}
81
-
82
49
  {%- endif -%}
83
50
 
@@ -7,7 +7,7 @@
7
7
  {%- include functions.html func='log' level='debug' msg='Get header_transparent value' -%}
8
8
  {% assign name = 'header_transparent' %}
9
9
  {%- include functions.html func='get_value' -%}
10
- {% assign header_transparent = return %}
10
+ {% assign header_transparent = return | default: true %}
11
11
 
12
12
  {%- if banner and header_transparent -%}
13
13
  {%- assign header_transparent_class = "site-header-transparent" -%}
@@ -39,9 +39,7 @@
39
39
  {%- for path in page_paths -%}
40
40
  {%- assign my_page = site.pages | where: "path", path | first -%}
41
41
  {%- if my_page.title -%}
42
- <a class="page-link" href="{{ my_page.url | relative_url }}">
43
- {{ my_page.title | upcase | escape }}
44
- </a>
42
+ <a class="page-link" href="{{ my_page.url | relative_url }}">{{ my_page.title | upcase | escape }}</a>
45
43
  {%- endif -%}
46
44
  {%- endfor -%}
47
45
 
@@ -11,16 +11,29 @@
11
11
  {%- for post in paginator.posts -%}
12
12
  <li>
13
13
  {%- assign date_format = site.yat.date_format | default: "%b %-d, %Y" -%}
14
- <span class="post-meta">{{ post.date | date: date_format }}</span>
15
- <h3>
14
+
15
+ {% assign article = post.content %}
16
+ {%- include functions.html func='get_reading_time' -%}
17
+ {% assign reading_time = return %}
18
+
19
+ <h2 class="post-title">
16
20
  {%- assign post_url = post.url | relative_url -%}
17
21
  <a class="post-link" href="{{ post_url }}">
18
22
  {{ post.title | escape }}
19
23
  </a>
20
- </h3>
24
+ </h2>
25
+ <div class="post-meta">
26
+ <span class="post-date"><i class="fa fa-calendar"></i> {{ post.date | date: date_format }}</span>
27
+ <span class="post-reading-time left-vsplit"><i class="fa fa-clock-o"></i> {{ reading_time }}</span>
28
+ </div>
21
29
  <p class="post-excerpt">
22
30
  {{ post.content | strip_html | truncatewords: 50 }}
23
31
  </p>
32
+ <div class="post-tags">
33
+ {%- for tag in post.tags -%}
34
+ <a class="post-tag" href="/tags.html#{{tag}}">#{{tag}}</a>
35
+ {%- endfor -%}
36
+ </div>
24
37
  </li>
25
38
  {%- endfor -%}
26
39
  </ul>
@@ -3,19 +3,23 @@
3
3
  {% endif %}
4
4
 
5
5
  {% if paginator.posts.size > 0 %}
6
- <div class="pagination">
6
+ <div class="paginator">
7
+ <span class="previous">
7
8
  {% if paginator.previous_page %}
8
- <a href="{{ paginator.previous_page_path }}">&laquo; Prev</a>
9
+ <a href="{{ paginator.previous_page_path }}">Prev</a>
9
10
  {% else %}
10
- <span>&laquo; Prev</span>
11
+ <span>Prev</span>
11
12
  {% endif %}
13
+ </span>
12
14
 
13
- <span> {{ paginator.page }}/{{ paginator.total_pages }}</span>
15
+ <span class="indicator"> {{ paginator.page }}/{{ paginator.total_pages }}</span>
14
16
 
17
+ <span class="next">
15
18
  {% if paginator.next_page %}
16
- <a href="{{ paginator.next_page_path }}">Next &raquo;</a>
19
+ <a href="{{ paginator.next_page_path }}">Next</a>
17
20
  {% else %}
18
- <span>Next &raquo;</span>
21
+ <span>Next</span>
19
22
  {% endif %}
23
+ </span>
20
24
  </div>
21
25
  {% endif %}
@@ -1,11 +1,25 @@
1
1
  <header class="post-header">
2
2
  <h1 class="post-title p-name" itemprop="name headline">{{ heading | default: page.title | escape }}</h1>
3
- <h3>{{ subheading | default: page.subtitle | escape }}</h3>
3
+ <h3 class="post-subtitle">{{ subheading | default: page.subtitle | escape }}</h3>
4
4
 
5
5
  <p class="post-meta">
6
6
  <time class="dt-published" datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">
7
7
  {%- assign date_format = site.yat.date_format | default: "%b %-d, %Y" -%}
8
- {{ page.date | date: date_format }}
8
+ <i class="fa fa-calendar"></i> {{ page.date | date: date_format }}
9
9
  </time>
10
+
11
+ {% assign article = page.content %}
12
+ {%- include functions.html func='get_reading_time' -%}
13
+ {% assign reading_time = return %}
14
+ <span class="post-reading-time left-vsplit"><i class="fa fa-clock-o"></i> {{ reading_time }}</span>
10
15
  </p>
16
+
17
+ {%- if page.tags.size > 0 -%}
18
+ <div class="post-tags">
19
+ {%- for tag in page.tags -%}
20
+ <a class="post-tag" href="/tags.html#{{tag}}">#{{tag}}</a>
21
+ {%- endfor -%}
22
+ </div>
23
+ {%- endif -%}
24
+
11
25
  </header>
@@ -1,7 +1,8 @@
1
1
  ---
2
2
  layout: framework
3
- banner: 'default'
3
+ banner:
4
4
  banner_html: post-header.html
5
+ hidden: []
5
6
  sidebar:
6
7
  - article-menu
7
8
  ---
@@ -13,39 +14,64 @@ sidebar:
13
14
  {%- include functions.html func='get_value' -%}
14
15
  {%- assign banner = return -%}
15
16
 
16
- {%- if banner == nil -%}
17
+ {%- assign name = 'hidden' -%}
18
+ {%- include functions.html func='get_value' -%}
19
+ {%- assign hidden = return -%}
20
+
21
+ {%- assign result = hidden | where_exp: "item", "item == 'header'" -%}
22
+ {%- if banner == nil and result.size == 0 -%}
17
23
  {%- include views/post-header.html -%}
18
24
  {%- endif -%}
19
25
 
20
26
  {%- include views/article.html -%}
21
27
 
28
+ {%- assign result = hidden | where_exp: "item", "item == 'navigator'" -%}
29
+ {%- if result.size == 0 -%}
22
30
  <div class="post-nav">
23
31
  {%- if page.previous -%}
24
- <a href="{{ page.previous.url }}" title="{{ page.previous.title | escape }}">&laquo; Prev</a>
32
+ <a class="previous" href="{{ page.previous.url }}" title="{{
33
+ page.previous.title | escape }}">{{ page.previous.title | escape | truncatewords: 6 }}</a>
25
34
  {%- else -%}
26
35
  <span></span>
27
36
  {%- endif -%}
28
37
 
29
38
  {%- if page.next -%}
30
- <a href="{{ page.next.url }}" title="{{ page.next.title | escape }}">Next &raquo;</a>
39
+ <a class="next" href="{{ page.next.url }}" title="{{ page.next.title | escape }}">{{ page.next.title | escape | truncatewords: 6 }}</a>
31
40
  {%- else -%}
32
41
  <span></span>
33
42
  {%- endif -%}
34
43
  </div>
35
-
36
- {%- if page.comments != false -%}
37
-
38
- {%- if site.disqus.shortname -%}
39
- {%- include extensions/comments/disqus.html -%}
40
44
  {%- endif -%}
41
45
 
42
- {%- if site.gitment.username -%}
43
- {%- include extensions/comments/gitment.html -%}
46
+ {%- assign result = hidden | where_exp: "item", "item == 'related_posts'" -%}
47
+ {%- if result.size == 0 -%}
48
+ <div class="post-related">
49
+ <div>Related Articles</div>
50
+ <ul>
51
+ {% assign posts = site[page.collection] | sample:4 %}
52
+ {%- for post in posts -%}
53
+ <li><a class="post-link" href="{{post.url}}" title="{{ page.next.title | escape }}">{{ post.title | escape | truncatewords: 12 }}</a></li>
54
+ {%- endfor -%}
55
+ </ul>
56
+ </div>
44
57
  {%- endif -%}
45
58
 
59
+ {%- assign result = hidden | where_exp: "item", "item == 'comments'" -%}
60
+ {%- if result.size == 0 -%}
61
+ <div class="post-comments">
62
+ {%- if page.comments != false -%}
63
+
64
+ {%- if site.disqus.shortname -%}
65
+ {%- include extensions/comments/disqus.html -%}
66
+ {%- endif -%}
67
+
68
+ {%- if site.gitment.username -%}
69
+ {%- include extensions/comments/gitment.html -%}
70
+ {%- endif -%}
71
+
72
+ {%- endif -%}
73
+ </div>
46
74
  {%- endif -%}
47
75
 
48
76
  </section>
49
77
  </div>
50
-
51
-
@@ -7,40 +7,54 @@
7
7
  max-width: 250px;
8
8
 
9
9
  .post-menu-title {
10
- font-size: $base-font-size * 1.35;
11
- margin-bottom: 6px;
10
+ font-size: $base-font-size * 1.5;
11
+ margin-bottom: 14px;
12
12
  font-weight: 600;
13
- color: #4e4e4e;
14
-
15
- &:before {
16
- content: '\f02e';
17
- margin-right: 5px;
18
- font-size: $base-font-size * 1.15;
19
- }
13
+ color: #222;
20
14
  }
21
15
 
22
16
  .post-menu-content {
23
17
  ul {
18
+ border-left: 1px solid #e9ecef;
19
+ $indent: $base-font-size / 4;
20
+ $active-bgcolor: #ecebec;
21
+
24
22
  @for $i from 2 to 7 {
25
23
  .h-h#{$i} {
26
- padding-left: ($i - 2) * $base-font-size * 0.9;
27
- font-size: (7 - $i) + $base-font-size * 0.9;
24
+ padding-inline-start: $indent + ($i - 2) * $base-font-size * 1.3;
25
+ font-size: $base-font-size * 1.2;
26
+ line-height: 1.4;
28
27
  }
29
28
  }
30
29
 
31
30
  a {
32
31
  display: flex;
33
- padding: 0px 8px;
32
+ padding: 2px 8px;
33
+ color: darken($text-color, 10%);
34
34
 
35
35
  * {
36
36
  pointer-events: none;
37
37
  }
38
+
39
+ &:hover {
40
+ text-decoration: none;
41
+ color: lighten($text-color, 20%)!important;
42
+ }
38
43
  }
39
44
 
40
45
  .active {
41
- color: white;
42
- background: mix(invert($theme-color), darkorange);
46
+ background-color: $active-bgcolor;
43
47
  transition: background 0.5s;
48
+ border-left: 2px solid #202020;
49
+ margin-left: -2px;
50
+
51
+ &:hover {
52
+ background-color: lighten($active-bgcolor, 2%);
53
+ }
54
+
55
+ a {
56
+ color: #121416;
57
+ }
44
58
  }
45
59
  }
46
60
  }