Justin Mayer f8828bf0e1 Fix formatting in always_modified ReadMe il y a 9 ans
..
README.md f8828bf0e1 Fix formatting in always_modified ReadMe il y a 9 ans
__init__.py f736f0a7e5 create always_modified plugin il y a 9 ans
always_modified.py f736f0a7e5 create always_modified plugin il y a 9 ans

README.md

Always Modified

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.

Usage

  1. Add ALWAYS_MODIFIED = True to your settings file.
  2. Now you can sort by modified date in your templates:

    {% for article in articles|sort(reverse=True,attribute='modified') %}