jekyll-theme-yat 1.8.0 → 1.10.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
2
  SHA256:
3
- metadata.gz: 68d64a82d730e3929877098dc29bdc3d970d2288d7d0a6a822bb6ea665cbfc79
4
- data.tar.gz: 43f608c27d246a32ccb0ff3d8b6f7cbc28f836d280357e60594b1253a98a8bf5
3
+ metadata.gz: 40afd01c8ec04c85bbbdec989574617affc46bbc654787bf274eb5b2567eab8f
4
+ data.tar.gz: d91b329158c536ef53e461fabf47adc04707f0dae3201834f1e23b54d5493b8e
5
5
  SHA512:
6
- metadata.gz: 2c66e47b39750dbf0a1399362a9c04b98c62df4ee0590c2973a4ea6ad80729289e8a311c064ad3458114b9c73b4205ab7f8aa6cea4a7b75441e7f2397e5de2b9
7
- data.tar.gz: e752d272ca91ec205e97ac5ea77fab2bc2e007b3ea385612ac94d24546afc6ec3e51aad3571a1fd032b4205d752d0fa55dd206e95e6fed708d519c33f6cbdfd3
6
+ metadata.gz: fe439a617d9f796b358e91e7cb562efbc4653d90ad61fd2e941508f872f94abf5693eeca35dedb2519da0f1637c6e5afdfef4cc3e7f60995ba138f579a1d7db8
7
+ data.tar.gz: c12a4377a77170fe1ac27b58e8320610a31f047fbcaef5bc3baa03256c803f1e7b65a10608aecec6880cd860900a608c168cbbbab27ee5a915088aa410d9ed68
data/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  <img alt="jekyll-theme-yat →~ jekyll" src="https://user-images.githubusercontent.com/9413601/106478481-346fdf00-64e4-11eb-9385-1ab5329c3234.png" width="600">
6
6
  </a>
7
7
 
8
- <h1>🎨 JEKYLL YAT THEME 🎨</h1>
8
+ <h1>JEKYLL YAT THEME</h1>
9
9
 
10
10
  </div>
11
11
 
@@ -19,7 +19,7 @@
19
19
  alt="Github Pages" />
20
20
  </a>
21
21
 
22
- <a href="http://badge.fury.io/rb/jekyll-theme-yat">
22
+ <a href="https://badge.fury.io/rb/jekyll-theme-yat">
23
23
  <img src="https://badge.fury.io/rb/jekyll-theme-yat.svg"
24
24
  alt="Gem Version" />
25
25
  </a>
@@ -30,7 +30,7 @@
30
30
  </a>
31
31
 
32
32
  <a href="https://liberapay.com/jeffreytse">
33
- <img src="http://img.shields.io/liberapay/goal/jeffreytse.svg?logo=liberapay"
33
+ <img src="https://img.shields.io/liberapay/goal/jeffreytse.svg?logo=liberapay"
34
34
  alt="Donate (Liberapay)" />
35
35
  </a>
36
36
 
@@ -49,36 +49,42 @@
49
49
  <sub>Built with ❤︎ by
50
50
  <a href="https://jeffreytse.net">jeffreytse</a> and
51
51
  <a href="https://github.com/jeffreytse/jekyll-theme-yat/graphs/contributors">contributors </a>
52
+ </sub>
52
53
  </div>
53
54
 
54
55
  <br>
55
56
 
56
57
  Hey, nice to meet you, you found this [Jekyll][jekyll] theme. Here the
57
- **Yet Another Theme** is a modern responsive theme, and it's quiet clear,
58
- clean and neat for writers and posts. **If you like the theme, give it
59
- a star!**
58
+ _YAT (Yet Another Theme)_ is a modern responsive theme. It's quite
59
+ clear, clean and neat for writers and posts. **If you are an elegant
60
+ writer and focus on content, don't miss it.**
60
61
 
62
+ <p align="center">
63
+ Like this elegant theme? You can give it a star or sponsor me!<br>
64
+ I will respect your crucial support and say THANK YOU!
65
+ </p>
61
66
 
62
67
  <p align="center">
63
68
 
64
- <img src="https://user-images.githubusercontent.com/9413601/91842897-6a840b00-ec87-11ea-95ca-52abcc1ac063.png" alt="demo-screenshot" width="780px"/>
69
+ <img src="https://user-images.githubusercontent.com/9413601/91842897-6a840b00-ec87-11ea-95ca-52abcc1ac063.png" alt="demo-screenshot" width="100%"/>
65
70
 
66
71
  </p>
67
72
 
68
- <h3 align="center">🌌 Night Mode</h3>
73
+ <h4 align="center">BANNER</h4>
69
74
 
70
75
  <p align="center">
71
76
 
72
- <img src="https://user-images.githubusercontent.com/9413601/94983351-760f6e00-0574-11eb-9494-5303ad6228dc.gif" alt="demo-screenshot" width="780px"/>
77
+ <img src="https://user-images.githubusercontent.com/9413601/123897812-ae729a00-d996-11eb-96b8-b76ba926f555.gif" alt="demo-screenshot" width="100%"/>
73
78
 
74
79
  </p>
75
80
 
76
- ## Features
81
+ ## Features
77
82
 
78
- - Support beautiful __Night Mode__.
83
+ - Support beautiful **Night Mode**.
79
84
  - Modern responsive web design.
80
85
  - Full layouts `home`, `post`, `tags`, `archive` and `about`.
81
86
  - Uses font awesome 5 for icons.
87
+ - Beautiful page banner with image and video.
82
88
  - Beautiful Syntax Highlight using [highlight.js][highlight-js].
83
89
  - RSS support using [Jekyll Feed][jekyll-feed] gem.
84
90
  - Optimized for search engines using [Jekyll Seo Tag][jekyll-seo-tag] gem.
@@ -92,7 +98,7 @@ a star!**
92
98
 
93
99
  Also, visit the [Live Demo][yat-live-demo] site for the theme.
94
100
 
95
- ## 🛠️ Installation
101
+ ## Installation
96
102
 
97
103
  There are three ways to install:
98
104
 
@@ -153,18 +159,17 @@ $ bundle
153
159
 
154
160
  ### GitHub Pages without limitation
155
161
 
156
- 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__.
162
+ 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**.
157
163
 
158
164
  To use the third-party gem in GitHub Pages without limitation:
159
165
 
160
166
  Here is a GitHub Action named [jekyll-deploy-action](https://github.com/jeffreytse/jekyll-deploy-action) for Jekyll site deployment conveniently. 👍
161
167
 
162
-
163
- ## 📚 Usage
168
+ ## Usage
164
169
 
165
170
  Add or update your available layouts, includes, sass and/or assets.
166
171
 
167
- ## ✏️ Development
172
+ ## Development
168
173
 
169
174
  To set up your environment to develop this theme, run `bundle install`.
170
175
 
@@ -173,17 +178,18 @@ Your theme is setup just like a normal Jekyll site! To test your theme, run `bun
173
178
  When your theme is released, only the files in `_data`, `_layouts`, `_includes`, `_sass` and `assets` tracked with Git will be bundled.
174
179
  To add a custom directory to your theme-gem, please edit the regexp in `jekyll-theme-yat.gemspec` accordingly.
175
180
 
176
- ## 🔫 Contributing
181
+ ## Contributing
177
182
 
178
183
  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.
179
184
 
180
185
  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.
181
186
 
182
- ## 🌈 License
187
+ ## License
183
188
 
184
189
  This theme is licensed under the [MIT license](https://opensource.org/licenses/mit-license.php) © JeffreyTse.
185
190
 
186
191
  <!-- External links -->
192
+
187
193
  [jekyll]: https://jekyllrb.com/
188
194
  [yat-git-repo]: https://github.com/jeffreytse/jekyll-theme-yat/
189
195
  [yat-live-demo]: https://jeffreytse.github.io/jekyll-theme-yat/
@@ -1,4 +1,4 @@
1
- # Translate languges
1
+ # Translate languages
2
2
  # langs refer to https://cloud.google.com/translate/docs/languages
3
3
 
4
4
  - lang: en
@@ -0,0 +1,6 @@
1
+ {% comment %}
2
+ Placeholder to allow defining custom head, in principle, you can add anything here, e.g. favicons:
3
+
4
+ 1. Head over to https://realfavicongenerator.net/ to add your own favicons.
5
+ 2. Customize default _includes/custom-head.html in your source directory and insert the given code snippet.
6
+ {% endcomment %}
@@ -0,0 +1,18 @@
1
+ <div id="click-to-top" class="click-to-top">
2
+ <i class="fa fa-arrow-up"></i>
3
+ </div>
4
+ <script>
5
+ (function () {
6
+ const clickToTop = document.getElementById('click-to-top');
7
+ window.addEventListener('scroll', () => {
8
+ if (window.scrollY > 100) {
9
+ clickToTop.classList.add('show')
10
+ }else {
11
+ clickToTop.classList.remove('show')
12
+ }
13
+ });
14
+ clickToTop.addEventListener('click', () => {
15
+ window.smoothScrollTo(0);
16
+ });
17
+ })();
18
+ </script>
@@ -0,0 +1,51 @@
1
+ {%- if site.utterances.follow_site_theme -%}
2
+ <div id="utterances-placeholder"></div>
3
+ <script>
4
+ const utterancesThemeFromDataTheme = () => {
5
+ const dataTheme = document.documentElement.getAttribute('data-theme');
6
+ return `github-${dataTheme}`;
7
+ };
8
+
9
+ const setUtterancesTheme = () => {
10
+ const iframe = document.querySelector('.utterances-frame');
11
+ if (iframe) {
12
+ const message = {
13
+ type: 'set-theme',
14
+ theme: utterancesThemeFromDataTheme()
15
+ };
16
+ iframe.contentWindow.postMessage(message, 'https://utteranc.es');
17
+ }
18
+ }
19
+
20
+ // dynamic change
21
+ const observer = new MutationObserver((mutationsList, observer) => {
22
+ for (let mutation of mutationsList) {
23
+ if (mutation.type === 'attributes' && mutation.attributeName === 'data-theme') {
24
+ setUtterancesTheme();
25
+ }
26
+ }
27
+ });
28
+ observer.observe(document.documentElement, { attributes: true, childList: false, subtree: false });
29
+
30
+ let utterancesScript = document.createElement('script');
31
+ utterancesScript.async = true;
32
+ utterancesScript.src = 'https://utteranc.es/client.js';
33
+ utterancesScript.crossOrigin = 'anonymous';
34
+ utterancesScript.setAttribute('issue-term', '{{ site.utterances.issue_term }}');
35
+ utterancesScript.setAttribute('label', '{{ site.utterances.label }}');
36
+ utterancesScript.setAttribute('repo', '{{ site.utterances.repo }}');
37
+ utterancesScript.setAttribute('theme', utterancesThemeFromDataTheme());
38
+
39
+ const placeholder = document.getElementById('utterances-placeholder');
40
+ placeholder.parentNode.replaceChild(utterancesScript, placeholder);
41
+ </script>
42
+ {%- else -%}
43
+ <script async
44
+ crossorigin="anonymous"
45
+ issue-term="{{ site.utterances.issue_term }}"
46
+ label="{{ site.utterances.label }}"
47
+ repo="{{ site.utterances.repo }}"
48
+ src="https://utteranc.es/client.js"
49
+ theme="{{ site.utterances.theme }}">
50
+ </script>
51
+ {%- endif -%}
@@ -1,3 +1,4 @@
1
+ <!-- Google tag (gtag.js) -->
1
2
  <script>
2
3
  function initGoogleAnalytics() {
3
4
  var doNotTrack = (window.doNotTrack === "1" || navigator.doNotTrack === "1" ||
@@ -5,15 +6,22 @@
5
6
  var enableDNT = "{{ site.enableDNT | default: true }}" == "true";
6
7
 
7
8
  if (!enableDNT || !doNotTrack) {
8
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
9
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
10
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
11
- })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
9
+ var measurementId = '{{ site.google_analytics }}';
12
10
 
13
- ga('create', '{{ site.google_analytics }}', 'auto');
14
- ga('send', 'pageview');
11
+ (function(src) {
12
+ var tag = document.createElement('script');
13
+ tag.src = src;
14
+ tag.async = true;
15
+ var firstScriptTag = document.getElementsByTagName('script')[0];
16
+ firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
17
+ })('https://www.googletagmanager.com/gtag/js?id=' + measurementId);
18
+
19
+ window.dataLayer = window.dataLayer || [];
20
+ function gtag(){dataLayer.push(arguments);}
21
+ gtag('js', new Date());
22
+ gtag('config', measurementId);
15
23
  }
16
24
  }
17
- initGoogleAnalytics();
25
+ window.addEventListener("load", initGoogleAnalytics);
18
26
  </script>
19
27
 
@@ -2,6 +2,10 @@
2
2
  {% assign translate_langs = include.translate_langs %}
3
3
  {% endif %}
4
4
 
5
+ {% if include.lang %}
6
+ {% assign lang = include.lang %}
7
+ {% endif %}
8
+
5
9
  <div id="google_translate_element" style="display: none;">
6
10
  </div>
7
11
 
@@ -24,11 +28,17 @@
24
28
  <script type="text/javascript">
25
29
  function googleTranslateElementInit() {
26
30
  new google.translate.TranslateElement({
27
- pageLanguage: '',
31
+ pageLanguage: '{{ lang }}',
28
32
  autoDisplay: false,
29
33
  layout: google.translate.TranslateElement.InlineLayout.VERTICAL
30
34
  }, 'google_translate_element');
31
35
 
36
+ // Links to cross-origin destinations are unsafe
37
+ var gll = document.getElementsByClassName('goog-logo-link')[0];
38
+ if (gll) {
39
+ gll.setAttribute('rel', 'noopener');
40
+ }
41
+
32
42
  function restoreLang() {
33
43
  var iframe = document.getElementsByClassName('goog-te-banner-frame')[0];
34
44
  if (!iframe) return;
@@ -0,0 +1,161 @@
1
+ <script src="//cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.3/photoswipe.min.js"></script>
2
+ <script src="//cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.3/photoswipe-ui-default.min.js"></script>
3
+ <link
4
+ href="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.3/photoswipe.css"
5
+ rel="stylesheet"
6
+ />
7
+ <link
8
+ href="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.3/default-skin/default-skin.css"
9
+ rel="stylesheet"
10
+ />
11
+ <style>
12
+ .pswp .pswp__container .pswp__img {
13
+ background-color: white;
14
+ }
15
+ </style>
16
+
17
+ <script>
18
+ function initPhotoSwipe() {
19
+ var mainEl = document.querySelector("section.main");
20
+
21
+ var imgEls = mainEl.querySelectorAll("img:not(.emoji)");
22
+ imgEls.forEach((imgEl) => {
23
+ imgEl.outerHTML = `
24
+ <a class="photo-swipe"
25
+ href="${imgEl.src}"
26
+ data-width="${imgEl.getAttribute("width") || imgEl.width * 2}"
27
+ data-height="${imgEl.getAttribute("height") || imgEl.height * 2}"
28
+ data-caption="${imgEl.getAttribute("caption") || imgEl.alt}"
29
+ target="_blank">
30
+ ${imgEl.outerHTML}
31
+ </a>`;
32
+ });
33
+
34
+ // Init empty gallery array
35
+ var container = [];
36
+
37
+ // Loop over gallery items and push it to the array
38
+ var linkEls = mainEl.querySelectorAll("a.photo-swipe");
39
+ linkEls.forEach((link) => {
40
+ var item = {
41
+ src: link.getAttribute("href"),
42
+ w: link.dataset.width,
43
+ h: link.dataset.height,
44
+ title: link.dataset.caption || "",
45
+ };
46
+ container.push(item);
47
+ });
48
+
49
+ // Define click event on gallery item
50
+ linkEls.forEach((link, index) => {
51
+ link.addEventListener("click", (event) => {
52
+ // Prevent location change
53
+ event.preventDefault();
54
+
55
+ // Define object and gallery options
56
+ var pswp = document.querySelector(".pswp");
57
+
58
+ var zoomLevel = 1;
59
+
60
+ // Define object and gallery options
61
+ var options = {
62
+ index: index,
63
+ bgOpacity: 0.85,
64
+ showHideOpacity: true,
65
+ closeOnScroll: true,
66
+ maxSpreadZoom: 1,
67
+ getDoubleTapZoom: (isMouseClick, item) => {
68
+ if (item.detail) {
69
+ zoomLevel += item.detail.origEvent.shiftKey ? -1 : 1;
70
+ item.detail = undefined;
71
+ } else {
72
+ zoomLevel = zoomLevel === 1 ? 2 : 1;
73
+ }
74
+ if (zoomLevel <= 1) {
75
+ zoomLevel = 1;
76
+ setTimeout(() => pswp.classList.remove("pswp--zoomed-in"), 0);
77
+ }
78
+ return item.initialZoomLevel * zoomLevel;
79
+ },
80
+ };
81
+
82
+ // Initialize PhotoSwipe
83
+ var gallery = new PhotoSwipe(
84
+ pswp,
85
+ PhotoSwipeUI_Default,
86
+ container,
87
+ options
88
+ );
89
+
90
+ gallery.init();
91
+
92
+ // Custom zoom event
93
+ gallery.container.addEventListener("pswpTap", (e) => {
94
+ gallery.currItem.detail = e.detail;
95
+ });
96
+ });
97
+ });
98
+ }
99
+
100
+ window.addEventListener("load", initPhotoSwipe);
101
+ </script>
102
+
103
+ <!-- Root element of PhotoSwipe. Must have class pswp. -->
104
+ <div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
105
+ <!-- Background of PhotoSwipe.
106
+ It's a separate element as animating opacity is faster than rgba(). -->
107
+ <div class="pswp__bg"></div>
108
+ <!-- Slides wrapper with overflow:hidden. -->
109
+ <div class="pswp__scroll-wrap">
110
+ <!-- Container that holds slides.
111
+ PhotoSwipe keeps only 3 of them in the DOM to save memory.
112
+ Don't modify these 3 pswp__item elements, data is added later on. -->
113
+ <div class="pswp__container">
114
+ <div class="pswp__item"></div>
115
+ <div class="pswp__item"></div>
116
+ <div class="pswp__item"></div>
117
+ </div>
118
+ <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
119
+ <div class="pswp__ui pswp__ui--hidden">
120
+ <div class="pswp__top-bar">
121
+ <!-- Controls are self-explanatory. Order can be changed. -->
122
+ <div class="pswp__counter"></div>
123
+ <button
124
+ class="pswp__button pswp__button--close"
125
+ title="Close (Esc)"
126
+ ></button>
127
+ <button class="pswp__button pswp__button--share" title="Share"></button>
128
+ <button
129
+ class="pswp__button pswp__button--fs"
130
+ title="Toggle fullscreen"
131
+ ></button>
132
+ <button
133
+ class="pswp__button pswp__button--zoom"
134
+ title="Zoom in/out"
135
+ ></button>
136
+ <!-- element will get class pswp__preloader--active when preloader is running -->
137
+ <div class="pswp__preloader">
138
+ <div class="pswp__preloader__icn">
139
+ <div class="pswp__preloader__cut">
140
+ <div class="pswp__preloader__donut"></div>
141
+ </div>
142
+ </div>
143
+ </div>
144
+ </div>
145
+ <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
146
+ <div class="pswp__share-tooltip"></div>
147
+ </div>
148
+ <button
149
+ class="pswp__button pswp__button--arrow--left"
150
+ title="Previous (arrow left)"
151
+ ></button>
152
+ <button
153
+ class="pswp__button pswp__button--arrow--right"
154
+ title="Next (arrow right)"
155
+ ></button>
156
+ <div class="pswp__caption">
157
+ <div class="pswp__caption__center"></div>
158
+ </div>
159
+ </div>
160
+ </div>
161
+ </div>
data/_includes/head.html CHANGED
@@ -2,9 +2,9 @@
2
2
  <meta charset="utf-8">
3
3
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
4
4
  <meta name="viewport" content="width=device-width, initial-scale=1">
5
- <meta name="google-translate-customization" content="108d9124921d80c3-80e20d618ff053c8-g4f02ec6f3dba68b7-c"></meta>
5
+ <meta name="google-translate-customization" content="108d9124921d80c3-80e20d618ff053c8-g4f02ec6f3dba68b7-c">
6
6
  {%- seo -%}
7
- <link rel="shortcut icon" href="{{ site.favicon }}">
7
+ <link rel="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
10
  <link rel="stylesheet" href="{{ "/assets/css/main.css" | relative_url }}">
@@ -14,4 +14,6 @@
14
14
  {%- include extensions/google-analytics.html -%}
15
15
  {%- endif -%}
16
16
  {%- include extensions/code-highlight.html -%}
17
+ {%- include extensions/photo-swipe.html -%}
18
+ {%- include custom-head.html -%}
17
19
  </head>
@@ -3,9 +3,17 @@
3
3
 
4
4
  <div class="wrapper">
5
5
  <div class="site-footer-inner">
6
- <div>{{ site.copyright }} {% if site.author %}@{{ site.author | escape }}{% endif %}</div>
6
+ {%- assign currentYear = 'now' | date: "%Y" -%}
7
+ {%- assign copyright = site.copyright
8
+ | replace: '{currentYear}', currentYear
9
+ | replace: '{author}', site.author
10
+ | replace: '(c)', '&copy;'
11
+ | replace: '(p)', '℗'
12
+ | replace: '(cleft)', '<span class="copyleft">&copy;</span>'
13
+ -%}
14
+ <div>{{ copyright }}</div>
7
15
  <div>Powered by <a title="Jekyll is a simple, blog-aware, static site
8
- generator." href="http://jekyllrb.com/">Jekyll</a> &amp; <a title="Yat, yet
16
+ generator." href="https://jekyllrb.com/">Jekyll</a> &amp; <a title="Yat, yet
9
17
  another theme." href="https://github.com/jeffreytse/jekyll-theme-yat">Yat Theme</a>.</div>
10
18
  <div class="footer-col rss-subscribe">Subscribe <a href="{{ "/feed.xml" | relative_url }}">via RSS</a></div>
11
19
  </div>
@@ -44,6 +44,9 @@
44
44
  {%- include functions.html func='get_value' -%}
45
45
  {%- assign translate_langs = return -%}
46
46
  {%- if translate_langs.size > 0 -%}
47
+ {%- assign name = 'lang' -%}
48
+ {%- include functions.html func='get_value' default='en' -%}
49
+ {%- assign lang = return -%}
47
50
  <span class="page-link">
48
51
  {%- include extensions/google-translate.html -%}
49
52
  </span>
@@ -56,7 +59,7 @@
56
59
  </header>
57
60
 
58
61
  <script>
59
- (function() {
62
+ function initHeader() {
60
63
  var lastScrollY = getScrollPos().y;
61
64
  var documentElement = document.documentElement;
62
65
 
@@ -87,5 +90,6 @@
87
90
  });
88
91
 
89
92
  storeScrollData();
90
- })();
93
+ }
94
+ document.addEventListener('DOMContentLoaded', initHeader);
91
95
  </script>
@@ -13,6 +13,8 @@
13
13
 
14
14
  {%- include extensions/theme-toggle.html -%}
15
15
 
16
+ {%- include extensions/click-to-top.html -%}
17
+
16
18
  <main class="page-content" aria-label="Content">
17
19
  <div class="wrapper">
18
20
  {{ content }}
data/_layouts/post.html CHANGED
@@ -69,6 +69,10 @@ sidebar:
69
69
  {%- include extensions/comments/gitment.html -%}
70
70
  {%- endif -%}
71
71
 
72
+ {%- if site.utterances.repo -%}
73
+ {%- include extensions/comments/utterances.html -%}
74
+ {%- endif -%}
75
+
72
76
  {%- endif -%}
73
77
  </div>
74
78
  {%- endif -%}
@@ -23,7 +23,7 @@
23
23
  @for $i from 2 to 7 {
24
24
  .h-h#{$i} {
25
25
  padding-inline-start: $indent + ($i - 2) * $base-font-size * 1.3;
26
- font-size: $base-font-size * 1.2;
26
+ font-size: $base-font-size * 1.1;
27
27
  line-height: 1.4;
28
28
  }
29
29
  }
@@ -0,0 +1,46 @@
1
+ .click-to-top {
2
+ transition: 0.3s;
3
+ display: flex;
4
+ align-items: center;
5
+ justify-content: center;
6
+ position: fixed;
7
+ width: 64px;
8
+ height: 64px;
9
+ border-radius: 32px;
10
+ right: 60px;
11
+ bottom: 48px;
12
+ background: white;
13
+ cursor: pointer;
14
+ opacity: 0;
15
+ transform: translateY(10px);
16
+ box-shadow: 0 2px 15px rgba(0, 0, 0, 0.15);
17
+ font-size: 24px;
18
+ user-select: none;
19
+
20
+ @include media-query(1024px) {
21
+ width: 48px;
22
+ height: 48px;
23
+ border-radius: 24px;
24
+ right: 35px;
25
+ font-size: 20px;
26
+ }
27
+
28
+ @include media-query($on-palm) {
29
+ width: 36px;
30
+ height: 36px;
31
+ border-radius: 18px;
32
+ right: 20px;
33
+ font-size: 16px;
34
+ }
35
+ }
36
+
37
+ .click-to-top.show {
38
+ opacity: 1;
39
+ transform: translateY(0);
40
+ }
41
+
42
+ html[data-theme="dark"] {
43
+ .click-to-top {
44
+ background: #34323D;
45
+ }
46
+ }
@@ -96,7 +96,7 @@ div#google_translate_element {
96
96
  }
97
97
 
98
98
  /* HIDE the google translate toolbar */
99
- .goog-te-banner-frame.skiptranslate {
99
+ .skiptranslate {
100
100
  display: none !important;
101
101
  border: none;
102
102
  box-shadow: 0 0;
data/_sass/yat/_base.scss CHANGED
@@ -17,6 +17,7 @@ body {
17
17
  font-family: $base-font-family;
18
18
  font-weight: $base-font-weight;
19
19
  font-size: #{$base-font-size};
20
+ font-display: swap;
20
21
  line-height: #{$base-line-height};
21
22
  color: $text-color;
22
23
  background-color: $background-color;
data/_sass/yat/_dark.scss CHANGED
@@ -142,9 +142,15 @@ html[data-theme="dark"] {
142
142
  }
143
143
  }
144
144
 
145
- .post .post-content {
146
- img:not([raw]) {
147
- background-color: #ffffff33;
145
+ .post {
146
+ .post-header {
147
+ border-bottom: 1px solid #555;
148
+ }
149
+
150
+ .post-content {
151
+ img:not(.emoji):not([raw]) {
152
+ background-color: #ffffff33;
153
+ }
148
154
  }
149
155
  }
150
156
 
@@ -210,6 +210,11 @@ html {
210
210
  }
211
211
  }
212
212
 
213
+ .copyleft {
214
+ display: inline-block;
215
+ transform: rotate(180deg);
216
+ }
217
+
213
218
  /**
214
219
  * Post header
215
220
  */
@@ -314,17 +319,21 @@ html {
314
319
 
315
320
  .post-excerpt {
316
321
  color: #777;
322
+ word-break: break-word;
323
+ overflow-wrap: break-word;
317
324
  }
318
325
 
319
326
  .post-tags .post-tag {
327
+ display: inline-block;
320
328
  text-decoration: none;
321
329
  border: 1px solid;
322
330
  padding: 2px 4px;
323
331
  border-radius: 2px;
324
332
  transition: color 0.2s;
333
+ margin-bottom: 8px;
325
334
 
326
- &:not(:first-child) {
327
- margin-left: 8px;
335
+ &:not(:last-child) {
336
+ margin-right: 8px;
328
337
  }
329
338
 
330
339
  &:hover {
@@ -425,7 +434,11 @@ html {
425
434
  img, svg, iframe {
426
435
  margin-left: auto;
427
436
  margin-right: auto;
437
+ }
438
+
439
+ img:not(.emoji), svg, iframe {
428
440
  display: block;
441
+ max-height: 50vh;
429
442
  }
430
443
 
431
444
  h2, h3, h4, h5, h6 {
data/_sass/yat.scss CHANGED
@@ -34,7 +34,7 @@ $banner-text-color: lighten($white-color, 0%) !default;
34
34
  $banner-background: rgba(0,0,0,0.8) !default;
35
35
 
36
36
  // Width of the content area
37
- $content-width: 920px !default;
37
+ // $content-width: 920px !default;
38
38
 
39
39
  $on-palm: 600px !default;
40
40
  $on-laptop: 800px !default;
@@ -65,5 +65,6 @@ $on-laptop: 800px !default;
65
65
  "misc/article-menu",
66
66
  "misc/common-list",
67
67
  "misc/google-translate",
68
- "misc/gitment"
68
+ "misc/gitment",
69
+ "misc/click-to-top"
69
70
  ;
data/assets/css/main.scss CHANGED
@@ -33,4 +33,6 @@ $brand-color: map-get($brand-colors, "orangered");
33
33
  $brand-color: {{ site.brand_color | default: '#ff5100' }};
34
34
  }
35
35
 
36
+ $content-width: {{ site.content_width | default: '920px' }};
37
+
36
38
  @import "yat";
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.8.0
4
+ version: 1.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - jeffreytse
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-28 00:00:00.000000000 Z
11
+ date: 2023-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -140,9 +140,9 @@ dependencies:
140
140
  - - "~>"
141
141
  - !ruby/object:Gem::Version
142
142
  version: '0.2'
143
- description:
143
+ description:
144
144
  email:
145
- - jeffreytse.mail@gmail.com
145
+ - hello@jeffreytse.net
146
146
  executables: []
147
147
  extensions: []
148
148
  extra_rdoc_files: []
@@ -151,14 +151,18 @@ files:
151
151
  - README.md
152
152
  - _data/defaults.yml
153
153
  - _data/translate_langs.yml
154
+ - _includes/custom-head.html
155
+ - _includes/extensions/click-to-top.html
154
156
  - _includes/extensions/code-highlight.html
155
157
  - _includes/extensions/comments/disqus.html
156
158
  - _includes/extensions/comments/gitment.html
159
+ - _includes/extensions/comments/utterances.html
157
160
  - _includes/extensions/geopattern.html
158
161
  - _includes/extensions/google-analytics.html
159
162
  - _includes/extensions/google-translate.html
160
163
  - _includes/extensions/hashlocate.html
161
164
  - _includes/extensions/mathjax.html
165
+ - _includes/extensions/photo-swipe.html
162
166
  - _includes/extensions/theme-toggle.html
163
167
  - _includes/extensions/trianglify.html
164
168
  - _includes/functions.html
@@ -199,6 +203,7 @@ files:
199
203
  - _layouts/post.html
200
204
  - _layouts/tags.html
201
205
  - _sass/misc/article-menu.scss
206
+ - _sass/misc/click-to-top.scss
202
207
  - _sass/misc/common-list.scss
203
208
  - _sass/misc/gitment.scss
204
209
  - _sass/misc/google-translate.scss
@@ -215,7 +220,7 @@ licenses:
215
220
  - MIT
216
221
  metadata:
217
222
  plugin_type: theme
218
- post_install_message:
223
+ post_install_message:
219
224
  rdoc_options: []
220
225
  require_paths:
221
226
  - lib
@@ -230,8 +235,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
230
235
  - !ruby/object:Gem::Version
231
236
  version: '0'
232
237
  requirements: []
233
- rubygems_version: 3.2.19
234
- signing_key:
238
+ rubygems_version: 3.0.3.1
239
+ signing_key:
235
240
  specification_version: 4
236
241
  summary: Yet another theme for elegant writers with modern flat style and beautiful
237
242
  night/dark mode.