搭建个人博客 方式2 使用jekyll

孙广东  2016.3.12


环境安装:
1、通过 RailsInstaller  来安装 Ruby https://www.ruby-lang.org/zh_cn/documentation/installation/#rubyinstaller

2、下载 RubyGems (不要用IE 浏览器, 下载不了)https://rubygems.org/pages/download
安装是: ruby setup.rb    // 这样的命令  路径肯定是在 setup.rb 所在文件夹在cmd
 更新是: gem update --system

3、在安装 gem install jekyll 会有报错!
error while executing gem (Gem::RomoteFetcher::FetchError)  。。。
解决 http://www.cnblogs.com/AloneSword/p/5048447.html  是代理的问题, 因为使用了什么翻墙软件(禁止不使用就行了呗!,Shadowsocks 不要使用全局模式就行)

创建项目:

gem install jekyll       // 安装
jekyll new myblog    // 在当前路径下新建一个 新的项目myblog   
cd myblog          // 进入这个文件夹
jekyll serve        // 启动本地服务器

然后 浏览器 访问: http://localhost:4000 即可看到刚刚 创建的
如果你希望把 jekyll 安装到当前目录,你可以运行 jekyll new . 来代替。


4  然后就是各种 配置了!


首先关心的是  Github  关联起来。 部署  集成


 


操作方式是这样的, 我们 先把  "用户名.github.io"  这个刚刚创建的仓库项目 clone (使用github的专属客户端会更好一些)到本地 (我们主要使用其中的 .git 文件夹


 


我们最早 创建的 jekyll 项目是: myblog   


我们把这个文件价更名为:myblog    = "用户名.github.io"    ,同时把刚刚 .git 文件夹 拷贝到 这里。


 


然后我们使用 github 客户端 打开这个  "用户名.github.io"  仓库。  这样就可以执行


Commit 操作 pull push 操作了。


 


计算机生成了可选文字:
loc al host:4000 
Posts 
Mar 11, 2016 
Welcome to Jekyll! 
subscribe 
via RSS 
sunguangdong_code@outlook.com 
o 
About 
Write an awesome description for your new site 
SunGuangdong_githumere_ You can edit this line in _config.yml_ It will 
appear in your document head meta (for Google 
search results) and in your feedxml site 
SunGuangdong twittedescription.


我们打开 网址试一试。


计算机生成了可选文字:
sunguangdonggithub.io 
Posts 
Mar 11, 2016 
Welcome to Jekyll! 
subscribe 
via RSS 
sunguangdong_code@outlook.com 
o 
About 
Write an awesome description for your new site 
SunGuangdong_githumere_ You can edit this line in _config.yml_ It will 
appear in your document head meta (for Google 
search results) and in your feedxml site 
SunGuangdong twittedescription.



5、定制域名


http://wellsnake.com/jekyll/update/2014/05/15/Jekyll%E9%83%A8%E7%BD%B2%E7%AF%87/  有很多可以了解一下。。。


http://wellsnake.com/jekyll/update/2014/05/24/Jekyll%E4%BD%BF%E7%94%A8%E7%AF%871/

首先 去万维网 买一个 域名


6、然后就是各种美化呀, 定制啊


模版:http://www.zhihu.com/question/20223939


http://jekyllthemes.org/page3/

http://jekyllthemes.org/themes/freshman21/

https://github.com/Huxpro/huxpro.github.io   


需要 更改的文件: _config.yml about.html



要发表的文章一般以markdown的格式放在这里_posts/,你只要看看这篇模板里的文章你就立刻明白该如何设置。


yaml 头文件长这样:

---
layout:     post
title:      "Hello2015"
subtitle:   "Hello World, HelloBlog"
date:       2015-01-2912:00:00
author:    "Hux"
header-img: "img/post-bg-2015.jpg"
tags:
    - Life
---









  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值