Development Tool: Pelican (static site generator written in Python)
Development Environment: Ubuntu 20.04
-
$ sudo apt-get install git $ sudo apt-get install python-pip
Install language packages to add locale (English, Traditional Chinese, and Thai in this example):
$ sudo apt-get install language-pack-en $ sudo apt-get install language-pack-zh-hant $ sudo apt-get install language-pack-th
git clone source code:
$ cd $ mkdir dev $ cd ~/dev/ $ git clone https://github.com/siongui/pelican-template.git YOUR_REPO
Install Python tools:
$ cd ~/dev/YOUR_REPO/ $ sudo pip install -r requirements.txt
Install Pelican i18n_subsites plugin and download normalize.css:
$ cd ~/dev/YOUR_REPO/ $ make download
Generate CSS file:
$ cd ~/dev/YOUR_REPO/ $ make scss
See workflow file.
Auto-deploy by Travis CI
Sing up a Travis CI account. Go to your profile page and enable Travis CI for the repository you want to build. (See Getting started - Travis CI)
delete global secure environment variable in .travis.yml.
Go to your GitHub. Generate a personal access token in Personal Settings (only public_repo privilege is enough).
Install Travis CI command line client to encrypt token:
$ sudo apt-get install ruby ruby-dev $ sudo gem install travis
encrypt the token and add it to .travis.yml:
$ travis encrypt GH_TOKEN=your_token --add -r YOUR_GITHUB_NAME/YOUR_REPO
# start edit and develope
$ cd ~/dev/YOUR_REPO/
# 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/
All works, including posts and code, of Siong-Ui Te are released in public domain. Please see UNLICENSE.
[1] | Deploy Website by Pelican, Travis CI, and GitHub Pages |
[2] | JINJA_FILTERS in Settings — Pelican documentation
|
[3] | 拈花微笑 聖嚴法師著_自序 |
[4] |