-
Notifications
You must be signed in to change notification settings - Fork 1
/
pelicanconf.py
83 lines (58 loc) · 1.74 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
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
from datetime import timedelta
from jinja2.ext import Extension
LIVERELOAD = True
AUTHOR = u'Python bendruomenė'
SITENAME = u'PyCon LT'
SITEURL = 'http://localhost:8000'
TIMEZONE = 'Europe/Vilnius'
DEFAULT_LANG = u'lt'
# Feed generation is usually not desired when developing
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM = None
TRANSLATION_FEED_ATOM = None
# Blogroll
LINKS = (
('Pelican', 'http://getpelican.com/'),
('Python.org', 'http://python.org/'),
('Jinja2', 'http://jinja.pocoo.org/'),
('You can modify those links in your config file', '#'),
)
# Social widget
SOCIAL = (('You can add links in your config file', '#'),
('Another social link', '#'),)
DEFAULT_PAGINATION = False
# Uncomment following line if you want document-relative URLs when developing
# RELATIVE_URLS = True
THEME = 'theme'
ARTICLE_EXCLUDES = ('pages', 'partials', 'images')
PAGE_URL = '{slug}.html',
PAGE_SAVE_AS = '{slug}.html'
STATIC_SAVE_AS = '{path}'
STATIC_URL = '{path}'
STATIC_PATHS = [
'media',
'images',
]
PLUGIN_PATHS = ['plugins']
# PLUGINS = ['assets']
class Timetable:
def __init__(self, hours, minutes=0):
self.time = timedelta(hours=hours, minutes=minutes)
def __call__(self, minutes):
starts = str(self.time)[:5]
self.time += timedelta(minutes=minutes)
return starts
class PyConLTExtension(Extension):
# a set of names that trigger the extension.
tags = set(['cache'])
def __init__(self, environment):
super(PyConLTExtension, self).__init__(environment)
environment.globals.update({
'Timetable': Timetable,
})
JINJA_EXTENSIONS = [
PyConLTExtension,
]