同步操作将从 orange1988/Django-Blog-Motor 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Blog platform based on Tornado, MongoDB, and Motor. To be used with MarsEdit.
Frontend: Motor-Blog runs in Tornado. It is very fast.
Editing: Motor-Blog has no admin panel, but supports MarsEdit.
Comments: Motor-Blog does not support comments natively, I recommend a third-party Javascript comments API like Disqus.
Customization: Appearance is completely customizable.
Install MongoDB and run it on the default port on the same machine as Motor-Blog
pip install -r requirements.txt
To migrate from a prior WordPress blog with migrate_from_wordpress.py you'll need Pandoc
Start MongoDB
mkdir data
mongod --dbpath data --logpath data/mongod.log --fork --setParameter textSearchEnabled=true
Copy motor_blog.conf.example to motor_blog.conf, edit it as desired. Start the application:
python server.py --debug --conf=motor\_blog.conf
Visit http://localhost:8888/blog
I run Motor-Blog on http://emptysquare.net/blog with Nginx at the front and four server.py
processes.
Those processes and MongoDB are managed by Supervisor.
I've provided example config files in this repository in etc/
.
If you have an Nginx version with WebSocket support (1.3.13 or later)
then draft posts will autoreload when you update them from MarsEdit.
In MarsEdit, do "File -> New Blog." Give it a name and the URL of your Motor-Blog's home page. MarsEdit auto-detects the rest. You'll need to enter the username and password you put in motor_blog.conf. In the "General" tab of your blog's settings, I suggest setting "Download the 1000 most recent posts on refresh," since Motor-Blog can handle it. Under "Editing," set Preview Text Filter to "Markdown", and Image Size "Defaults To Full Size".
When you're editing a post, do "View -> Excerpt" to edit the post's meta-description. This text appears in Google results as a snippet, or when sharing a link to the post on Facebook. Motor-Blog refuses the post if the meta-description field is over 155 characters. Do "View -> Slug Field" to set a custom slug as the final part of the post's URL. If you leave the slug empty, Motor-Blog slugifies the title.
Finally, you'll want to customize how MarsEdit inserts images.
This customization serves two purposes: first, we'll remove the width and height
from img
tags so Motor-Blog's responsive layout can fit them to the visitor's screen.
Second, we'll set images' title text is set to the same value as their alt-text,
since browsers display image titles as tooltips.
Open the MarsEdit Media Manager and select an image.
In the Media Manager's lower-right corner is a "Style" chooser,
with the option "Customize...":
Choose this and create a new image style with "opening markup" like this:
<img
style="display:block; margin-left:auto; margin-right:auto;"
src="#fileurl#"
alt="#alttext#"
title="#alttext#" />
Motor-Blog renders Markdown with Python-Markdown. Plain inline code is surrounded by single backticks (``). Code blocks can be fenced in a number of styles, such as GitHub's:
```python
print "foo"
```
The list of languages
is whatever Pygments supports. The following are of
interest to Python coders like me: py
, py3
, pytb
and py3tb
for tracebacks, and pycon
for
console sessions.
Using a feature in the latest Python-Markdown, you can highlight specific lines in a code block:
```python hl_lines="2"
# Line 1.
# Line 2. This will have a yellow background
```
motor_blog.conf
.templates
subdir with the same set of filenames as the example theme.
Tornado templates or Jade templates are both supported.setting()
function is available to all templates, and gives access to values in motor_blog.conf
.server.py --ensure_indexes
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。