How to generate a file without file extension?

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?

Aha, a recent commit allows for a Netlify _redirects file, this is the right approach for me. Will implement shortly and update.


1 Like