總說
Pelican是個Python寫的Static Generator,就是說你寫markdown他幫你轉成html然後自己上傳這樣 可以使用github pages等幫你host的服務 中文介紹詳見使用Pelican + Github Pages搭建個人博客
安裝
首先要跑完安裝流程Pelican Quickstart,再來就可以在content底下新增一些Post 通常Header會長這樣
Title: Pelican Tutorial
Date: 2016-04-05 01:30
Category: Pelican
Tags: python, pelican, tutorial
Slug: pelican-tutorial
Authors: Alexander Shieh
Summary: 簡單的Pelican安裝教學
再來是處理static,要在pelicanconf裡面加
STATIC_PATHS = ['folder']
然後你會發現要連結檔案就只要
[Link to xxx]({filename}/folder/xxx)
設定
然後再換theme,比如說
THEME = "blog-themes/Responsive-Pelican"
還可以設定Disqus跟Google Analytics這裡不多介紹
記得要設SITE_URL
,剛好我的Theme中文日期很醜,所以用了
TIMEZONE = 'Asia/Taipei'
DEFAULT_LANG = u'en'
LOCALE = u'en_US'
要加入Plugins,比如說Math Render for Pelican,把它下載到blog的一個資料夾,比如說pelican-plugins
PLUGIN_PATHS = ["pelican-plugins"]
PLUGINS = ["render_math"]
爽
所以現在就可以
$$\int_a^b \frac{1}{x} dx$$
要Render就pelican content
,然後ghp-import output
再git push -f http://github.com/xxx/xxx.github.io.git gh-pages:master
就上去了
Jekyll跟Hexo就待其他人介紹了,附上其他Static Generator