Linux-github 搭建静态博客
2015-07-17 16:00
567 查看
1.在Github上创建一个新的Repository
到你的github上 https://github.com去create a new repository命名为 github.myblog2.本地安装Jekyll-Bootstrap
如果本地centos没有git,使用yum安装$ yum install git
克隆jekyll-bootstrap
$ git clone https://github.com/plusjade/jekyll-bootstrap.git myblog $ cd myblog $ git remote add origin-myblog https://github.com/csuldw/myblog.git $ git push origin-myblog master #代码传至github
经过上面的代码之后,就可以看到自己的博客了:http://myblog.github.io/
github文件目录
3.安装Jekyll
使用下面代码看看是否安装了jekyll$ git clone https://github.com/plusjade/jekyll-bootstrap.git $ cd jekyll-bootstrap $ jekyll serve
根据网址http://localhost:4000. 看是否安装成功
如果没有安装成功,下面再centos中安装jekyll,参考:https://hack0nair.me/2013-10-31-config-jekyll-on-centos/
首先安装ruby:
$ sudo yum install ruby
接着安装jekyll
$ gem install jekyll
然后回到myblog目录,执行下列代码检测jekyll是否安装成功
$ jekyll server
如果出现下面情况,表示安装成功
4.创建一个页面
下载rake$ gem install rake
创建页面
$ rake page name="about.md"
创建一个内部页面
rake page name="pages/about.md"
Create a page with a “pretty” path:
$ rake page name="pages/about" # this will create the file: ./pages/about/index.html
The rake task automatically creates a page file with properly formatted filename and YAML Front Matter as well as includes the Jekyll Bootstrap “setup” file.
5.发布至github
$ git add . $ git commit -m "Add new content" $ git push origin master
附:jekyll支持主题定做 http://jekyllbootstrap.com/usage/jekyll-theming.html
主题目录位于:_includes/themes 下面.
相关文章推荐
- 嵌入式linux之poll机制
- 基于Linux C的socketEthereal程序和Package分析 (一个)
- linux系统调用如何实现write
- linux C++ 多线程编程
- mysql 在linux上的集群安装方法(数据节点和存储节点分开)
- Linux_Logo – 输出彩色 ANSI Linux 发行版徽标的命令行工具
- linux系统 关闭 oom killer
- linux命令(3)---mkdir
- Centos系统mysql 忘记root用户的密码
- 修改Linux kernel中打印的级别
- centos 挂载与卸载硬盘
- Linux的open函数
- linux sysctl.conf中相关重要设定的详细说明
- linux中内核的一个不错的参数somaxconn
- Linux正则表达式sed
- linux kernel ABC #2 LVM
- CentOS7 配置 vsftpd
- centos下sentinel主从监控配置
- Linux命令学习总结:last
- linux awk、sed、grep