【问题标题】:Editing Hugo-Academic theme in `blogdown` doesn't show updates made在“blogdown”中编辑 Hugo-Academic 主题不显示更新
【发布时间】:2018-12-04 14:35:15
【问题描述】:

我是第一次使用blogdown,并通过推荐的方法blogdown::new_site(theme = 'gcushen/hugo-academic')安装了Hugo-academic主题。

我已开始编辑config.toml,更新按预期呈现。在尝试编辑about.md 文件后,我所做的任何编辑似乎都没有出现。我删除了一些示例文件(例如 Selected Projects 等),但站点预览仍然显示它们。我遇到了感觉相关的 (Customize the "about" widget in hugo academic theme),在终端中执行 hugo -v 时(在同一项目的 RStudio 中),我收到以下我无法理解的错误:

ERROR 2018/06/25 19:50:10 Error while rendering "home" in "": template: index.html:1:3: executing "index.html" at <partial "widget_page...>: error calling partial: template: partials/widget_page.html:23:9: executing "partials/widget_page.html" at <partial $widget $par...>: error calling partial: template: partials/widgets/projects.html:66:84: executing "partials/widgets/projects.html" at <delimit.Params.tags...>: error calling delimit: can't iterate over <nil>

尝试理解:我是否删除了我不应该拥有的文件,或者没有更新 config.toml 中的某些内容,以至于它正在寻找我现在已经删除的文件?

我在 Mac 上,并使用 RStudio 版本 1.1.453,以防万一了解

【问题讨论】:

    标签: rstudio hugo blogdown


    【解决方案1】:

    我将不得不查看您在 config.toml 中所做的更改。 如果您在 config.toml 文件中向下滚动,您应该会找到[params.menus],因为第一个菜单是关于。它看起来像这样:

    [[menu.main]]  
      name = "About me"  
      url = "#about"  
      weight = 1  
    

    如果参数没问题,并且如果您编辑了 root&gt;content&gt;home 文件夹中的 about.md 文件,则应该没问题。

    【讨论】:

    • 我已经对config.toml 进行了广泛的编辑,以及相应的[params.menus] 进行自定义;最初的项目/表格现在看起来像:[[menu.main]] name = "Home" url = "#bio" weight = 1 - 在content/home 目录中还有一个名为 bio.md 的文件,它基本上是自定义的 About Me
    • 为了调试方便,何不恢复到原来的config.toml文件,使用编辑后的about.md文件。这应该有助于确定是您的新配置破坏了站点还是您编辑了 about.md 文件的事实。记得再次serve_site。
    • 我一直在这样做,并同意这可能是考虑到执行的编辑/自定义数量的最佳行动方案 -- 谢谢
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-05-06
    • 2020-08-16
    • 2018-02-11
    • 1970-01-01
    • 2019-05-03
    相关资源
    最近更新 更多