This repository has been archived by the owner on Apr 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
config_default.py
221 lines (213 loc) · 6.47 KB
/
config_default.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
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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
import os
import sys
import datetime
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
UTILITIES = os.path.join(PROJECT_ROOT, 'utilities')
sys.path.insert(1, UTILITIES)
import filters
LOAD_CONTENT_CACHE = False
AUTORELOAD_IGNORE_CACHE = True
AUTHOR = u'Open Knowledge'
SITENAME = u'Open Data Index'
DEFAULT_LANG = u'en'
PATH = 'content'
STATIC_PATHS = ['extra/CNAME', 'data']
EXTRA_PATH_METADATA = {
'extra/CNAME': {'path': 'CNAME'},
}
OUTPUT_PATH = 'output'
TIMEZONE = 'UTC'
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM = None
TRANSLATION_FEED_ATOM = None
LINKS = (('', ''),)
SOCIAL = (('', ''),)
DEFAULT_PAGINATION = False
ARTICLE_URL = 'stories/{date:%Y}/{slug}/'
ARTICLE_SAVE_AS = 'stories/{date:%Y}/{slug}/index.html'
INDEX_SAVE_AS = 'stories/index.html'
PAGE_URL = '{slug}/'
PAGE_SAVE_AS = '{slug}/index.html'
AUTHOR_SAVE_AS = False
AUTHORS_SAVE_AS = False
CATEGORY_URL = 'stories/{slug}/'
CATEGORY_SAVE_AS = 'stories/{slug}/index.html'
#CATEGORY_SAVE_AS = False
#CATEGORIES_SAVE_AS = False
TAG_SAVE_AS = False
TAGS_SAVE_AS = False
ARCHIVES_SAVE_AS = False
THEME = os.path.join(PROJECT_ROOT, 'themes', 'odi')
THEME_STATIC_DIR = 'static'
THEME_STATIC_PATH = os.path.join(THEME, THEME_STATIC_DIR)
DISPLAY_DATE_FORMAT = '%Y-%m-%d'
DISPLAY_TIME_FORMAT = '%H:%M:%S'
DISPLAY_DATETIME_FORMAT = '{0}T{1}'.format(DISPLAY_DATE_FORMAT,
DISPLAY_TIME_FORMAT)
TIMESTAMP = datetime.datetime.now().strftime(DISPLAY_DATE_FORMAT)
SUMMARY_MAX_LENGTH = 25
JINJA_EXTENSIONS = [
'jinja2.ext.i18n',
'jinja2.ext.do',
'jinja2.ext.with_',
'jinja2.ext.loopcontrols'
]
JINJA_FILTERS = {
'where': filters.where,
'markdown': filters.markdown,
'natsort': filters.natsort,
'tojson': filters.tojson,
'debug': filters.debug,
'search': filters.search,
'first_or_default': filters.first_or_default,
}
PLUGIN_PATHS = [os.path.join(PROJECT_ROOT, 'plugins')]
PLUGINS = [
'datastore',
'datastore_api',
'datastore_assets',
'i18n_subsites',
'pelican_alias'
]
# DATASTORE PLUGIN CONFIGURATION
DATASTORE = {
'location': os.path.join(PROJECT_ROOT, 'content', 'data'),
'formats': ['.csv'],
'intrafield_delimiter': '~*',
'true_strings': ['TRUE', 'True', 'true'],
'false_strings': ['FALSE', 'False', 'false'],
'none_strings': ['NULL', 'Null', 'null', 'NONE', 'None', 'none',
'NIL', 'Nil', 'nil', '-', 'NaN', 'N/A', 'n/a', ''],
'api': { # settings for the datastore_api plugin
'base': 'api', # directory relative to `output`
'formats': ['json', 'csv'], # output API in these formats
'filters': {
# Key must match a datastore file name.
# Values must match headers in that file.
'entries': ['year'],
'datasets': ['category']
#'places': ['region']
},
'exclude': [] # datastore files to exclude from API (by name of type)
},
'assets': {
'location': 'downloads'
}
}
OK = {
'ribbon': True
}
# OPEN DATA INDEX CONFIGURATION
ODI = {
'scheme': u'',
'domain': u'',
'production_domain': u'index.okfn.org',
'survey': {
'name': u'Open Data Index Survey',
'domain': u'http://global.census.okfn.org/',
'submit_route': u'submit/'
},
'sponsor': {
'name': u'Open Knowledge',
'domain': u'https://okfn.org/',
},
'analytics': {
'google': u''
},
'stories': {
'email': '[email protected]'
},
'press': {
'email': '[email protected]'
},
'years': [u'2015', u'2014', u'2013'],
'current_year': u'2015',
'previous_year': u'2014',
'na': u'n/a',
'email': u'[email protected]',
'description': u'The Global Open Data Index assesses the state of open government data around the world.',
'keywords': 'Open Government, Open Data, Government Transparency, Open Knowledge',
'twitter': '',
'repo': u'https://github.com/okfn/opendataindex',
'author': {
'name': AUTHOR,
'url': u'https://okfn.org/'
},
'mailinglist': u'',
'languages': ['en', 'es'],
'test_path': 'tests',
'tmp_path': 'tmp',
'content_path': PATH,
'output_path': OUTPUT_PATH,
'trans_path': 'themes/odi/translations',
'deploy_remote': 'upstream',
'database': {
'datasets': 'http://global.census.okfn.org/api/datasets/score/{year}.cascade.json',
'entries': 'http://global.census.okfn.org/api/entries/{year}.cascade.json',
'questions': 'http://global.census.okfn.org/api/questions.json',
'places': 'http://global.census.okfn.org/api/places/score/{year}.cascade.json',
},
'include': {
'datasets': [], # example: 'timetables' or 'timetables-2015'
'places': [], # example: 'au' or 'au-2015'
},
'exclude': {
'2013': {
'datasets': ['health'],
'places': [
'ae', 'bb', 'bh', 'bs', 'bt', 'gg', 'gi', 'je', 'jo',
'kn', 'ky', 'lc', 'ly', 'ma', 'om', 'pk', 'tc', 'ua',
'va', 'vg', 'ye',
],
},
'2014': {
'datasets': ['health'],
'places': [
'ae', 'bb', 'bh', 'bs', 'bt', 'gg', 'gi', 'je', 'jo',
'kn', 'ky', 'lc', 'ly', 'tc', 'ua', 'va', 'vg', 'ye',
],
},
'2015': {
'datasets': ['timetables', 'health'],
'places': [
'am', 'ba', 'bd', 'bt', 'by', 'cy', 'gh', 'gi', 'hr',
'ht', 'hu', 'ls', 'lt', 'mt', 'nz', 'pe', 'pl', 'rs',
'si', 'sl', 'uz', 'va', 've', 'vg', 'vi', 'ye', 'zm',
'zw',
],
},
},
'limited': {
'datasets': ['statistics'],
'places': ['gb'],
},
'forms': {
'download': {
'url': 'https://docs.google.com/forms/d/1fEJxaJdOI9SxicgS3INwrgtGLK43qLTPpFiQ-e2ISm0/viewform?embedded=true',
'width': '560',
'height': '720'
}
},
# Census -> Font Awesome
'icons': {
'unlock-alt': 'unlock-alt',
'dollar': 'dollar',
'keyboard': 'keyboard-o',
'copy': 'copy',
'time': 'clock-o',
'eye-open': 'eye',
'save': 'save',
'download': 'download',
'file-alt': 'file-o',
},
}
SITEURL = u'{0}{1}'.format(ODI['scheme'], ODI['domain'])
# If `config_instance` exists, load it for instance-specific configuration.
# See `config_instance.example` to get started.
try:
from config_instance import *
except ImportError:
pass