1
0
Fork 0
forked from github/pelican

Support ordering pages and articles when iterating in templates.

Order can be set to a metadata attribute or a sorting function.
Default to order by slug for articles and order by filename for pages.
This commit is contained in:
David Marble 2013-11-14 12:29:01 -08:00 committed by Mark Lee
commit 0c69f4ad84
4 changed files with 43 additions and 3 deletions

View file

@ -57,10 +57,12 @@ DEFAULT_CONFIG = {
'OUTPUT_RETENTION': (),
'ARTICLE_URL': '{slug}.html',
'ARTICLE_SAVE_AS': '{slug}.html',
'ARTICLE_ORDER_BY': 'slug',
'ARTICLE_LANG_URL': '{slug}-{lang}.html',
'ARTICLE_LANG_SAVE_AS': '{slug}-{lang}.html',
'PAGE_URL': 'pages/{slug}.html',
'PAGE_SAVE_AS': os.path.join('pages', '{slug}.html'),
'PAGE_ORDER_BY': 'filename',
'PAGE_LANG_URL': 'pages/{slug}-{lang}.html',
'PAGE_LANG_SAVE_AS': os.path.join('pages', '{slug}-{lang}.html'),
'STATIC_URL': '{path}',