【问题标题】:How can I create a directory for each category under _posts in Jekyll?如何在 Jekyll 的 _posts 下为每个类别创建一个目录?
【发布时间】:2014-10-31 14:18:39
【问题描述】:

我正在尝试在我的 Jekyll 网站中使用这样的结构:

_posts php 2014-10-31-this-is-a-test.md ruby 2014-12-01-some-other-test.md

我希望php 目录中的所有帖子都属于PHP 类别,并且ruby 中的所有帖子都属于Ruby 类别。这是我的_config.yml 文件:

defaults: - scope: path: "" type: "posts" values: layout: post comments: true share: true - scope: path: "_posts/php" type: "posts" values: category: PHP - scope: path: "_posts/ruby" type: "posts" values: category: Ruby

但是,这不起作用。有什么想法吗?

【问题讨论】:

    标签: jekyll github-pages


    【解决方案1】:

    path: "php" 或 path: "ruby" 设置类别。

    注意:any category set in the front matter will replace the one in default config.

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-06-17
      相关资源
      最近更新 更多