-
Notifications
You must be signed in to change notification settings - Fork 11
/
pelicanconf.py
164 lines (146 loc) · 4.98 KB
/
pelicanconf.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
# Uncomment following line if you want document-relative URLs when developing
#RELATIVE_URLS = True
###############################################################
############################################################### Site abt.
###############################################################
AUTHOR = u'Pythoneerm'
SITENAME = u'蠎周刊'
SITEDESC = u'汇集全球蠎事儿 ;-)'
SITENOTE = u"各种 weekly 中译版"
#SITEURL = 'https://weekly.101.so'
SITEURL = 'https://weekly.pychina.org'
#SITEURL = 'http://weekly.101.camp'
DISQUS_SITENAME = u"weeklypychinaorg" #填入你的Shortname
MARKUP = ('md', 'rst')#'rst', 'html',
READERS = {
'html': None,
}
# TIMEZONE = 'Europe/Paris'
TIMEZONE = 'Asia/Shanghai'
DATE_FORMATS = {
'zh_CN': '%Y-%m-%d %H:%M',
}
DEFAULT_DATE_FORMAT = '%Y-%m-%d %H:%M'
DEFAULT_DATE = 'fs' # use filesystem's mtime
#LOCALE = ('zh_CN.utf8',)
DEFAULT_LANG = u'zh_CN'
FILENAME_METADATA = '(?P<slug>.*)'
###############################################################
############################################################### Plugins abt.
###############################################################
# Plugins
PLUGINS=[
#'_plugins.sitemap'
#, '_plugins.extract_toc'
#, '_plugins.gzip_cache'
#, u"pelican.plugins.disqus_static"
]
# upgraded Pelican 3.7 must self open them
MARKDOWN = {
'extension_configs': {
'markdown.extensions.codehilite': {'css_class': 'highlight'},
'markdown.extensions.extra': {},
'markdown.extensions.meta': {},
},
'output_format': 'html5',
}
SITEMAP = {
'format': 'xml',
'priorities': {
'articles': 0.5,
'indexes': 0.5,
'pages': 0.5
},
'changefreqs': {
'articles': 'monthly',
'indexes': 'daily',
'pages': 'monthly'
}
}
# code blocks with line numbers
PYGMENTS_RST_OPTIONS = {'linenos': 'table'}
###############################################################
############################################################### Template abt.
###############################################################
THEME = "_themes/pelican-bootstrap3"
BOOTSTRAP_THEME = 'readable'
DEFAULT_PAGINATION = 3
TAG_CLOUD_MAX_ITEMS = 10
DISPLAY_CATEGORIES_ON_MENU = None # 分类标签是否显示在导航
# Social widget -> China jiathis.com
ADDTHIS_PROFILE = None #True
#GITHUB_USER = "ZoomQuiet"
MENUITEMS = (('PyChina', 'http://pychina.org')
, ('蟒营', 'http://www.101.camp')
, ('设计', 'design.html')
, ('有关', 'about.html')
, ('Zoom.Quiet', 'http://zoomquiet.io')
)
# Feed generation is usually not desired when developing
#SUMMARY_MAX_LENGTH = 142
#FEED_ALL_ATOM = None
#CATEGORY_FEED_ATOM = None
FEED_ALL_ATOM = 'feeds/all.atom.xml'
CATEGORY_FEED_ATOM = 'feeds/%s.atom.xml'
RSS_FEED_SUMMARY_ONLY = True
FEED_ALL_RSS = 'feeds/all.rss.xml'
CATEGORY_FEED_RSS = 'feeds/%s.rss.xml'
TRANSLATION_FEED_ATOM = None
#FEED_ALL_RSS = None
#CATEGORY_FEED_RSS= None
SOCIAL = (('github', 'https://github.com/PyChina/weekly')
#, ('rss', SITEURL + '/' + FEED_ALL_ATOM)
, ('rss', SITEURL + '/' + FEED_ALL_RSS)
#, ('CPyUG', 'https://gitcafe.com/CPyUG')
, ('PyChina', 'https://github.com/PyChina')
, ('Wiki', 'http://wiki.pychina.org')
#, ('O.B.P', 'http://weibo.com/openbookproject')
#, ('weibo', 'http://weibo.com/pyconcn')
, ('啄木鸟', 'http://wiki.woodpecker.org.cn/moin/CPUG')
, ('蟒营', 'http://www.101.camp')
, ('大妈的多重宇宙', 'https://www.youtube.com/@Chaos42DAMA')
, ('小红花Club', 'https://xhh.club/')
)
# Blogroll
LINKS = None
###############################################################
############################################################### Publish abt.
###############################################################
USE_FOLDER_AS_CATEGORY = True
#DELETE_OUTPUT_DIRECTORY = True #因为嵌套仓库的原因,不能清除发布目录!
DEFAULT_CATEGORY = u'Chaos'
TEMPLATE_PAGES = {
"404.html": "404.html",
}
STATIC_PATHS = ['_images', '_files', '_extra'
, '_extra/robots.txt'
, '_extra/favicon.ico'
, '_extra/README.md'
, '_extra/LICENSE'
, '_extra/CNAME'
, '_extra/.nojekyll'
]
ARTICLE_EXCLUDES = ['_extra']
PAGE_EXCLUDES = ['_extra']
EXTRA_PATH_METADATA = {'_extra/robots.txt': {'path': 'robots.txt'}
, '_extra/favicon.ico': {'path': 'favicon.ico'}
, '_extra/LICENSE': {'path': 'LICENSE'}
, '_extra/README.md': {'path': 'README.md'}
, '_extra/CNAME': {'path': 'CNAME'}
, '_extra/.nojekyll': {'path': '.nojekyll'}
}
ARTICLE_URL = '{category}/{slug}.html'
ARTICLE_SAVE_AS = ARTICLE_URL
PAGE_URL = '{slug}.html'
PAGE_SAVE_AS = PAGE_URL
CATEGORY_URL = '{slug}/index.html'
CATEGORY_SAVE_AS = CATEGORY_URL
TAG_URL = 'tag/{slug}.html'
TAG_SAVE_AS = TAG_URL
TAGS_SAVE_AS = 'tag/index.html'
# disable author pages
#AUTHOR_SAVE_AS = ''
#AUTHORS_SAVE_AS = ''