您的位置:首页 > 其它

使用jekyll搭建自己的博客系统

2016-06-22 00:00 295 查看

方式一

在上网下载一款Jekyll主题

修改配置

在_posts文件夹内写博客,并推送到自己的github page上去。

方式二

这种方法主要是用来在本地预览效果,这样不用每次写完博客或网页后必须上传到github上才可以看到效果。

下载Ruby

在官网下载,安装时将ruby添加到环境变量选项勾选。

下载Ruby DevKit

将DevKit解压到需要的路径,然后打开命令行进入到这个目录执行如下命令

cd 解压目录
ruby dk.rb init
ruby dk.rb install
#官方源不可用
gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/ gem install jekyll

gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/[/code] 应为ssl无法通过的话,可以使用http协议。
3. 下载主题

4. 预览效果

jekyll --server --auto


http://localhost:4000 预览

以下是本人安装过程中遇到的问题:

Jekyll 3x版本使用主题时,在配置_config.yml时,

markdown: redcarpet
redcarpet:
extensions:
- hard_wrap
- no_intra_emphasis
- autolink
- strikethrough
- tables
- lax_spacing
- with_toc_data

改变为

markdown: kramdown
kramdown:
input: GFM
extensions:
- autolink
- footnotes
- smart
- hard_wrap
- no_intra_emphasis
- strikethrough
- tables
- lax_spacing
- with_toc_data
enable_coderay: true
syntax_highlighter: rouge
coderay:
coderay_line_numbers:  nil

参考链接

Jekyll官方教程

ruby镜像

参考的博客

Jekyll主题
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: