Skip to content

JavaScript template docs don’t discuss exporting a data object and render function directly #1824

@darthmall

Description

@darthmall

I can’t find anywhere in the documentation for JavaScript templates information about exporting a data object and a render function, like this:

export const data = {
  // ...
};

export function render () {
  // ...
}

I only discovered that it was possible to construct JavaScript templates this way when looking at the pagination docs, where the 11ty.js and 11ty.cjs examples show how you can export these directly without wrapping them in a class.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions