I plan on outputting a file named /_rebuild
to the root of my project.
It is a plain text file that will simply contain the date of the next future article. My server will read this date and schedule a job to automatically rebuild the site in the future for automatic publishing. The logic looks like this:
{{ range first 1 (where .Data.Pages.ByDate ".Date.Unix" ">" .Now.Unix ) }}
{{ .Date }}
{{ end }}
This logic works OK in a layout template (say layouts/index.html
). However I need to know how to generate a file named /_rebuild
with this logic alone. Where would I add such a file?