Skip to content

Commit

Permalink
docs: add Chinese documents
Browse files Browse the repository at this point in the history
  • Loading branch information
kitian616 committed May 15, 2018
1 parent da1775f commit 6ffc9cc
Show file tree
Hide file tree
Showing 24 changed files with 507 additions and 40 deletions.
2 changes: 2 additions & 0 deletions _config.demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ paths:
# rss: /feed.xml

nav_lists:
- title: Documents
url: /docs/quick-start
- titles:
en: About
zh: 关于
Expand Down
4 changes: 2 additions & 2 deletions _config.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ chart: true # false (default), true
## => Paginate
##############################
paginate: 3
paginate_path: /blog/page:num # don't change this unless for special need
paginate_path: /page:num # don't change this unless for special need


## => Sources
Expand Down Expand Up @@ -153,7 +153,7 @@ exclude:
- jekyll-text-theme.gemspec
- package-lock.json
- package.json
- /docs
# - /docs
- /node_modules
- /screenshots
# - /test
Expand Down
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ chart: # false (default), true
## => Paginate
##############################
paginate: 8
paginate_path: /blog/page:num # don't change this unless for special need
paginate_path: /page:num # don't change this unless for special need


## => Sources
Expand Down
4 changes: 2 additions & 2 deletions _sass/common/_reset.scss
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ a {
}

pre, code {
font-family: map-get($base, code-font-family);
font-family: map-get($base, font-family-code);
}

code {
Expand All @@ -141,7 +141,7 @@ figure>img {
}

figcaption {
font-size: map-get($base, font-size-sub);
font-size: map-get($base, font-size-small);
}

.icon {
Expand Down
10 changes: 7 additions & 3 deletions _sass/common/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$base: (
font-family: (-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif),
code-font-family: (Menlo, Monaco, Consolas, Andale Mono, lucida console, Courier New, monospace),
font-family-code: (Menlo, Monaco, Consolas, Andale Mono, lucida console, Courier New, monospace),

font-size-root: 16px,
font-size: 1rem,
Expand All @@ -11,15 +11,15 @@ $base: (
font-size-h4: 1.2rem,
font-size-h5: 1rem,
font-size-h6: 1rem,
font-size-sub: .9rem,
font-size-small: .9rem,
font-size-tiny: .8rem,

font-size-h1-small: 2rem,
font-size-h2-small: 1.5rem,
font-size-h3-small: 1.35rem,
font-size-h4-small: 1.15rem,

font-size-header-list: 1.4rem,
font-size-heading-list: 1.4rem,
font-size-h1-excerpt: 1rem,
font-size-h2-excerpt: .975rem,
font-size-h3-excerpt: .95rem,
Expand Down Expand Up @@ -53,6 +53,10 @@ $layout: (
footer-height: 12rem
);

// sm md lg
// | ------ | ------ | ------ |
// 0 500 1024 ∞

$responsive: (
s: 500px,
l: 1024px
Expand Down
2 changes: 1 addition & 1 deletion _sass/components/_article.content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
blockquote {
padding-left: 1rem;
@include split-line(left, 4px, $border-color);
font-size: map-get($base, font-size-sub);
font-size: map-get($base, font-size-small);
color: $text-color-l;
p {
margin: map-get($base, vertical-space) 0;
Expand Down
2 changes: 1 addition & 1 deletion _sass/components/_article.info.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.date-wrapper,
.tag-wrapper,
.view-wrapper {
font-size: map-get($base, font-size-sub);
font-size: map-get($base, font-size-small);
}
.tag-wrapper {
float: left;
Expand Down
2 changes: 1 addition & 1 deletion _sass/components/_toc.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}
a {
display: inline-block;
font-size: map-get($base, font-size-sub);
font-size: map-get($base, font-size-small);
@include link-normal() {
text-decoration: none;
}
Expand Down
4 changes: 2 additions & 2 deletions _sass/layout/_all.scss
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@
list-style-type: none;
margin: .4rem 0;
.date {
font-family: map-get($base, code-font-family);
font-family: map-get($base, font-family-code);
display: inline-block;
font-size: map-get($base, font-size-sub);
font-size: map-get($base, font-size-small);
color: $text-color-l;
padding: 0 1rem 0 0;
}
Expand Down
6 changes: 3 additions & 3 deletions _sass/layout/_home.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
.m-post-list {
& > article {
& > h1 {
font-size: map-get($base, font-size-header-list);
font-size: map-get($base, font-size-heading-list);
& > a {
@include link-text-colors( $text-color-d, $main-color-1, $main-color-1);
}
}
& > a {
font-size: map-get($base, font-size-sub);
font-size: map-get($base, font-size-small);
}
padding-bottom: 1.3rem;
margin: 2.6rem 0 1rem 0;
Expand All @@ -16,7 +16,7 @@
}
}
.m-article-content {
font-size: map-get($base, font-size-sub);
font-size: map-get($base, font-size-small);
line-height: map-get($base, line-height);
@include block-elements() {
margin-top: map-get($base, vertical-space);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: post
title: 'Document - Writing Posts'
permalink: /docs/writing-posts
key: 20180410
category: Document
tags:
Expand Down Expand Up @@ -33,29 +34,29 @@ To improve the user experience for both reading and writing posts, TeXt made som
mathjax: true
---

Between these triple-dashed lines you can set variables. you can consider it as page configuration, these would overrides the global configuration in `_config.yml`.
Between these triple-dashed lines you can set variables. you can consider it as page configuration, these would overrides the global configuration in ``_config.yml``.

Beside Jekyll's predefined variables, TeXt define some new variables:

| Variable | Option Values | Description |
| --- | --- | --- |
| key | - | Unique key for the post |
| modify_date | - | The last modified date of this post, the date is modified in the format `YYYY-MM-DD HH:MM:SS +/-TTTT`; hours, minutes, seconds, and timezone offset are optional. just like `date` variable |
| comment | true(default), false | Set as `false` to disable comment on the post |
| mathjax | true, false(default) | Set as `true` to enable Mathjax on the post |
| mathjax_autoNumber | true, false(default) | Set as `true` to enable Mathjax autoNumber on the post |
| mermaid | true, false(default) | Set as `true` to enable Mermaid on the post |
| chart | true, false(default) | Set as `true` to enable Chart on the post |
| Variable | Option Values | Description |
| --- | --- | --- |
| **key** | - | Unique key for the post, required by Comment and Pageviews. begin with a letter (`[A-Za-z]`) and may be followed by any number of letters, digits (`[0-9]`), hyphens (`-`), underscores (`_`), colons (`:`), and periods (`.`)|
| **modify_date** | - | The last modified date of this post, the date is modified in the format `YYYY-MM-DD HH:MM:SS +/-TTTT`; hours, minutes, seconds, and timezone offset are optional. just like `date` variable |
| **comment** | true(default), false | Set as `false` to disable comment on the post |
| **mathjax** | true, false(default) | Set as `true` to enable Mathjax on the post |
| **mathjax_autoNumber** | true, false(default) | Set as `true` to enable Mathjax autoNumber on the post |
| **mermaid** | true, false(default) | Set as `true` to enable Mermaid on the post |
| **chart** | true, false(default) | Set as `true` to enable Chart on the post |

### Markdown Enhancements

| Enhancemen Name | Description |
| --------------- | ----------- |
| **Mathjax** | Make it easy to add mathematics in articles | [EXAMPLES](https://tianqi.name/jekyll-TeXt-theme/test/2017/07/07/mathjax.html) |
| **Mathjax** | Make it easy to add mathematics in articles, using MathML, LaTeX and ASCIIMathML markup | [EXAMPLES](https://tianqi.name/jekyll-TeXt-theme/test/2017/07/07/mathjax.html) |
| **Mermaid** | Bring diagrams and flowcharts in articles | [EXAMPLES](https://tianqi.name/jekyll-TeXt-theme/test/2017/06/06/mermaid.html) |
| **Chart** | Bring charts in articles | [EXAMPLES](https://tianqi.name/jekyll-TeXt-theme/test/2017/05/05/chart.html) |

As mentioned above, you need set the variable true in the _config.yml or in the YAML Front Matter to enable markdown enhancement.
As mentioned above, you need set the variable true in the `_config.yml` or in the YAML Front Matter to enable markdown enhancement.

### Additional styles

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
---
layout: post
title: 'Document - Configuration'
permalink: /docs/configuration
key: 20180420
category: Document
tags:
- Document
- English
---

Jekyll allows you to concoct your sites in any way you can dream up, and it’s thanks to the powerful and flexible configuration options that this is possible. These options can either be specified in a `_config.yml` file placed in your site’s root directory, or can be specified as flags for the jekyll executable in the terminal.

For technical reasons, this file is *NOT* reloaded automatically when you use `jekyll serve`. If you change this file, please restart the server process.
For technical reasons, `_config.yml` is *NOT* reloaded automatically when you use `jekyll serve`. If you change this file, please restart the server process.
{:.warning}

<!--more-->
Expand Down Expand Up @@ -126,7 +126,7 @@ Depending on your settings, the social network buttons would show on every pages

Setting for [GitHub Metadata](https://github.com/jekyll/github-metadata) plugin, you can refer to [HERE](https://github.com/jekyll/github-metadata/blob/master/docs/configuration.md#configuration) for more info.

In order for jekyll-github-metadata to know what metadata to fetch it must be able to determine the repository NWO (name with owner, e.g. kitian616/jekyll-TeXt-theme) to ask GitHub about.
In order for jekyll-github-metadata to know what metadata to fetch it must be able to determine the repository NWO to ask GitHub about.

"NWO" stands for "name with owner." It is GitHub lingo for the username of the owner of the repository plus a forward slash plus the name of the repository, e.g. 'kitian616/jekyll-TeXt-theme', where 'kitian616' is the owner and 'jekyll-TeXt-theme' is the repository name.

Expand Down Expand Up @@ -198,7 +198,7 @@ The number should be the maximum number of Posts you’d like to be displayed pe
You may also specify the destination of the pagination pages:

```yaml
paginate_path: /blog/page:num # don't change this unless for special need
paginate_path: /page:num # don't change this unless for special need
```

## Sources
Expand Down Expand Up @@ -241,14 +241,14 @@ gitalk:
owner: "github-repo-owner"
admin: # Github repo owner and collaborators, only these guys can initialize github issues, IT IS A LIST.
- "your-github-id"
- "other-admin-github-id"
- "the-other-admin-github-id"
```

## Pageview

TeXt use [LeanCloud](https://leancloud.cn/) as back-end service. You need create a app on the dashboard, and config the app's id, key and class name.

The detail guide of LeanCloud will find in Chinese document(not available yet) since LeanCloud haven't provide an English-language edition.
The detail guide of LeanCloud will find in [Chinese document](https://tianqi.name/jekyll-TeXt-theme/docs/zh/configuration#%E6%96%87%E7%AB%A0%E7%82%B9%E5%87%BB%E9%87%8F) since LeanCloud haven't provide an English-language edition.
{:.info}

```yaml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
layout: post
title: 'Document - Quick Start'
permalink: /docs/quick-start
key: 20180501
category: Document
tags:
- Document
- English
Expand Down Expand Up @@ -32,9 +32,9 @@ To install it with common method, all you need to do is copying all the theme fi

3. If you host your site on GitHub Pages, you can just fork [jekyll-TeXt-theme](https://github.com/kitian616/jekyll-TeXt-theme), then rename the repository to **USERNAME.github.io** — replacing **USERNAME** with your GitHub username.

![Fork](https://raw.githubusercontent.com/kitian616/jekyll-TeXt-theme/master/test/assets/images/fork.png)
![Fork](https://raw.githubusercontent.com/kitian616/jekyll-TeXt-theme/master/test/assets/images/github-fork.png)

![Rename](https://raw.githubusercontent.com/kitian616/jekyll-TeXt-theme/master/test/assets/images/rename.png)
![Rename](https://raw.githubusercontent.com/kitian616/jekyll-TeXt-theme/master/test/assets/images/github-rename-repo.png)

### Ruby Gem Method

Expand Down Expand Up @@ -91,6 +91,6 @@ If you host your site on your server, you need first run `JEKYLL_ENV=production

## Further Reading

- [Configuration](https://tianqi.name/jekyll-TeXt-theme/test/document/2018/04/20/configuration.html)
- [Configuration](https://tianqi.name/jekyll-TeXt-theme/docs/quick-start)

- [Writing Posts](https://tianqi.name/jekyll-TeXt-theme/test/document/2018/04/10/writing-posts.html)
- [Writing Posts](https://tianqi.name/jekyll-TeXt-theme/docs/writing-posts)
72 changes: 72 additions & 0 deletions docs/zh/_posts/2018-04-10-writing-posts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
layout: post
title: 撰写博客
permalink: /docs/zh/writing-posts
key: 20180410-ch
lang: zh
category: Document
tags:
- Document
- Simplified Chinese | 简
---

[目录结构](http://jekyllcn.com/docs/structure/)介绍中说明过,所有的文章都在 _posts 文件夹中。这些文件可以用 Markdown 或 HTML 编写。只要文件中有 YAML 头信息,它们就会从源格式转化成 HTML 页面,从而成为你的静态网站的一部分。

<!--more-->

## 创建文章

发表一篇新文章,你所需要做的就是在 `_posts` 文件夹中创建一个新的文件。文件名的命名非常重要。Jekyll 要求一篇文章的文件名遵循下面的格式:

年-月-日-标题.MARKUP

下面是一些合法的文件名的例子:

2011-12-31-new-years-eve-is-awesome.md
2012-09-12-how-to-write-a-blog.markdown

## 内容相关

所有博客文章顶部必须有一段 YAML 头信息(YAML front-matter)。

为了提高文章的阅读和书写体验,TeXt 在 Markdown 原有的基础上做了一些增强。

### YAML 头信息

---
layout: post
title: Document - Writing Posts
mathjax: true
---

`---` 之间你可以设置属性的值,可以把它们看作页面的配置,这些配置会覆盖在 `_config.yml` 文件中设置的全局配置。

除去 Jekyll 自定义的变量外,TeXt 也定义了一些额外的变量:

| 变量名 | 可选值 | 描述 |
| --- | --- | --- |
| **key** | - | 文章或页面的唯一标识符,供评给评论系统和点击量统计使用。必须以字母(`[A-Za-z]`)开头,其后可以接若干字母、数字(`[0-9]`)、连字符(`-`)、下划线(`_`)、冒号(`:`)和小数点(`.`|
| **modify_date** | - | 该文章的最后修改时间, 其格式为 `YYYY-MM-DD HH:MM:SS +/-TTTT``date` 的格式相同 |
| **comment** | true(default), false | 该文章或页面是否开启评论支持,默认开启,设置为 `false` 关闭 |
| **mathjax** | true, false(default) | 该文章或页面是否开启 Mathjax 公式支持,默认关闭,设置为 `true` 开启 |
| **mathjax_autoNumber** | true, false(default) | 该文章或页面的 Mathjax 公式是否自动编号,默认关闭,设置为 `true` 开启 |
| **mermaid** | true, false(default) | 该文章或页面是否开启 Mermaid 流程图支持,默认关闭,设置为 `true` 开启 |
| **chart** | true, false(default) | 该文章或页面是否开启 Chart 图表支持,默认关闭,设置为 `true` 开启 |

### Markdown 增强

| 增强项 | 描述 |
| --------------- | ----------- |
| **Mathjax** | 在文章中方便的加入数学公式,使用 MathML、LaTeX 和 ASCIIMathML 语法 | [示例](https://tianqi.name/jekyll-TeXt-theme/test/2017/07/07/mathjax.html) |
| **Mermaid** | 在文章中方便的加入流程图 | [示例](https://tianqi.name/jekyll-TeXt-theme/test/2017/06/06/mermaid.html) |
| **Chart** | 在文章中方便的加入可交互的图表 | [示例](https://tianqi.name/jekyll-TeXt-theme/test/2017/05/05/chart.html) |

正如上文所说,你需要在 `_config.yml` 或 YAML 头信息中设置相关的属性为 `true` 来开启对应的功能。

### 附加样式

Jekyll 使用 kramdown 作为默认 Markdown 解释器。kramdown 可以通过 ALDs[^ALDs] 来设置块级元素或行内元素的属性。例如,可以通过 `{:.class-name1 .class-name-2}` 来给元素定义样式类。

TeXt 定义了一些样式类,你可以在文章和页面的方便的使用,可以在[这里](https://tianqi.name/jekyll-TeXt-theme/test/2017/08/08/additional-styles.html)看到示例和详细的说明.

[^ALDs]: [Attribute List Definitions](https://kramdown.gettalong.org/syntax.html#attribute-list-definitions)
Loading

0 comments on commit 6ffc9cc

Please sign in to comment.