forked from github/pelican
Addressed comments from @avaris in PR getpelican/pelican#1348
This commit is contained in:
parent
e86f4d6250
commit
b572cbeef1
2 changed files with 7 additions and 2 deletions
|
|
@ -473,7 +473,12 @@ def process_translations(content_list, order_by=None):
|
|||
elif order_by == 'basename':
|
||||
index.sort(key=lambda x: os.path.basename(x.source_path or ''))
|
||||
elif order_by != 'slug':
|
||||
index.sort(key=attrgetter(order_by))
|
||||
try:
|
||||
index.sort(key=attrgetter(order_by))
|
||||
except AttributeError:
|
||||
error_msg = ('There is no "{}" attribute in the item metadata.'
|
||||
'Defaulting to slug order.')
|
||||
logger.warning(error_msg.format(order_by))
|
||||
|
||||
return index, translations
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue