Closed ardianta closed 7 years ago
I think it would better if that short code available for offline build.
Not sure what you suggest. We do cache the result once it is retrieved, but it is a remote service, so it is not possible to make it entirely offline.
I'm a Chinese developer and got the same issue.
That's not the "same issue". You got a timeout there. Start looking into cache.
I use this https://github.com/gohugoio/hugoBasicExample to develop the theme, and the shortcodes are Twiter Vimeo ... But China has banned visits to Twitter, so I got the error. I tried setting "timeout" to 30s and setting the proxy but not work.
Hi @nanxiaobei, I solved this problem by creating new shotcodes for twitter and instagram.
This is my shortcode for Twitter: layouts/shortcodes/twitter.html
{{ if not .Site.IsServer }}
{{ template "_internal/shortcodes/twitter.html" . }}
{{ else }}
<!-- Render the placeholder for the shortcode -->
<pre>Twitter embed: {{ .Get 0 }}</pre>
{{ end }}
and this for Instagram: layouts/shortcodes/instagram.html
{{ if not .Site.IsServer }}
{{ template "_internal/shortcodes/instagram.html" . }}
{{ else }}
<!-- Render the placeholder for the shortcode -->
<pre>Instagram Photo: {{ .Get 0 }}</pre>
{{ end }}
So, whenever you run the local server, the build-in shortcodes will not be used.
@ardianta Thanks a lot, I'll try it!
hi @ardianta i'm trying your solution by creating those files (twitter.html and instagram.html) still come out with the same error
i even create those files in to two folders
could you please have additional advice on this?
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
This error produced because I use build-in short codes and run the server at offline and low speed internet connection.
I use Hugo 0.26.
Its take long time to build and run the server. Because the Instagram and tweet short code trying to getJSON from API first.
I think it would better if that short code available for offline build.