zola icon indicating copy to clipboard operation
zola copied to clipboard

Feature request: build datetime

Open nab-os opened this issue 8 months ago • 4 comments

Hi,

I would like to access the current date while building the static site. It would be helpful to have an information about how old the last build is on a website. Would it be possible to integrate this feature ?

Or maybe it is already available and I did not find it, don't hesitate to correct me if I'm wrong.

Have a nice day

nab-os avatar Dec 17 '23 16:12 nab-os

We don't currently give a build time or git sha (https://zola.discourse.group/t/using-git-revision-as-cache-key/1971). We could probably add both eventually, but likely something to do when it's using tera v2 and we have global contexts.

Keats avatar Dec 17 '23 20:12 Keats

Ok I got it https://keats.github.io/tera/docs/#now

nab-os avatar Dec 18 '23 05:12 nab-os

This will be evaluated at each render so you might end up with different timestamp for different pages

Keats avatar Dec 18 '23 07:12 Keats

Ho yeah, you're right :-/

nab-os avatar Dec 19 '23 07:12 nab-os