Total Pageviews

Tuesday 13 May 2014

在linux vps上,搭建基于python的静态博客程序-peanut

git clone https://github.com/zqqf16/Peanut peanut
cd peanut
pip install -r requirements.txt

python setup.py install

cd /usr/local/
mkdir peanut-blog
cd peanut-blog
peanut init (此命令会在peanut-blog目录里生成一些东西)

root@AR:/usr/local/peanut-blog# ls 
assets  config.yml  drafts   
root@AR:/usr/local/peanut-blog# cd drafts
root@AR:/usr/local/peanut-blog/drafts# nano hi.md
root@AR:/usr/local/peanut-blog/drafts# cat hi.md
---
title: 你好
tag: test
date: 2015-11-11 09:10
---

世界,你好!
root@AR:/usr/local/peanut-blog/drafts# cd ..
root@AR:/usr/local/peanut-blog# nano config.yml
(修改url的值为http://yourdomain.com ,
设置sitemap,rss,archive的值均为True ,
修改pagination的值为3)
root@AR:/usr/local/peanut-blog# peanut (这就是生成/更新静态网站的根目录的命令)
root@AR:/usr/local/peanut-blog# ls
archive.html  config.yml  index.html  posts    sitemap.xml
assets       drafts   page       rss.xml
root@AR:/usr/local/peanut-blog#
(可见/usr/local/peanut-blog/就是静态网站的根目录。你可绑定域名到该目录)

演示网站:http://pn.bright.biz.st
项目地址:https://github.com/zqqf16/Peanut