Skip to content

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

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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