Total Pageviews

Friday 12 October 2018

博客程序Paper

Feel free about writing blog. This is a simple blog system, Just bloging, Implemented on bottle.
This is a simple blog system based on Bottle, Jinja2, SQLalchemy.
White blog with Markdown.

Demo

  • Not avaliable

Quick Start

details see Deploy
git clone https://github.com/yueyoum/paper.git
cd paper

cp settings.py.example settings.py
vim settings.py
echo "this is me" > templates/me.html

make init
make database
make key
make run
Then you can visit the demo at http://127.0.0.1:8999 (static file will not be served)
For static files, you need nignx, or set DEBUG = True in settings.py

Deploy

  1. using git or download paper directly.
  2. settings
    cp settings.py.example settings.py
    
    your should modify the settings with your needs
  3. set up a html page for /about link
    create a me.html file in templates folder. this page will show in /about link
  4. paper use virtualenv to running in a independent python environments. run this commands below:
    make init
    
  5. paper use sqlalchemy as ORM, so sync table metadata to DB
    make database
    
  6. generate the key for post blog.
    you will using paper-client to post blog. so, this key is used for security.
    make key
    
  7. start the web
    gunicorn with gevent_pywsgi workers will serve the web at 127.0.0.1:8999
    make run
    
  8. config nginx
    there is a nginx config file located at deploy folder, copy and modify it to make nginx serve paper

How to post blog

paper is designed for writing markdown at local, you need paper-client to post markdown.
At the step 5 above, we make the security key via make key. the key file is located at src/ folder.
cat src/_key, and you will get the security key, copy it. It will be used for paper_client.conf.
details see paper-client

from https://github.com/yueyoum/paper
------

Paper-Client

this is the client of paper, used for post markdown.

How to use

git clone https://github.com/yueyoum/paper-client.git
cd /usr/local/bin
sudo ln -s YOUR_PATH/paper-client/paper_publish.sh paper_publish
cd ~
cp paper-client/config ~/.paper-client.conf
vim ~/.paper-client.conf

paper-client YOUR_POST.md
.paper-client.conf now needs two variable:
  • key: the security key for post. see paper
  • url: your domain

Format

Just markdown, but you should care about the code area. see the example.md
  • File name of markdown file will be the post's title
  • Markdown file must contains Tags: line at the top of file
  • Post date is in paper settings
from https://github.com/yueyoum/paper-client

No comments:

Post a Comment