change default value for DEFAULT_DATE to None

(was 'fs' => guess from file mtime)
This commit is contained in:
Bruno Binet 2012-11-24 00:26:46 +01:00
commit fa82e19c1f
3 changed files with 2 additions and 3 deletions

View file

@ -43,7 +43,7 @@ Setting name (default value) What doe
`DISPLAY_PAGES_ON_MENU` (``True``) Whether to display pages on the menu of the `DISPLAY_PAGES_ON_MENU` (``True``) Whether to display pages on the menu of the
template. Templates may or not honor this template. Templates may or not honor this
setting. setting.
`DEFAULT_DATE` (``fs``) The default date you want to use. `DEFAULT_DATE` (``None``) The default date you want to use.
If 'fs', Pelican will use the file system If 'fs', Pelican will use the file system
timestamp information (mtime) if it can't get timestamp information (mtime) if it can't get
date information from the metadata. date information from the metadata.

View file

@ -331,7 +331,7 @@ class ArticlesGenerator(Generator):
if category != '': if category != '':
metadata['category'] = Category(category, self.settings) metadata['category'] = Category(category, self.settings)
if 'date' not in metadata and self.settings['DEFAULT_DATE']: if 'date' not in metadata and self.settings.get('DEFAULT_DATE'):
if self.settings['DEFAULT_DATE'] == 'fs': if self.settings['DEFAULT_DATE'] == 'fs':
metadata['date'] = datetime.datetime.fromtimestamp( metadata['date'] = datetime.datetime.fromtimestamp(
os.stat(f).st_ctime) os.stat(f).st_ctime)

View file

@ -36,7 +36,6 @@ _DEFAULT_CONFIG = {'PATH': '.',
'OUTPUT_SOURCES_EXTENSION': '.text', 'OUTPUT_SOURCES_EXTENSION': '.text',
'USE_FOLDER_AS_CATEGORY': True, 'USE_FOLDER_AS_CATEGORY': True,
'DEFAULT_CATEGORY': 'misc', 'DEFAULT_CATEGORY': 'misc',
'DEFAULT_DATE': 'fs',
'WITH_FUTURE_DATES': True, 'WITH_FUTURE_DATES': True,
'CSS_FILE': 'main.css', 'CSS_FILE': 'main.css',
'NEWEST_FIRST_ARCHIVES': True, 'NEWEST_FIRST_ARCHIVES': True,