Skip to content

Commit 3d03ff9

Browse files
committed
2015 new version
1 parent b00d7b5 commit 3d03ff9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1949
-3088
lines changed

404.html

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
---
2-
layout: index
3-
title: 404 Not Found Error
4-
---
5-
6-
<article id="post__content">
7-
<h1 id="post__title">404 Not Found Error</h1>
8-
</article> <!-- end #post__content -->
1+
---
2+
layout: default
3+
---
4+
<div id="not-found" class="container">
5+
<h1>抱歉,文章不存在</h1>
6+
<p>欢迎阅读其他文章</p>
7+
</div>

LICENSE.txt

Lines changed: 0 additions & 22 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,4 @@
1-
# 3-Jekyll Theme
2-
3-
欢迎任何改进建议,请直接[提交 issues](https://github.com/P233/3-Jekyll/issues/new),感谢。
4-
5-
## 主要功能
6-
7-
* 不支持 IE9 及以下浏览器。
8-
* 三列布局,最左侧是博客的 Tags 列表(需手动配置),点击后过滤相关文章,一篇文章可以给多个 tags 不会影响。
9-
* 支持 pygments 代码高亮。
10-
* 支持插入 Codepen。
11-
* Lazy-load Disqus。
12-
* 自动生成文章目录列表(h1-h3),鼠标移动到浏览器右侧边缘自动滑出(给每个标题重新生成一串随机字母做 ID,但这样可能会影响分享链接)。
13-
* 支持移动设备,文章目录在移动设备上不显示。
14-
15-
同时制作了一份 Ghost 版本,请查看:[https://github.com/P233/3-Ghost](https://github.com/P233/3-Ghost),你也可以移植给其他 Blog 平台,需遵守 MIT License。
16-
17-
**安装后需要做一些简单配置才可使用,请仔细阅读下面的说明:**
18-
19-
## 配置模板
20-
21-
### 模板文件
22-
23-
`/_layouts/index.html` 包含整个页面框架,以及左侧 sidebar 部分;`/index.html` 仅包含首页内容;`/_layouts/post.html` 包含文章内容布局,分享按钮,以及评论等等。
24-
25-
### 设置标签
26-
27-
这是修改模板最关键的一步。
28-
29-
1. 打开 `/_layouts/index.html` 文件找到 `<ul id="tags__ul"></ul>` 部分,将 `place_your_tag_display_name_here` 替换成 Tag 显示名称,别忘记修改 ID 顺序,完毕之后记录 tags 顺序以及总数。
30-
2. 打开 `/assets/js/script.js` 找到 `// Variables` 部分,将 `place_your_tag_name_here` 替换成 tag 名称,这个名称需要与编辑文章时输入的 tag 一模一样,同时也需要满足 CSS 的 class 命名规则(不得已会影响命名 tag 的方式),顺序要与第一步匹配。
31-
3. 在 js 文件中继续寻找 `// Tags switcher` 注释后面跟着的 `for` 循环,将 `i <= 6` 换成 tags 总数 + 1 (因为 No.1 是全部分类)。
32-
33-
### 搜索功能
34-
35-
搜索框目前只是摆设,请使用 [Google Custom Search Engine](https://www.google.com/cse/)[jekyll-lunr-js-search](https://github.com/slashdotdash/jekyll-lunr-js-search) 插件。
36-
37-
### 修改头像
38-
39-
替换 `/assets/img/` 中的头像图片,`100px * 100px` 用于普通屏幕, `200px * 200px` 用于 Retina Display。
40-
41-
### 修改邮箱
42-
43-
通过 [Stop Link Spam Bots](http://www.safeemail.org/) 编辑了邮箱地址,希望能防 spam。
44-
45-
### Icon-font
46-
47-
使用了 [Fontello icon fonts generator](http://fontello.com),并附上了 config 文件放置在 `/assets/font/` 中,方便替换图标。
48-
49-
### 代码高亮
50-
51-
支持 pygments 代码高亮,配色使用的是 [https://gist.github.com/edwardhotchkiss/2005058](https://gist.github.com/edwardhotchkiss/2005058) 并基于 [prism.js Coy theme](http://prismjs.com/download.html) 修改,文件位置在 `/assets/_sass/_pygments.scss` 中。
521

53-
### Embedding Codepen
54-
55-
如果需要插入 Codepen,只需将 embed code 中的 `<p>` 部分粘贴在正文中,而不必粘贴 `<script>` 部分。更多关于插入 Codepen 的解释请查看 http://blog.codepen.io/documentation/features/how-do-i-embed-a-pen-on-another-site/
56-
57-
如果完全不需要这个功能可以将 `/assets/js/script.js` 中的相关代码删除。
58-
59-
### 修改分享链接地址
60-
61-
打开 `/_layouts/post.html` 将分享链接中的 `place_your_url_here` 提换成博客地址。
62-
63-
### 修改许可协议
64-
65-
`/_layouts/post.html` 文件的分享链接部分声明博客内容所使用的许可协议,默认使用 [Attribution-NonCommercial-ShareAlike 3.0 Unported](http://creativecommons.org/licenses/by-nc-sa/3.0/)
66-
67-
### Disqus 评论
68-
69-
Disqus 评论加载比较慢,所以使用了 lazy-load 的方式,在 `/assets/js/script.js` 的最下方找到 Disqus 相关代码,将 `window.disqus_shortname` 的值修改为自己的 shortname 。每篇文章的发表时间(`{{ page.date | date: "%Y%m%d" }}`)作为 identifier。
70-
71-
### 调整配色
72-
73-
个人非常不擅长配色,所以在 `/assets/_sass/style.scss` 文件中尽可能多地定义了颜色变量方便大家修改配色。关于默认的主题配色也请大家多提建议。
74-
75-
### 设置 RSS
76-
77-
请不要忘记编辑 `rss.xml` 文件,语言可填 `zh-cn``zh-tw`
78-
79-
## 已知问题
80-
81-
1. 键盘 <kbd>Space</kbd> <kbd>PgUp</kbd> <kbd>PgDn</kbd> <kbd>↑</kbd> <kbd>↓</kbd> 等快捷键无效,这是由于当前的布局方式影响的。iOS7 Mobile Safari 自动隐藏地址栏也会无效。
82-
83-
## Credits
84-
85-
* [jquery-pjax](https://github.com/defunkt/jquery-pjax)
86-
* [NProgress.js](http://ricostacruz.com/nprogress/)
87-
* [Solarized Light Pygments CSS](https://gist.github.com/edwardhotchkiss/2005058)
88-
89-
## Copyright & License
90-
91-
Copyright (c) 2013 Peiwen Lu - Released under The MIT License.
92-
93-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
94-
95-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
2+
# 3-Jekyll Theme
963

97-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
98-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4+
2015 新版,完成度 80%,旧版请在 [https://github.com/P233/3-Jekyll/releases](https://github.com/P233/3-Jekyll/releases) 下载

_config.yml

100755100644
Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,29 @@
1-
pygments: true
1+
# Site settings
2+
title: Your awesome title
3+
4+
description: > # this means to ignore newlines until "baseurl:"
5+
Write an awesome description for your new site here. You can edit this
6+
line in _config.yml. It will appear in your document head meta (for
7+
Google search results) and in your feed.xml site description.
8+
baseurl: "" # the subpath of your site, e.g. /blog/
9+
url: "http://yourdomain.com" # the base hostname & protocol for your site
10+
11+
12+
# Social account
13+
# twitter: username
14+
# weibo: ID
15+
# github: username
16+
# codepen: username
17+
# dribbble: username
18+
19+
20+
# Comment
21+
# disqus_shortname:
22+
23+
24+
# Build settings
25+
markdown: kramdown
26+
sass:
27+
style: compressed
28+
gems:
29+
- jekyll-sitemap

_includes/head.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<head>
2+
<meta charset="utf-8">
3+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
4+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
5+
<!--[if lte IE 9]><meta http-equiv="refresh" content="0;url={{ "/ie.html" | prepend: site.baseurl }}"><![endif]-->
6+
7+
<title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
8+
<meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">
9+
10+
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,400italic,600|Droid+Sans+Mono' rel='stylesheet' type='text/css'>
11+
<link rel="stylesheet" href="{{ "/css/main.css" | prepend: site.baseurl }}">
12+
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
13+
<link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}" />
14+
</head>

_includes/scripts.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<script src="{{ "/assets/js/jquery-2.1.3.min.js" | prepend: site.baseurl }}"></script>
2+
<script src="{{ "/assets/js/jquery.pjax.js" | prepend: site.baseurl }}"></script>
3+
<script src="{{ "/assets/js/nprogress.js" | prepend: site.baseurl }}"></script>
4+
<script src="{{ "/assets/js/main.js" | prepend: site.baseurl }}"></script>

_includes/sidebar.html

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<aside id="sidebar">
2+
<div id="sidebar-left">
3+
<a id="sidebar-avatar" href="{{ "/" | prepend: site.baseurl }}">
4+
<img id="sidebar-avatar-img" alt="{{ site.tittle }}" src="{{ "/assets/img/avatar.jpg" | prepend: site.baseurl }}"/>
5+
</a>
6+
7+
<div id="sidebar-social">
8+
<a href="{{ "/feed.xml" | prepend: site.baseurl }}" class="sidebar-social-icon feed"></a>
9+
<a href="mailto:{{ site.email }}" class="sidebar-social-icon email"></a>
10+
{% include social.html %}
11+
</div>
12+
13+
<ul id="sidebar-tags">
14+
<li class="sidebar-tag active" data-filter="all">全部文章</li>
15+
{% for category in site.categories %}
16+
<li class="sidebar-tag" data-filter="{{ category | first }}">{{ category | first }}</li>
17+
{% endfor %}
18+
</ul>
19+
</div>
20+
21+
<div id="sidebar-right">
22+
<div id="search-box">
23+
<input id="search-input" type="text" placeholder="Search" />
24+
</div>
25+
26+
<nav id="toc">
27+
{% for post in site.posts %}
28+
<a class="toc-link" data-tags="{{ post.categories | join: ' ' }}" href="{{ post.url }}">
29+
{{ post.title }}
30+
</a>
31+
{% endfor %}
32+
</nav>
33+
</div>
34+
</aside>

_includes/social.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{% if site.twitter %}
2+
<a href="https://twitter.com/{{ site.twitter }}" class="sidebar-social-icon twitter" target="_blank"></a>
3+
{% endif %}
4+
5+
{% if site.weibo %}
6+
<a href="http://www.weibo.com/{{ site.weibo }}" class="sidebar-social-icon weibo" target="_blank"></a>
7+
{% endif %}
8+
9+
{% if site.github %}
10+
<a href="https://github.com/{{ site.github }}" class="sidebar-social-icon github" target="_blank"></a>
11+
{% endif %}
12+
13+
{% if site.codepen %}
14+
<a href="http://codepen.io/{{ site.codepen }}" class="sidebar-social-icon codepen" target="_blank"></a>
15+
{% endif %}
16+
17+
{% if site.dribbble %}
18+
<a href="https://dribbble.com/{{ site.dribbble }}" class="sidebar-social-icon dribbble" target="_blank"></a>
19+
{% endif %}

_layouts/compress.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
#
3+
# Jekyll layout that compresses HTML
4+
# v1.1.1
5+
# http://jch.penibelst.de/
6+
# © 2015 Anatol Broder
7+
# MIT License
8+
#
9+
---
10+
11+
{% if site.compress_html.ignore.envs contains jekyll.environment %}{{ content }}{% else %}{% capture _content %}{{ content }}{% endcapture %}{% if site.compress_html.endings == "all" %}{% assign _endings = "html head body li dt dd p rt rp optgroup option colgroup caption thead tbody tfoot tr td th" | split: " " %}{% else %}{% assign _endings = site.compress_html.endings %}{% endif %}{% for _element in _endings %}{% capture _end %}</{{ _element }}>{% endcapture %}{% assign _content = _content | remove: _end %}{% endfor %}{% if site.compress_html.comments.size == 2 %}{% assign _comment_befores = _content | split: site.compress_html.comments.first %}{% for _comment_before in _comment_befores %}{% assign _comment_content = _comment_before | split: site.compress_html.comments.last | first %}{% if _comment_content %}{% capture _comment %}{{ site.compress_html.comments.first }}{{ _comment_content }}{{ site.compress_html.comments.last }}{% endcapture %}{% assign _content = _content | remove: _comment %}{% endif %}{% endfor %}{% endif %}{% assign _pre_befores = _content | split: "<pre" %}{% assign _content = "" %}{% for _pre_before in _pre_befores %}{% assign _pres = _pre_before | split: "</pre>" %}{% case _pres.size %}{% when 2 %}{% capture _content %}{{ _content }}<pre{{ _pres.first }}</pre>{{ _pres.last | split: " " | join: " " }}{% endcapture %}{% when 1 %}{% capture _content %}{{ _content }}{{ _pres.last | split: " " | join: " " }}{% endcapture %}{% endcase %}{% endfor %}{% if site.compress_html.clippings == "all" %}{% assign _clippings = "html head title base link meta style body article section nav aside h1 h2 h3 h4 h5 h6 hgroup header footer address p hr blockquote ol ul li dl dt dd figure figcaption main div table caption colgroup col tbody thead tfoot tr td th" | split: " " %}{% else %}{% assign _clippings = site.compress_html.clippings %}{% endif %}{% for _element in _clippings %}{% assign _edges = " <e;<e; </e>;</e>;</e> ;</e>" | replace: "e", _element | split: ";" %}{% assign _content = _content | replace: _edges[0], _edges[1] | replace: _edges[2], _edges[3] | replace: _edges[4], _edges[5] %}{% endfor %}{{ _content }}{% endif %}

_layouts/default.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
layout: compress
3+
---
4+
<!DOCTYPE html>
5+
<html>
6+
{% include head.html %}
7+
<body>
8+
{% include sidebar.html %}
9+
10+
<main id="main">
11+
{{ content }}
12+
13+
<div class="footer">
14+
<div class="container">
15+
<p class="footer-entry">All content is licensed under <a href="http://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA</a></p>
16+
<p class="footer-entry">Buit with <a href="http://jekyllrb.com/" target="_blank">Jekyll</a> and <a href="https://github.com/P233/3-Jekyll" target="_blank">3-Jekyll theme</a> • Hosted on <a href="https://pages.github.com/" target="_blank">Github</a></p>
17+
</div>
18+
</div>
19+
</main>
20+
21+
<button id="menu">
22+
<span id="menu-icons"></span>
23+
</button>
24+
25+
{% include scripts.html %}
26+
</body>
27+
</html>

_layouts/index.html

Lines changed: 0 additions & 68 deletions
This file was deleted.

0 commit comments

Comments
 (0)