1

我正在用 blogdown 和 Hugo 的学术主题构建我的网站,一切进展顺利。但是,当我从 content/posts 文件夹中删除示例帖子文件时,build_site () 中会出现错误。

例如,如果我删除 widgets.md 文件(示例帖子)并使用 build_site(),我会得到

blogdown::build_site()
Started building sites ...
Built site for language en:
0 draft content
0 future content
0 expired content
9 regular pages created
14 other pages created
0 non-page files copied
1 paginator pages created
0 tags created
0 categories created
1 publication_types created
ERROR 2017/08/22 10:21:49 error processing shortcode "_internal/shortcodes/ref.html" for page "post\getting-started.md": template: _internal/shortcodes/ref.html:1:73: executing "_internal/shortcodes/ref.html" at <ref .Page (.Get 0)>: error calling ref: No page found with path or logical name "post/widgets.md".

我是否忘记删除对已删除文件的一些引用?

4

2 回答 2

2

在您的示例帖子content/post/getting-started.md中,必须有一个 Hugo 短代码{{< ref "post/widgets.md" >}}。不明白就删掉。

该示例帖子来自 hugo-academic 主题,并且帖子中有更多简码。如果您删除了短代码引用的 Markdown 文件ref,您也应该删除短代码。

于 2017-08-22T18:15:20.530 回答
2

删除所有示例帖子后问题消失。

于 2017-08-23T12:24:50.933 回答