代码之家  ›  专栏  ›  技术社区  ›  JBecker

在blogdown中使用new_post有困难

  •  1
  • JBecker  · 技术社区  · 8 年前

    我刚刚把我现有的网站从雨果改成了博客。我所做的只是换了几个地方 {{ .Site.BaseURL }} blogdown::new_post() . 我认为这是因为我的主题不包含基于以下信息的任何原型。还有其他人遇到过这种麻烦吗?有什么解决办法吗?

    ERROR 2017/09/04 16:58:13 Error processing archetype file /Users/jason/code/hugo-site/themes/jsonbecker/archetypes/default.md: unable to cast <nil> of type <nil> to Time
    Error: unable to cast <nil> of type <nil> to Time
    Error in file(con, "r") : cannot open the connection
    In addition: Warning message:
    In file(con, "r") :
      cannot open file 'content/post/2017-09-04-switching-to-blogdown.md': No such file or directory
    

    我假设文件问题是一个转移注意力的问题,因为目录内容/帖子绝对存在于我所在的项目工作目录的相对路径中,第一步就是无法生成文件。

    https://github.com/jsonbecker/jsonbecker-hugo .

    1 回复  |  直到 4 年前
        1
  •  2
  •   Yihui Xie    8 年前

    你的原型模板 default.md 无效。

    ---
    title:
    author:
    date:
    ---
    

    看起来你只是想要一个空的原型,你可以删除这个

    ---
    title: ''
    author: ''
    date: ''
    ---