-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpelicanconf.py
More file actions
206 lines (152 loc) · 4.58 KB
/
pelicanconf.py
File metadata and controls
206 lines (152 loc) · 4.58 KB
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
############################
# Basic Details
AUTHOR = u'Saevon'
EMAIL = u'dot.saevon@gmail.com'
SITENAME = u'Saevon.ca'
SITEURL = u''
TIMEZONE = u'Canada/Eastern'
DEFAULT_LANG = u'en'
############################
# Content
# The theme folder to use
THEME = 'theme'
# The directory to copy statics into
THEME_STATIC_DIR = 'static'
STATIC_DIR = THEME_STATIC_DIR
# Taglines for auto-generated items with no page
TAG_TAGLINES = {
}
CATEGORY_TAGLINES = {
'coding': 'Coding for fun! (and profit)',
'review': 'Have fun, then write about why',
'personal': 'Random miscellaneous articles',
'roleplaying': 'My public campaign details and notes',
}
# Location of blog content
PATH = 'content'
ARTICLE_DIR = 'articles'
# Templates that make a page, rather than being a layout
DIRECT_TEMPLATES = ['index', 'tags', 'categories', 'license', 'sitemap']
# Mapping of URL to title, for history
DIRECT_TEMPLATES.append('history_map_js')
HISTORY_MAP_JS_SAVE_AS = "static/js/history_map.js"
ENABLE_HISTORY_LINKS = True
# Show the Untold Story page (off for Dev)
SHOW_UNTOLD = False
# Articles per page
DEFAULT_PAGINATION = 5
# Which direct templates should be paginated
PAGINATED_DIRECT_TEMPLATES = ()
# If the article is in a folder and doesn't have a category use the folder name as its category
USE_FOLDER_AS_CATEGORY = True
DEFAULT_CATEGORY = 'personal'
# The author page doesn't exist yet
AUTHOR_SAVE_AS = False
AUTHOR_URL = False
# Disable the authors list page (as there is only one author)
AUTHORS_SAVE_AS = False
# License File
LICENSE_FILE = '../LICENSE.md'
LICENSE_SAVE_AS = 'license/index.html'
LICENSE_URL = 'license/'
# Comments
DISQUS_SITENAME = "dev-blog-saevon"
# Facebook
FACEBOOK_LINK_PROTOCOL = "http"
# Whether to show the powered by pelicaon logo
INCLUDE_PELICAN_LINK = False
############################
# Coding
# Fix the import path, then get all the plugins
import sys
sys.path.append('.')
from plugins.markdown import MD_EXTENSIONS
from plugins.jinja2 import JINJA_EXTENSIONS, JINJA_FILTERS, JINJA_FUNCTIONS
from plugins.pelican import PLUGINS
# Delete the output directory every time we generate the code
DELETE_OUTPUT_DIRECTORY = True
######################################
# Sitemap
# Used by robots to rank your site
# Sitemap file
SITEMAP_SAVE_AS = "sitemap.xml"
# My custom sitemap data
# Not for use with the pelican sitemap plugin
SITEMAP = {
'format': 'xml',
'articles': {
'priority': 0.5,
'changefreq': 'monthly',
},
'pages': {
'priority': 0.5,
'changefreq': 'monthly',
},
}
###########################
# Feeds
# Feed generation is usually not desired when developing
FEED_DOMAIN = SITEURL
ENABLE_ATOM = False
if ENABLE_ATOM:
FEED_ATOM = 'atom.xml'
FEED_ALL_ATOM = 'feeds/all.atom.xml'
AUTHOR_FEED_ATOM = None
CATEGORY_FEED_ATOM = 'feeds/%s.atom.xml'
TAG_FEED_ATOM = 'feeds/%s.atom.xml'
else:
FEED_ATOM = None
FEED_ALL_ATOM = None
AUTHOR_FEED_ATOM = None
CATEGORY_FEED_ATOM = None
TAG_FEED_ATOM = None
TRANSLATION_FEED_ATOM = None
ENABLE_RSS = False
if ENABLE_RSS:
FEED_RSS = 'rss.xml'
AUTHOR_FEED_RSS = None
FEED_ALL_RSS = 'feeds/all.rss.xml'
CATEGORY_FEED_RSS = 'feeds/%s.rss.xml'
TAG_FEED_RSS = 'feeds/%s.rss.xml'
else:
FEED_RSS = None
FEED_ALL_RSS = None
AUTHOR_FEED_RSS = None
CATEGORY_FEED_RSS = None
TAG_FEED_RSS = None
TRANSLATION_FEED_RSS = None
############################
# Urls
# Categories are the root directory under which articles go
CATEGORY_SAVE_AS = '{slug}/index.html'
CATEGORY_URL = '{slug}/'
# Articles go directly under their category
ARTICLE_SAVE_AS = '{category}/{slug}/index.html'
ARTICLE_URL = '{category}/{slug}/'
# No need for a categories page, as the index page already does that
# But any links to it should head to the right place
CATEGORIES_SAVE_AS = 'categories/index.html'
CATEGORIES_URL = 'categories'
# The tags page is actually for tags and categories
TAGS_SAVE_AS = 'tags/index.html'
TAGS_URL = 'tags/'
# Individual tags have a page for each of them
TAG_SAVE_AS = 'tags/{slug}/index.html'
TAG_URL = 'tags/{slug}/'
############################
# Menu bar Links
# Blog Links
LINKS = (
# (Menu Name, url, enabled),
)
# My Account Links
ACCOUNTS = (
# (icon, url, enabled),
('rss-square', FEED_RSS, ENABLE_RSS),
('rss-square', FEED_ATOM, not ENABLE_RSS and ENABLE_ATOM),
('github-square', 'https://github.com/Saevon', True),
('linkedin-square', 'https://ca.linkedin.com/in/saevon', True),
)