Is there any flag for offline rendering?

Hello,

I’m using tweet and instagram shortcode in my post. But when I render on offline, it will be error like this:

Is there any flag to prevent HTTP request to the web services?

You can check the value of .Site.BaseURL, and then not call the twitter, Instagram stuff if the value is "localhost".

Also there’s an open feature request:

But even without that request getting implemented, it’s pretty easy to check for the BaseURL value.


Related: How I prevent Disqus from showing up on Hugo server

1 Like

Thank you, it worked :+1:

Update: The solution is not working on Hugo 0.41

I can’t run hugo server at offline because the tweet and instagram shortcode need to hit web service.

We don’t know what changed, you haven’t shared any code. Please see Requesting Help and rephrase your question.