1
0
Fork 0
forked from github/pelican
pelican-theme/pelican/settings.py

57 lines
2.3 KiB
Python
Raw Normal View History

# -*- coding: utf-8 -*-
import os
import locale
_DEFAULT_THEME = os.sep.join([os.path.dirname(os.path.abspath(__file__)),
Put the notmyidea theme by default. --HG-- rename : samples/themes/notmyidea/css/main.css => pelican/themes/notmyidea/css/main.css rename : samples/themes/notmyidea/css/pygment.css => pelican/themes/notmyidea/css/pygment.css rename : samples/themes/notmyidea/css/reset.css => pelican/themes/notmyidea/css/reset.css rename : samples/themes/notmyidea/images/icons/delicious.png => pelican/themes/notmyidea/images/icons/delicious.png rename : samples/themes/notmyidea/images/icons/lastfm.png => pelican/themes/notmyidea/images/icons/lastfm.png rename : samples/themes/notmyidea/images/icons/rss.png => pelican/themes/notmyidea/images/icons/rss.png rename : samples/themes/notmyidea/images/icons/twitter.png => pelican/themes/notmyidea/images/icons/twitter.png rename : samples/themes/notmyidea/templates/archives.html => pelican/themes/notmyidea/templates/archives.html rename : samples/themes/notmyidea/templates/article.html => pelican/themes/notmyidea/templates/article.html rename : samples/themes/notmyidea/templates/base.html => pelican/themes/notmyidea/templates/base.html rename : samples/themes/notmyidea/templates/categories.html => pelican/themes/notmyidea/templates/categories.html rename : samples/themes/notmyidea/templates/category.html => pelican/themes/notmyidea/templates/category.html rename : samples/themes/notmyidea/templates/index.html => pelican/themes/notmyidea/templates/index.html rename : samples/themes/notmyidea/templates/tag.html => pelican/themes/notmyidea/templates/tag.html rename : samples/themes/notmyidea/templates/tags.html => pelican/themes/notmyidea/templates/tags.html rename : pelican/themes/templates/archives.html => pelican/themes/simple/templates/archives.html rename : pelican/themes/templates/article.html => pelican/themes/simple/templates/article.html rename : pelican/themes/templates/base.html => pelican/themes/simple/templates/base.html rename : pelican/themes/templates/categories.html => pelican/themes/simple/templates/categories.html rename : pelican/themes/templates/category.html => pelican/themes/simple/templates/category.html rename : pelican/themes/templates/index.html => pelican/themes/simple/templates/index.html rename : pelican/themes/templates/tag.html => pelican/themes/simple/templates/tag.html rename : pelican/themes/templates/tags.html => pelican/themes/simple/templates/tags.html
2010-10-30 16:47:59 +01:00
"themes/notmyidea"])
_DEFAULT_CONFIG = {'PATH': None,
'THEME': _DEFAULT_THEME,
'OUTPUT_PATH': 'output/',
'MARKUP': ('rst', 'md'),
'STATIC_PATHS': ['images',],
2010-12-05 19:15:02 +00:00
'THEME_STATIC_PATHS': ['static',],
'FEED': 'feeds/all.atom.xml',
'CATEGORY_FEED': 'feeds/%s.atom.xml',
'TRANSLATION_FEED': 'feeds/all-%s.atom.xml',
'SITENAME': 'A Pelican Blog',
2010-11-05 02:05:00 +00:00
'DISPLAY_PAGES_ON_MENU': True,
'PDF_GENERATOR': False,
'DEFAULT_CATEGORY': 'misc',
2010-11-12 02:18:19 +00:00
'FALLBACK_ON_FS_DATE': True,
'CSS_FILE': 'main.css',
'REVERSE_ARCHIVE_ORDER': False,
'REVERSE_CATEGORY_ORDER': False,
'DELETE_OUTPUT_DIRECTORY': False,
'CLEAN_URLS': False, # use /blah/ instead /blah.html in urls
'RELATIVE_URLS': True,
'DEFAULT_LANG': 'en',
'TAG_CLOUD_STEPS': 4,
'TAG_CLOUD_MAX_ITEMS': 100,
'DIRECT_TEMPLATES': ('index', 'tags', 'categories', 'archives'),
'PAGINATED_DIRECT_TEMPLATES': ('index', ),
'PELICAN_CLASS': 'pelican.Pelican',
'DEFAULT_DATE_FORMAT': '%a %d %B %Y',
'DATE_FORMATS': {},
'JINJA_EXTENSIONS': [],
'LOCALE': '', # default to user locale
'WITH_PAGINATION': False,
'DEFAULT_PAGINATION': 5,
'DEFAULT_ORPHANS': 0,
'DEFAULT_METADATA': (),
'FILES_TO_COPY': (),
}
def read_settings(filename):
"""Load a Python file into a dictionary.
"""
context = _DEFAULT_CONFIG.copy()
if filename:
tempdict = {}
execfile(filename, tempdict)
for key in tempdict:
if key.isupper():
context[key] = tempdict[key]
# set the locale
locale.setlocale(locale.LC_ALL, context['LOCALE'])
return context