Skip to content

Commit

Permalink
chore: change code indentation from 4 to 2
Browse files Browse the repository at this point in the history
  • Loading branch information
kitian616 committed Nov 21, 2017
1 parent b534374 commit debfbde
Show file tree
Hide file tree
Showing 60 changed files with 1,575 additions and 1,528 deletions.
10 changes: 10 additions & 0 deletions .vscode/settings.json
@@ -0,0 +1,10 @@
{
"editor.tabSize": 2,
"beautify.config": {
"indent_size": 2
},
"files.associations": {
"*.html": "jekyll"
}
}

78 changes: 40 additions & 38 deletions _includes/blog/article-data.html
@@ -1,12 +1,12 @@
<div class="m-article-data clearfix">
{% if page %}
<meta itemprop="author" itemscope itemtype="https://schema.org/Person">
{% if page.author %}
<meta itemprop="name" content="{{ page.author }}"/>
{% elsif site.author.name %}
<meta itemprop="name" content="{{ site.author.name }}"/>
{% endif %}
</meta>
<meta itemprop="author" itemscope itemtype="https://schema.org/Person">
{% if page.author %}
<meta itemprop="name" content="{{ page.author }}"/>
{% elsif site.author.name %}
<meta itemprop="name" content="{{ site.author.name }}"/>
{% endif %}
</meta>
{% endif %}

{% if post %}
Expand All @@ -15,37 +15,39 @@
{% assign cur_page = page %}
{% endif %}
{% if cur_page.tags[0] %}
<ul class="inline-list tag-wrapper">
{% if site.paths.all %}
{% assign all_path = site.paths.all %}
{% else %}
{% assign all_path = '/all.html' %}
{% endif %}
{% for tag in cur_page.tags %}
{% assign _tag = tag | strip | url_encode } %}
{% assign __path = all_path | append: '?tag=' %}
{% include snippets/prepend-baseurl.html %}
<li><a class="round-rect-button"
href="{{ __return | append: _tag | replace: '//', '/' }}">{{ tag }}
</a></li>
{% endfor %}
</ul>
<ul class="inline-list tag-wrapper">
{% if site.paths.all %}
{% assign all_path = site.paths.all %}
{% else %}
{% assign all_path = '/all.html' %}
{% endif %}
{% for tag in cur_page.tags %}
{% assign _tag = tag | strip | url_encode } %}
{% assign __path = all_path | append: '?tag=' %}
{% include snippets/prepend-baseurl.html %}
<li>
<a class="round-rect-button" href="{{ __return | append: _tag | replace: '//', '/' }}">{{ tag }}</a>
</li>
{% endfor %}
</ul>
{% endif %}
<div class="other-wrapper">
{% if site.leancloud.app_id and site.leancloud.app_key and site.leancloud.app_class %}
<div class="view-wrapper">
<span class="article-view" id="post-key-{{ cur_page.key }}">0</span> views
</div>
{% endif %}
<div class="date-wrapper">
{% assign __locale = site.data.locale.ARTICLE_DATE_FORMAT } %}
{% include snippets/locale-to-string.html %}
{% if post %}
<span class="article-meta">{{ post.date | date: __return }}</span>
{% elsif page %}
<time class="article-meta" datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">
{{ page.date | date: __return }}</time>
{% endif %}
</div>
<div class="other-wrapper">
{% if site.leancloud.app_id and site.leancloud.app_key and site.leancloud.app_class %}
<div class="view-wrapper">
<span class="article-view" id="post-key-{{ cur_page.key }}">0
</span> views
</div>
{% endif %}
<div class="date-wrapper">
{% assign __locale = site.data.locale.ARTICLE_DATE_FORMAT } %}
{% include snippets/locale-to-string.html %}
{% if post %}
<span class="article-meta">{{ post.date | date: __return }}</span>
{% elsif page %}
<time class="article-meta" datetime="{{ page.date | date_to_xmlschema }}"
itemprop="datePublished">{{ page.date | date: __return }}
</time>
{% endif %}
</div>
</div>
</div>
20 changes: 8 additions & 12 deletions _includes/blog/footer.html
@@ -1,14 +1,10 @@
<div class="m-page-footer js-page-footer">
<div class="main">
<aside>
{% include info/follow-me.html %}
</aside>
<footer class="site-info">
<p>漏 {{ site.title }} {{ site.data.locale.COPYRIGHT_DATES }}</p>
<p>Powered by <a
title="Jekyll is a simple, blog-aware, static site generator." href="http://jekyllrb.com/">Jekyll</a> & <a
title="TeXt is a succinct theme for blogging." href="https://github.com/kitian616/jekyll-TeXt-theme">TeXt Theme</a>.
</p>
</footer>
</div>
<div class="main">
<aside> {% include info/follow-me.html %} </aside>
<footer class="site-info">
<p>漏 {{ site.title }} {{ site.data.locale.COPYRIGHT_DATES }}</p>
<p>Powered by <a title="Jekyll is a simple, blog-aware, static site generator." href="http://jekyllrb.com/">Jekyll</a> & <a
title="TeXt is a succinct theme for blogging." href="https://github.com/kitian616/jekyll-TeXt-theme">TeXt Theme</a>.</p>
</footer>
</div>
</div>
101 changes: 50 additions & 51 deletions _includes/blog/header.html
@@ -1,53 +1,52 @@
<header class="m-page-header main clearfix">
{% if site.paths.home %}
{% assign __path = site.paths.home %}
{% else %}
{% assign __path = '/' %}
{% endif %}
{% include snippets/prepend-baseurl.html %}
{% if site.title %}
<a class="site-title" title="{% if site.description %}{{ site.description }}{% endif %}"
href="{{ __return }}">{{ site.title }}</a>
{% endif %}
<div class="site-logo">
{% include logo/logo.svg %}
</div>
<nav>
<ul class="inline-list">
{% assign __path = '/' %}
{% include snippets/prepend-baseurl.html %}
{% assign href = __return %}
{% assign __locale = site.data.locale.NAV.HOME %}
{% include snippets/locale-to-string.html %}
<li><a href="{{ href }}">{{ __return }}</a></li>
{% if site.paths.all %}
{% assign __path = site.paths.all %}
{% else %}
{% assign __path = '/all.html' %}
{% endif %}
{% include snippets/prepend-baseurl.html %}
{% assign href = __return %}
{% assign __locale = site.data.locale.NAV.ALL %}
{% include snippets/locale-to-string.html %}
<li><a href="{{ href | append: "?tag=" | replace: '//', '/'}}">{{ __return }}</a></li>
{% for list in site.nav_lists %}
{% assign __path = list.url %}
{% include snippets/prepend-baseurl.html %}
{% assign href = __return %}
{% assign __locale = list.titles %}
{% include snippets/locale-to-string.html %}
<li><a href="{{ href }}">{% if list.title %}{{ list.title }}{% else %}{{ __return }}{% endif %}</a></li>
{% endfor %}
{% if site.paths.rss %}
{% assign __path = site.paths.rss %}
{% else %}
{% assign __path = '/feed.xml' %}
{% endif %}
{% include snippets/prepend-baseurl.html %}
{% assign href = __return %}
{% assign __locale = site.data.locale.NAV.RSS %}
{% include snippets/locale-to-string.html %}
<li><a type="application/rss+xml" href="{{ href }}">{{ __return }}</a></li>
</ul>
</nav>
{% if site.paths.home %}
{% assign __path = site.paths.home %}
{% else %}
{% assign __path = '/' %}
{% endif %}
{% include snippets/prepend-baseurl.html %}
{% if site.title %}
<a class="site-title" title="{% if site.description %}{{ site.description }}{% endif %}" href="{{ __return }}">{{ site.title }}</a>
{% endif %}
<div class="site-logo">
{% include logo/logo.svg %}
</div>
<nav>
<ul class="inline-list">
{% assign __path = '/' %}
{% include snippets/prepend-baseurl.html %}
{% assign href = __return %}
{% assign __locale = site.data.locale.NAV.HOME %}
{% include snippets/locale-to-string.html %}
<li><a href="{{ href }}">{{ __return }}</a></li>
{% if site.paths.all %}
{% assign __path = site.paths.all %}
{% else %}
{% assign __path = '/all.html' %}
{% endif %}
{% include snippets/prepend-baseurl.html %}
{% assign href = __return %}
{% assign __locale = site.data.locale.NAV.ALL %}
{% include snippets/locale-to-string.html %}
<li><a href="{{ href | append: "?tag=" | replace: '//', '/'}}">{{ __return }}</a></li>
{% for list in site.nav_lists %}
{% assign __path = list.url %}
{% include snippets/prepend-baseurl.html %}
{% assign href = __return %}
{% assign __locale = list.titles %}
{% include snippets/locale-to-string.html %}
<li><a href="{{ href }}">{% if list.title %}{{ list.title }}{% else %}{{ __return }}{% endif %}</a></li>
{% endfor %}
{% if site.paths.rss %}
{% assign __path = site.paths.rss %}
{% else %}
{% assign __path = '/feed.xml' %}
{% endif %}
{% include snippets/prepend-baseurl.html %}
{% assign href = __return %}
{% assign __locale = site.data.locale.NAV.RSS %}
{% include snippets/locale-to-string.html %}
<li><a type="application/rss+xml" href="{{ href }}">{{ __return }}</a></li>
</ul>
</nav>
</header>
47 changes: 24 additions & 23 deletions _includes/blog/license.html
@@ -1,25 +1,26 @@
{% assign locale = site.data.locale %}
<div class="m-license">
<div class="clearfix">
{% if site.repository and site.repository_tree %}
{% assign __path = '/assets/images/octocat.jpg' %}
{% include snippets/prepend-baseurl.html %}
<a class="octocat" href="https://github.com/{{ site.repository }}/tree/{{ site.repository_tree }}/{{ page.path }}">
<img alt="View on Github" src="{{ __return }}" /></a>
{% assign __locale = locale.POST_ON_GITHUB %}
{% include snippets/locale-to-string.html %}
<p><a href="https://github.com/{{ site.repository }}/tree/{{ site.repository_tree }}/{{ page.path }}">{{ __return }}</a></p>
{% endif %}
{% assign __locale = locale.LICENSE_ANNOUNCE %}
{% include snippets/locale-to-string.html %}
<p>{{ __return | replace: "[LICENSE]", '<a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/">CC-BY-NC-4.0</a>' }}</p>
{% assign __path = '/assets/images/license-cc4.png' %}
{% include snippets/prepend-baseurl.html %}
<a class="license" rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/">
<img alt="Creative Commons License" src="{{ __return }}" />
</a>
{% assign __locale = locale.LICENSE_INTRO %}
{% include snippets/locale-to-string.html %}
<p>{{ __return }}</p>
</div>
{% assign locale = site.data.locale %}
<div class="clearfix">
{% if site.repository and site.repository_tree %}
{% assign __path = '/assets/images/octocat.jpg' %}
{% include snippets/prepend-baseurl.html %}
<a class="octocat" href="https://github.com/{{ site.repository }}/tree/{{ site.repository_tree }}/{{ page.path }}">
<img alt="View on Github" src="{{ __return }}" />
</a>
{% assign __locale = locale.POST_ON_GITHUB %}
{% include snippets/locale-to-string.html %}
<p><a href="https://github.com/{{ site.repository }}/tree/{{ site.repository_tree }}/{{ page.path }}">{{ __return }}</a></p>
{% endif %}
{% assign __locale = locale.LICENSE_ANNOUNCE %}
{% include snippets/locale-to-string.html %}
<p>{{ __return | replace: "[LICENSE]", '<a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/">CC-BY-NC-4.0</a>' }}</p>
{% assign __path = '/assets/images/license-cc4.png' %}
{% include snippets/prepend-baseurl.html %}
<a class="license" rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/">
<img alt="Creative Commons License" src="{{ __return }}" />
</a>
{% assign __locale = locale.LICENSE_INTRO %}
{% include snippets/locale-to-string.html %}
<p>{{ __return }}</p>
</div>
</div>
80 changes: 42 additions & 38 deletions _includes/blog/tags.html
Expand Up @@ -3,47 +3,51 @@
{% assign cur_size = 1 %}
{% assign _tags = site.tags | sort %}
{% for tag in _tags %}
{% assign cur_size = tag[1].size %}
{% if cur_size > max_size%}
{% assign max_size = cur_size %}
{% endif %}
{% if cur_size < min_size %}
{% assign min_size = cur_size %}
{% endif %}
{% assign cur_size = tag[1].size %}
{% if cur_size > max_size %}
{% assign max_size = cur_size %}
{% endif %}
{% if cur_size < min_size %}
{% assign min_size = cur_size %}
{% endif %}
{% endfor %}
{% assign gap_size = max_size | minus: min_size | plus: 1 | divided_by: 4 %}
{% if gap_size < 1 %}
{% assign gap_size = 1 %}
{% assign gap_size = 1 %}
{% endif %}
<div class="m-tags">
<ul class="inline-list">
<li><button type="button" class="js-article-tag js-tag-show-all all round-rect-button" onclick="tagSelect('')">
Show All<div class="tag-count"> {{ site.posts | size }} </div>
</button></li>
{% for tag in _tags %}
{% assign cur_size = tag[1].size %}
{% assign m1 = min_size %}
{% assign n1 = m1 | plus: gap_size %}
{% assign m2 = n1 %}
{% assign n2 = m2 | plus: gap_size %}
{% assign m3 = n2 %}
{% assign n3 = m3 | plus: gap_size %}
{% assign m4 = n3 %}
{% assign n4 = m4 | plus: gap_size %}
{% if cur_size >= m1 and cur_size < n1 %}
{% assign c_index = 1 %}
{% elsif cur_size >= m2 and cur_size < n2 %}
{% assign c_index = 2 %}
{% elsif cur_size >= m3 and cur_size < n3 %}
{% assign c_index = 3 %}
{% elsif cur_size >= m4 and cur_size < n4 %}
{% assign c_index = 4 %}
{% else %}
{% assign c_index = 4 %}
{% endif %}
<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 }}')">
<span>{{ tag[0] | strip }}</span><div class="tag-count">{{ tag[1].size }}</div>
</button></li>
{% endfor %}
</ul>
<ul class="inline-list">
<li>
<button type="button" class="js-article-tag js-tag-show-all all round-rect-button" onclick="tagSelect('')">Show All
<div class="tag-count">{{ site.posts | size }}</div>
</button>
</li>
{% for tag in _tags %}
{% assign cur_size = tag[1].size %}
{% assign m1 = min_size %}
{% assign n1 = m1 | plus: gap_size %}
{% assign m2 = n1 %}
{% assign n2 = m2 | plus: gap_size %}
{% assign m3 = n2 %}
{% assign n3 = m3 | plus: gap_size %}
{% assign m4 = n3 %}
{% assign n4 = m4 | plus: gap_size %}
{% if cur_size >= m1 and cur_size < n1 %}
{% assign c_index = 1 %}
{% elsif cur_size >= m2 and cur_size < n2 %}
{% assign c_index = 2 %}
{% elsif cur_size >= m3 and cur_size < n3 %}
{% assign c_index = 3 %}
{% elsif cur_size >= m4 and cur_size < n4 %}
{% assign c_index = 4 %}
{% else %}
{% assign c_index = 4 %}
{% endif %}
<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 }}')">
<span>{{ tag[0] | strip }}</span><div class="tag-count">{{ tag[1].size }}</div>
</button>
</li>
{% endfor %}
</ul>
</div>
8 changes: 4 additions & 4 deletions _includes/icon/mail.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions _includes/icon/menu.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions _includes/icon/next.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions _includes/icon/previous.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit debfbde

Please sign in to comment.