博客基於win7系統,python2.7和pelican.python
1.安裝工具git
安裝virtualenvgithub
pip install virtualenv服務器
下載make,或者make移動至任一目錄,並將路徑寫入環境變量path中.markdown
2.部署環境
安裝虛擬環境,並激活框架
virtualenv Pelican
cd Pelican
Scripts>activatepython2.7
此時命令行左側就會出現 (Pelican)
的字樣,說明進入虛擬環境每次對博客的修改發佈都要記得先激活虛擬環境,退出執行工具
Scripts>deactivate.bat測試
安裝pelican和makrdownui
pip install pelican
pip install markdown
3.建立博客
mkdir myblog
cd myblog
pelican-quickstart
此時會提示你輸入配置,都可以選默認,後期再pelicanconf.py
中修改,不過URL prefix
能夠先選n
,隨後就會生成一個基本博客框架
blog/ ├── content # 存放你要寫的博客 ├── output # 生成的輸出文件 ├── develop_server.sh # 方便開啓測試服務器 ├── Makefile # 方便管理博客的Makefile ├── pelicanconf.py # 主配置文件 └── publishconf.py # 主發佈文件
4.在content
目錄下用markdown
語法來寫博客.
Date: XX(時間) Title: XX(標題) Tags: XX(標籤) Category: XX(分類) Slug: XX(能夠理解爲文章url別名) Author: XX(做者) Summary: XX(簡介) 正文
5.生成頁面和發佈
make publish
make serve
如今能夠打開localhost:8000
查看你的初始博客.
6.在GitHub上面建立GitHub Pages
7.把博客push
到github
上去
cd output git init git add . git commit -m "first commit of my blog" git remote add origin https://github.com/xxx/xxx.github.io.git git push -u origin master