-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpelicanconf.py
169 lines (146 loc) · 4.65 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
165
166
167
168
169
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
AUTHOR = 'The Instantbird Team'
SITENAME = "The blog of Instantbird's development"
SITEURL = 'http://localhost:8000'
# The main Instantbird site's URL.
MAIN_SITE_URL = 'https://www.instantbird.com'
# Set up locations of articles, pages and theme.
PATH = 'content'
ARTICLE_PATHS = ['articles']
PAGE_PATHS = ['pages']
# Set up static content and output locations.
STATIC_PATHS = [
'files',
'images',
'smileys',
'static',
'wp-content',
]
EXTRA_PATH_METADATA = {
# Disable GitHub's Jekyll parsing, this will allow folders starting with a .
# to be served:
# https://help.github.com/articles/files-that-start-with-an-underscore-are-missing/
'static/.nojekyll': {'path': '.nojekyll'},
# Tell GitHub the domain name:
# https://help.github.com/articles/adding-a-cname-file-to-your-repository/
'static/CNAME': {'path': 'CNAME'},
# Include a favicon.
'static/favicon.ico': {'path': 'favicon.ico'},
}
TEMPLATE_PAGES = {
# Custom 404 page for GitHub pages.
'404.html': '404.html',
}
TIMEZONE = 'UTC'
DEFAULT_DATE_FORMAT = '%B %-d, %Y'
DEFAULT_LANG = 'en'
# Improve readability of HTML.
TYPOGRIFY = True
# Top-level links.
LINKS = (
('Blog', "/"),
('Add-ons', 'https://addons.instantbird.org/'),
('F.A.Q.', 'http://www.instantbird.com/faq.html'),
('Wiki', 'https://wiki.instantbird.org/'),
('About', 'http://www.instantbird.com/about.html'),
)
# This is currently a modified copy of notmyidea, one of the default themes.
THEME = 'theme'
# Configuration pagination to show 7 articles per page.
DEFAULT_PAGINATION = 7
PAGINATED_TEMPLATES = {
'index': None,
'tag': None,
'category': None,
'author': None,
'period_archives': None,
}
PAGINATION_PATTERNS = (
(1, '{url}', '{save_as}'),
(2, '{base_name}/page/{number}/', '{base_name}/page/{number}/index.html'),
)
# Do not use relative URLs.
RELATIVE_URLS = False
# Create an archive for each year, month, and day.
YEAR_ARCHIVE_URL = '{date:%Y}/'
YEAR_ARCHIVE_SAVE_AS = YEAR_ARCHIVE_URL + 'index.html'
MONTH_ARCHIVE_URL = YEAR_ARCHIVE_URL + '{date:%m}/'
MONTH_ARCHIVE_SAVE_AS = MONTH_ARCHIVE_URL + 'index.html'
DAY_ARCHIVE_URL = MONTH_ARCHIVE_URL + '{date:%d}/'
DAY_ARCHIVE_SAVE_AS = DAY_ARCHIVE_URL + 'index.html'
# Place each article under the year & month.
ARTICLE_URL = MONTH_ARCHIVE_URL + '{slug}/'
ARTICLE_SAVE_AS = ARTICLE_URL + 'index.html'
# Create separate archives for each author, category, and tag.
AUTHOR_URL = 'author/{slug}/'
AUTHOR_SAVE_AS = AUTHOR_URL + 'index.html'
CATEGORY_URL = 'category/{slug}/'
CATEGORY_SAVE_AS = CATEGORY_URL + 'index.html'
TAG_URL = 'tag/{slug}/'
TAG_SAVE_AS = TAG_URL + 'index.html'
# Change the default feed URLs.
FEED_ALL_RSS_URL = 'feed/'
FEED_ALL_RSS = FEED_ALL_RSS_URL + 'rss.xml'
TAG_FEED_RSS_URL = TAG_URL + 'feed/'
TAG_FEED_RSS = TAG_FEED_RSS_URL + 'rss.xml'
CATEGORY_FEED_RSS_URL = CATEGORY_URL + 'feed/'
CATEGORY_FEED_RSS = CATEGORY_FEED_RSS_URL + 'rss.xml'
AUTHOR_FEED_RSS_URL = AUTHOR_URL + 'feed/'
AUTHOR_FEED_RSS = AUTHOR_FEED_RSS_URL + 'rss.xml'
# Disable atom feeds.
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM = None
TAG_FEED_ATOM = None
AUTHOR_FEED_ATOM = None
# Disable translation feeds.
FEED_ATOM = None
FEED_RSS = None
TRANSLATION_FEED_ATOM = None
TRANSLATION_FEED_RSS = None
# Show full content in the feeds.
RSS_FEED_SUMMARY_ONLY = False
# Show 7 items in the feed.
FEED_MAX_ITEMS = 7
# The domain to serve the feeds from.
FEED_DOMAIN = SITEURL
# Match the slugification of Wordpress.
SLUG_REGEX_SUBSTITUTIONS = [
# Only this first regular expression is modified. It replaces with a -,
# instead of removing characters.
(r'[^\w\s]', '-'), # replace non-alphabetical/whitespace/'-' chars with -
(r'(?u)\A\s*', ''), # strip leading whitespace
(r'(?u)\s*\Z', ''), # strip trailing whitespace
(r'[-\s]+', '-'), # reduce multiple whitespace or '-' to single '-'
]
# Enable the comments system.
PELICAN_COMMENT_SYSTEM = True
# Configure permalink redirects.
REDIRECT_SAVE_AS = [
'a{index}-{slug}.html',
'c{index}-{slug}.html',
'n{index}-{slug}.html',
]
# The WordPress blog renamed mozilla and community tags with a "-2" on the end.
# Generate redirects for all categories since they won't hurt.
REDIRECT_TAG_SAVE_AS = [
'tag/{slug}-2/index.html',
]
# Configure the tag cloud.
TAG_CLOUD_MAX_ITEMS = 100
TAG_CLOUD_MIN_FONT = 8
TAG_CLOUD_MAX_FONT = 22
TAG_CLOUD_ORDER_BY = 'name'
TAG_CLOUD_ORDER = 'ASC'
# Configure installed plug-ins.
PLUGIN_PATHS = [
'pelican-plugins/',
]
PLUGINS = [
'pelican_comment_system',
'plugins.archives',
'plugins.comments',
'plugins.most_used_categories',
'plugins.redirects',
'plugins.tag_cloud',
]