Keep previous "versions" of a page

I’m trying to hack together a theme, whereby I can keep access to previous “versions” of a given file.

Specifically, I’m hoping to have it where I can have multiple files in a given directory, each representing a version of that content. The default when someone navigates to that section would be to see the newest version, but then there’d be a list/dropdown menu/whatever with the previous version(s), and selecting one would navigate to that. My hope is that there’s some way to have the page.html template check for other files in the same directory and sort them by date, but I’m not clear on how I’d do that.

Related to this, does sorting by date (in general) require the date in the file name, or can Zola read file properties (e.g. last modified)?

1 Like