我需要分组一些集合,以便我可以密码保护该组。同时,我希望保持_posts集合处于打开状态,因此它需要保持在jekyll的根上。
例如,这是组secure
collection:
notes:
output: true
hybrid:
output: true
collections_dir: secure如何排除集合(如_posts )和在secure下分组的自定义集合
我能用permalinks来实现这一点吗?例如
collection:
notes:
output: true
permalink: /secure/:path/
hybrid:
output: true
permalink: /secure/:path/发布于 2019-04-29 20:30:33
回答我自己的问题。实际上,在这种情况下,permalinks选项是最好的。这样,_posts仍然是jekyll的根,其他不需要分组的集合也在正常运行。
构建站点后,所有分组集合都将在本地_site/secure/下,并将位于服务器上的http://example.com/secure/下。确保使用htpasswd设置http身份验证。网络上有很多关于如何做到这一点的材料。
https://stackoverflow.com/questions/55907607
复制相似问题