forked from hyphanet/website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pelicanconf.py
84 lines (66 loc) · 1.88 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
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
import os
import os.path
AUTHOR = u'Freenet Project Inc.'
SITENAME = u'Freenet Project'
SITEURL = os.environ['SITEURL']
BASE_URL = os.environ['SITEURL']
THEME = 'theme'
PATH = 'content'
TIMEZONE = 'US/Pacific'
DEFAULT_LANG = u'en'
# 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
# Blogroll
LINKS = set()
# Social widget
SOCIAL = set()
DEFAULT_PAGINATION = 10
PLUGIN_PATHS = ['pelican-plugins']
PLUGINS = ["assets", "i18n_subsites", "optimize_images"]
JINJA_ENVIRONMENT = {
'extensions' : ["jinja2.ext.i18n"],
}
ASSET_SOURCE_PATHS = ['static']
I18N_SUBSITES = {}
def subsite(language):
I18N_SUBSITES[language] = {
'MARKDOWN' : {
'extensions': ["markdown.extensions.def_list", "markdown.extensions.toc", "markdown_i18n", "markdown.extensions.extra", ],
'extension_configs': {
'markdown_i18n': {
'i18n_dir': 'locales',
'i18n_lang': language,
},
},
},
}
for language in os.listdir("locales"):
if os.path.exists(os.path.join("locales", language, "LC_MESSAGES", "messages.mo")):
subsite(language)
I18N_GETTEXT_LOCALEDIR = 'locales'
I18N_GETTEXT_DOMAIN = 'messages'
I18N_TEMPLATES_LANG = 'en'
MARKDOWN = {
'extensions': ["markdown.extensions.def_list", "markdown.extensions.toc", "markdown_i18n", "markdown.extensions.extra", ],
'extension_configs': {
'markdown_i18n': {
'i18n_dir': 'locales',
},
},
}
STATIC_PATHS = [
'assets',
'extra/robots.txt',
'extra/favicon.ico'
]
EXTRA_PATH_METADATA = {
'extra/robots.txt': {'path': 'robots.txt'},
'extra/favicon.ico': {'path': 'favicon.ico'}
}