Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

78
Visualizações
11ty pagation across multiple directories / multiple pagation

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.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You should be able to use computed data + JS front matter to get this to work:

~~~js
{
  pagination: {
    data: "flattenedData",
    size: 1,
    alias: "test",
  },
  permalink: "{{ test.name | slugify }}/{{ test.data }}",
  eleventyComputed: {
    flattenedData: ({ myData }) => 
      myData.flatMap(({ name, data }) =>
        data.map(d => ({ name, data: d }))
      )
  }
}
~~~
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda