-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
pelicanconf.py
77 lines (61 loc) · 2.11 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
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
import os
# Adjust `TESTING_LOCALLY` if testing search functionality locally.
TESTING_LOCALLY = False
USE_EMAIL_THEME = True if os.environ.get('USE_EMAIL_THEME') == '1' else False
AUTHOR = u'TWiR Contributors'
SITENAME = u"This Week in Rust"
SITEURL = 'https://this-week-in-rust.org' if not TESTING_LOCALLY else 'http://localhost:8000'
SOURCE_URL = 'https://github.com/rust-lang/this-week-in-rust'
if USE_EMAIL_THEME:
THEME = 'themes/newsletter'
else:
THEME = 'themes/rusted'
THEME_STATIC_DIR = THEME + '/static'
TIMEZONE = 'America/New_York'
DEFAULT_LANG = u'en'
FEED_DOMAIN = SITEURL
FEED_ALL_ATOM = 'atom.xml'
FEED_ALL_RSS = 'rss.xml'
FEED_MAX_ITEMS = 4
CATEGORY_FEED_ATOM = 'categories/{slug}/atom.xml'
CATEGORY_FEED_RSS = 'categories/{slug}/rss.xml'
RSS_FEED_SUMMARY_ONLY = False
DEFAULT_PAGINATION = 10
ARTICLE_URL = 'blog/{date:%Y}/{date:%m}/{date:%d}/{slug}/'
ARTICLE_SAVE_AS = 'blog/{date:%Y}/{date:%m}/{date:%d}/{slug}/index.html'
ARCHIVES_SAVE_AS = 'blog/archives/index.html'
CATEGORY_URL = 'categories/{slug}/'
CATEGORY_SAVE_AS = 'categories/{slug}/index.html'
LANDING_PAGE_ABOUT = {
"title": "Cataloging the Rust community's awesomeness",
"details": """
A weekly newsletter about Rust and the Rust community, with bonus content
scattered about.
"""
}
PLUGIN_PATHS = ["plugins"]
# Don't add next/previous buttons search functionality for email.
if USE_EMAIL_THEME:
PLUGINS = ['webassets']
else:
PLUGINS = ['webassets', 'neighbors']
"""
Search functionality disabled while troubleshooting performance issues
for non-desktop readers. See https://github.com/rust-lang/this-week-in-rust/issues/4271
PLUGINS = ['webassets', 'neighbors', 'search']
SEARCH_HTML_SELECTOR = "article"
"""
MARKDOWN = {
'extension_configs': {
'markdown.extensions.codehilite': {'css_class': 'highlight'},
'markdown.extensions.extra': {},
'markdown.extensions.meta': {},
'markdown.extensions.toc': {
'anchorlink': True,
},
},
'output_format': 'html5',
}