【问题标题】:Jekyll not finding blog postsJekyll 找不到博客文章
【发布时间】:2017-03-21 17:07:52
【问题描述】:

Source Code

我是 Jekyll 的新手,并通过 Grunt 和 SASS 安装了它。我的问题是,虽然我的测试站点将显示我的新帖子,但当我单击帖子链接时,我收到错误“无法获取 /blog/example-post-name”。

Grunt 在运行 Grunt Serve 时没有显示任何错误。但是,如果我运行 Jekyll serve 我会收到以下错误:

Build Warning: Layout 'article' requested in app/_posts/2015-01-31-optimized-jekyll-site-with-grunt.markdown does not exist.
Build Warning: Layout 'article' requested in app/_posts/2017-03-20-welcome-to-jekyll.markdown does not exist.
Liquid Exception: Could not locate the included file 'blog.html' in any of ["/Users/rich/jekyll-site/_includes"]. Ensure it exists in one of those directories and, if it is a symlink, does not point outside your site source. in app/index.html
jekyll 3.4.2 | Error:  Could not locate the included file 'blog.html' in any of ["/Users/rich/jekyll-site/_includes"]. Ensure it exists in one of those directories and, if it is a symlink, does not point outside your site source.

它似乎在我的 _includes、_layouts 等文件夹中找不到任何内容。

任何帮助将不胜感激。

【问题讨论】:

  • _config.yml 应与_includes 等处于同一级别
  • 当我将任何内容移出 app 文件夹并将其放在与配置文件相同的目录中时,它会使 jekyll serve 工作。虽然那时grunt serve 出错了。

标签: jekyll


【解决方案1】:

由于您的模板文件位于app/ 目录中,只需将app 构建为source 目录即可。

将以下内容添加到您的_config.yml

source: app

然后像往常一样运行jekyll serve

【讨论】:

    【解决方案2】:

    尝试在 _includes 文件夹中添加 blog.html 文件或在您的帖子中使用 layout: default 2015-01-31-optimized-jekyll-site-with-grunt.markdown 等。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-29
      • 1970-01-01
      • 2022-12-25
      • 1970-01-01
      • 2015-12-01
      相关资源
      最近更新 更多