forked from ovh/docs-rendering
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pelicanconf.py
198 lines (177 loc) · 5.7 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
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
#!/usr/bin/env python
# encoding: utf-8
from __future__ import unicode_literals
import sys
sys.path.append('.')
from plugins.ovh_entities.ovh_entities import OvhEntityGenerator
AUTHOR = 'OVH'
SITENAME = "OVH Guides"
SITEURL = ''
TIMEZONE = "Europe/Paris"
PATH = "pages"
STATIC_PATHS = ['.']
THEME = "themes/ovh"
TRANSLATIONS_FILE = "config/translations.yml"
# can be useful in development, but set to False when you're ready to publish
RELATIVE_URLS = False
GITHUB_URL = "https://github.com/ovh/docs/blob/develop/"
REVERSE_CATEGORY_ORDER = True
LOCALE = "C"
DEFAULT_PAGINATION = False
DEFAULT_DATE = (2012, 3, 2, 14, 1, 1)
DEFAULT_LANG = "fr-fr"
PAGE_PATHS = []
ARTICLE_PATHS = []
LINKS = ()
# global metadata to all the contents
DEFAULT_METADATA = {'lang': 'fr-fr', 'locale': 'fr', 'global': 'fr', 'order': 'z', 'folder': '', 'summary': False, 'contribute': True,}
# path-specific metadata
EXTRA_PATH_METADATA = {
'extra/robots.txt': {'path': 'robots.txt'},
}
# code blocks with line numbers
PYGMENTS_RST_OPTIONS = {'linenos': 'table'}
# deactivation
PAGE_SAVE_AS = ''
PAGE_LANG_SAVE_AS = ''
ARTICLE_SAVE_AS = ''
ARTICLE_LANG_SAVE_AS = ''
AUTHOR_SAVE_AS = ''
CATEGORY_SAVE_AS = ''
STATIC_LANG_SAVE_AS = ''
ARCHIVES_SAVE_AS = ''
AUTHORS_SAVE_AS = ''
CATEGORIES_SAVE_AS = ''
TAGS_SAVE_AS = ''
FEED_ATOM = None
FEED_ALL_ATOM = None
AUTHOR_FEED_ATOM = None
CATEGORY_FEED_ATOM = None
TAG_FEED_ATOM = None
TRANSLATION_FEED_ATOM = None
TRANSLATION_FEED_ALL_ATOM = None
TRANSLATION_AUTHOR_FEED_ATOM = None
TRANSLATION_CATEGORY_FEED_ATOM = None
TRANSLATION_TAG_FEED_ATOM = None
FEED_RSS = None
FEED_ALL_RSS = None
AUTHOR_FEED_RSS = None
CATEGORY_FEED_RSS = None
TAG_FEED_RSS = None
TRANSLATION_FEED_RSS = None
TRANSLATION_FEED_ALL_RSS = None
TRANSLATION_AUTHOR_FEED_RSS = None
TRANSLATION_CATEGORY_FEED_RSS = None
TRANSLATION_TAG_FEED_RSS = None
DIRECT_TEMPLATES = ['sitemap']
SITEMAP_SAVE_AS = 'sitemap.xml'
# plugins
PLUGIN_PATHS = ['plugins']
PLUGINS = ['ovh_entities', 'ovh_filters', 'ovh_markdown']
MARKDOWN = {
'extensions': ['markdown.extensions.codehilite', 'markdown.extensions.extra'],
'extension_configs': {
'markdown.extensions.codehilite': {'css_class': 'highlight'},
'markdown.extensions.extra': {},
},
}
ZONES = {
'en-au': 'Australia',
'en-ca': 'Canada',
'fr-ca': 'Québec',
'cs-cz': 'Czech Republic',
'de-de': 'Germany',
'es-es': 'Spain',
'fi-fi': 'Finland',
'fr-fr': 'France',
'en-gb': 'United Kingdom',
'en-ie': 'Ireland',
'it-it': 'Italy',
'lt-lt': 'Lithuania',
'nl-nl': 'Netherlands',
'pl-pl': 'Poland',
'pt-pt': 'Portugal',
'fr-ma': 'Morocco',
'mx': 'WorldSpanish',
'fr-sn': 'Senegal',
'fr-tn': 'Tunisia',
'en-us': 'United States',
}
LANGS = {
'en-au': 'English (Australia)',
'en-ca': 'English (Canada)',
'fr-ca': 'Français (Canada)',
'cs-cz': 'Česky',
'de-de': 'Deutsch',
'es-es': 'Español',
'fi-fi': 'Suomen kieli',
'fr-fr': 'Français',
'en-gb': 'English (GB)',
'en-ie': 'English (Ireland)',
'it-it': 'Italiano',
'lt-lt': 'Lietuvių kalba',
'nl-nl': 'Nederlands',
'pl-pl': 'Polski',
'pt-pt': 'Português',
'en-us': 'English (US)',
}
ENTITY_TYPES = {
"Home": {
"PATHS": ["home.*.md"],
"PATH_METADATA": r"home\.(?P<lang>(?P<locale>\w{2})-(?P<global>\w{2,4}))\.md",
"SUBGENERATOR_CLASS": OvhEntityGenerator.OvhSubEntityGenerator,
"CHILDREN": ["Universe"],
"SKIP_SLUG": True,
"IS_ROOT": True,
},
"Universe": {
"PATHS": ["**/universe.*.md"],
"PATH_METADATA": r"(?P<slug>([^\/]+\/)*(?P<folder>[^\/]+))\/universe\.(?P<lang>(?P<locale>\w{2})-(?P<global>\w{2,4}))\.md",
"SUBGENERATOR_CLASS": OvhEntityGenerator.OvhSubEntityGenerator,
"CHILDREN": ["Universe", "Product"],
"EXCLUDE_SLUGS": ["Home"],
},
"Product": {
"PATHS": ["**/product.*.md"],
"PATH_METADATA": r"(?P<slug>([^\/]+\/)*(?P<folder>[^\/]+))\/product\.(?P<lang>(?P<locale>\w{2})-(?P<global>\w{2,4}))\.md",
"SUBGENERATOR_CLASS": OvhEntityGenerator.OvhSubEntityGenerator,
"CHILDREN": ["Guide"],
"EXCLUDE_SLUGS": ["Home", "Universe"],
},
"Guide": {
"PATHS": ["**/guide.*.md"],
"PATH_METADATA": r"(?P<slug>([^\/]+\/)*(?P<folder>[^\/]+))\/guide\.(?P<lang>(?P<locale>\w{2})-(?P<global>\w{2,4}))\.md",
"SUBGENERATOR_CLASS": OvhEntityGenerator.OvhSubEntityGenerator,
"CHILDREN": ["Guide"],
"EXCLUDE_SLUGS": ["Home", "Universe"],
"OVH_HOSTS": {
'cs-cz': 'https://www.ovh.cz',
'de-de': 'https://www.ovh.de',
'en-asia': 'https://www.ovh.com/asia',
'en-au': 'https://www.ovh.com.au',
'en-ca': 'https://www.ovh.com/ca/en',
'en-gb': 'https://www.ovh.co.uk',
'en-ie': 'https://www.ovh.ie',
'en-sg': 'https://www.ovh.com/sg',
'en-us': 'https://us.ovhcloud.com/',
'es-es': 'https://www.ovh.es',
'es-us': 'https://www.ovh.com/world/es',
'fi-fi': 'https://www.ovh-hosting.fi',
'fr-ca': 'https://www.ovh.com/ca/fr',
'fr-fr': 'https://www.ovh.com/fr',
'it-it': 'https://www.ovh.it',
'lt-lt': 'https://www.ovh.lt',
'nl-nl': 'https://www.ovh.nl',
'pl-pl': 'https://www.ovh.pl',
'pt-pt': 'https://www.ovh.pt',
'default': 'https://www.ovh.com/fr',
},
},
"NotFound": {
"PATHS": ["404.*.md"],
"PATH_METADATA": r"(?P<slug>404)\.(?P<lang>(?P<locale>\w{2})-(?P<global>\w{2,4}))\.md",
"SUBGENERATOR_CLASS": OvhEntityGenerator.OvhSubEntityGenerator,
"CHILDREN": [],
"IS_ROOT": True,
},
}