How To Schedule Post Using A Static Site And Netlify

One of the things I wanted when doing this blog was the ability to write post and have them published in the future. I also wanted a static site for the ease of maintaining and not worry about keeping the site up to date.

You will need to be using a static site generator that will only create the article on the a set publish date. I’m using Hugo for this site and it has a publishDate in the meta data on the article. If set Hugo will only create the article if its past that date.

Netlify has build hooks which you can call to trigger a rebuild.

Follow these steps to set it up

  1. After logging into Netlify, start by clicking deploys Deploy

  2. Then click deploy settings
    Deploy Settings

  3. Then scroll down to Build Hooks and click add build hook
    Build Hooks

  4. Enter the name of the hook (doesn’t matter this is for you) Name Hook

  5. After hitting save copy the URL. This is the URL you will use to trigger the rebuild. Url

  6. Now we need to trigger it somehow. I am using ifttt go to create

  7. Click this and choose date & time

  8. Click Every Day then choose your time
    date

  9. Click create trigger, and then click that.

  10. Search for webhooks and click it
    webhooks

  11. Paste your build hook url from netlify in the url field
    webhooks

  12. Select POST Method, content type doesn’t matter and empty body.

  13. Click Create Action and then finish This should trigger everyday at the time specified.

Now you need to add publishDate or whatever metadata your static generator requires to postpone creating the article till the specified date.