jekyll-text-theme 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a1aa398df377dfd6b122e098d544e318748d07c7
4
- data.tar.gz: f987a8a0c3c72b15b1ba97de00a6f4c2997ed33d
3
+ metadata.gz: 7890d4f956260e2c679c232b460efa3f78e465ec
4
+ data.tar.gz: f2e28c1c6333f352e8dac5eb13654910cb079515
5
5
  SHA512:
6
- metadata.gz: 74ab4f4ff2ed104babd46329ffedfcc1bf53509ede6ac4a8d70e73dd6997add2809e502009ef7a069ebda3100a409ffdff15e978b98b114adbed8ba48308d874
7
- data.tar.gz: d9f6011d976b88eda46c11b257b2610252a32fcd50321138a1bbbed9a20e974c7d7f6db8352e90972698a3648742b986ae37c4ca1ce7291f5fb73fbc42229b2a
6
+ metadata.gz: 77de3d06cd318ce39bda35ff48b3b66cd6f2873154fb3aa3b1d7769262f46a613fe1a4b35f7283d47eb72a3601830b36bb4faf10891d615184341b8411a1b23f
7
+ data.tar.gz: 47b6e4be740e991ac3d8cce74a3e65608b9bc11c704e76d053defc76988dd7ee397b7958d657320262a71eeffe55bc61e42806cb26de6671003b507ef6685f47
data/README.md CHANGED
@@ -1,15 +1,20 @@
1
1
  # [TeXt Theme](https://github.com/kitian616/jekyll-TeXt-theme)
2
2
 
3
- [![GitHub release](https://img.shields.io/github/release/kitian616/jekyll-TeXt-theme.svg)](https://github.com/kitian616/jekyll-TeXt-theme/releases)
3
+ [![Gem Version](https://img.shields.io/gem/v/jekyll-text-theme.svg)](https://github.com/kitian616/jekyll-TeXt-theme/releases)
4
4
  [![license](https://img.shields.io/github/license/kitian616/jekyll-TeXt-theme.svg)](https://github.com/kitian616/jekyll-TeXt-theme/blob/master/LICENSE)
5
+ [![Travis](https://img.shields.io/travis/kitian616/jekyll-TeXt-theme.svg)](https://travis-ci.org/kitian616/jekyll-TeXt-theme)
6
+
7
+ **==> [English (Beta)](https://github.com/kitian616/jekyll-TeXt-theme/blob/master/README-en.md) <==**
5
8
 
6
9
  ![TeXt Theme](https://raw.githubusercontent.com/kitian616/jekyll-TeXt-theme/master/screenshots/TeXt-home.png)
7
10
 
8
11
  ![TeXt Theme Details](https://raw.githubusercontent.com/kitian616/jekyll-TeXt-theme/master/screenshots/TeXt-details.png)
9
12
 
13
+ **==> [English (Beta)](https://github.com/kitian616/jekyll-TeXt-theme/blob/master/README-en.md) <==**
14
+
10
15
  TeXt is a succinct theme for blogging.
11
16
 
12
- TeXt 是针对博客的一款简洁的主题,它虽然简洁但并不简单。该主题参考了 iOS 11 的风格,有大而突出的标题和圆润的按钮及卡片。
17
+ TeXt 是针对博客的一款简洁的主题,它虽然简洁但并不简单。它参考了 iOS 11 的风格,有大而突出的标题和圆润的按钮及卡片。
13
18
 
14
19
  ## Features
15
20
 
@@ -25,44 +30,49 @@ TeXt 是针对博客的一款简洁的主题,它虽然简洁但并不简单。
25
30
  - Web 语意化
26
31
  - 网站图标的自动化工具([gulp-svg2png](https://www.npmjs.com/package/gulp-svg2png), [gulp-to-ico](https://www.npmjs.com/package/gulp-to-ico))
27
32
  - Color Theme
28
- - 数学公式([MathJax](https://www.mathjax.org/))
33
+ - 数学公式([MathJax](https://www.mathjax.org/)
29
34
  - RSS([jekyll-feed](https://github.com/jekyll/jekyll-feed))
35
+ - 多语言支持(English | 简体中文 | 繁體中文)
30
36
 
31
37
  下面简要的介绍下使用的方法,当然如果你对 Jekyll 比较了解可以直接看后面的高级部分,这是该主题增加的一些特有功能。
32
38
 
33
39
  ## How To Use
34
40
 
35
- 最简单的方法是直接 **Fork** 到你的 GitHub 仓库然后更改其名称为 `<username>.github.io`,稍等一会儿访问 `https://<username>.github.io` 即可看到页面。接下来你可以在线修改 _config.yml 和 md 文件,或者把它 Clone 到本地修改后提交。
41
+ 最简单的方法是直接 **Fork** 到你的 GitHub 仓库然后更改其名称为 `<username>.github.io`,稍等一会儿访问 `https://<username>.github.io` 即可看到一个空的博客页,接下来你可以把它 Clone 到本地修改后提交。
36
42
 
37
- 当然,你也可以在 [Releases 页面](https://github.com/kitian616/jekyll-TeXt-theme/releases) 下载最新版本源码,或直接 Clone 代码到本地。
43
+ 当然你也可以在 [Releases 页面](https://github.com/kitian616/jekyll-TeXt-theme/releases) 下载最新版本源码,或直接 Clone 代码到本地。
44
+
45
+ 另外,因为每个版本都是作为一个 [Gem](https://rubygems.org/gems/jekyll-text-theme) 发布的,所以你也可以通过 Jekyll 的主题系统安装该主题,这种方式可以很方便的升级保持最新,但不支持 GitHub 的自动编译,详见 [Jekyll: 主题](http://jekyllcn.com/docs/themes/)。项目的 ./test 目录就是一个使用主题系统的例子。
38
46
 
39
47
  ### 配置
40
48
 
41
- 在 _config.yml 文件里按照说明加上你的信息,例如你的名字和联系方式,网站的标题和描述等等。
49
+ ./\_config.yml 文件里按照说明加上你的信息,例如你的名字和联系方式,网站的标题和描述等等。
42
50
 
43
51
  在 ./about.md 中写上你的简单介绍,例如我叫小明之类的。
44
52
 
45
53
  ### 写博客
46
54
 
47
- 使用 Markdown 编写文章,位于 _posts 目录,文件名采用日期 + 标题的形式,形如 `2017-02-02-Very-Long-Title`。
55
+ 使用 Markdown 编写文章,位于 ./\_posts 目录(需要自行创建)下,文件名采用日期 + 标题的形式,形如 `2017-02-02-Very-Long-Title`,可参考 ./test/\_posts 目录。
48
56
 
49
- 可以在头信息里设置文章的一些基本信息,包括标题、发布时间和标签等。当然,如果你不设置标题和发布时间,系统会使用文件名中的标题和发布时间,具体详见 [Jekyll: 头信息](http://jekyllcn.com/docs/frontmatter/)。当然,该主题在原有的基础上增加了一些属性,这在后面会讲到。
57
+ 可以在头信息里设置文章的一些基本信息,包括标题、发布时间和标签等。当然,如果你不设置标题和发布时间,系统会使用文件名中的标题和发布时间,详见 [Jekyll: 头信息](http://jekyllcn.com/docs/frontmatter/)。当然,该主题在原有的基础上增加了一些属性,这在后面会讲到。
50
58
 
51
59
  #### 摘要
52
60
 
53
- 该主题的摘要有两种模式——TEXT 模式和 HTML 模式。 当 _config.yml 配置项 `excerpt_type` 的值为 `text` 时是 TEXT 模式,为 `html` 时是 HTML 模式,**默认为 TEXT 模式**。
61
+ 该主题的摘要有两种模式——TEXT 模式和 HTML 模式。 当 ./\_config.yml 配置项 `excerpt_type` 的值为 `text` 时是 TEXT 模式,为 `html` 时是 HTML 模式,**默认为 TEXT 模式**。
54
62
 
55
63
  TEXT 模式的摘要为纯文本,会过滤掉一切非文本元素(标题,链接,列表,表格,图片等等),且截取前 350 个字符。
56
64
 
57
- HTML 模式的摘要为 HTML 文档,与文章内容一致,并且 **默认展示整篇文章的内容**。若想控制摘要内容,需要在文章中想要显示到的地方加上 `<!--more-->` 行,具体详见 [Jekyll: 文章摘要](http://jekyll.com.cn/docs/posts/#_6)。
65
+ HTML 模式的摘要为 HTML 文档,与文章内容一致,并且 **默认展示整篇文章的内容**。若想控制摘要内容,需要在文章中想要显示到的地方加上 `<!--more-->`,详见 [Jekyll: 文章摘要](http://jekyll.com.cn/docs/posts/#_6)。
58
66
 
59
- > 提示:为了首页更好的展示效果,个人还是推荐使用 HTML 模式,并自己在文章中加上 `<!--more-->` 行。
67
+ > 提示:为了首页更好的展示效果,个人还是推荐使用 HTML 模式,并自己在文章中加上 `<!--more-->`。
60
68
 
61
69
  ### 安装环境(非必须)
62
70
 
71
+ 具体可参考 [Jekyll: 安装](http://jekyllcn.com/docs/installation/)。
72
+
63
73
  请确保你的电脑上配置好了 Ruby 开发环境。(ruby, bundle, Command Line Tools(macOS) ...)
64
74
 
65
- 首先安装 github-pages,在项目根目录执行 `bundle install` 即可安装。
75
+ 首先安装 github-pages(包含了 Jekyll 以及一些插件),在项目根目录执行 `bundle install` 即可安装。
66
76
 
67
77
  推荐安装 Node.js 环境,可以获得更好的开发体验。
68
78
 
@@ -70,21 +80,13 @@ HTML 模式的摘要为 HTML 文档,与文章内容一致,并且 **默认展
70
80
 
71
81
  如果你安装了 Node.js 环境,只需要在项目根目录运行 `npm run dev` 即可启动本地服务。
72
82
 
73
- 如果不想安装 Node.js 环境,则需要以下两步:
74
-
75
- 启动编译服务,在文件改变时会自动重新编译:
76
-
77
- ```console
78
- bundle exec jekyll build --watch
79
- ```
80
-
81
- 启动静态服务器:
83
+ 如果没有安装 Node.js 环境,则是:
82
84
 
83
85
  ```console
84
86
  bundle exec jekyll serve -H 0.0.0.0
85
87
  ```
86
88
 
87
- 在浏览器中访问 [http://localhost:4000/](http://localhost:4000/) 即可看到页面。
89
+ 命令执行成功后在浏览器中访问 [http://localhost:4000/](http://localhost:4000/) 即可看到页面。
88
90
 
89
91
  ### 部署与提交
90
92
 
@@ -92,13 +94,23 @@ bundle exec jekyll serve -H 0.0.0.0
92
94
 
93
95
  如果你是下载或者 Clone 的源码,那么你需要在 GitHub 上建立一个 Repository,然后把项目代码 push 到其对应的分支上(如果以 `<username>.github.io` 命名则对应分支为 `master` ,其他的为 `gh-pages`,详见 [Github Pages: Configuring a publishing source for GitHub Pages](https://help.github.com/articles/configuring-a-publishing-source-for-github-pages/))。
94
96
 
97
+ 如果你是通过 Jekyll 的主题系统安装的,那么你需要把本地编译好的代码 push 到上文所说的对应分支上。
98
+
95
99
  当然你也可以部署到到其他地方。
96
100
 
97
101
  ## 高级
98
102
 
103
+ ### 多语言
104
+
105
+ 该主题支持 English、简体中文和繁體中文,只需在 ./\_config.yml 中设置对应 `lang` 项即可。设置后整个网站的主题文字(导航,阅读更多,文章数统计,日期格式,文章协议等等)会变为设置的语言,多语言的配置文件为 ./_data/locale.yml,你可以自由的修改、增加语言。
106
+
107
+ 另外,该主题也支持对某篇文章(页面)单独设置语言,只需在 Markdown 或页面 HTML 文件的头信息中设置 `lang` 项,其优先级高于 ./\_config.yml 中设置的值。设置后该文章(页面)的主题文字会变为头信息中设置的语言。
108
+
109
+ > 提示:当前的 `lang` 值可选值为 en(English), zh(简体中文), zh-Hans(简体中文), zh-Hant(繁體中文)。
110
+
99
111
  ### Color Theme
100
112
 
101
- 颜色主题位于文件夹 _sass/colors 中,修改 _sass/settings/colors.scss 的 `@import` 路径即可修改主题,默认主题为 default。
113
+ 颜色主题位于文件夹 ./\_sass/colors 中,修改 ./\_sass/settings/colors.scss 的 `@import` 路径即可修改主题,默认主题为 default。
102
114
 
103
115
  | `default` | `dark` | `forest` | `ocean` |
104
116
  | --- | --- | --- | --- |
@@ -108,7 +120,7 @@ bundle exec jekyll serve -H 0.0.0.0
108
120
 
109
121
  ### 网站图标
110
122
 
111
- 该主题自带了一个“银杏叶”图标,你可以把它替换为自己的图标。网站的图标位于根目录的 favicon.ico 和 ./assets/images/logo 目录下。你会看到 logo 目录中有很多的 png 文件和一个 svg 矢量图文件。那些 png 图片实际上就是根据 svg 矢量图生成的不同大小的图片,这些图片是一些场景可能会用到的大图标,像 iOS 和 Android 的固定到屏幕和 Windows 10 的磁贴。
123
+ 该主题自带了一个“银杏叶”图标,你可以把它替换为自己的图标。网站的图标位于 ./favicon.ico 和 ./assets/images/logo 目录下。你会看到 logo 目录中有很多的 png 文件和一个 svg 矢量图文件。那些 png 图片实际上就是根据 svg 矢量图生成的不同大小的图片,这些图片是一些场景可能会用到的大图标,像 iOS 和 Android 的固定到屏幕和 Windows 10 的磁贴。
112
124
 
113
125
  该主题提供了一个自动化脚本能将 svg 矢量图自动生成 favicon 和 png 文件。你所要做的是:
114
126
 
@@ -124,19 +136,19 @@ bundle exec jekyll serve -H 0.0.0.0
124
136
 
125
137
  ### 评论系统
126
138
 
127
- 在 _config.yml 文件的 `disqus.shortname` 项填上你在 [Disqus](https://disqus.com/) 上为网站建立的 site 对应的 shortname,需要注意的是 Disqus 在大陆是无法直接访问的。
139
+ ./\_config.yml 文件的 `disqus.shortname` 项填上你在 [Disqus](https://disqus.com/) 上为网站建立的 site 对应的 shortname,需要注意的是 Disqus 在大陆是无法直接访问的。
128
140
 
129
141
  > 注意:使用评论系统必须在文章的头信息中设置 key 值(可用字符集:`字母`、`数字` 及 `- _ : .`)。
130
142
 
131
143
  ### 阅读量统计
132
144
 
133
- 在 _config.yml 文件 `leancloud` 的 `app_id`、`app_key`、`app_class` 项分别填上你在 [LeanCloud](https://leancloud.cn) 为网站建立的应用的对应参数。
145
+ ./\_config.yml 文件 `leancloud` 的 `app_id`、`app_key`、`app_class` 项分别填上你在 [LeanCloud](https://leancloud.cn) 为网站建立的应用的对应参数。
134
146
 
135
147
  > 注意:使用阅读量统计必须在文章的头信息中设置 key 值(可用字符集:`字母`、`数字` 及 `- _ : .`)。
136
148
 
137
149
  ### Google Analytics
138
150
 
139
- 在 _config.yml 文件的 `ga_tracking_id` 项填上你在 [Google Analytics](https://analytics.google.com) 上为网站建立的媒体资源对应的跟踪 ID。
151
+ ./\_config.yml 文件的 `ga_tracking_id` 项填上你在 [Google Analytics](https://analytics.google.com) 上为网站建立的媒体资源对应的跟踪 ID。
140
152
 
141
153
  ### Markdown 头信息增强
142
154
 
@@ -145,6 +157,7 @@ bundle exec jekyll serve -H 0.0.0.0
145
157
  | 变量名称 | 可选值 | 描述 |
146
158
  | --- | --- | --- |
147
159
  | key | | 评论系统和阅读量统计使用的文章标识符,如果未设置则评论和统计无效。可用字符集:`字母`、`数字` 及 `- _ : .` |
160
+ | lang | en/zh/zh-Hans/zh-Hant | 该文章的语言,其优先级高于 ./\_config.yml 中设置的值 |
148
161
  | picture_frame | shadow | 该文章的图片框样式,如果为 `shadow` 则图片带有阴影边框 |
149
162
  | modify_date | | 该文章的修改时间,不影响首页文章排序(`date` 代表发表时间,会影响文章排序) |
150
163
  | comment | true/false | 该文章是否能够评论,默认为 true(当然你也可以通过不设置 key 来实现,但是这样的话统计也失效了) |
@@ -152,10 +165,9 @@ bundle exec jekyll serve -H 0.0.0.0
152
165
 
153
166
  ### 其他资源
154
167
 
155
- 在 _includes/icon/social 目录下有很多的社交产品图标,例如 Behance、Flickr、QQ、微信等,方便修改和使用。
168
+ ./\_includes/icon/social 目录下有很多的社交产品图标,例如 Behance、Flickr、QQ、微信等,方便修改和使用。
156
169
 
157
170
  ## 示例
158
171
 
159
- 在线访问:[Qi's blog](https://tianqi.name/blog/)
160
-
161
- 示例源码:[https://github.com/kitian616/kitian616.github.io/](https://github.com/kitian616/kitian616.github.io/)
172
+ - [Demo](https://tianqi.name/jekyll-TeXt-theme/)
173
+ - [Qi's blog](https://tianqi.name/blog/)
data/_data/locale.yml ADDED
@@ -0,0 +1,78 @@
1
+ NAV:
2
+ HOME:
3
+ en: Home
4
+ zh: 主页
5
+ zh-Hans: 主页
6
+ zh-Hant: 主頁
7
+ ALL:
8
+ en: All
9
+ zh: 归档
10
+ zh-Hans: 归档
11
+ zh-Hant: 歸檔
12
+ RSS:
13
+ en: RSS
14
+ zh: RSS
15
+ zh-Hans: RSS
16
+ zh-Hant: RSS
17
+
18
+ READMORE:
19
+ en: Click to read more ...
20
+ zh: 点我阅读更多...
21
+ zh-Hans: 点我阅读更多...
22
+ zh-Hant: 「點我閱讀更多」
23
+
24
+ COPYRIGHT_DATES: 2015 - 2017
25
+
26
+ LAST_UPDATED:
27
+ en: Last updated
28
+ zh: 更新于
29
+ zh-Hans: 更新于
30
+ zh-Hant: 更新於
31
+
32
+ ARTICLE_DATE_FORMAT:
33
+ en: '%b %d, %Y'
34
+ zh: '%Y年 %m月%d日'
35
+ zh-Hans: '%Y年 %m月%d日'
36
+ zh-Hant: '%Y年 %m月%d日'
37
+
38
+ ARTICLE_LIST_DATE_FORMAT:
39
+ en: '%b %d'
40
+ zh: '%m月%d日'
41
+ zh-Hans: '%m月%d日'
42
+ zh-Hant: '%m月%d日'
43
+
44
+ STATISTICS:
45
+ en: '[POST_COUNT] post articles, [PAGE_COUNT] pages.'
46
+ zh: 共计 [POST_COUNT] 篇文章, [PAGE_COUNT] 页。
47
+ zh-Hans: 共计 [POST_COUNT] 篇文章, [PAGE_COUNT] 页。
48
+ zh-Hant: 共計 [POST_COUNT] 篇文章, [PAGE_COUNT] 頁。
49
+
50
+ LICENSE_ANNOUNCE:
51
+ en: This work is licensed under a [LICENSE] license.
52
+ zh: 本文遵守 [LICENSE] 许可协议。
53
+ zh-Hans: 本文遵守 [LICENSE] 许可协议。
54
+ zh-Hant: 本文遵守 [LICENSE] 許可協議。
55
+
56
+ LICENSE_INTRO:
57
+ en:
58
+ zh: 欢迎转载,转载需注明出处,且禁止用于商业目的。
59
+ zh-Hans: 欢迎转载,转载需注明出处,且禁止用于商业目的。
60
+ zh-Hant: 歡迎轉載,轉載需註明出處,且禁止用於商業目的。
61
+
62
+ POST_ON_GITHUB:
63
+ en: View this POST on Github.
64
+ zh: 在 Github 上查阅此文。
65
+ zh-Hans: 在 Github 上查阅此文。
66
+ zh-Hant: 在 Github 上查閱此文。
67
+
68
+ FOLLOW_ME:
69
+ en: Follow me on [NAME].
70
+ zh: 在 [NAME] 上关注我。
71
+ zh-Hans: 在 [NAME] 上关注我。
72
+ zh-Hant: 在 [NAME] 上關注我。
73
+
74
+ EMAIL_ME:
75
+ en: Send me Email.
76
+ zh: 给我发邮件。
77
+ zh-Hans: 给我发邮件。
78
+ zh-Hant: 給我發郵件。
@@ -16,10 +16,17 @@
16
16
  {% endif %}
17
17
  {% if cur_page.tags[0] %}
18
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 %}
19
24
  {% for tag in cur_page.tags %}
20
25
  {% assign _tag = tag | strip | url_encode } %}
26
+ {% assign __path = all_path | append: '?tag=' %}
27
+ {% include snippets/prepend-baseurl.html %}
21
28
  <li><a class="round-rect-button"
22
- href="{{ "/all.html?tag=" | prepend: site.baseurl | append: _tag | replace: '//', '/' }}">{{ tag }}
29
+ href="{{ __return | append: _tag | replace: '//', '/' }}">{{ tag }}
23
30
  </a></li>
24
31
  {% endfor %}
25
32
  </ul>
@@ -31,12 +38,13 @@
31
38
  </div>
32
39
  {% endif %}
33
40
  <div class="date-wrapper">
41
+ {% assign __locale = site.data.locale.ARTICLE_DATE_FORMAT } %}
42
+ {% include snippets/locale-to-string.html %}
34
43
  {% if post %}
35
- <span class="article-meta">{{ post.date | date: "%b %d, %Y" }}</span>
44
+ <span class="article-meta">{{ post.date | date: __return }}</span>
36
45
  {% elsif page %}
37
46
  <time class="article-meta" datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">
38
- {{ page.date | date: "%b %-d, %Y" }}
39
- </time>
47
+ {{ page.date | date: __return }}</time>
40
48
  {% endif %}
41
49
  </div>
42
50
  </div>
@@ -4,7 +4,7 @@
4
4
  {% include info/follow-me.html %}
5
5
  </aside>
6
6
  <footer class="site-info">
7
- <p>© {{ site.title }} 2015 - 2017</p>
7
+ <p>© {{ site.title }} {{ site.data.locale.COPYRIGHT_DATES }}</p>
8
8
  <p>Powered by <a
9
9
  title="Jekyll is a simple, blog-aware, static site generator." href="http://jekyllrb.com/">Jekyll</a> & <a
10
10
  title="TeXt is a succinct theme for blogging." href="https://github.com/kitian616/jekyll-TeXt-theme">TeXt Theme</a>.
@@ -1,22 +1,53 @@
1
1
  <header class="m-page-header main clearfix">
2
+ {% assign __path = '/' %}
3
+ {% include snippets/prepend-baseurl.html %}
4
+ {% if site.title %}
2
5
  <a class="site-title" title="{% if site.description %}{{ site.description }}{% endif %}"
3
- href="{{ "/" | prepend: site.baseurl | replace: '//', '/' }}">{% if site.title %}{{ site.title }}{% endif %}
4
- </a>
6
+ href="{{ __return }}">{{ site.title }}</a>
7
+ {% endif %}
5
8
  <div class="site-logo">
6
9
  {% include logo/logo.svg %}
7
10
  </div>
8
11
  <nav>
9
12
  <ul class="inline-list">
10
- <li><a href="{{ "/" | prepend: site.baseurl | replace: '//', '/' }}">Home</a></li>
11
- <li><a
12
- href="{{ "/all.html" | prepend: site.baseurl | append: "?tag=" | replace: '//', '/'}}">All
13
- </a></li>
13
+ {% if site.paths.home %}
14
+ {% assign __path = site.paths.home %}
15
+ {% else %}
16
+ {% assign __path = '/' %}
17
+ {% endif %}
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>
14
33
  {% for list in site.nav_lists %}
15
- <li><a href="{{ list.url }}"> {{ list.title }} </a></li>
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>
16
40
  {% endfor %}
17
- <li><a type="application/rss+xml"
18
- href="{{ "/feed.xml" | prepend: site.baseurl | replace: '//', '/'}}">RSS
19
- </a></li>
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>
20
51
  </ul>
21
52
  </nav>
22
53
  </header>
@@ -1,17 +1,25 @@
1
+ {% assign locale = site.data.locale %}
1
2
  <div class="m-license">
2
3
  <div class="clearfix">
3
4
  {% if site.repository and site.repository_tree %}
4
- <a class="octocat" href="https://github.com/{{ site.repository }}/tree/{{ site.repository_tree }}/{{ page.path }}">
5
- <img alt="View on Github" src="{{ "/assets/images/octocat.jpg" | prepend: site.baseurl | replace: '//', '/'}}" />
6
- </a>
7
- <p><a href="https://github.com/{{ site.repository }}/tree/{{ site.repository_tree }}/{{ page.path }}">View this POST on Github</a>.</P>
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>
8
12
  {% endif %}
9
- <p>This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/">CC-BY-NC-4.0</a> license.</p>
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 %}
10
18
  <a class="license" rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/">
11
- <img alt="Creative Commons License" src="{{ '/assets/images/license-cc4.png' | prepend: site.baseurl | replace: '//', '/'}}" />
19
+ <img alt="Creative Commons License" src="{{ __return }}" />
12
20
  </a>
13
- <p>欢迎转载,转载需注明出处:<a class="url" href="{% include snippets/page-url.html %}">
14
- {% include snippets/page-url.html %}
15
- </a>,且禁止用于商业目的。</p>
21
+ {% assign __locale = locale.LICENSE_INTRO %}
22
+ {% include snippets/locale-to-string.html %}
23
+ <p>{{ __return }}</p>
16
24
  </div>
17
25
  </div>
@@ -1,7 +1,10 @@
1
1
  <meta charset="utf-8">
2
2
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
3
3
  <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
4
- <title>{% if page.title %}{{ page.title | truncatewords: 15 }} - {{ site.title }}{% else %}{{ site.title }}{% endif %}</title>
4
+ {% include snippets/page-title.html %}
5
+ <title>{% if __return %}{{ __return }} - {{ site.title }}{% else %}{{ site.title }}{% endif %}</title>
5
6
  <meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">
6
7
  <link rel="canonical" href="{% include snippets/page-url.html %}">
7
- <link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{% include snippets/rss-url.html %}">
8
+ {% assign __path = '/feed.xml' %}
9
+ {% include snippets/prepend-baseurl.html %}
10
+ <link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ __return | prepend: site.url }}">
@@ -1,25 +1,38 @@
1
- <!--
2
- for Safari on iOS
3
- https://developer.apple.com/ios/human-interface-guidelines/icons-and-images/app-icon/
4
- -->
5
- <link rel="apple-touch-icon" sizes="180x180" href="/assets/images/logo/icon-180x180.png">
6
- <link rel="apple-touch-icon" sizes="167x167" href="/assets/images/logo/icon-167x167.png">
7
- <link rel="apple-touch-icon" sizes="152x152" href="/assets/images/logo/icon-152x152.png">
8
- <link rel="apple-touch-icon" sizes="120x120" href="/assets/images/logo/icon-120x120.png">
9
- <link rel="shortcut icon" href="/assets/images/logo/icon-120x120.png">
10
- <!--
11
- for Chrome on Android
12
- https://developer.chrome.com/multidevice/android/installtohomescreen
13
- -->
1
+ <!-- for Safari on iOS https://developer.apple.com/ios/human-interface-guidelines/icons-and-images/app-icon/ -->
2
+ {% assign __path = '/assets/images/logo/icon-180x180.png' %}
3
+ {% include snippets/prepend-baseurl.html %}
4
+ <link rel="apple-touch-icon" sizes="180x180" href="{{ __return }}">
5
+ {% assign __path = '/assets/images/logo/icon-167x167.png' %}
6
+ {% include snippets/prepend-baseurl.html %}
7
+ <link rel="apple-touch-icon" sizes="167x167" href="{{ __return }}">
8
+ {% assign __path = '/assets/images/logo/icon-152x152.png' %}
9
+ {% include snippets/prepend-baseurl.html %}
10
+ <link rel="apple-touch-icon" sizes="152x152" href="{{ __return }}">
11
+ {% assign __path = '/assets/images/logo/icon-120x120.png' %}
12
+ {% include snippets/prepend-baseurl.html %}
13
+ <link rel="apple-touch-icon" sizes="120x120" href="{{ __return }}">
14
+ {% assign __path = '/assets/images/logo/icon-120x120.png' %}
15
+ {% include snippets/prepend-baseurl.html %}
16
+ <link rel="shortcut icon" href="{{ __return }}">
17
+ <!-- for Chrome on Android https://developer.chrome.com/multidevice/android/installtohomescreen -->
14
18
  <meta name="mobile-web-app-capable" content="yes">
15
- <link rel="icon" sizes="192x192" href="/assets/images/logo/icon-192x192.png">
16
- <!--
17
- for Edge on Windows 10
18
- https://msdn.microsoft.com/en-us/library/dn255024(v=vs.85).aspx
19
- -->
20
- <meta name="msapplication-TileImage" content="/assets/images/logo/icon-144x144.png">
21
- <meta name="msapplication-square310x310logo" content="/assets/images/icon-310x310.png">
22
- <meta name="msapplication-wide310x150logo" content="/assets/images/icon-310x150.png">
23
- <meta name="msapplication-square150x150logo" content="/assets/images/icon-150x150.png">
24
- <meta name="msapplication-square70x70logo" content="/assets/images/icon-70x70.png">
19
+ {% assign __path = '/assets/images/logo/icon-192x192.png' %}
20
+ {% include snippets/prepend-baseurl.html %}
21
+ <link rel="icon" sizes="192x192" href="{{ __return }}">
22
+ <!-- for Edge on Windows 10 https://msdn.microsoft.com/en-us/library/dn255024(v=vs.85).aspx -->
23
+ {% assign __path = '/assets/images/logo/icon-144x144.png' %}
24
+ {% include snippets/prepend-baseurl.html %}
25
+ <meta name="msapplication-TileImage" content="{{ __return }}">
26
+ {% assign __path = '/assets/images/logo/icon-310x310.png' %}
27
+ {% include snippets/prepend-baseurl.html %}
28
+ <meta name="msapplication-square310x310logo" content="{{ __return }}">
29
+ {% assign __path = '/assets/images/logo/icon-310x150.png' %}
30
+ {% include snippets/prepend-baseurl.html %}
31
+ <meta name="msapplication-wide310x150logo" content="{{ __return }}">
32
+ {% assign __path = '/assets/images/logo/icon-150x150.png' %}
33
+ {% include snippets/prepend-baseurl.html %}
34
+ <meta name="msapplication-square150x150logo" content="{{ __return }}">
35
+ {% assign __path = '/assets/images/logo/icon-70x70.png' %}
36
+ {% include snippets/prepend-baseurl.html %}
37
+ <meta name="msapplication-square70x70logo" content="{{ __return }}">
25
38
  <meta name="msapplication-TileColor" content="#eeeeee">
@@ -1,9 +1,11 @@
1
1
  <div class="follow-me">
2
+ {% assign __locale = site.data.locale.FOLLOW_ME %}
3
+ {% include snippets/locale-to-string.html %}
2
4
  <ul class="inline-list" itemscope itemtype="http://schema.org/Person">
3
5
  <meta itemprop="name" content="{{ site.author.name }}">
4
6
  <link itemprop="url" href="{{ '/' | prepend: site.url }}">
5
7
  {% if site.author.weibo %}
6
- <li title="Follow me on Weibo.">
8
+ <li title="{{ __return | replace: '[NAME]', 'Weibo' }}">
7
9
  <div class="round-button weibo">
8
10
  <a itemprop="sameAs" href="https://weibo.com/{{ site.author.weibo }}" target="_blank">
9
11
  <div class="icon">{% include icon/social/weibo.svg %}</div>
@@ -12,7 +14,7 @@
12
14
  </li>
13
15
  {% endif %}
14
16
  {% if site.author.facebook %}
15
- <li title="Follow me on Facebook.">
17
+ <li title="{{ __return | replace: '[NAME]', 'Facebook' }}">
16
18
  <div class="round-button facebook">
17
19
  <a itemprop="sameAs" href="https://www.facebook.com/{{ site.author.facebook }}" target="_blank">
18
20
  <div class="icon">{% include icon/social/facebook.svg %}</div>
@@ -21,7 +23,7 @@
21
23
  </li>
22
24
  {% endif %}
23
25
  {% if site.author.twitter %}
24
- <li title="Follow me on Twitter.">
26
+ <li title="{{ __return | replace: '[NAME]', 'Twitter' }}">
25
27
  <div class="round-button twitter">
26
28
  <a itemprop="sameAs" href="https://twitter.com/{{ site.author.twitter }}" target="_blank">
27
29
  <div class="icon">{% include icon/social/twitter.svg %}</div>
@@ -30,7 +32,7 @@
30
32
  </li>
31
33
  {% endif %}
32
34
  {% if site.author.googleplus %}
33
- <li title="Follow me on Google+.">
35
+ <li title="{{ __return | replace: '[NAME]', 'Google+' }}">
34
36
  <div class="round-button googlepluse">
35
37
  <a itemprop="sameAs" href="https://plus.google.com/u/0/{{ site.author.googleplus }}" target="_blank">
36
38
  <div class="icon">{% include icon/social/googleplus.svg %}</div>
@@ -39,7 +41,7 @@
39
41
  </li>
40
42
  {% endif %}
41
43
  {% if site.author.github %}
42
- <li title="Follow me on Github.">
44
+ <li title="{{ __return | replace: '[NAME]', 'Github' }}">
43
45
  <div class="round-button github">
44
46
  <a itemprop="sameAs" href="https://github.com/{{ site.author.github }}" target="_blank">
45
47
  <div class="icon">{% include icon/social/github.svg %}</div>
@@ -48,7 +50,7 @@
48
50
  </li>
49
51
  {% endif %}
50
52
  {% if site.author.linkedin %}
51
- <li title="Follow me on Linkedin.">
53
+ <li title="{{ __return | replace: '[NAME]', 'Linkedin' }}">
52
54
  <div class="round-button linkedin">
53
55
  <a itemprop="sameAs" href="https://www.linkedin.com/in/{{ site.author.linkedin }}" target="_blank">
54
56
  <div class="icon">{% include icon/social/linkedin.svg %}</div>
@@ -57,7 +59,7 @@
57
59
  </li>
58
60
  {% endif %}
59
61
  {% if site.author.douban %}
60
- <li title="Follow me on Douban.">
62
+ <li title="{{ __return | replace: '[NAME]', 'Douban' }}">
61
63
  <div class="round-button douban">
62
64
  <a itemprop="sameAs" href="https://www.douban.com/people/{{ site.author.douban }}" target="_blank">
63
65
  <div class="icon">{% include icon/social/douban.svg %}</div>
@@ -67,8 +69,10 @@
67
69
  {% endif %}
68
70
  </ul>
69
71
  {% if site.author.email %}
72
+ {% assign __locale = site.data.locale.EMAIL_ME %}
73
+ {% include snippets/locale-to-string.html %}
70
74
  <p class="email">
71
- <a title="Send me Email." href="mailto:{{ site.author.email }}" target="_self"> {{ site.author.email }} </a>
75
+ <a title="{{ __return }}" href="mailto:{{ site.author.email }}" target="_self"> {{ site.author.email }} </a>
72
76
  </p>
73
77
  {% endif %}
74
78
  </div>
@@ -0,0 +1,2 @@
1
+ {% assign __return = '' %}
2
+ {% if page.lang %}{% assign __return = page.lang %}{% else %}{% assign __return = site.lang %}{% endif %}
@@ -0,0 +1,3 @@
1
+ {% include snippets/get-lang.html %}
2
+ {% assign __lang = __return %}
3
+ {% if __locale[__lang] %}{% assign __return = __locale[__lang] %}{% else %}{% assign __return = __locale.en %}{% endif %}
@@ -0,0 +1,8 @@
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 %}
7
+ {% assign __return = __localeTitle %}
8
+ {% endif %}
@@ -0,0 +1 @@
1
+ {% assign __return = __path | replace:'index.html','' | prepend: site.baseurl | replace:'//','/' %}
data/_layouts/all.html CHANGED
@@ -1,15 +1,20 @@
1
1
  ---
2
2
  layout: blog-default
3
- title: All Posts
3
+ titles:
4
+ en: All Posts
5
+ zh: 归档
6
+ zh-Hans: 归档
7
+ zh-Hant: 歸檔
4
8
  ---
5
9
  <div class="m-all">
6
10
  <div class="main">
7
- <h1 class="js-page-heading">All Posts</h1>
11
+ {% include snippets/page-title.html %}
12
+ <h1 class="js-page-heading">{{ __return }}</h1>
8
13
  {% include blog/tags.html %}
9
14
  <!--group by year: http://stackoverflow.com/questions/19086284/jekyll-liquid-templating-how-to-group-blog-posts-by-year-->
10
15
  <section class="js-year-wrapper">
11
16
  {% for post in site.posts %}
12
- {% assign currentdate = post.date | date: "%Y" %}
17
+ {% assign currentdate = post.date | date: '%Y' %}
13
18
  {% if currentdate != date %}
14
19
  {% unless forloop.first %}</ul></section>{% endunless %}
15
20
  <section id="{{ post.date | date: "%Y" }}">
@@ -17,22 +22,27 @@ title: All Posts
17
22
  <ul class="year-list">
18
23
  {% assign date = currentdate %}
19
24
  {% endif %}
20
- {% assign _tags = "" %}
25
+ {% assign _tags = '' %}
21
26
  {% for tag in post.tags %}
22
27
  {% assign _tag = tag | strip | url_encode %}
23
- {% assign _tags = _tags | append: ","" | append: _tag %}
28
+ {% assign _tags = _tags | append: ',' | append: _tag %}
24
29
  {% endfor %}
25
30
  {% assign last = _tags | size | minus: 1 %}
26
31
  {% assign _tags = _tags | slice: 1, last %}
32
+ {% assign __path = post.url %}
33
+ {% include snippets/prepend-baseurl.html %}
34
+ {% assign href = __return %}
35
+ {% assign __locale = site.data.locale.ARTICLE_LIST_DATE_FORMAT %}
36
+ {% include snippets/locale-to-string.html %}
27
37
  <li class="js-post-block" data-tag="{{ _tags }}">
28
- <span class="post-date">{{ post.date | date:"%b %d" }}</span><a class="post-link" href="{{ post.url | prepend: site.baseurl | replace: '//', '/' }}">{{ post.title }}</a>
29
- </li>
38
+ <span class="post-date">{{ post.date | date: __return }}</span>
39
+ <a class="post-link" href="{{ href }}">{{ post.title }}</a></li>
30
40
  {% if forloop.last %}</ul></section>{% endif %}
31
41
  {% endfor %}
32
42
  </section>
33
43
  </div>
34
44
  </div>
35
-
45
+ {% include snippets/page-title.html %}
36
46
  <script type="text/javascript">
37
47
  // function queryString is copied from
38
48
  // http://stackoverflow.com/questions/979975/how-to-get-the-value-from-url-parameter#answer-979995
@@ -69,7 +79,8 @@ title: All Posts
69
79
  var i = 0, flag = false, cur, tagStr = '',
70
80
  tags = [], _tag = '', lis = [];
71
81
  if (tag === undefined || tag === '') {
72
- $pageHeading.text('All Posts'); $tagShowAll.focus(); $postBlock.show();
82
+ $pageHeading.text('{{ __return }}');
83
+ $tagShowAll.focus(); $postBlock.show();
73
84
  } else {
74
85
  tag = tag.trim();
75
86
  // $articleTag.filter('.tag-' + tag).focus();
@@ -1,15 +1,18 @@
1
1
  <!DOCTYPE html>
2
- <html lang="{{ site.lang }}">
2
+ {% include snippets/get-lang.html %}
3
+ <html lang="{{ __return }}">
3
4
  <head>
4
5
  {% include common-head.html %}
5
6
  {% include head-icons-rel.html %}
6
- <link rel="stylesheet" href="{{ "/assets/css/blog.css" | prepend: site.baseurl | replace:'//','/' }}">
7
+ {% assign __path = '/assets/css/blog.css' %}
8
+ {% include snippets/prepend-baseurl.html %}
9
+ <link rel="stylesheet" href="{{ __return }}">
7
10
  <style>
8
- {% if page.picture_frame == 'shadow' %}
9
- .m-article-content img:not(.emoji) {
10
- box-shadow: 0 0 5px rgba(0, 0, 0, .4);
11
- }
12
- {% endif %}
11
+ {% if page.picture_frame == 'shadow' %}
12
+ .m-article-content img:not(.emoji) {
13
+ box-shadow: 0 0 5px rgba(0, 0, 0, .4);
14
+ }
15
+ {% endif %}
13
16
  </style>
14
17
  <script src="//cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script>
15
18
  {% include utils/mathjax.html %}
data/_layouts/home.html CHANGED
@@ -1,15 +1,20 @@
1
1
  ---
2
2
  layout: blog-default
3
- title: Blog
3
+ titles:
4
+ en: Blog
5
+ zh: 博客
6
+ zh-Hans: 博客
7
+ zh-Hant: 博客
4
8
  ---
5
9
  <div class="m-home">
6
10
  <div class="main">
7
11
  <div class="m-post-list">
8
12
  {% for post in paginator.posts %}
9
13
  <article>
10
- <h1>
11
- <a href="{{ post.url | prepend: site.baseurl | replace: '//', '/' }}">{{ post.title }}</a>
12
- </h1>
14
+ {% assign __path = post.url %}
15
+ {% include snippets/prepend-baseurl.html %}
16
+ {% assign href = __return %}
17
+ <h1><a href="{{ href }}">{{ post.title }}</a></h1>
13
18
  <div class="m-article-content">
14
19
  {% if site.excerpt_type == 'html' %}
15
20
  {{ post.excerpt }}
@@ -17,48 +22,59 @@ title: Blog
17
22
  {{ post.excerpt | strip_html | truncate: 350 }}
18
23
  {% endif %}
19
24
  </div>
20
- <a href="{{ post.url | prepend: site.baseurl | replace: '//', '/' }}">Click to read more ...</a>
25
+ {% assign __path = post.url %}
26
+ {% include snippets/prepend-baseurl.html %}
27
+ {% assign __locale = site.data.locale.READMORE %}
28
+ {% include snippets/locale-to-string.html %}
29
+ <a href="{{ href }}">{{ __return }}</a>
21
30
  {% include blog/article-data.html %}
22
31
  </article>
23
32
  {% endfor %}
24
33
  </div>
25
34
  {% if paginator.total_pages > 1 %}
26
35
  <nav class="m-pagination">
27
- <p>{{ site.posts | size }} post articles, {{ paginator.total_pages }} pages.</p>
36
+ {% assign __locale = site.data.locale.STATISTICS %}
37
+ {% include snippets/locale-to-string.html %}
38
+ {% assign post_count = site.posts | size %}
39
+ {% assign page_count = paginator.total_pages %}
40
+ <p>{{ __return | replace: '[POST_COUNT]', post_count | replace: '[PAGE_COUNT]', page_count }}</p>
28
41
  <ul class="inline-list">
29
42
  {% if paginator.previous_page %}
30
- <li><a class="round-button" href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">
31
- <div class="icon icon--previous">{% include icon/previous.svg %}</div>
32
- </a></li>
43
+ {% assign __path = paginator.previous_page_path %}
44
+ {% include snippets/prepend-baseurl.html %}
45
+ {% assign href = __return %}
46
+ <li><a class="round-button" href="{{ href }}">
47
+ <div class="icon icon--previous">{% include icon/previous.svg %}</div></a></li>
33
48
  {% else %}
34
49
  <li><div class="round-button inactive">
35
- <div class="icon icon--prrevious">{% include icon/previous.svg %}</div>
36
- </div></li>
50
+ <div class="icon icon--prrevious">{% include icon/previous.svg %}</div></div></li>
37
51
  {% endif %}
38
52
  {% for page in (1..paginator.total_pages) %}
39
53
  {% if page == paginator.page %}
40
54
  <li><div class="round-button cur">
41
- <span>{{ page }}</span>
42
- </div></li>
55
+ <span>{{ page }}</span></div></li>
43
56
  {% elsif page == 1 %}
57
+ {% assign __path = '/' %}
58
+ {% include snippets/prepend-baseurl.html %}
59
+ {% assign href = __return %}
44
60
  <li><a class="round-button"
45
- href="{{ '/' | prepend: site.baseurl | replace: '//', '/' }}">
46
- <span>{{ page }}</span>
47
- </a></li>
61
+ href="{{ href }}">
62
+ <span>{{ page }}</span></a></li>
48
63
  {% else %}
49
- <li><a class="round-button" href="{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}">
50
- <span>{{ page }}</span>
51
- </a></li>
64
+ {% assign __path = site.paginate_path %}
65
+ {% include snippets/prepend-baseurl.html %}
66
+ {% assign href = __return %}
67
+ <li><a class="round-button" href="{{ href | replace: ':num', page }}">
68
+ <span>{{ page }}</span></a></li>
52
69
  {% endif %}
53
70
  {% endfor %}
54
71
  {% if paginator.next_page %}
55
- <li><a class="round-button" href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}">
56
- <div class="icon icon--next">{% include icon/next.svg %}</div>
57
- </a></li>
72
+ {% assign __path = paginator.next_page_path %}
73
+ {% include snippets/prepend-baseurl.html %}
74
+ {% assign href = __return %}
75
+ <li><a class="round-button" href="{{ href }}"><div class="icon icon--next">{% include icon/next.svg %}</div></a></li>
58
76
  {% else %}
59
- <li><div class="round-button inactive">
60
- <div class="icon icon--next">{% include icon/next.svg %}</div>
61
- </div></li>
77
+ <li><div class="round-button inactive"><div class="icon icon--next">{% include icon/next.svg %}</div></div></li>
62
78
  {% endif %}
63
79
  </ul>
64
80
  </nav>
data/_layouts/page.html CHANGED
@@ -3,7 +3,8 @@ layout: blog-default
3
3
  ---
4
4
  <div class="m-page">
5
5
  <article class="main">
6
- <h1>{{ page.title }}</h1>
6
+ {% include snippets/page-title.html %}
7
+ <h1>{{ __return }}</h1>
7
8
 
8
9
  <div class="m-article-content" itemprop="articleBody">
9
10
  {{ content }}
data/_layouts/post.html CHANGED
@@ -7,7 +7,8 @@ layout: blog-default
7
7
  <article itemscope itemtype="http://schema.org/BlogPosting">
8
8
  <meta itemprop="mainEntityOfPage" itemscope itemType="https://schema.org/WebPage"/>
9
9
  <header class="article-header">
10
- <h1 itemprop="headline" itemprop="name headline">{{ page.title }}</h1>
10
+ {% include snippets/page-title.html %}
11
+ <h1 itemprop="headline" itemprop="name headline">{{ __return }}</h1>
11
12
  {% include blog/article-data.html %}
12
13
  </header>
13
14
  <div class="m-article-content js-article-content" itemprop="articleBody">
@@ -15,12 +16,13 @@ layout: blog-default
15
16
  </div>
16
17
  <footer>
17
18
  {% if page.modify_date %}
18
- <span>
19
- Last updated
20
- <time datetime="{{ page.modify_date | date_to_xmlschema }}" itemprop="dateModified">
21
- {{ page.modify_date | date: "%b %-d, %Y" }}
22
- </time>
23
- </span>
19
+ {% assign __locale = site.data.locale.LAST_UPDATED %}
20
+ {% include snippets/locale-to-string.html %}
21
+ <span>{{ __return }}
22
+ {% assign __locale = site.data.locale.ARTICLE_DATE_FORMAT %}
23
+ {% include snippets/locale-to-string.html %}
24
+ <time datetime="{{ page.modify_date | date_to_xmlschema }}" itemprop="dateModified">{{ page.modify_date | date: __return }}</time>
25
+ </span>
24
26
  {% else %}
25
27
  <meta itemprop="dateModified" content="{{ page.date | date_to_xmlschema }}">
26
28
  {% endif %}
@@ -21,7 +21,6 @@
21
21
  margin: $content-gap 0;
22
22
  font-size: $small-font-size;
23
23
  color: $text-color-l;
24
- background-color: $text-background-color;
25
24
  p {
26
25
  margin: $content-gap * .5 0;
27
26
  }
@@ -118,6 +117,7 @@
118
117
  display: block;
119
118
  width: 100%;
120
119
  overflow-x: auto;
120
+ -webkit-overflow-scrolling: touch;
121
121
  margin: $content-gap 0;
122
122
  border-collapse: collapse;
123
123
  th, td {
@@ -1,10 +1,7 @@
1
1
  .follow-me {
2
2
  text-align: center;
3
- p {
4
- margin: 0;
5
- }
6
3
  & > ul{
7
- margin: 0 0 $content-gap 0;
4
+ margin: 0;
8
5
  }
9
6
  .round-button {
10
7
  color: $text-color-1;
@@ -8,10 +8,6 @@
8
8
  height: $footer-height;
9
9
  margin-top: -$footer-height;
10
10
  background-color: $main-color-3;
11
- & > .main {
12
- @include flexbox;
13
- @include flex-direction(column);
14
- }
15
11
  p {
16
12
  color: $text-color-3;
17
13
  }
@@ -22,15 +18,13 @@
22
18
  );
23
19
  }
24
20
  .follow-me {
25
- padding: $content-gap 0 0 0;
26
21
  .round-button {
27
22
  box-shadow: $shadow-down;
28
23
  }
29
24
  }
30
25
  .site-info {
31
- display: table;
32
- font-size: $tiny-font-size;
33
26
  text-align: center;
27
+ font-size: $tiny-font-size;
34
28
  margin: 0 auto;
35
29
  }
36
30
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-text-theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kitian616
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-11 00:00:00.000000000 Z
11
+ date: 2017-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -117,6 +117,7 @@ extra_rdoc_files: []
117
117
  files:
118
118
  - LICENSE
119
119
  - README.md
120
+ - _data/locale.yml
120
121
  - _includes/blog/article-data.html
121
122
  - _includes/blog/footer.html
122
123
  - _includes/blog/header.html
@@ -143,8 +144,11 @@ files:
143
144
  - _includes/icon/social/zhihu.svg
144
145
  - _includes/info/follow-me.html
145
146
  - _includes/logo/logo.svg
147
+ - _includes/snippets/get-lang.html
148
+ - _includes/snippets/locale-to-string.html
149
+ - _includes/snippets/page-title.html
146
150
  - _includes/snippets/page-url.html
147
- - _includes/snippets/rss-url.html
151
+ - _includes/snippets/prepend-baseurl.html
148
152
  - _includes/utils/comment-disqus.html
149
153
  - _includes/utils/google-analytics.html
150
154
  - _includes/utils/mathjax.html
@@ -152,7 +156,6 @@ files:
152
156
  - _layouts/blog-base.html
153
157
  - _layouts/blog-default.html
154
158
  - _layouts/error-404.html
155
- - _layouts/home-base.html
156
159
  - _layouts/home.html
157
160
  - _layouts/none.html
158
161
  - _layouts/page.html
@@ -1 +0,0 @@
1
- {{ "/feed.xml" | prepend: site.baseurl | replace:'//','/' | prepend: site.url }}
@@ -1,15 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="{{ site.lang }}">
3
- <head>
4
- {% include common-head.html %}
5
- {% include head-icons-rel.html %}
6
- <link rel="stylesheet" href="{{ "/assets/css/home.css" | prepend: site.baseurl | replace:'//','/' }}">
7
- <script src="//cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script>
8
- </head>
9
- <body>
10
- {{ content }}
11
- {% if site.isdebug == false %}
12
- {% include utils/google-analytics.html %}
13
- {% endif %}
14
- </body>
15
- </html>