Open skyfaller opened 4 years ago
We completely rewrote this task several different ways without getting it to work.
Here is the problem: we have a list of Hugo websites. When we change the theme, the config file, or both for a given website, we want to have Hugo re-generate the site, so that the website served to users reflects the updates.
We do not want to regenerate all Hugo sites always. We do not want to regenerate a Hugo site twice if both its theme AND its config file have changed. We only want to regenerate a Hugo site once, if its theme and/or config file have changed, and if neither have changed, we want to do nothing. That would be idempotent, which is what we want.
What we think we need to do is:
This seems actually really complicated and hard. There must be a simpler approach!
I rewrote this to run as a handler. The problem is that Hugo will run twice if both the theme and the config have changed. I cannot figure out how to make it only run once in that case.
We take this array of sites, run hugo.yml to create them, and call this handler to make Hugo regenerate them if (1) the theme has changed, and if (2) the config has changed.
This task fails. Once we get this working, we should be able to update any Hugo sites that have changed. Then we should be able to automate hosting Hugo sites :)
Typical error: