Skip to content

Commit debfbde

Browse files
committed
chore: change code indentation from 4 to 2
1 parent b534374 commit debfbde

Some content is hidden

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

60 files changed

+1575
-1528
lines changed

β€Ž.vscode/settings.jsonβ€Ž

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"editor.tabSize": 2,
3+
"beautify.config": {
4+
"indent_size": 2
5+
},
6+
"files.associations": {
7+
"*.html": "jekyll"
8+
}
9+
}
10+
Lines changed: 40 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<div class="m-article-data clearfix">
22
{% if page %}
3-
<meta itemprop="author" itemscope itemtype="https://schema.org/Person">
4-
{% if page.author %}
5-
<meta itemprop="name" content="{{ page.author }}"/>
6-
{% elsif site.author.name %}
7-
<meta itemprop="name" content="{{ site.author.name }}"/>
8-
{% endif %}
9-
</meta>
3+
<meta itemprop="author" itemscope itemtype="https://schema.org/Person">
4+
{% if page.author %}
5+
<meta itemprop="name" content="{{ page.author }}"/>
6+
{% elsif site.author.name %}
7+
<meta itemprop="name" content="{{ site.author.name }}"/>
8+
{% endif %}
9+
</meta>
1010
{% endif %}
1111

1212
{% if post %}
@@ -15,37 +15,39 @@
1515
{% assign cur_page = page %}
1616
{% endif %}
1717
{% if cur_page.tags[0] %}
18-
<ul class="inline-list tag-wrapper">
19-
{% if site.paths.all %}
20-
{% assign all_path = site.paths.all %}
21-
{% else %}
22-
{% assign all_path = '/all.html' %}
23-
{% endif %}
24-
{% for tag in cur_page.tags %}
25-
{% assign _tag = tag | strip | url_encode } %}
26-
{% assign __path = all_path | append: '?tag=' %}
27-
{% include snippets/prepend-baseurl.html %}
28-
<li><a class="round-rect-button"
29-
href="{{ __return | append: _tag | replace: '//', '/' }}">{{ tag }}
30-
</a></li>
31-
{% endfor %}
32-
</ul>
18+
<ul class="inline-list tag-wrapper">
19+
{% if site.paths.all %}
20+
{% assign all_path = site.paths.all %}
21+
{% else %}
22+
{% assign all_path = '/all.html' %}
23+
{% endif %}
24+
{% for tag in cur_page.tags %}
25+
{% assign _tag = tag | strip | url_encode } %}
26+
{% assign __path = all_path | append: '?tag=' %}
27+
{% include snippets/prepend-baseurl.html %}
28+
<li>
29+
<a class="round-rect-button" href="{{ __return | append: _tag | replace: '//', '/' }}">{{ tag }}</a>
30+
</li>
31+
{% endfor %}
32+
</ul>
3333
{% endif %}
34-
<div class="other-wrapper">
35-
{% if site.leancloud.app_id and site.leancloud.app_key and site.leancloud.app_class %}
36-
<div class="view-wrapper">
37-
<span class="article-view" id="post-key-{{ cur_page.key }}">0</span> views
38-
</div>
39-
{% endif %}
40-
<div class="date-wrapper">
41-
{% assign __locale = site.data.locale.ARTICLE_DATE_FORMAT } %}
42-
{% include snippets/locale-to-string.html %}
43-
{% if post %}
44-
<span class="article-meta">{{ post.date | date: __return }}</span>
45-
{% elsif page %}
46-
<time class="article-meta" datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">
47-
{{ page.date | date: __return }}</time>
48-
{% endif %}
49-
</div>
34+
<div class="other-wrapper">
35+
{% if site.leancloud.app_id and site.leancloud.app_key and site.leancloud.app_class %}
36+
<div class="view-wrapper">
37+
<span class="article-view" id="post-key-{{ cur_page.key }}">0
38+
</span> views
39+
</div>
40+
{% endif %}
41+
<div class="date-wrapper">
42+
{% assign __locale = site.data.locale.ARTICLE_DATE_FORMAT } %}
43+
{% include snippets/locale-to-string.html %}
44+
{% if post %}
45+
<span class="article-meta">{{ post.date | date: __return }}</span>
46+
{% elsif page %}
47+
<time class="article-meta" datetime="{{ page.date | date_to_xmlschema }}"
48+
itemprop="datePublished">{{ page.date | date: __return }}
49+
</time>
50+
{% endif %}
5051
</div>
52+
</div>
5153
</div>

β€Ž_includes/blog/footer.htmlβ€Ž

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
<div class="m-page-footer js-page-footer">
2-
<div class="main">
3-
<aside>
4-
{% include info/follow-me.html %}
5-
</aside>
6-
<footer class="site-info">
7-
<p>Β© {{ site.title }} {{ site.data.locale.COPYRIGHT_DATES }}</p>
8-
<p>Powered by <a
9-
title="Jekyll is a simple, blog-aware, static site generator." href="http://jekyllrb.com/">Jekyll</a> & <a
10-
title="TeXt is a succinct theme for blogging." href="https://github.com/kitian616/jekyll-TeXt-theme">TeXt Theme</a>.
11-
</p>
12-
</footer>
13-
</div>
2+
<div class="main">
3+
<aside> {% include info/follow-me.html %} </aside>
4+
<footer class="site-info">
5+
<p>Β© {{ site.title }} {{ site.data.locale.COPYRIGHT_DATES }}</p>
6+
<p>Powered by <a title="Jekyll is a simple, blog-aware, static site generator." href="http://jekyllrb.com/">Jekyll</a> & <a
7+
title="TeXt is a succinct theme for blogging." href="https://github.com/kitian616/jekyll-TeXt-theme">TeXt Theme</a>.</p>
8+
</footer>
9+
</div>
1410
</div>

β€Ž_includes/blog/header.htmlβ€Ž

Lines changed: 50 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,52 @@
11
<header class="m-page-header main clearfix">
2-
{% if site.paths.home %}
3-
{% assign __path = site.paths.home %}
4-
{% else %}
5-
{% assign __path = '/' %}
6-
{% endif %}
7-
{% include snippets/prepend-baseurl.html %}
8-
{% if site.title %}
9-
<a class="site-title" title="{% if site.description %}{{ site.description }}{% endif %}"
10-
href="{{ __return }}">{{ site.title }}</a>
11-
{% endif %}
12-
<div class="site-logo">
13-
{% include logo/logo.svg %}
14-
</div>
15-
<nav>
16-
<ul class="inline-list">
17-
{% assign __path = '/' %}
18-
{% include snippets/prepend-baseurl.html %}
19-
{% assign href = __return %}
20-
{% assign __locale = site.data.locale.NAV.HOME %}
21-
{% include snippets/locale-to-string.html %}
22-
<li><a href="{{ href }}">{{ __return }}</a></li>
23-
{% if site.paths.all %}
24-
{% assign __path = site.paths.all %}
25-
{% else %}
26-
{% assign __path = '/all.html' %}
27-
{% endif %}
28-
{% include snippets/prepend-baseurl.html %}
29-
{% assign href = __return %}
30-
{% assign __locale = site.data.locale.NAV.ALL %}
31-
{% include snippets/locale-to-string.html %}
32-
<li><a href="{{ href | append: "?tag=" | replace: '//', '/'}}">{{ __return }}</a></li>
33-
{% for list in site.nav_lists %}
34-
{% assign __path = list.url %}
35-
{% include snippets/prepend-baseurl.html %}
36-
{% assign href = __return %}
37-
{% assign __locale = list.titles %}
38-
{% include snippets/locale-to-string.html %}
39-
<li><a href="{{ href }}">{% if list.title %}{{ list.title }}{% else %}{{ __return }}{% endif %}</a></li>
40-
{% endfor %}
41-
{% if site.paths.rss %}
42-
{% assign __path = site.paths.rss %}
43-
{% else %}
44-
{% assign __path = '/feed.xml' %}
45-
{% endif %}
46-
{% include snippets/prepend-baseurl.html %}
47-
{% assign href = __return %}
48-
{% assign __locale = site.data.locale.NAV.RSS %}
49-
{% include snippets/locale-to-string.html %}
50-
<li><a type="application/rss+xml" href="{{ href }}">{{ __return }}</a></li>
51-
</ul>
52-
</nav>
2+
{% if site.paths.home %}
3+
{% assign __path = site.paths.home %}
4+
{% else %}
5+
{% assign __path = '/' %}
6+
{% endif %}
7+
{% include snippets/prepend-baseurl.html %}
8+
{% if site.title %}
9+
<a class="site-title" title="{% if site.description %}{{ site.description }}{% endif %}" href="{{ __return }}">{{ site.title }}</a>
10+
{% endif %}
11+
<div class="site-logo">
12+
{% include logo/logo.svg %}
13+
</div>
14+
<nav>
15+
<ul class="inline-list">
16+
{% assign __path = '/' %}
17+
{% include snippets/prepend-baseurl.html %}
18+
{% assign href = __return %}
19+
{% assign __locale = site.data.locale.NAV.HOME %}
20+
{% include snippets/locale-to-string.html %}
21+
<li><a href="{{ href }}">{{ __return }}</a></li>
22+
{% if site.paths.all %}
23+
{% assign __path = site.paths.all %}
24+
{% else %}
25+
{% assign __path = '/all.html' %}
26+
{% endif %}
27+
{% include snippets/prepend-baseurl.html %}
28+
{% assign href = __return %}
29+
{% assign __locale = site.data.locale.NAV.ALL %}
30+
{% include snippets/locale-to-string.html %}
31+
<li><a href="{{ href | append: "?tag=" | replace: '//', '/'}}">{{ __return }}</a></li>
32+
{% for list in site.nav_lists %}
33+
{% assign __path = list.url %}
34+
{% include snippets/prepend-baseurl.html %}
35+
{% assign href = __return %}
36+
{% assign __locale = list.titles %}
37+
{% include snippets/locale-to-string.html %}
38+
<li><a href="{{ href }}">{% if list.title %}{{ list.title }}{% else %}{{ __return }}{% endif %}</a></li>
39+
{% endfor %}
40+
{% if site.paths.rss %}
41+
{% assign __path = site.paths.rss %}
42+
{% else %}
43+
{% assign __path = '/feed.xml' %}
44+
{% endif %}
45+
{% include snippets/prepend-baseurl.html %}
46+
{% assign href = __return %}
47+
{% assign __locale = site.data.locale.NAV.RSS %}
48+
{% include snippets/locale-to-string.html %}
49+
<li><a type="application/rss+xml" href="{{ href }}">{{ __return }}</a></li>
50+
</ul>
51+
</nav>
5352
</header>

β€Ž_includes/blog/license.htmlβ€Ž

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
1-
{% assign locale = site.data.locale %}
21
<div class="m-license">
3-
<div class="clearfix">
4-
{% if site.repository and site.repository_tree %}
5-
{% assign __path = '/assets/images/octocat.jpg' %}
6-
{% include snippets/prepend-baseurl.html %}
7-
<a class="octocat" href="https://github.com/{{ site.repository }}/tree/{{ site.repository_tree }}/{{ page.path }}">
8-
<img alt="View on Github" src="{{ __return }}" /></a>
9-
{% assign __locale = locale.POST_ON_GITHUB %}
10-
{% include snippets/locale-to-string.html %}
11-
<p><a href="https://github.com/{{ site.repository }}/tree/{{ site.repository_tree }}/{{ page.path }}">{{ __return }}</a></p>
12-
{% endif %}
13-
{% assign __locale = locale.LICENSE_ANNOUNCE %}
14-
{% include snippets/locale-to-string.html %}
15-
<p>{{ __return | replace: "[LICENSE]", '<a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/">CC-BY-NC-4.0</a>' }}</p>
16-
{% assign __path = '/assets/images/license-cc4.png' %}
17-
{% include snippets/prepend-baseurl.html %}
18-
<a class="license" rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/">
19-
<img alt="Creative Commons License" src="{{ __return }}" />
20-
</a>
21-
{% assign __locale = locale.LICENSE_INTRO %}
22-
{% include snippets/locale-to-string.html %}
23-
<p>{{ __return }}</p>
24-
</div>
2+
{% assign locale = site.data.locale %}
3+
<div class="clearfix">
4+
{% if site.repository and site.repository_tree %}
5+
{% assign __path = '/assets/images/octocat.jpg' %}
6+
{% include snippets/prepend-baseurl.html %}
7+
<a class="octocat" href="https://github.com/{{ site.repository }}/tree/{{ site.repository_tree }}/{{ page.path }}">
8+
<img alt="View on Github" src="{{ __return }}" />
9+
</a>
10+
{% assign __locale = locale.POST_ON_GITHUB %}
11+
{% include snippets/locale-to-string.html %}
12+
<p><a href="https://github.com/{{ site.repository }}/tree/{{ site.repository_tree }}/{{ page.path }}">{{ __return }}</a></p>
13+
{% endif %}
14+
{% assign __locale = locale.LICENSE_ANNOUNCE %}
15+
{% include snippets/locale-to-string.html %}
16+
<p>{{ __return | replace: "[LICENSE]", '<a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/">CC-BY-NC-4.0</a>' }}</p>
17+
{% assign __path = '/assets/images/license-cc4.png' %}
18+
{% include snippets/prepend-baseurl.html %}
19+
<a class="license" rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/">
20+
<img alt="Creative Commons License" src="{{ __return }}" />
21+
</a>
22+
{% assign __locale = locale.LICENSE_INTRO %}
23+
{% include snippets/locale-to-string.html %}
24+
<p>{{ __return }}</p>
25+
</div>
2526
</div>

β€Ž_includes/blog/tags.htmlβ€Ž

Lines changed: 42 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3,47 +3,51 @@
33
{% assign cur_size = 1 %}
44
{% assign _tags = site.tags | sort %}
55
{% for tag in _tags %}
6-
{% assign cur_size = tag[1].size %}
7-
{% if cur_size > max_size%}
8-
{% assign max_size = cur_size %}
9-
{% endif %}
10-
{% if cur_size < min_size %}
11-
{% assign min_size = cur_size %}
12-
{% endif %}
6+
{% assign cur_size = tag[1].size %}
7+
{% if cur_size > max_size %}
8+
{% assign max_size = cur_size %}
9+
{% endif %}
10+
{% if cur_size < min_size %}
11+
{% assign min_size = cur_size %}
12+
{% endif %}
1313
{% endfor %}
1414
{% assign gap_size = max_size | minus: min_size | plus: 1 | divided_by: 4 %}
1515
{% if gap_size < 1 %}
16-
{% assign gap_size = 1 %}
16+
{% assign gap_size = 1 %}
1717
{% endif %}
1818
<div class="m-tags">
19-
<ul class="inline-list">
20-
<li><button type="button" class="js-article-tag js-tag-show-all all round-rect-button" onclick="tagSelect('')">
21-
Show All<div class="tag-count"> {{ site.posts | size }} </div>
22-
</button></li>
23-
{% for tag in _tags %}
24-
{% assign cur_size = tag[1].size %}
25-
{% assign m1 = min_size %}
26-
{% assign n1 = m1 | plus: gap_size %}
27-
{% assign m2 = n1 %}
28-
{% assign n2 = m2 | plus: gap_size %}
29-
{% assign m3 = n2 %}
30-
{% assign n3 = m3 | plus: gap_size %}
31-
{% assign m4 = n3 %}
32-
{% assign n4 = m4 | plus: gap_size %}
33-
{% if cur_size >= m1 and cur_size < n1 %}
34-
{% assign c_index = 1 %}
35-
{% elsif cur_size >= m2 and cur_size < n2 %}
36-
{% assign c_index = 2 %}
37-
{% elsif cur_size >= m3 and cur_size < n3 %}
38-
{% assign c_index = 3 %}
39-
{% elsif cur_size >= m4 and cur_size < n4 %}
40-
{% assign c_index = 4 %}
41-
{% else %}
42-
{% assign c_index = 4 %}
43-
{% endif %}
44-
<li><button type="button" class="js-article-tag tag-{{ c_index }} round-rect-button" data-tag="{{ tag[0] | strip | url_encode }}" onclick="tagSelect('{{ tag[0] | strip | url_encode }}')">
45-
<span>{{ tag[0] | strip }}</span><div class="tag-count">{{ tag[1].size }}</div>
46-
</button></li>
47-
{% endfor %}
48-
</ul>
19+
<ul class="inline-list">
20+
<li>
21+
<button type="button" class="js-article-tag js-tag-show-all all round-rect-button" onclick="tagSelect('')">Show All
22+
<div class="tag-count">{{ site.posts | size }}</div>
23+
</button>
24+
</li>
25+
{% for tag in _tags %}
26+
{% assign cur_size = tag[1].size %}
27+
{% assign m1 = min_size %}
28+
{% assign n1 = m1 | plus: gap_size %}
29+
{% assign m2 = n1 %}
30+
{% assign n2 = m2 | plus: gap_size %}
31+
{% assign m3 = n2 %}
32+
{% assign n3 = m3 | plus: gap_size %}
33+
{% assign m4 = n3 %}
34+
{% assign n4 = m4 | plus: gap_size %}
35+
{% if cur_size >= m1 and cur_size < n1 %}
36+
{% assign c_index = 1 %}
37+
{% elsif cur_size >= m2 and cur_size < n2 %}
38+
{% assign c_index = 2 %}
39+
{% elsif cur_size >= m3 and cur_size < n3 %}
40+
{% assign c_index = 3 %}
41+
{% elsif cur_size >= m4 and cur_size < n4 %}
42+
{% assign c_index = 4 %}
43+
{% else %}
44+
{% assign c_index = 4 %}
45+
{% endif %}
46+
<li><button type="button" class="js-article-tag tag-{{ c_index }} round-rect-button"
47+
data-tag="{{ tag[0] | strip | url_encode }}" onclick="tagSelect('{{ tag[0] | strip | url_encode }}')">
48+
<span>{{ tag[0] | strip }}</span><div class="tag-count">{{ tag[1].size }}</div>
49+
</button>
50+
</li>
51+
{% endfor %}
52+
</ul>
4953
</div>

β€Ž_includes/icon/mail.svgβ€Ž

Lines changed: 4 additions & 4 deletions
Loading

β€Ž_includes/icon/menu.svgβ€Ž

Lines changed: 2 additions & 2 deletions
Loading

β€Ž_includes/icon/next.svgβ€Ž

Lines changed: 2 additions & 2 deletions
Loading

β€Ž_includes/icon/previous.svgβ€Ž

Lines changed: 2 additions & 2 deletions
Loading

0 commit comments

Comments
Β (0)