【问题标题】:Deleting example posts causing errors in build_site()删除导致 build_site() 错误的示例帖子
【发布时间】:2017-08-22 13:39:44
【问题描述】:

我正在用 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".

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

【问题讨论】:

标签: r blogdown


【解决方案1】:

在您的示例帖子 content/post/getting-started.md 中,必须有一个 Hugo 短代码 {{&lt; ref "post/widgets.md" &gt;}}。看不懂就删。

那个示例帖子是from the hugo-academic theme,帖子中有更多简码。如果您删除了 ref 短代码引用的 Markdown 文件,您也应该删除这些短代码。

【讨论】:

  • 感谢您的提示和博客!但是,我仍然无法删除文件。我的帖子示例是widgets.md,我识别的唯一简码是{{% Alert note%}} By default, publications will be... {{% / Alert%}} 我无法识别简码{{% alert note%}} 引用了哪个文件!
  • 我不是这个特定主题的专家,但我真的不建议您在弄清楚它们的作用之前删除文件。
  • 谢谢一辉,我会继续分析这个问题。
  • 删除所有示例帖子后问题消失,感谢您的关注。 Tyler Clavelle 建议这样做。
【解决方案2】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-04-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-11-26
    • 2016-03-02
    • 1970-01-01
    相关资源
    最近更新 更多