mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
List files missing tag needed to order content
This commit is contained in:
parent
45c884cba5
commit
497271ea7e
1 changed files with 13 additions and 3 deletions
|
|
@ -763,9 +763,19 @@ def order_content(content_list, order_by='slug'):
|
|||
content_list.sort(key=attrgetter(order_by),
|
||||
reverse=order_reversed)
|
||||
except AttributeError:
|
||||
logger.warning(
|
||||
'There is no "%s" attribute in the item '
|
||||
'metadata. Defaulting to slug order.', order_by)
|
||||
for content in content_list:
|
||||
try:
|
||||
getattr(content, order_by)
|
||||
except AttributeError:
|
||||
logger.warning(
|
||||
'There is no "%s" attribute in "%s". '
|
||||
'Defaulting to slug order.',
|
||||
order_by,
|
||||
content.get_relative_source_path(),
|
||||
extra={
|
||||
'limit_msg': ('More files are missing '
|
||||
'the needed attribute.')
|
||||
})
|
||||
else:
|
||||
logger.warning(
|
||||
'Invalid *_ORDER_BY setting (%s).'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue