Skip to content
Discussion options

You must be logged in to vote

Yes, you have to create a page in javascript or typescript exporting a generator. You have an example with pagination here: https://lumeland.github.io/creating-pages/pagination/

Basically, every value returned by a generator will be converted to a page. The 11ty example would be something like this:

// possum-pages.tmpl.js

export default function *({possums}) {
    for (const possum of possums) {
        yield {
            url: `possums/${possum.name}/`,
            content: `${possum.name} is ${possum.age} years old`
        }
    }
}

Replies: 5 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by oscarotero
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@oscarotero
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #38 on February 17, 2021 21:43.