Well, this is my first blog here (right now on github).
This blog has permanently moved to here
I’m using the Octopress as blog content management, and I will briefly describe the way to set it up.
First, go to Octopress setup page. Follow the instruction, install the dependencies that Octopress will need.
Then choose the platform that the blog will be hosted on, here is a link for deploying github pages. Note: an error occured while I followed the instruction to rake it.
1 2 3 4 5 |
|
This error could be easily solved by adding bundle exec
in front of the rake
command.
After rake generate
, go to ‘_deploy’ folder, and type git pull origin master
.
Then type rake deploy
.
Otherwise, there will be some errors:
1
|
|
Now, your blog page is on-line. Although the pages are hosted on github, you still need version control on your Octopress settings, so don’t forget to commit to the ‘source’ branch.
1 2 3 |
|
(I’d rather put them into a bash file than typing every time)
1 2 3 4 |
|
To generate a blog page, you could use rake new_post['blog name']
.
However, as I mentioned before the rake
command wouldn’t work properly if the ruby version didn’t match.
We could use bundle exec rake
to run the command.
Moreover, if you are using zsh shell, you should also add noglob
in front of these command, because symbol ‘[’ and ‘]’ are reserved in zsh for regular expression.
Finally, my blog is here. Much easier than I expected. Using Octopress can save your time on setting a blog site, and it generates pages automatically.
This blog is still underconstruction. I would like to make it more simple and pretty. K.I.S.S
Update (several minutes later):
Encountered a problem of creating single page, e.g. 404.html.
The command rake new-page['404']
cannot work on zsh due to ‘[]’ is converted.
Hence, the only way to add cutomize page is to write a markdown file and put into ‘source’ fold.
But, do not forget to add the following to the head of page:
1 2 3 4 5 6 7 8 |
|
Update (2014-Mar-12):
rake preview
has problem with Safari.
Don’t know why but only show blank page while open http://localhost:4000 .
Using Chrome or Firefox will solve this.[ref]
Due to save typing, I have written some bash files:
1 2 3 4 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
|
Please ignore the text below, the latest code fixes all of them. :P
Warnning:
This preview shell script may not work for you if you are a ruby developer,
or you are using some programs written or depended in/on ruby or ruby packages,
because it killed all ruby processes at the end.
Do not forget to fully quit Chrome (Comman+q in MacOS) before starting a new preview,
otherwise unknown error would occur (duplicate processes).
BTW, the preview.sh also left a messy terminal for you.
Well, everything have side effects.
But you could add clear
command at the end of the script,
if you don’t really care about the traces.