如何设置 Jekyll collection 存档 URL?

How to set up Jekyll collection archive URL?

我使用 Jekyll 生成带有博客和自定义 collection 命名照片的网站。我的自定义 collection 项目具有以下 URL:0.0.0.0:4000/photos/photo-name.

collections:
  photos:
    output: true
    permalink: /photos/:path/

在 _site 目录中,它们生成为:

_site/
  photos/
    photo-name/
      index.html
    other-photo-name/
      index.html

现在我想像这样使用 URL 存档照片:0.0.0.0:4000/photos/。

那么有没有办法在_site/photos/目录下生成index.html呢?非常感谢!

如果你想为你的照片做一个索引页,只需创建一个photos.html页,在前面加上permalink : /photos/,它会生成一个_site/photos/index.html页。