11ty 跨多个目录的分页/多分页
我使用 Eleventy/11ty 站点生成器,我有一个像这样结构的 myData 对象
[ {name: one, data: [1,2,3]},
{name: two, data: [1,2,3,4]} ]
,我想为每个对象生成一组分页目录,例如
/one/1.html, /one/2.html etc
/two/1.html, /two/2.html etc
我能够用来
pagination:
data: myData
size: 1
alias: test
permalink: "{{ test.name | slug }}/index.html"
生成单个 html 文件 (/one/index.html)。 html
),其中包含名为“one”的对象中的所有数据。 但是我不知道如何额外分页该数据以获得所需的结构。
Im using Eleventy/11ty site generator and I have a myData object structured like this
[ {name: one, data: [1,2,3]},
{name: two, data: [1,2,3,4]} ]
And I want to generate a set of paged directories of each, for example
/one/1.html, /one/2.html etc
/two/1.html, /two/2.html etc
Im able to use
pagination:
data: myData
size: 1
alias: test
permalink: "{{ test.name | slug }}/index.html"
to generate a single html file (/one/index.html
) with all the data from the object named "one".
However I cant figure out how to additionally page that data to get the desired structure.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该能够使用 计算数据 + JS front Matter 使其正常工作:
You should be able to use computed data + JS front matter to get this to work: