Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2542bdc

Browse files
authored
Update README.md
1 parent 9bc9535 commit 2542bdc

File tree

1 file changed

+1
-276
lines changed

1 file changed

+1
-276
lines changed

README.md

Lines changed: 1 addition & 276 deletions
Original file line numberDiff line numberDiff line change
@@ -1,282 +1,7 @@
11

22

3-
![](https://raw.githubusercontent.com/qiubaiying/qiubaiying.github.io/master/img/readme-home.png)
4-
5-
[![Build Status](https://travis-ci.org/qiubaiying/qiubaiying.github.io.svg?branch=master)](https://travis-ci.org/qiubaiying/qiubaiying.github.io)
6-
[![codebeat badge](https://codebeat.co/badges/5f031df3-f6c1-4ec0-911a-ff6617ca50b9)](https://codebeat.co/projects/github-com-qiubaiying-qiubaiying-github-io-master)
7-
[![GitHub issues](https://img.shields.io/github/issues/qiubaiying/qiubaiying.github.io.svg?style=flat)](https://github.com/qiubaiying/qiubaiying.github.io/issues)
8-
[![License MIT](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://github.com/home-assistant/home-assistant-iOS/blob/master/LICENSE)
9-
[![](https://img.shields.io/github/stars/qiubaiying/qiubaiying.github.io.svg?style=social&label=Star)](https://github.com/qiubaiying/qiubaiying.github.io)
10-
[![](https://img.shields.io/github/forks/qiubaiying/qiubaiying.github.io.svg?style=social&label=Fork)](https://github.com/qiubaiying/qiubaiying.github.io)
11-
12-
13-
博客的搭建教程修改自 [Hux](https://github.com/Huxpro/huxpro.github.io)
14-
15-
更为详细的教程戳这 [《利用 GitHub Pages 快速搭建个人博客》](http://www.jianshu.com/p/e68fba58f75c)[wiki](https://github.com/qiubaiying/qiubaiying.github.io/wiki/%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA%E8%AF%A6%E7%BB%86%E6%95%99%E7%A8%8B)
16-
17-
>
18-
### [查看博客戳这里 👆](http://qiubaiying.github.io)
19-
20-
21-
22-
## 使用
23-
24-
* 开始
25-
* [环境](#环境)
26-
* [开始](#开始)
27-
* [撰写博文](#撰写博文)
28-
* 组件
29-
* [侧边栏](#侧边栏)
30-
* [迷你关于我](#mini-about-me)
31-
* [推荐标签](#featured-tags)
32-
* [好友链接](#friends)
33-
* [HTML5 演示文档布局](#keynote-layout)
34-
* 评论与 Google/Baidu Analytics
35-
* [评论](#comment)
36-
* [网站分析](#analytics)
37-
* 高级部分
38-
* [自定义](#customization)
39-
* [标题底图](#header-image)
40-
* [搜索展示标题-头文件](#seo-title)
41-
42-
43-
44-
### 环境
45-
46-
如果你安装了 [jekyll](http://jekyllcn.com/),那你只需要在命令行输入`jekyll serve``jekyll s`就能在本地浏览器中输入`http://127.0.0.1:4000/`预览主题,对主题的修改也能实时展示(需要强刷浏览器)。
47-
48-
49-
50-
### 开始
51-
52-
你可以通用修改 `_config.yml`文件来轻松的开始搭建自己的博客:
53-
54-
```
55-
# Site settings
56-
title: BY Blog # 你的博客网站标题
57-
SEOTitle: 柏荧的博客 | BY Blog # SEO 标题
58-
description: "Hey" # 随便说点,描述一下
59-
60-
# SNS settings
61-
github_username: qiubaiying # 你的github账号
62-
jianshu_username: e71990ada2fd # 你的简书ID。
63-
64-
# Build settings
65-
# paginate: 10 # 一页你准备放几篇文章
66-
```
67-
68-
Jekyll官方网站还有很多的参数可以调,比如设置文章的链接形式...网址在这里:[Jekyll - Official Site](http://jekyllrb.com/) 中文版的在这里:[Jekyll中文](http://jekyllcn.com/).
69-
70-
### 撰写博文
71-
72-
要发表的文章一般以 **Markdown** 的格式放在这里`_posts/`,你只要看看这篇模板里的文章你就立刻明白该如何设置。
73-
74-
yaml 头文件长这样:
75-
76-
```
77-
---
78-
layout: post
79-
title: 定时器 你真的会使用吗?
80-
subtitle: iOS定时器详解
81-
date: 2016-12-13
82-
author: BY
83-
header-img: img/post-bg-ios9-web.jpg
84-
catalog: true
85-
tags:
86-
- iOS
87-
- 定时器
88-
---
89-
90-
```
91-
92-
### 侧边栏
93-
94-
看右边:
95-
![](https://raw.githubusercontent.com/qiubaiying/qiubaiying.github.io/master/img/readme-side.png)
96-
97-
设置是在 `_config.yml`文件里面的`Sidebar settings`那块。
98-
99-
```
100-
# Sidebar settings
101-
sidebar: true #添加侧边栏
102-
sidebar-about-description: "简单的描述一下你自己"
103-
sidebar-avatar: /img/avatar-by.jpg #你的大头贴,请使用绝对地址.注意:名字区分大小写!后缀名也是
104-
```
105-
106-
侧边栏是响应式布局的,当屏幕尺寸小于992px的时候,侧边栏就会移动到底部。具体请见bootstrap栅格系统 <http://v3.bootcss.com/css/>
107-
108-
109-
### Mini About Me
110-
111-
Mini-About-Me 这个模块将在你的头像下面,展示你所有的社交账号。这个也是响应式布局,当屏幕变小时候,会将其移动到页面底部,只不过会稍微有点小变化,具体请看代码。
112-
113-
### Featured Tags
114-
115-
看到这个网站 [Medium](http://medium.com) 的推荐标签非常的炫酷,所以我将他加了进来。
116-
这个模块现在是独立的,可以呈现在所有页面,包括主页和发表的每一篇文章标题的头上。
117-
118-
```
119-
# Featured Tags
120-
featured-tags: true
121-
featured-condition-size: 1 # A tag will be featured if the size of it is more than this condition value
122-
```
123-
124-
唯一需要注意的是`featured-condition-size`: 如果一个标签的 SIZE,也就是使用该标签的文章数大于上面设定的条件值,这个标签就会在首页上被推荐。
125-
126-
内部有一个条件模板 `{% if tag[1].size > {{site.featured-condition-size}} %}` 是用来做筛选过滤的.
127-
128-
### Social-media Account
129-
130-
在下面输入的社交账号,没有的添加的不会显示在侧边框中。新加入了[简书](https:/www.jianshu.com)链接, <http://www.jianshu.com/u/e71990ada2fd>
131-
132-
# SNS settings
133-
RSS: false
134-
jianshu_username: jianshu_id
135-
zhihu_username: username
136-
facebook_username: username
137-
github_username: username
138-
# weibo_username: username
139-
140-
141-
142-
![](http://ww4.sinaimg.cn/large/006tKfTcgy1fgrgbgf77aj308i02v748.jpg)
143-
144-
### Friends
145-
146-
好友链接部分。这会在全部页面显示。
147-
148-
设置是在 `_config.yml`文件里面的`Friends`那块,自己加吧。
149-
150-
```
151-
# Friends
152-
friends: [
153-
{
154-
title: "BY Blog",
155-
href: "https://qiubaiying.github.io/"
156-
},
157-
{
158-
title: "Apple",
159-
href: "https://apple.com/"
160-
}
161-
]
162-
```
163-
164-
165-
### Keynote Layout
166-
167-
HTML5幻灯片的排版:
168-
169-
![](https://camo.githubusercontent.com/f30347a118171820b46befdf77e7b7c53a5641a9/687474703a2f2f6875616e677875616e2e6d652f696d672f626c6f672d6b65796e6f74652e6a7067)
170-
171-
这部分是用于占用html格式的幻灯片的,一般用到的是 Reveal.js, Impress.js, Slides, Prezi 等等.我认为一个现代化的博客怎么能少了放html幻灯的功能呢~
172-
173-
其主要原理是添加一个 `iframe`,在里面加入外部链接。你可以直接写到头文件里面去,详情请见下面的yaml头文件的写法。
174-
175-
```
176-
---
177-
layout: keynote
178-
iframe: "http://huangxuan.me/js-module-7day/"
179-
---
180-
```
181-
182-
iframe在不同的设备中,将会自动的调整大小。保留内边距是为了让手机用户可以向下滑动,以及添加更多的内容。
183-
184-
185-
### Comment
186-
187-
博客不仅支持 [Disqus](http://disqus.com) 评论系统,还加入了 [Gitalk](https://gitalk.github.io/) 评论系统,[支持 Markdwon 语法](https://guides.github.com/features/mastering-markdown/),cool~
188-
189-
#### Disqus
190-
191-
优点:国际比较流行,界面也很大气、简洁,如果有人评论,还能实时通知,直接回复通知的邮件就行了;
192-
193-
缺点:评论必须要去注册一个disqus账号,分享一般只有Facebook和Twitter,另外在墙内加载速度略慢了一点。想要知道长啥样,可以看以前的版本点[这里](http://brucezhaor.github.io/about.html) 最下面就可以看到。
194-
195-
> Node:有很多人反映 Disqus 插件加载不出来,可能墙又架高了,有条件的话翻个墙就好了~
196-
197-
**使用:**
198-
199-
**首先**,你需要去注册一个Disqus帐号。**不要直接使用我的啊!**
200-
201-
**其次**,你只需要在下面的 yaml 头文件中设置一下就可以了。
202-
203-
```
204-
# 评论系统
205-
# Disqus(https://disqus.com/)
206-
disqus_username: qiubaiying
207-
```
208-
209-
#### Gitalk
210-
211-
优点:界面干净简洁,利用 Github issue API 做的评论插件,使用 Github 帐号进行登录和评论,最喜欢的支持 Markdown 语法,对于程序员来说真是太 cool 了。
212-
213-
缺点:配置比较繁琐,每篇文章的评论都需要初始化。
214-
215-
**使用:**
216-
217-
参考我的这篇文章:[《为博客添加 Gitalk 评论插件》](http://qiubaiying.top/2017/12/19/%E4%B8%BA%E5%8D%9A%E5%AE%A2%E6%B7%BB%E5%8A%A0-Gitalk-%E8%AF%84%E8%AE%BA%E6%8F%92%E4%BB%B6/)
218-
219-
220-
### Analytics
221-
222-
网站分析,现在支持百度统计和Google Analytics。需要去官方网站注册一下,然后将返回的code贴在下面:
223-
224-
```
225-
# Baidu Analytics
226-
ba_track_id: 4cc1f2d8f3067386cc5cdb626a202900
227-
228-
# Google Analytics
229-
ga_track_id: 'UA-49627206-1' # 你用Google账号去注册一个就会给你一个这样的id
230-
ga_domain: huangxuan.me # 默认的是 auto, 这里我是自定义了的域名,你如果没有自己的域名,需要改成auto。
231-
```
232-
233-
### Customization
234-
235-
如果你喜欢折腾,你可以去自定义这个模板的 Code。
236-
237-
**如果你可以理解 `_include/``_layouts/`文件夹下的代码(这里是整个界面布局的地方),你就可以使用 Jekyll 使用的模版引擎 [Liquid](https://github.com/Shopify/liquid/wiki)的语法直接修改/添加代码,来进行更有创意的自定义界面啦!**
238-
239-
### Header Image
240-
241-
博客每页的标题底图是可以自己选的,看看几篇示例post你就知道如何设置了。
242-
243-
标题底图的选取完全是看个人的审美了。每一篇文章可以有不同的底图,你想放什么就放什么,最后宽度要够,大小不要太大,否则加载慢啊。
244-
245-
> 上传的图片最好先压缩,这里推荐 imageOptim 图片压缩软件,让你的博客起飞。
246-
247-
但是需要注意的是本模板的标题是**白色**的,所以背景色要设置为**灰色**或者**黑色**,总之深色系就对了。当然你还可以自定义修改字体颜色,总之,用github pages就是可以完全的个性定制自己的博客。
248-
249-
### SEO Title
250-
251-
我的博客标题是 **“BY Blog”** 但是我想要在搜索的时候显示 **“柏荧的博客 | BY Blog”** ,这个就需要 SEO Title 来定义了。
252-
253-
其实这个 SEO Title 就是定义了<head><title>标题</title></head>这个里面的东西和多说分享的标题,你可以自行修改的。
254-
255-
### 关于收到"Page Build Warning"的 Email
256-
257-
由于jekyll升级到3.0.x,对原来的 pygments 代码高亮不再支持,现只支持一种-rouge,所以你需要在 `_config.yml`文件中修改`highlighter: rouge`.另外还需要在`_config.yml`文件中加上`gems: [jekyll-paginate]`.
258-
259-
同时,你需要更新你的本地 jekyll 环境.
260-
261-
使用`jekyll server`的同学需要这样:
262-
263-
1. `gem update jekyll` # 更新jekyll
264-
2. `gem update github-pages` #更新依赖的包
265-
266-
使用`bundle exec jekyll server`的同学在更新 jekyll 后,需要输入`bundle update`来更新依赖的包.
267-
268-
> Note:
269-
> 可以使用 `jekyll -s` 命令在本地实时配置博客,提高效率。详见 [Jekyll.com](http://jekyllcn.com/)
270-
271-
参考文档:[using jekyll with pages](https://help.github.com/articles/using-jekyll-with-pages/) & [Upgrading from 2.x to 3.x](http://jekyllrb.com/docs/upgrading/2-to-3/)
272-
273-
2743
## 致谢
2754

276-
1. 这个模板是从这里 [Hux](https://github.com/Huxpro/huxpro.github.io) fork 的, 感谢这个作者。
5+
1. 这个模板是从这里 [Hux](https://github.com/qiubaiying/baiyingqiu.github.io) fork 的, 感谢这个作者。
2776
2. 感谢 Jekyll、Github Pages 和 Bootstrap!
2787

279-
## License
280-
281-
遵循 MIT 许可证。有关详细,请参阅 [LICENSE](https://github.com/qiubaiying/qiubaiying.github.io/blob/master/LICENSE)
282-

0 commit comments

Comments
 (0)