Skip to content

Commit

Permalink
feat: post-list layout -> home layout, toc bottom bugs fix, mermaid b…
Browse files Browse the repository at this point in the history
…ugs fix
  • Loading branch information
kitian616 committed May 29, 2018
1 parent 9e7f84b commit 885aaf7
Show file tree
Hide file tree
Showing 26 changed files with 110 additions and 93 deletions.
4 changes: 2 additions & 2 deletions _includes/pageview.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
{%- assign _pageview = __return -%}


{%- if page.layout == "post-list" -%}
{%- if page.layout == "home" -%}

{%- if jekyll.environment != "development" -%}
{%- include pageview-providers/leancloud/post-list.html -%}
{%- include pageview-providers/leancloud/home.html -%}
{%- endif -%}


Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion _includes/scripts/aside/toc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
var SOURCES = window.TEXT_VARIABLES.sources;
var TOC_SELECTOR = window.TEXT_VARIABLES.site.toc.selectors;
window.Lazyload.js(SOURCES.jquery, function() {
var $window = $(window), $pageMain = $('.js-page-main');
var $window = $(window);
var $articleContent = $('.js-article-content');
var $tocRoot = $('.js-toc-root'), $col2 = $('.js-col-2');
var toc;
Expand Down
4 changes: 2 additions & 2 deletions _includes/scripts/common.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(function () {
/*(function () {
})();
})();*/
3 changes: 3 additions & 0 deletions _includes/scripts/home.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/*(function () {
})();*/
3 changes: 3 additions & 0 deletions _includes/scripts/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/*(function () {
})();*/
Empty file removed _includes/scripts/post-list.js
Empty file.
2 changes: 1 addition & 1 deletion _layouts/archive.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
</div>

<script>
{%- include scripts/all.js -%}
{%- include scripts/archieve.js -%}
</script>
2 changes: 1 addition & 1 deletion _layouts/post-list.html → _layouts/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,5 @@ <h1><a href="{{ href }}">{{ post.title }}</a></h1>
</div>

<script>
{%- include scripts/post-list.js -%}
{%- include scripts/home.js -%}
</script>
3 changes: 2 additions & 1 deletion _layouts/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,11 @@

{%- if page.aside -%}
<script>
{%- include scripts/aside/affix.js -%}
/* toc must before affix, since affix need to konw toc' height. */
{%- if page.aside.toc -%}
{%- include scripts/aside/toc.js -%}
{%- endif -%}
{%- include scripts/aside/affix.js -%}
</script>
{%- endif -%}

Expand Down
5 changes: 5 additions & 0 deletions _sass/common/_reset.scss
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,9 @@ input {
&:focus {
outline: none;
}
}

// mermaid
.mermaidTooltip {
display: none;
}
24 changes: 12 additions & 12 deletions _sass/components/_article.content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
p {
margin: map-get($base, vertical-space) 0;
}
&>:last-child {
& > :last-child {
margin-bottom: 0;
}
}
Expand Down Expand Up @@ -78,7 +78,7 @@
pre {
overflow: auto;
-webkit-overflow-scrolling: touch;
&>code {
& > code {
padding: 0;
background-color: transparent;
word-wrap: normal;
Expand All @@ -93,13 +93,13 @@
}
}
}
.highlighter-rouge>.highlight, figure.highlight {
&>pre {
.highlighter-rouge > .highlight, figure.highlight {
& > pre {
border-radius: map-get($base, border-radius);
padding: 1rem 0 1rem 1rem;
margin: 0;
background-color: $text-background-color;
&>code {
& > code {
display: block;
}
}
Expand All @@ -117,25 +117,25 @@
text-align: right;
text-transform: uppercase;
}
&>pre {
& > pre {
padding-top: 0;
border-top-left-radius: 0;
border-top-right-radius: 0;
&>code {
&>.rouge-table {
& > code {
& > .rouge-table {
width: auto;
margin: 0 0 -1rem -1rem;
tbody, tr, td {
border: none;
padding-top: 0;
padding-bottom: 0;
}
&>tbody {
& > tbody {
@include flexbox;
&>tr {
& > tr {
width: 100%;
@include flexbox;
&>.code {
& > .code {
padding: 0 0 1rem .5rem;
overflow: auto;
-webkit-overflow-scrolling: touch;
Expand All @@ -146,7 +146,7 @@
&.gl {
padding-left: 1rem;
}
&>pre {
& > pre {
border-radius: 0;
display: block;
overflow: visible;
Expand Down
118 changes: 60 additions & 58 deletions _sass/layout/_home.scss
Original file line number Diff line number Diff line change
@@ -1,68 +1,70 @@
.post-list {
& > article {
& > h1 {
font-size: map-get($base, font-size-h3);
.layout--home {
.post-list {
& > article {
& > h1 {
font-size: map-get($base, font-size-h3);
& > a {
@include link-colors($text-color-d, $main-color-1, $main-color-1);
}
}
& > a {
@include link-colors($text-color-d, $main-color-1, $main-color-1);
font-size: map-get($base, font-size-sm);
}
padding-bottom: 1.3rem;
margin: 2.6rem 0 1rem 0;
&:not(:last-child) {
@include split-line(bottom);
}
}
& > a {
.article-content {
font-size: map-get($base, font-size-sm);
}
padding-bottom: 1.3rem;
margin: 2.6rem 0 1rem 0;
&:not(:last-child) {
@include split-line(bottom);
}
}
.article-content {
font-size: map-get($base, font-size-sm);
line-height: map-get($base, line-height);
@include block-elements() {
margin-top: map-get($base, vertical-space);
margin-bottom: map-get($base, vertical-space);
}
@include heading-elements() {
margin-top: map-get($base, vertical-space) * 1.5;
}
line-height: map-get($base, line-height);
@include block-elements() {
margin-top: map-get($base, vertical-space);
margin-bottom: map-get($base, vertical-space);
}
@include heading-elements() {
margin-top: map-get($base, vertical-space) * 1.5;
}

h1,
h2,
h3 {
color: $text-color;
}
h1,
h2 {
padding: 0;
border: none;
}
h1 {
font-size: map-get($base, font-size-h1-xs);
}
h2 {
font-size: map-get($base, font-size-h2-xs);
}
h3 {
font-size: map-get($base, font-size-h3-xs);
}
h4 {
font-size: map-get($base, font-size-h4-xs);
}
h5 {
font-size: map-get($base, font-size-h5-xs);
}
h6 {
font-size: map-get($base, font-size-h6-xs);
}
img {
max-height: 12rem;
h1,
h2,
h3 {
color: $text-color;
}
h1,
h2 {
padding: 0;
border: none;
}
h1 {
font-size: map-get($base, font-size-h1-xs);
}
h2 {
font-size: map-get($base, font-size-h2-xs);
}
h3 {
font-size: map-get($base, font-size-h3-xs);
}
h4 {
font-size: map-get($base, font-size-h4-xs);
}
h5 {
font-size: map-get($base, font-size-h5-xs);
}
h6 {
font-size: map-get($base, font-size-h6-xs);
}
img {
max-height: 12rem;
}
}
}
}

.pagination {
margin: map-get($base, vertical-space-lg) 0;
.pagination__omit {
color: $text-color-l;
.pagination {
margin: map-get($base, vertical-space-lg) 0;
.pagination__omit {
color: $text-color-l;
}
}
}
2 changes: 1 addition & 1 deletion docs/en/1.1-quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ aside:

TeXt Theme is 100% compatible with GitHub Pages and it has been developed as a [gem-based themes](https://jekyllrb.com/docs/themes/) for easier use.

In this document, you will learn how to **install the theme**, **setup your site**, **local preview** for development, **build and publish**.
In this document, you will learn how to **install the theme**, **setup your site**, **local preview** for development, **build** and **publish**.

<!--more-->

Expand Down
2 changes: 1 addition & 1 deletion docs/en/2.2-navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ aside:
toc: true
---

There are two types of navigation in TeXt: Header Navigation and Sidebar Navigation, both are defined in data/navigation.yml.
There are two types of navigation in TeXt: **Header Navigation** and **Sidebar Navigation**, both are defined in data/navigation.yml.

<!--more-->

Expand Down
6 changes: 3 additions & 3 deletions docs/en/2.3-layouts.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ graph TB;
BASE[base]
PAGE[page]
ARTICLE[article]
POST_LIST[post-list]
HOME[home]
ARCHIVE[archive]
404[404]
NONE-->BASE;
BASE-->PAGE;
PAGE-->ARTICLE;
PAGE-->POST_LIST;
PAGE-->HOME;
PAGE-->ARCHIVE;
PAGE-->404;
```
Expand Down Expand Up @@ -53,7 +53,7 @@ Base on Page Layout.
| Variable | Option Values | Description |
| **modify_date** | - | The last modified date of this article, 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 |

## Post List Layout
## Home Layout

Base on Page Layout.

Expand Down
2 changes: 1 addition & 1 deletion docs/en/3.1-writing-posts.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ aside:
toc: true
---

As explained on the [directory structure](https://jekyllrb.com/docs/structure/) page, the _posts folder is where your blog posts will live. These files are generally Markdown or HTML. All posts must have YAML Front Matter, and they will be converted from their source format into an HTML page that is part of your static site.
As explained on the [directory structure](https://jekyllrb.com/docs/structure/) page, **the _posts folder is where your blog posts will live**. These files are generally Markdown or HTML. All posts must have YAML Front Matter, and they will be converted from their source format into an HTML page that is part of your static site.

<!--more-->

Expand Down
2 changes: 1 addition & 1 deletion docs/zh/1.1-quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ aside:

TeXt 是一款 100% 兼容 GitHub Pages 的 Jekyll 主题,你可以通过 Fork、下载或主题等方式安装。

在这篇文章中,你将学到如何安装设置主题,通过本地预览进行开发以及编译和发布网站的方法
在这篇文章中,你将学到如何**安装设置主题**,通过**本地预览**进行开发以及**编译****发布**

<!--more-->

Expand Down
2 changes: 1 addition & 1 deletion docs/zh/2.2-navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ aside:
toc: true
---

在 TeXt 中有两种导航栏:头部导航栏(Header Navigation)和侧边栏导航栏(Sidebar Navigation),它们均在 data/navigation.yml 中配置。
在 TeXt 中有两种导航栏:**头部导航栏**(Header Navigation)**侧边栏导航栏**(Sidebar Navigation),它们均在 data/navigation.yml 中配置。

<!--more-->

Expand Down
7 changes: 4 additions & 3 deletions docs/zh/2.3-layouts.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ graph TB;
BASE[base]
PAGE[page]
ARTICLE[article]
POST_LIST[post-list]
HOME[home]
ARCHIVE[archive]
404[404]
NONE-->BASE;
BASE-->PAGE;
PAGE-->ARTICLE;
PAGE-->POST_LIST;
PAGE-->HOME;
PAGE-->ARCHIVE;
PAGE-->404;
```
Expand All @@ -38,6 +38,7 @@ graph TB;
| Variable | Option Values | Description |
| --- | --- | --- |
| **key** | - | 页面的唯一标识符,供评给评论系统和点击量统计使用。必须以字母(`[A-Za-z]`)开头,其后可以接若干字母、数字(`[0-9]`)、连字符(`-`)、下划线(`_`)、冒号(`:`)和小数点(`.`|
| **lang** | en | 该页的语言 |
| **show_title** | true(default), false | 该页是否显示标题,默认显示,设置为 `false` 隐藏 |
| **modify_date** | - | 该文章的最后修改时间, 其格式为 `YYYY-MM-DD HH:MM:SS +/-TTTT``date` 的格式相同 |
| **comment** | true(default), false | 该页是否开启评论支持,默认开启,设置为 `false` 关闭 |
Expand All @@ -55,7 +56,7 @@ graph TB;
| Variable | Option Values | Description |
| **modify_date** | - | 该文章的最后修改时间, 其格式为 `YYYY-MM-DD HH:MM:SS +/-TTTT``date` 的格式相同 |

## Post List 布局
## Home 布局

继承于 Page 布局.

Expand Down
2 changes: 1 addition & 1 deletion docs/zh/3.1-writing-posts.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ aside:
toc: true
---

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

<!--more-->

Expand Down
Loading

0 comments on commit 885aaf7

Please sign in to comment.