在单个子目录中生成所有帖子

Generate all posts in a single subdirectory

我有一个带有一些静态文件的 jekyll 博客,我的博客索引在 /blog 生成,而所有帖子都在 / 生成。我怎样才能使帖子在 /blog 子目录中生成?

请注意,我不希望将整个 Jekyll 安装移动到子目录,因为我仍然希望我的站点地图、静态页面等位于根目录。

我不确定要提供什么代码,但我正在使用 this 主题以及 gulp 4 和其他升级包。

_config.yml 中的 permalink

更改
permalink: /:title/

permalink: /blog/:title/

您可以在 Jekyll documentation 中阅读有关永久链接的更多信息。