快樂小碼農

{happy coder}

Install Octopress

| Comments

1
2
3
4
5
6
7
cd ~/
git clone git://github.com/imathis/octopress.git octopress
cd octopress
gem install bundler
bundle install
rake install
rake preview

http://localhost:4000/

1
rake setup_github_pages

git@github.com:[your_username]/[your_username].github.io.git

例如輸入

1
git@github.com:copy0401/copy0401.github.io
1
2
3
rake generate
rake preview
rake deploy

新的頁面

1
rake new_page["title"] # for zsh, use: rake new_page\["title"\]

or

1
rake new_page[about/index.html] # for zsh, use: rake new_page\[about/index.html\]

再去 source/_includes/custom/navigation.html 新增連結

1
2
3
4
5
6
<ul class="main-navigation">
  <li><a href="/">Blog</a></li>
  <li><a href="/blog/categories/octopress/">Octopress</a></li>
  <li><a href="/blog/archives">Archives</a></li>
  <li><a href="/about">About</a></li>
</ul>

撰寫文章

1
rake new_post["title"]

產生新的檔案 YYYY-MM-DD-title.markdownsource/_posts/

如果 .markdown 要改成 .md 可以到修改 Rakefile

1
2
new_post_ext    = "md"
new_page_ext    = "md"

Push to Github

1
2
3
git add .
git commit -m "some commit"
git push origin source

Comments