Justin Mayer f8828bf0e1 Fix formatting in always_modified ReadMe | лет назад: 9 | |
---|---|---|
.. | ||
README.md | лет назад: 9 | |
__init__.py | лет назад: 9 | |
always_modified.py | лет назад: 9 |
Say you want to sort by modified date/time in a theme template, but not all your articles have modified date/timestamps explicitly defined in article metadata. This plugin facilitates that sorting by assuming the modified date (if undefined) is equal to the created date.
ALWAYS_MODIFIED = True
to your settings file.Now you can sort by modified date in your templates:
{% for article in articles|sort(reverse=True,attribute='modified') %}