I found a dirty trick, so I still hope that somebody will answer this question in a more nicer way than I did.
The point is to use the pelicanconf.py
file to set up an environment variable to get the required date. I just added the following to pelicanconf.py
:
import os.path, time
INDEX_DATE = time.ctime(os.path.getmtime(path/to/the/index.html))
Once you get the INDEX_DATE
variable set, you can use it in your Jinja2 templates like this:
{{ INDEX_DATE }}
So, this is a quick and dirty trick. Hopefully, somebody will give me a better way !