forked from pyladies-brazil/br-pyladies-pelican
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pelicanconf.py
165 lines (137 loc) · 4.53 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
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
from datetime import datetime
from collections import namedtuple
import os
import yaml
AUTHOR = u'Pyladies'
SITENAME = u'Pyladies Brasil'
SITEURL = 'http://localhost:{}'.format(os.getenv('PORT', '8000'))
TAGLINE = (u'Ninguém pode fazer você se sentir inferior'
'sem o seu consentimento (Eleanor Roosevelt)')
DEFAULT_DATE_FORMAT = ('%d-%m-%Y')
DEFAULT_BG = 'images/pyladies-brasil-logo.png'
SINCE = datetime.now().year
NOW = datetime.now().date()
SUMMARY_MAX_LENGTH = 30
ARTICLE_URL = '{date:%Y}/{date:%m}/{date:%d}/{slug}/'
ARTICLE_SAVE_AS = '{}index.html'.format(ARTICLE_URL)
PAGE_URL = '{slug}/'
PAGE_SAVE_AS = '{slug}/index.html'
# Sitemap
DIRECT_TEMPLATES = ('index', 'tags', 'categories', 'archives', 'sitemap')
SITEMAP_SAVE_AS = 'sitemap.xml'
TIMEZONE = 'America/Sao_Paulo'
DEFAULT_LANG = u'en'
THEME = 'themes/default'
PATH = 'content'
# Feed generation is usually not desired when developing
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM = None
TRANSLATION_FEED_ATOM = None
AUTHOR_FEED_ATOM = None
AUTHOR_FEED_RSS = None
MENUITEMS = (
('Sobre', '/about'),
('Eventos', '/events'),
('Locais', '/locations'),
('Ladies', '/ladies'),
('Videos', '/videos'),
('Materiais', '/materiais'),
('Blog', '/archives.html'),
)
DEFAULT_PAGINATION = 10
READERS = {'html': None}
STATIC_PATHS = [
'images',
'extra/robots.txt',
'extra/favicon.ico',
'extra/favicon.png',
# Site estático da primeira edição do evento
'conf-1',
# Site estático da primeira edição da PyLadies Conf Nordeste
'conf-nordeste-1'
]
EXTRA_PATH_METADATA = {
'extra/robots.txt': {'path': 'robots.txt'},
'extra/favicon.ico': {'path': 'favicon.ico'},
'extra/favicon.png': {'path': 'favicon.png'},
'conf-1': {'path': 'conf-1'},
'conf-nordeste-1': {'path': 'conf-nordeste-1'},
}
# ANALYTICS
GOOGLE_ANALYTICS_UA = 'UA-58961512-1'
DISQUS_SITENAME = 'pyladiesbrasil'
# Uncomment following line if you want document-relative URLs when developing
# RELATIVE_URLS = True
# Ladies, Locations, Events and Videos
with open('data/ladies.yml') as ladies:
ladies_converted = yaml.load(ladies.read())
LADIES = []
for lady in ladies_converted:
LADIES.append(
namedtuple('Ladies', lady.keys())(**lady)
)
with open('data/locations.yml') as locations:
locations_converted = yaml.load(locations.read())
LOCATIONS = []
for location in locations_converted:
LOCATIONS.append(
namedtuple('Locations', location.keys())(**location)
)
with open('data/events.yml') as events:
events_converted = yaml.load(events.read())
EVENTS = []
# Convert dates to datetimes
for event in events_converted:
event['date'] = datetime.strptime(event['date'], '%d-%m-%Y').date()
# Sort events by date
for event in sorted(events_converted,
key=lambda event: event['date'], reverse=True):
e = namedtuple('Event', event.keys())(**event)
EVENTS.append(e)
with open('data/videos_depo.yml') as videos:
videos_converted = yaml.load(videos.read())
VIDEOS_DEPO = []
for video in videos_converted:
VIDEOS_DEPO.append(
namedtuple('Videos', video.keys())(**video)
)
with open('data/videos_dojos.yml') as videos:
videos_converted = yaml.load(videos.read())
VIDEOS_DOJOS = []
for video in videos_converted:
VIDEOS_DOJOS.append(
namedtuple('Videos', video.keys())(**video)
)
with open('data/videos_talks.yml') as videos:
videos_converted = yaml.load(videos.read())
VIDEOS_TALKS = []
for video in videos_converted:
VIDEOS_TALKS.append(
namedtuple('Videos', video.keys())(**video)
)
with open('data/videos_tutorials.yml') as videos:
videos_converted = yaml.load(videos.read())
VIDEOS_TUTORIALS = []
for video in videos_converted:
VIDEOS_TUTORIALS.append(
namedtuple('Videos', video.keys())(**video)
)
with open('data/talks.yml') as talks:
talks_readed = yaml.load(talks.read())
TALKS = []
for talk in talks_readed:
TALKS.append(
namedtuple('Talks', talk.keys())(**talk)
)
with open('data/materials.yml') as materials:
materials_readed = yaml.load(materials.read())
MATERIALS = []
for materials in materials_readed:
MATERIALS.append(
namedtuple('Materials', materials.keys())(**materials)
)
PLUGIN_PATHS = ['plugins']
PLUGINS = ['tipue_search']