mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Added some more notes about how this is working on the documentation. I do think that the overall structure is clearer now, and easiest to understand. After all, that's how it should always be ! --HG-- rename : pelican/processors.py => pelican/generators.py rename : pelican/generators.py => pelican/writers.py
31 lines
1.1 KiB
Python
31 lines
1.1 KiB
Python
import os
|
|
|
|
_DEFAULT_THEME = os.sep.join([os.path.dirname(os.path.abspath(__file__)),
|
|
"themes/notmyidea"])
|
|
_DEFAULT_CONFIG = {'PATH': None,
|
|
'THEME': _DEFAULT_THEME,
|
|
'OUTPUT_PATH': 'output/',
|
|
'MARKUP': ('rst', 'md'),
|
|
'STATIC_PATHS': ['images',],
|
|
'THEME_PATHS': ['static',],
|
|
'FEED': 'feeds/all.atom.xml',
|
|
'CATEGORY_FEED': 'feeds/%s.atom.xml',
|
|
'SITENAME': 'A Pelican Blog',
|
|
'DISPLAY_PAGES_ON_MENU': True,
|
|
'PDF_GENERATOR': False,
|
|
'DEFAULT_CATEGORY': 'misc',
|
|
'FALLBACK_ON_FS_DATE': True,
|
|
'CSS_FILE': 'main.css',
|
|
}
|
|
|
|
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]
|
|
return context
|