sshort code 嵌入某些网站时超时

用hugo的shortcodes来嵌入如推特等网站时会超时

用了 shortcodes 嵌入推特界面的时候超时了。
是因为获取了 id 之后他要去访问推特原链接获取推特官方给出的嵌入代码才能做嵌入,但国内网络问题无法访问推特所以超时了。

报错

1
2
3
Start building sites … hugo v0.115.3-5c2e014a5150553a9fa4f9c1eb7dc4db89c0f1ab+extended linux/amd64 

BuildDate=2023-07-13T16:11:34Z VendorInfo=snap:0.115.3 ERROR Failed to get JSON resource "https://vimeo.com/api/oembed.json?url=https://vimeo.com/48912912": Get "https://vimeo.com/api/oembed.json?url=https://vimeo.com/48912912": dial tcp 157.240.8.41:443: i/o timeout Total in 30176 ms

推特官方的嵌入代码

1
<blockquote class="twitter-tweet"><p lang="en" dir="ltr">“In addition to being more logical, asymmetry has the advantage that its complete appearance is far more optically effective than symmetry.”<br>— Jan Tschichold <a href="https://t.co/gcv7SrhvJb">pic.twitter.com/gcv7SrhvJb</a></p>&mdash; Graphic Design History (@DesignReviewed) <a href="https://twitter.com/DesignReviewed/status/1085870671291310081?ref_src=twsrc%5Etfw">January 17, 2019</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

实际嵌入效果

Licensed under CC BY-NC-SA 4.0
Sow nothing, reap nothing.
Built with Hugo 主题 StackJimmy 设计