jekyll的简单搭建

首先,进入github.io这个网址,
进去按照里面的教程搭建ruby 和gem 这都搭建好了以后
在cmd里面输入ruby和gem后会出现如下的这种情况:
[python]  view plain  copy
 print ?
  1. $ ruby  
  2. ASUS@DESKTOP-5J15LT4 MINGW32 ~/Desktop/mylog (gh-pages)  
  3. $ gem  
  4. RubyGems is a sophisticated package manager for Ruby.  This is a  
  5. basic help message containing pointers to more information.  
  6.   Usage:  
  7.     gem -h/--help  
  8.     gem -v/--version  
  9.     gem command [arguments...] [options...]  
  10.   
  11.   Examples:  
  12.     gem install rake  
  13.     gem list --local  
  14.     gem build package.gemspec  
  15.     gem help install  
  16.   
  17.   Further help:  
  18.     gem help commands            list all 'gem' commands  
  19.     gem help examples            show some examples of usage  
  20.     gem help gem_dependencies    gem dependencies file guide  
  21.     gem help platforms           gem platforms guide  
  22.     gem help <COMMAND>           show help on COMMAND  
  23.                                    (e.g. 'gem help install')  
  24.     gem server                   present a web page at  
  25.                                  http://localhost:8808/  
  26.                                  with info about installed gems  

这就说明你安装成功了!
然后!安装镜像,在本地新建个文件夹,用cmd进去安装这些东西
$ gem sources -a http://gems.ruby-china.org/
 安装jekyll 3.0的版本呢
 $ gem install jekyll -v '3.0'
 还有这也要安装
$ gem install minima
$ gem install bundle
安装成功以后,会在文件里面出现
$ ls
_config.yml  _posts/  _site/  about.md  css/  feed.xml  Gemfile  Gemfile.lock  index.html
但是,当我们不小心删了里面的东西以后,还可以生成jekyll
$ jekyll new blog
后面的哪个blog是自己的文件夹
进入这个文件夹
$ cd blog
$ jekyll serve
就可以在本地运行了!打开 localhost:4000
页面就出现了!
但是!我们还想往github上推,这该怎么半呢?
首先:git init
就是在本地创建一个版本库
git remote add origin [email protected]:/yiiyang/yiiyang.github.io
这是与远程版本库有关联,这是必要的操作
$ git add * -f
$ git commit -m '1'
$ git push origin master
然后我们会发现这推不上去,这该怎么办呢?
因为我们首次推的时候,github有ssh加密协议,so
$ git config --global user.email "自己的邮箱"
$ ssh-keygen -t rsa -C  "自己的邮箱"
$ ssh-keygen -t rsa -C "自己的邮箱"
vim /c/Users/ASUS/.ssh/id_rsa.pub
进入里面,把里面的东西复制到自己的github上
$ git push origin master
我们再接着往上推
就ok了!
我们要想在本地运行的话,还要再主意一点就是
进入自己的文件里面,运行
$ jekyll build
$ jekyll serve --watch
别关!就very good了!!!!!!

猜你喜欢

转载自blog.csdn.net/hwk_yellow/article/details/53187835
今日推荐