Skip to content

Commit 8836049

Browse files
committed
my blog
1 parent 2b58ac9 commit 8836049

38 files changed

Lines changed: 3132 additions & 1 deletion

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
_site
2+
.sass-cache

‎404.html‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
layout: default
3+
---
4+
<div id="not-found" class="container">
5+
<h1>抱歉,文章不存在</h1>
6+
<p>欢迎阅读其他文章</p>
7+
</div>

‎_config.yml‎

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,38 @@
1-
theme: jekyll-theme-cayman
1+
# Site settings
2+
title: st blog
3+
email: st.email@qq.com
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://www.shitao.xyz" # the base hostname & protocol for your site
10+
11+
12+
# Sidebar filter
13+
# Choose 'tag' or 'category' as filter in sidebar.
14+
filter: 'tag'
15+
16+
17+
# Social account
18+
# twitter: username
19+
# weibo: ID
20+
# github: username
21+
# codepen: username
22+
# dribbble: username
23+
24+
25+
# Comment
26+
# disqus_shortname: discussion_shortname
27+
28+
29+
# Google Analytics
30+
# google_analytics: tracking_ID
31+
32+
33+
# Build settings
34+
markdown: kramdown
35+
sass:
36+
style: compressed
37+
gems:
38+
- jekyll-sitemap

‎_includes/head.html‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
15+
<script src="{{ "/assets/js/prefixfree.js" | prepend: site.baseurl }}"></script>
16+
</head>

‎_includes/scripts.html‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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>
5+
6+
{% if site.google_analytics %}
7+
<script>
8+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
9+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
10+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
11+
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
12+
13+
ga('create', '{{ site.google_analytics }}', 'auto');
14+
ga('send', 'pageview');
15+
</script>
16+
{% endif %}

‎_includes/sidebar.html‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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+
{% if site.filter == 'category' %}
16+
{% for category in site.categories %}
17+
<li class="sidebar-tag" data-filter="{{ category | first }}">{{ category | first }}</li>
18+
{% endfor %}
19+
{% elsif site.filter == 'tag' %}
20+
{% for tag in site.tags %}
21+
<li class="sidebar-tag" data-filter="{{ tag | first }}">{{ tag | first }}</li>
22+
{% endfor %}
23+
{% endif %}
24+
</ul>
25+
</div>
26+
27+
<div id="sidebar-right">
28+
<div id="search-box">
29+
<input id="search-input" type="text" placeholder="Search" />
30+
</div>
31+
32+
<nav id="toc">
33+
{% if site.filter == 'category' %}
34+
{% for post in site.posts %}
35+
<a class="toc-link" data-tags="{{ post.categories | join: ' ' }}" href="{{ post.url }}">
36+
{{ post.title }}
37+
</a>
38+
{% endfor %}
39+
{% elsif site.filter == 'tag' %}
40+
{% for post in site.posts %}
41+
<a class="toc-link" data-tags="{{ post.tags | join: ' ' }}" href="{{ post.url }}">
42+
{{ post.title }}
43+
</a>
44+
{% endfor %}
45+
{% endif %}
46+
</nav>
47+
</div>
48+
</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/post.html‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
layout: default
3+
---
4+
<article class="post container">
5+
<div class="post-meta">
6+
<span class="post-meta-span date">{{ page.date | date:"%Y %B %d" }}</span>
7+
{% if page.tags.size > 0 %}
8+
<span class="post-meta-span tag">{{ page.tags | join: ', ' }}</span>
9+
{% endif %}
10+
</div>
11+
12+
<h1 class="post-title">{{ page.title }}</h1>
13+
{{ content }}
14+
</article>
15+
16+
<div class="post-share">
17+
<div class="container">
18+
<a href="https://twitter.com/share?url={{ page.url | prepend: site.baseurl | prepend: site.url }}&text={{ page.title }}" target="_blank" class="post-share-icon twitter"></a>
19+
<a href="https://www.evernote.com/clip.action?url={{ page.url | prepend: site.baseurl | prepend: site.url }}&title={{ page.title }}" target="_blank" class="post-share-icon evernote"></a>
20+
<a href="http://service.weibo.com/share/share.php?url={{ page.url | prepend: site.baseurl | prepend: site.url }}&title={{ page.title }}" target="_blank" class="post-share-icon weibo"></a>
21+
</div>
22+
</div>
23+
24+
{% if site.disqus_shortname %}
25+
<div class="comment container">
26+
<div id="disqus_thread">
27+
<a href=""></a>
28+
</div>
29+
</div>
30+
{% endif %}

0 commit comments

Comments
 (0)