-
安裝時,請將 Python 以及 Devel 選成 Install (不要選 Default )
- 安裝須花頗多時間,完成後,在桌面建立一個 Cygwin Terminal 的捷徑。
點擊捷徑進入 Cygwin Terminal,進入後先檢查 Python 以及 git 是否安裝成功。
先檢查 Python :
$ python -V
如果成功會看到 Python 的版本號碼。
接著檢查 git :
$ git --version
如果成功會看到 git 的版本號碼。 接著設定user名稱跟email:
$ git config --global user.name "twnanda" $ git config --global user.email "tw.nanda@gmail.com"
-
$ easy_install-2.7 pip
進入D槽,建立github資料夾:
$ cd /cygdrive/d/ $ mkdir github
進入剛剛建立的github資料夾,把網站原始碼從GitHub上clone下來:
$ cd /cygdrive/d/github/ $ git clone https://github.com/twnanda/twnanda.git
進入原始碼目錄,用 pip 安裝需要的 Python 套件:
$ cd /cygdrive/d/github/twnanda $ pip install -r requirements.txt
產生 JavaScript 及 CSS 檔
$ cd /cygdrive/d/github/twnanda $ make js $ make scss
產生整個網站:
$ cd /cygdrive/d/github/twnanda $ make
打開 http://localhost:8000/ 可看產生的網站。
進入原始碼目錄修改或新增檔案,完成後
$ cd /cygdrive/d/github/twnanda
$ make
# 此時打開瀏覽器(chrome, firefox, ...),拜訪網址:
# http://localhost:8000/
# 確認是否正確。
# 觀看還未加入的修改
$ git status
# 加入修改
$ git add ...
# 確認修改
$ git commit -m "..."
# 整合別人的修改
$ git pull
# 上傳修改到GitHub
$ git push
# 接著git會問帳號密碼,請輸入你的帳號密碼
- cygwin installation
necessary package: Devel, Python - python -V
- devel -V
- git -- version
- easy-install-2.7 pip
- cd d:
- click cygwin icon
(cygwin window) - cd /cygdrive/d/github/twnanda
- make
- open chrome (or firefox, ..., )
- url: http://localhost:8000
make
make serve
(if no update)
- git status
(red on file not added yet)
- git add dir/file
(e.g. content/articles/tipitaka/sutta/khuddaka/dhammapada) - git status
- git commit -m ""
"remark what is added, changed, etc." - git status
- git push
upload github server
Development Tool: pelican (static site generator written in Python)
Development Environment: Ubuntu 15.10
$ sudo apt-get install git
$ sudo apt-get install python3-pip
- git clone source code:
$ cd
$ mkdir dev
$ cd ~/dev/
$ git clone https://github.com/twnanda/twnanda.git
- Install Python tools:
$ cd ~/dev/twnanda/
$ sudo pip install -r requirements.txt
- Generate CSS/JS file:
$ cd ~/dev/twnanda/
$ make scss
$ make js
- Install language packages to add locale (Traditional Chinese):
$ sudo apt-get install language-pack-zh-hant
# start edit and develope
$ cd ~/dev/twnanda/
# If something changes, re-generate the website:
$ make html
# start dev server
$ make serve
# open your browser and preview the website at http://localhost:8000/