欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

用Jekyll写Github Pages

程序员文章站 2022-05-24 16:10:44
...

用Jekyll写Github Pages, Windows7环境, 实践无错记录。
基于以下软件和版本:

msysGit-fullinstall-1.8.1.2-preview20130201.exe

rubyinstaller-1.9.3-p392.exe

python-2.7.3.msi

DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe

git-credential-winstore.exe

步骤: 

  • 注册Github帐号(user), 创建新REPO, 全名(user.github.com)
  • 下载并安装msysgit, 安装位置: C:\msysgit
  • msys.bat生成SSH Key
 $ cd ~/.ssh<是否存在.ssh目录>
-------------备份命令------------
 $ ls
     config  id_rsa  id_rsa.pub  known_hosts
 $ mkdir key_backup
 $ cp id_rsa* key_backup<如存在, 则备份>
 $ rm id_rsa*
----------------------------------
 $ ssh-keygen -t rsa -C "user#email.com"
     Generating public/private rsa key pair.
     Enter file in which to save the key (~/.ssh/id_rsa):<回车>
     Enter passphrase (empty for no passphrase):<输入密钥>
     Enter same passphrase again:<输入密钥>
  • 将id_rsa.pub内容添加到Github->Account Settings->SSH Keys项
  • 测试连接情况

 

 $ ssh -T git@github.com
     The authenticity of host 'github.com (207.97.227.239)' can't be established.
     RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
     Are you sure you want to continue connecting (yes/no)?<yes>

     Hi user! 
     You've successfully authenticated, but GitHub does not provide shell access.

 

  •  设置全局信息

 

$ git config --global user.name "user"
$ git config --global user.email "user#email.com"

 

  • Clone并提交REPO

 

$ git clone https://github.com/user/user.github.com.git
$ git clone https://github.com/plusjade/jekyll-bootstrap.git

拷贝jekyll-bootstrap下面所有内容(隐藏.git目录除外)到user.github.com中

提交到github: 
$ git add .
$ git commit -m "Creating_initial_branch_structure"
$ git push origin master<输入rsa密钥>

    几分钟后浏览http://user.github.com, It Works!

 

 *本文转载自:http://kanbanner.github.io/2013/03/28/write-github-pages-using-jekyll/

相关标签: github