jekyll的简单搭建

来源:互联网 发布:在淘宝上如可开零食店? 编辑:程序博客网 时间:2024/05/22 17:21
首先,进入github.io这个网址,进去按照里面的教程搭建ruby 和gem 这都搭建好了以后在cmd里面输入ruby和gem后会出现如下的这种情况:
$ rubyASUS@DESKTOP-5J15LT4 MINGW32 ~/Desktop/mylog (gh-pages)$ gemRubyGems is a sophisticated package manager for Ruby.  This is abasic help message containing pointers to more information.  Usage:    gem -h/--help    gem -v/--version    gem command [arguments...] [options...]  Examples:    gem install rake    gem list --local    gem build package.gemspec    gem help install  Further help:    gem help commands            list all 'gem' commands    gem help examples            show some examples of usage    gem help gem_dependencies    gem dependencies file guide    gem help platforms           gem platforms guide    gem help <COMMAND>           show help on COMMAND                                   (e.g. 'gem help install')    gem server                   present a web page at                                 http://localhost:8808/                                 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 git@github.com:/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了!!!!!!


0 0
原创粉丝点击