Skip to content

Commit

Permalink
feat: add custom snippets for main/top, main/bottom, article/top and …
Browse files Browse the repository at this point in the history
…article/footer
  • Loading branch information
kitian616 committed Dec 20, 2018
1 parent 8bf3ff4 commit e5b8a80
Show file tree
Hide file tree
Showing 22 changed files with 50 additions and 16 deletions.
10 changes: 5 additions & 5 deletions README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

TeXt 是针对个人或团队网站、博客、项目、文档等的一款高度可定制的 Jekyll 主题。它参考了 iOS 11 的风格,有大而突出的标题和圆润的按钮及卡片。

[English Documentation](https://github.com/kitian616/jekyll-TeXt-theme/blob/master/README.md)
[English](https://github.com/kitian616/jekyll-TeXt-theme/blob/master/README.md)

## 特性

Expand Down Expand Up @@ -74,10 +74,6 @@ TeXt 使用 [Tomorrow](https://github.com/chriskempson/tomorrow-theme) 作为它
- [扩展](https://tianqi.name/jekyll-TeXt-theme/docs/zh/extensions)
- [Markdown 增强](https://tianqi.name/jekyll-TeXt-theme/docs/zh/markdown-enhancements)

## 其他资源

*_includes/icon/social* 目录下有很多的社交产品图标,例如 Behance、Flickr、QQ、微信等,方便修改和使用。

## 示例

| Name | Description |
Expand All @@ -99,6 +95,10 @@ TeXt 使用 [Tomorrow](https://github.com/chriskempson/tomorrow-theme) 作为它
| --- | --- |
| ![微信支付](https://raw.githubusercontent.com/kitian616/jekyll-TeXt-theme/master/docs/assets/images/tip_wechat.jpg) | ![支付宝](https://raw.githubusercontent.com/kitian616/jekyll-TeXt-theme/master/docs/assets/images/tip_alipay.jpg) |

## 其他资源

*_includes/icon/social* 目录下有很多的社交产品图标,例如 Behance、Flickr、QQ、微信等,方便修改和使用。

## 协议

TeXt Theme 遵循 [MIT 协议](https://github.com/kitian616/jekyll-TeXt-theme/blob/master/LICENSE)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

TeXt is a super customizable Jekyll theme for personal site, team site, blog, project, documentation, etc. Similar to iOS 11 style, it has large and prominent titles, round buttons and cards.

[Change Log](https://github.com/kitian616/jekyll-TeXt-theme/blob/master/CHANGELOG.md) | [中文文档](https://github.com/kitian616/jekyll-TeXt-theme/blob/master/README-zh.md)
[Change Log](https://github.com/kitian616/jekyll-TeXt-theme/blob/master/CHANGELOG.md) | [中文](https://github.com/kitian616/jekyll-TeXt-theme/blob/master/README-zh.md)

## Features

Expand Down
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ sources: # bootcdn (default), unpkg
## => Sharing
##############################
sharing:
provider: false # false (default), "addtoany", "addthis"
provider: false # false (default), "addtoany", "addthis", "custom"

## AddThis
addthis:
Expand Down
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions _includes/article/top/custom.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- start custom article top snippet -->

<!-- end custom article top snippet -->
3 changes: 3 additions & 0 deletions _includes/comments-providers/custom.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- start custom comments snippet -->

<!-- end custom comments snippet -->
File renamed without changes.
3 changes: 3 additions & 0 deletions _includes/main/top/custom.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- start custom main top snippet -->

<!-- end custom main top snippet -->
Empty file.
3 changes: 3 additions & 0 deletions _includes/sharing-providers/custom.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- start custom sharing snippet -->

<!-- end custom sharing snippet -->
2 changes: 2 additions & 0 deletions _includes/sharing.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
{%- include sharing-providers/addtoany.html -%}
{%- elsif site.sharing.provider == 'addthis' -%}
{%- include sharing-providers/addthis.html -%}
{%- elsif site.sharing.provider == 'custom' -%}
{%- include sharing-providers/custom.html -%}
{%- endif -%}
7 changes: 4 additions & 3 deletions _layouts/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
{%- assign _license = __return -%}

<div class="layout--article">
{%- include article/top/custom.html -%}

<div class="article__content" itemprop="articleBody">{{ content }}</div>

Expand All @@ -40,15 +41,15 @@
{%- elsif page.date -%}
<meta itemprop="dateModified" content="{{ page.date | date_to_xmlschema }}">
{%- endif -%}
{%- include article-footer/custom.html -%}
{%- include article/footer/custom.html -%}

{%- if _show_author_profile -%}
{%- if page.author -%}
{%- assign _author = site.data.authors[page.author] -%}
{%- else -%}
{%- assign _author = site.author -%}
{%- endif -%}
{%- include article-footer/author-profile.html author=_author -%}
{%- include article/footer/author-profile.html author=_author -%}
{%- endif -%}

{%- if _license != false -%}
Expand All @@ -60,7 +61,7 @@
{%- assign _license_data = _data_license[_license] -%}
{%- endif -%}
<div class="article__license">
{%- include article-footer/license.html license=_license_data -%}
{%- include article/footer/license.html license=_license_data -%}
</div>
{%- endif -%}
</footer>
Expand Down
3 changes: 2 additions & 1 deletion _layouts/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@
</div>

<div class="col-main cell cell--auto">
{%- include main/top/custom.html -%}
{%- if _page_type == 'article' -%}
<article itemscope itemtype="http://schema.org/Article">
{%- elsif _page_type == 'webpage' -%}
Expand All @@ -214,7 +215,7 @@
<section class="page__comments d-print-none">{%- include comments.html -%}</section>
{%- endif -%}
</article>
{%- include main-bottom/custom.html -%}
{%- include main/bottom/custom.html -%}
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion docs/_config.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ sources: unpkg # bootcdn (default), unpkg
## => Sharing
##############################
sharing:
provider: addtoany # false (default), "addtoany", "addthis"
provider: addtoany # false (default), "addtoany", "addthis", "custom"

## AddThis
addthis:
Expand Down
2 changes: 1 addition & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ sources: # bootcdn (default), unpkg
## => Sharing
##############################
sharing:
provider: addthis # false (default), "addtoany", "addthis"
provider: addthis # false (default), "addtoany", "addthis", "custom"

## AddThis
addthis:
Expand Down
4 changes: 4 additions & 0 deletions docs/_docs/en/2.1-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ sources: bootcdn # bootcdn (default), unpkg
| --- | --- |
| **addtoany** | [AddToAny](https://www.addtoany.com/) |
| **addthis** | [AddThis](https://www.addthis.com/) |
| **custom** | |

### AddToAny

Expand Down Expand Up @@ -279,6 +280,7 @@ You NEED set `sharing` variable as `true` in the page’s YAML Front Matter to e
| **disqus** | [Disqus](https://disqus.com/) |
| **gitalk** | [Gitalk](https://github.com/gitalk/gitalk/) |
| **valine** | [Valine](https://valine.js.org/en/) |
| **custom** | |

### Disqus

Expand Down Expand Up @@ -328,6 +330,7 @@ For all the above comments systems, you NEED set `key` variable in the page’s
| Name | Pageview Provider |
| --- | --- |
| **leancloud** | [Disqus](https://leancloud.cn/) |
| **custom** | |

### LeanCloud

Expand All @@ -353,6 +356,7 @@ For all the above pageview statistics, you **NEED** set `key` variable in the pa
| Name | Analytics Provider |
| --- | --- |
| **google** | [Google Analytics](https://analytics.google.com/) |
| **custom** | |

### Google Analytics

Expand Down
4 changes: 4 additions & 0 deletions docs/_docs/zh/2.1-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ sources: bootcdn # bootcdn (default), unpkg
| --- | --- |
| **addtoany** | [AddToAny](https://www.addtoany.com/) |
| **addthis** | [AddThis](https://www.addthis.com/) |
| **custom** | |

### AddToAny

Expand Down Expand Up @@ -277,6 +278,7 @@ comments:
| **disqus** | [Disqus](https://disqus.com/) |
| **gitalk** | [Gitalk](https://github.com/gitalk/gitalk/) |
| **valine** | [Valine](https://valine.js.org/en/) |
| **custom** | |

### Disqus

Expand Down Expand Up @@ -328,6 +330,7 @@ comments:
| 名称 | 文章点击量后台提供方 |
| --- | --- |
| **leancloud** | [Disqus](https://leancloud.cn/) |
| **custom** | |

### LeanCloud

Expand Down Expand Up @@ -370,6 +373,7 @@ pageview:
| 名称 | 站点统计提供方 |
| --- | --- |
| **google** | [Google Analytics](https://analytics.google.com/) |
| **custom** | |

### Google Analytics

Expand Down
8 changes: 8 additions & 0 deletions docs/_includes/article/top/custom.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!-- start custom article top snippet -->
<div class="my-3">
<a href="https://www.paypal.me/kitian616">
<img src="https://img.shields.io/badge/PayPal-tip%20me-green.svg?logo=paypal" alt="Tip Me via PayPal" />
</a>
<iframe src="https://ghbtns.com/github-btn.html?user=kitian616&repo=jekyll-TeXt-theme&type=star&count=true" frameborder="0" scrolling="0" width="170px" height="20px"></iframe>
</div>
<!-- end custom article top snippet -->
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<div align="center" style="margin: 1rem 0;">
<!-- start custom main bottom snippet -->
<div align="center" class="my-3">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Bottom -->
<ins class="adsbygoogle"
Expand All @@ -10,4 +11,5 @@
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
</div>
<!-- end custom main bottom snippet -->
2 changes: 1 addition & 1 deletion test/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ sources: # bootcdn (default), unpkg
## => Sharing
##############################
sharing:
provider: false # false (default), "addtoany", "addthis"
provider: false # false (default), "addtoany", "addthis", "custom"

## AddThis
addthis:
Expand Down

0 comments on commit e5b8a80

Please sign in to comment.