Offline mode for resources.GetRemote

I’m occasionally in a situation where I’d like to work on one of my websites while I don’t have internet access. However, if the site is using resources.GetRemote, the build fails because it can’t access the resource.

This of course makes sense, but would there be any way to tell it “Just do your best, I know some content won’t be present, just skip over it?” That way I could work on the other parts of the website that aren’t using remote resources.

I tried using with but it seems that hugo is still making the attempt to find the resource and erroring.

Caching could be an option I suppose. But that puts you in the situation of having to make sure you spin up the server so stuff gets cached while you still have internet access, and if you forget to do that, you’d be out of luck.

Any ideas?

Have you tested this construct?

1 Like

Let’s say I have the result cached from a previous run, but the maxAge has already passed. If I warn instead of error when unable to reach the destination, will the expired cache still be available?

I’m slightly confused by the question, but I’m pretty sure the answer is “no”.