forked from dylanninin/blog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
66 lines (60 loc) · 1.79 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import web
blogconfig = web.storage(
name='小菠萝网',
home='http://121.196.222.186',
author='pierre',
disqus='"webpymdblog"',
google_analytics='"UA-21870463-1"',
template_dir='template',
entry_dir='raw/entry',
page_dir='raw/page',
tweet_dir='raw/tweet',
static_dir='static',
url_suffix='.html',
raw_suffix='.md',
index_url='/',
entry_url='/blog',
tweet_url='/tweet',
archive_url='/archive',
about_url='/about.html',
subscribe_url='/atom.xml',
error_url='/error.html',
favicon_url='/favicon.ico',
search_url='/search',
static_url='/static',
raw_url='/raw',
other_url='(.+)',
start=1,
limit=5,
pagination=15,
search_holder='search all site',
time_fmt='%Y-%m-%d %H:%M:%S',
date_fmt='%Y-%m-%d',
url_fmt='yyyy/mm/dd',
url_date_fmt='%Y/%m/%d',
recently=10,
ranks=10,
subscribe=10,
cache=False,
debug=True,
)
web.config.debug = blogconfig.debug
render = web.template.render(blogconfig.template_dir, cache=blogconfig.cache)
web.template.Template.globals['config'] = blogconfig
web.template.Template.globals['render'] = render
urls = (
blogconfig.index_url + '/?', 'controller.Index',
blogconfig.entry_url + '(.*)', 'controller.Entry',
blogconfig.archive_url + '(.*)', 'controller.Archive',
blogconfig.about_url, 'controller.About',
blogconfig.subscribe_url, 'controller.Subscribe',
blogconfig.search_url + '?(.+)', 'controller.Search',
blogconfig.raw_url + '(.*)', 'controller.Raw',
blogconfig.favicon_url, 'controller.Image',
blogconfig.other_url, 'controller.Error',
)
if __name__ == "__main__":
import doctest
doctest.testmod()