Transfer: https: //www.cnblogs.com/wanxudong/p/6772684.html
Octopress framework Github Pages are set up personal blog
First, prior knowledge:
1、shell command
2、Git
Second, the building process:
The following are specific installation steps (herein RVM
installation, also by rbenv
mounting, mounting official document Octopress analysis: Octopress the Setup ):
A view ruby version
1
|
|
If the version of ruby> = 1.9.3-p0
skip RVM and Ruby installation.
Second, install RVM
1
|
|
Third, install Ruby 1.9.3
1
2
3
|
|
Fourth, the installation Octopress
1, the Octopress project clone
to local:
1
2
|
|
2, the update ruby
source, the official will ruby
replace the source to domestic Taobao source.
1
2
3
|
|
3, dependent on the installation:
1
2
|
|
4, the final installation Octopress
1
|
|
5, the initial configuration modification Octopress
1
2
|
|
Note: You can see the following code:
1
2
3
4
5
6 7 8 9 10 11 12 13 14 15 |
|
Ensure octopress directory, execute the command
1
2
|
|
Sixth, deployed to GitHub Pages
Create an on GitHub New repository
,Repository name
that is the project name for the naming userName.github.io
. userName
It must match the user name. Tips:
Best not to checkREADME
, lest synchronized to the remote repository when the need to do additional pull
operations.
1, synchronized to the local code repository GitHub
.
1
|
|
2, binding remote repository
1
|
|
3. Create an article
1
|
|
4, to generate a new article _posts / at source / directory
1
2
|
|
This time will see the directory .markdown
file suffix, we can through some third-party Markdown editor opens. Here is what I used Mou (Download: here ), Mou
comes with real-time preview, also documented in the markdown syntax that is very detailed, not repeat them here.
5, after editing to generate a static site, the terminal execute the command:
1
|
|
6, preview the local site, the implementation of directives:
1
|
|
7, open a browser localhost:4000
to view the web page effect effect. If the problem can not be a static site is synchronized to GitHub
a remote warehouse in. Excuting an order
1
|
|
Open GitHub wait a minute, we will see a static web page has been synchronized to the GitHub repository master
branch on. Access browser access username.github.io
, you will find a personal blog has been created successfully.
Finally, create source
a branch. Octopress Git repository ( repository
) has two branches, respectively, master
and source
.
source
Branch store is to generate blog's source file in the root directory octopress.master
Branch storage contents of the blog site itself is the master, in the root directory_deploy
folder, when youpush
when the source file is ignored, it uses arake deploy
command to update.
1
2
3
4
|
|
8, git operation code is as follows:
1
2
3
4
5
6 |
|