jekyll-theme-h2o-ac 1.2.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/_layouts/post.html CHANGED
@@ -108,8 +108,9 @@
108
108
  {% endif %}
109
109
 
110
110
  {% assign copyright = post.copyright %}
111
- {% if site.toc %}
111
+
112
112
  <div class="container">
113
+ {% include submenu.html %}
113
114
  <div class="contents">
114
115
  <article class="markdown-body post">
115
116
  {% if page.langs %}
@@ -162,64 +163,15 @@
162
163
  </div>
163
164
  </article>
164
165
  </div>
166
+ {% if page.content contains 'h1' or page.content contains 'h2' or page.content contains 'h3' or page.content contains 'h4' or page.content contains 'h5' or page.content contains 'h6' and site.toc %}
165
167
  <div class="table-of-contents">
166
168
  <h2>{{ post.outline }}</h2>
167
169
  {% include toc.html html=content %}
170
+ {% else %}
171
+ <div class="table-of-contents hidden">
172
+ {% endif %}
168
173
  </div>
169
174
  </div>
170
- {% else %}
171
- <article class="markdown-body">
172
- {% if page.langs %}
173
- <p><b>{{ locales.langs }}</b>
174
- {% assign langs = "zh-Hans, zh-Hant, en, ja" | split: ", " %}
175
- {% assign langnames = "简中, 繁中, EN, 日本語" | split: ", " %}
176
- {% if lang == site.default_lang %}
177
- {% assign url = page.url %}
178
- {% else %}
179
- {% assign urls = page.url | split: '/' %}
180
- {% assign url = "" %}
181
- {% for u in urls offset:2 %}
182
- {% assign url = url | append: "/" | append: u %}
183
- {% endfor %}
184
- {% endif %}
185
- {% for l in page.langs %}
186
- {% for i in (0..4) %}
187
- {% if langs[i] == l %}
188
- {% if l == page.lang %}
189
- {{ langnames[i] }}
190
- {% elsif l == site.default_lang %}
191
- <a href="{{ url }}">{{ langnames[i] }}</a>
192
- {% else %}
193
- {% assign prefix = "/" | append: l %}
194
- <a href="{{ url | prepend: prefix }}">{{ langnames[i] }}</a>
195
- {% endif %}
196
- {% endif %}
197
- {% endfor %}
198
- {% endfor %}
199
- </p>
200
- {% endif %}
201
- {{ page.content }}
202
- <div class="post-copyright">
203
- {% assign copyright = post.copyright %}
204
- <p>
205
- <span>{{ copyright.statement.name }}:</span>
206
- {{ copyright.statement.left }}
207
- <a href="{{ site.url }}" class="cplink">{{ site.title }}</a>
208
- {{ copyright.statement.middle }}
209
- </p>
210
- {% if site.cclicense %}
211
- <p>
212
- {{ copyright.statement.right1 }}
213
- <a href="https://creativecommons.org/licenses/by-sa/4.0/" target="_blank" class="extlinks">CC BY-NC-SA 4.0</a>
214
- {{ copyright.statement.right2 }}
215
- </p>
216
- {% endif %}
217
- <p><span>{{ copyright.title }}:</span>《 {{ page.title }} 》</p>
218
- <p><span>{{ copyright.link }}:</span><a href="{{ page.url | prepend: site.url }}" class="cplink">{{ page.url | prepend: site.url }}</a></p>
219
- <p class="tips">{{ copyright.statement.outdate1 }} <span></span> {{ copyright.statement.outdate2 }}</p>
220
- </div>
221
- </article>
222
- {% endif %}
223
175
 
224
176
  {% if site.social-share %}
225
177
  <div class="social-share-wrapper">
@@ -512,7 +464,7 @@
512
464
  });
513
465
  });
514
466
  </script>
515
- <script src="https://at.alicdn.com/t/font_3046306_skfh9jzzbbf.js"></script>
467
+ <script src="https://at.alicdn.com/t/c/font_3046306_9tox63bysiw.js"></script>
516
468
  {% include analytics.html %}
517
469
  {% include umami.html %}
518
470
  {% include busuanzi.html %}
@@ -0,0 +1,22 @@
1
+ {% capture stats_data %}
2
+ {"calendar":[
3
+ {% assign vdate = "2001-01-01" %}
4
+ {% assign vcount = 0 %}
5
+ {% assign total = 0 %}
6
+ {% for post in site.posts %}
7
+ {% assign cdate = post.date | date: "%Y-%m-%d" %}
8
+ {% if vdate == cdate %}
9
+ {% assign vcount = vcount | plus: 1 %}
10
+ {% else %}
11
+ {% if vdate != "2001-01-01" %}
12
+ {"date": "{{ vdate }}", "count": {{ vcount }} },
13
+ {% endif %}
14
+ {% assign vdate = cdate %}
15
+ {% assign vcount = 1 %}
16
+ {% endif %}
17
+ {% assign total = total | plus: 1 %}
18
+ {% endfor %}
19
+ {"date": "{{ vdate }}", "count": {{ vcount }} }],
20
+ "total": {{total}}
21
+ }
22
+ {% endcapture %}{{ stats_data | strip | strip_newlines}}