Life is Struggle

用 GitHub 寫文章的步驟

1
2
cd ~/apps/octopress
rake new_post

會得到文章的檔名

再用 Mou 或 vi 編輯內容

1
2
3
4
5
6
7
open -a Mou source/_posts/2014-01-09-first-article.markdown 
# or
open source/_posts/2014-01-09-first-article.markdown 
# or
vi source/_posts/2014-01-09-first-article.markdown
# 可以打開 Mou 的說明頁參考 markdown 語法
open /Applications/Mou.app/Contents/Resources/help.md

內容 sample

1
2
3
4
5
6
7
8
9
10
11
---
layout: post
title: "first article"
date: 2014-01-09 15:03:44 +0800
comments: true
categories: 'Technical'
tags: ['github', 'octopress']
---
this is my first article @ github by octopress
* line1
* line2

文章寫完後執行

1
2
rake generate # 沒做似乎也可以
rake preview # for local preview

沒問題的話就 push 到 github

1
2
3
4
git add .
git commit -m "first article"
git push origin source
rake deploy

到線上看結果 http://trully.github.io/