Skip to content

Commit 0c3c5e1

Browse files
committed
feat: update style, edit_on_github config
1 parent 565ce72 commit 0c3c5e1

File tree

92 files changed

+477
-440
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+477
-440
lines changed

404.html

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
---
22
layout: 404
3-
title: 404
4-
show_title: false
53
---

Gemfile

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
source 'https://rubygems.org/'
1+
source "https://rubygems.org"
22

3-
gemspec
3+
gem "github-pages", group: :jekyll_plugins
44

5-
# For dev under windows, I know that yikes....
6-
7-
# gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]
8-
# gem 'wdm', '>= 0.1.0' if Gem.win_platform?
5+
gem "tzinfo-data"
6+
gem "wdm", "~> 0.1.0" if Gem.win_platform?

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ TeXt is a Jekyll theme for personal site, blog, project, documentation and so on
2121
- Search
2222
- Page views ([LeanCloud](https://leancloud.cn/))
2323
- Emoji ([Jemoji](https://github.com/jekyll/jemoji))
24-
- Comment ([Disqus](https://disqus.com/))
24+
- Comments ([Disqus](https://disqus.com/))
2525
- Google Analytics
2626
- Contact information (Email, Facebook, Twitter, Linkedin, Weibo, Zhihu, etc)
2727
- Semantic HTML

_config.yml

+2
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,11 @@ defaults:
152152
path: ""
153153
type: posts
154154
values:
155+
layout: article
155156
license: true
156157
aside:
157158
toc: true
159+
show_edit_on_github: true
158160
pageview: true
159161

160162

_data/locale.yml

+4-10
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,11 @@ LICENSE_ANNOUNCE:
6969
zh-Hans: "本文遵守 [LICENSE] 许可协议。"
7070
zh-Hant: "本文遵守 [LICENSE] 許可協議。"
7171

72-
LICENSE_INTRO:
73-
en:
74-
zh: "欢迎转载,转载需注明出处,且禁止用于商业目的。"
75-
zh-Hans: "欢迎转载,转载需注明出处,且禁止用于商业目的。"
76-
zh-Hant: "歡迎轉載,轉載需註明出處,且禁止用於商業目的。"
77-
7872
POST_ON_GITHUB:
79-
en: "View this POST on Github."
80-
zh: "在 Github 上查阅此文。"
81-
zh-Hans: "在 Github 上查阅此文。"
82-
zh-Hant: "在 Github 上查閱此文。"
73+
en: "Edit on Github"
74+
zh: "在 Github 上修改"
75+
zh-Hans: "在 Github 上修改"
76+
zh-Hant: "在 Github 上修改"
8377

8478
FOLLOW_ME:
8579
en: "Follow me on [NAME]."

_data/variables.yml

+8-5
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@ default:
1212
chart: false
1313
toc:
1414
selectors: 'h1,h2,h3'
15-
show_title: true
16-
show_header: true
17-
full_width: false
18-
pageview: false
19-
excerpt_type: text
2015
sources: bootcdn
16+
excerpt_type: text
17+
18+
page:
19+
show_header: true
20+
show_title: true
21+
show_edit_on_github: false
22+
full_width: false
23+
pageview: false
2124

2225
sources:
2326
bootcdn:

_includes/analytics-providers/google.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
{%- if site.ga_tracking_id -%}
1+
{%- if site.analytics.google.tracking_id -%}
22

33
<script>
44
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
55
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
66
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
77
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
88

9-
ga('create', '{{ site.ga_tracking_id }}', 'auto');
9+
ga('create', '{{ site.analytics.google.tracking_id }}', 'auto');
1010
ga('send', 'pageview');
11-
{% if site.ga_anonymize_ip == true %}
11+
{% if site.analytics.google.anonymize_ip == true %}
1212
ga('set', 'anonymizeIp', true);
1313
{% endif %}
1414
</script>

_includes/analytics.html

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
{%- if jekyll.environment != "development" -%}
2-
{%- include analytics-providers/google.html -%}
1+
{%- if jekyll.environment != 'development' -%}
2+
{%- if site.analytics.provider == 'google' -%}
3+
{%- include analytics-providers/google.html -%}
4+
{%- elsif site.analytics.provider == 'custom' -%}
5+
{%- include analytics-providers/custom.html -%}
6+
{%- endif -%}
37
{%- endif -%}
File renamed without changes.

_includes/article-footer/license.html

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<div class="license">
2+
{%- assign locale = site.data.locale -%}
3+
{%- assign __locale = locale.LICENSE_ANNOUNCE -%}
4+
{%- include snippets/locale-to-string.html -%}
5+
{%- assign _license_announce = __return -%}
6+
{%- assign __path = '/assets/images/license-cc4.png' -%}
7+
{%- include snippets/prepend-baseurl.html -%}
8+
{%- assign _license_img_src = __return -%}
9+
<p>{{ _license_announce | replace: "[LICENSE]", '<a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/">CC-BY-NC-4.0</a>' }}
10+
<a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/">
11+
<img alt="Creative Commons License" src="{{ _license_img_src }}" />
12+
</a>
13+
</p>
14+
</div>

_includes/article-info.html

+18-17
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{%- include snippets/assign.html -%}
1010
{%- assign _pageview = __return -%}
1111

12-
<div class="article-info clearfix">
12+
<div class="article__info clearfix">
1313
{%- if page -%}
1414
<meta itemprop="author" itemscope itemtype="https://schema.org/Person">
1515
{%- if page.author -%}
@@ -20,7 +20,7 @@
2020
</meta>
2121
{%- endif -%}
2222
{%- if cur_page.tags[0] -%}
23-
<ul class="article-info__left-col menu">
23+
<ul class="left-col menu">
2424
{%- if site.paths.all -%}
2525
{%- assign all_path = site.paths.all -%}
2626
{%- else -%}
@@ -36,29 +36,30 @@
3636
{%- endfor -%}
3737
</ul>
3838
{%- endif -%}
39-
40-
{%- if (_pageview or post) and cur_page.date -%}
41-
<ul class="article-info__right-col menu">
39+
{%- if (_pageview or post) or cur_page.date -%}
40+
<ul class="right-col menu">
4241
{%- if _pageview or post -%}
43-
{%- if site.leancloud.app_id and site.leancloud.app_key and site.leancloud.app_class -%}
42+
{%- if site.pageview.provider -%}
4443
{%- assign __locale = site.data.locale.VIEWS } -%}
4544
{%- include snippets/locale-to-string.html -%}
4645
<li class="pageview">
4746
<span class="js-pageview" data-page-key="{{ cur_page.key }}">0</span> {{ __return }}
4847
</li>
4948
{%- endif -%}
5049
{%- endif -%}
51-
<li class="publish-date">
52-
{%- assign __locale = site.data.locale.ARTICLE_DATE_FORMAT } -%}
53-
{%- include snippets/locale-to-string.html -%}
54-
{%- if post -%}
55-
<span>{{ cur_page.date | date: __return }}</span>
56-
{%- elsif page -%}
57-
<time datetime="{{ page.date | date_to_xmlschema }}"
58-
itemprop="datePublished">{{ cur_page.date | date: __return }}
59-
</time>
60-
{%- endif -%}
61-
</li>
50+
{%- if cur_page.date -%}
51+
<li class="publish-date">
52+
{%- assign __locale = site.data.locale.ARTICLE_DATE_FORMAT } -%}
53+
{%- include snippets/locale-to-string.html -%}
54+
{%- if post -%}
55+
<span>{{ cur_page.date | date: __return }}</span>
56+
{%- elsif page -%}
57+
<time datetime="{{ page.date | date_to_xmlschema }}"
58+
itemprop="datePublished">{{ cur_page.date | date: __return }}
59+
</time>
60+
{%- endif -%}
61+
</li>
62+
{%- endif -%}
6263
</ul>
6364
{%- endif -%}
6465
</div>

_includes/comment.html

-9
This file was deleted.

_includes/comments-providers/custom.html

Whitespace-only changes.

_includes/comment-providers/disqus.html _includes/comments-providers/disqus.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{%- if page.key and
2-
site.disqus.shortname -%}
2+
site.comments.disqus.shortname -%}
33

44
<div id="disqus_thread"></div>
55
<script>
@@ -12,7 +12,7 @@
1212
};
1313
(function() { // DON'T EDIT BELOW THIS LINE
1414
var d = document, s = d.createElement('script');
15-
s.src = 'https://{{ site.disqus.shortname }}.disqus.com/embed.js';
15+
s.src = 'https://{{ site.comments.disqus.shortname }}.disqus.com/embed.js';
1616
s.setAttribute('data-timestamp', +new Date());
1717
(d.head || d.body).appendChild(s);
1818
})();

_includes/comment-providers/gitalk.html _includes/comments-providers/gitalk.html

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{%- if page.key and
2-
site.gitalk.clientID and
3-
site.gitalk.clientSecret and
4-
site.gitalk.repository and
5-
site.gitalk.owner and
6-
site.gitalk.admin -%}
2+
site.comments.gitalk.clientID and
3+
site.comments.gitalk.clientSecret and
4+
site.comments.gitalk.repository and
5+
site.comments.gitalk.owner and
6+
site.comments.gitalk.admin -%}
77

88
{%- include snippets/get-sources.html -%}
99
{%- assign _sources = __return -%}
1010
<div id="js-gitalk-container"></div>
1111
{%- assign _admin = '' -%}
12-
{%- for adminId in site.gitalk.admin -%}
12+
{%- for adminId in site.comments.gitalk.admin -%}
1313
{%- assign _admin = _admin | append: ", '" | append: adminId | append: "'" -%}
1414
{%- endfor -%}
1515
{%- assign last = _admin | size | minus: 1 -%}
@@ -18,10 +18,10 @@
1818
window.Lazyload.css('{{ _sources.gitalk.css }}');
1919
window.Lazyload.js('{{ _sources.gitalk.js }}', function() {
2020
var gitalk = new Gitalk({
21-
clientID: '{{ site.gitalk.clientID }}',
22-
clientSecret: '{{ site.gitalk.clientSecret }}',
23-
repo: '{{ site.gitalk.repository }}',
24-
owner: '{{ site.gitalk.owner }}',
21+
clientID: '{{ site.comments.gitalk.clientID }}',
22+
clientSecret: '{{ site.comments.gitalk.clientSecret }}',
23+
repo: '{{ site.comments.gitalk.repository }}',
24+
owner: '{{ site.comments.gitalk.owner }}',
2525
admin: [{{ _admin }}],
2626
id: '{{ page.key }}'
2727
});

_includes/comments.html

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{%- if jekyll.environment != 'development' -%}
2+
{%- if site.comments.provider == 'disqus' -%}
3+
{%- include comments-providers/disqus.html -%}
4+
{%- elsif site.comments.provider == 'gitalk' -%}
5+
{%- include comments-providers/gitalk.html -%}
6+
{%- elsif site.comments.provider == 'custom' -%}
7+
{%- include comments-providers/custom.html -%}
8+
{%- endif -%}
9+
10+
{%- endif -%}

_includes/license.html

-26
This file was deleted.

_includes/pageview-providers/custom/home.html

Whitespace-only changes.

_includes/pageview-providers/custom/post.html

Whitespace-only changes.

_includes/pageview-providers/leancloud/home.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{%- include snippets/get-sources.html -%}
22
{%- assign _sources = __return -%}
33

4-
{%- assign _LEANCLOUD_APP_ID = site.leancloud.app_id -%}
5-
{%- assign _LEANCLOUD_APP_KEY = site.leancloud.app_key -%}
6-
{%- assign _LEANCLOUD_APP_CLASS = site.leancloud.app_class -%}
4+
{%- assign _LEANCLOUD_APP_ID = site.pageview.leancloud.app_id -%}
5+
{%- assign _LEANCLOUD_APP_KEY = site.pageview.leancloud.app_key -%}
6+
{%- assign _LEANCLOUD_APP_CLASS = site.pageview.leancloud.app_class -%}
77

88
{%- if _LEANCLOUD_APP_ID and
99
_LEANCLOUD_APP_KEY and

_includes/pageview-providers/leancloud/post.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{%- include snippets/get-sources.html -%}
22
{%- assign _sources = __return -%}
33

4-
{%- assign _LEANCLOUD_APP_ID = site.leancloud.app_id -%}
5-
{%- assign _LEANCLOUD_APP_KEY = site.leancloud.app_key -%}
6-
{%- assign _LEANCLOUD_APP_CLASS = site.leancloud.app_class -%}
4+
{%- assign _LEANCLOUD_APP_ID = site.pageview.leancloud.app_id -%}
5+
{%- assign _LEANCLOUD_APP_KEY = site.pageview.leancloud.app_key -%}
6+
{%- assign _LEANCLOUD_APP_CLASS = site.pageview.leancloud.app_class -%}
77

88
{%- if page.key and
99
_LEANCLOUD_APP_ID and

_includes/pageview.html

+10-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
{%- if page.layout == "home" -%}
88

99
{%- if jekyll.environment != "development" -%}
10-
{%- include pageview-providers/leancloud/home.html -%}
10+
{%- if site.pageview.provider == 'leancloud' -%}
11+
{%- include pageview-providers/leancloud/home.html -%}
12+
{%- elsif site.pageview.provider == 'custom' -%}
13+
{%- include pageview-providers/custom/home.html -%}
14+
{%- endif -%}
1115
{%- endif -%}
1216

1317

@@ -16,7 +20,11 @@
1620

1721
{%- if jekyll.environment != "development" and
1822
jekyll.environment != "beta" -%}
19-
{%- include pageview-providers/leancloud/post.html -%}
23+
{%- if site.pageview.provider == 'leancloud' -%}
24+
{%- include pageview-providers/leancloud/post.html -%}
25+
{%- elsif site.pageview.provider == 'custom' -%}
26+
{%- include pageview-providers/custom/post.html -%}
27+
{%- endif -%}
2028
{%- endif -%}
2129

2230
{%- endif -%}

_includes/snippets/page-title.html

+16-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1-
{%- assign __locale = page.titles -%}
2-
{%- include snippets/locale-to-string.html -%}
3-
{%- assign __localeTitle = __return -%}
4-
{%- if page.title -%}
5-
{%- assign __return = page.title -%}
6-
{%- else -%}
1+
{%- assign __source = page.title -%}
2+
{%- assign __target = layout.title -%}
3+
{%- include snippets/assign.html -%}
4+
{%- assign _title = __return -%}
5+
6+
{%- assign __source = page.titles -%}
7+
{%- assign __target = layout.titles -%}
8+
{%- include snippets/assign.html -%}
9+
{%- assign _titles = __return -%}
10+
11+
{%- if _title -%}
12+
{%- assign __return = _title -%}
13+
{%- elsif _titles -%}
14+
{%- assign __locale = _titles -%}
15+
{%- include snippets/locale-to-string.html -%}
16+
{%- assign __localeTitle = __return -%}
717
{%- assign __return = __localeTitle -%}
818
{%- endif -%}

_layouts/archive.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
---
22
layout: page
33
titles:
4-
en: All Posts
4+
en: Archive
55
zh: 归档
66
zh-Hans: 归档
77
zh-Hant: 歸檔
88
show_title: false
99
---
10+
1011
<div class="layout--all js-all">
1112
<div class="search-box js-search-box">
1213
<div class="icon-search"><i class="fas fa-search"></i></div>

0 commit comments

Comments
 (0)