hugo server Failed to get JSON resource “https://api.twitter.com

作者

今天尝试了一下静态博客 hugo , hugo的官网本身也是使用 hugo 制作的网站。安装和运行非常简单。只有两个步骤安装运行

运行的时候出现了一个小问题,就是由于网络的原因不能启动成功。

粗暴的禁用网络连接相关的操作

就是两个 短代码 给删除了 instagram, tweet

find . -name "*.md" | xargs sed -i '/{{< instagram/cinstagram content'
find . -name "*.md" | xargs sed -i '/{{< tweet/ctwitter content'

hugo server --bind '0.0.0.0'

具体的错误信息

[root@  hugoDocs-0.78.2]$hugo server
Start building sites …
ERROR 2020/11/19 02:33:55 Failed to get JSON resource "https://api.twitter.com/1/statuses/oembed.json?id=898398437527363585&dnt=false": Get "https://api.twitter.com/1/statuses/oembed.json?id=898398437527363585&dnt=false": dial tcp 157.240.10.41:443: i/o timeout
ERROR 2020/11/19 02:33:55 Failed to get JSON resource "https://api.instagram.com/oembed/?url=https://instagram.com/p/BWNjjyYFxVx/&hidecaption=1": Get "https://api.instagram.com/oembed/?url=https://instagram.com/p/BWNjjyYFxVx/&hidecaption=1": dial tcp 157.240.1.50:443: i/o timeout
Built in 30395 ms
Error: Error building site: "/root/liuhaolin.com/hugoDocs-0.78.2/content/en/content-management/shortcodes.md:1:1": timed out initializing value. You may have a circular loop in a shortcode, or your site may have resources that take longer to build than the `timeout` limit in your Hugo config file.