Replies: 1 comment
-
You could create an .11ty.js template and do something like this: // src/index.11ty.js
class IndexPage {
data() {
return {
layout: "home.liquid",
title: "Eleventy 11ty.js templates",
};
}
render(data) {
return `${data.title} -- ${data.layout} -- ${data.eleventy.version}`;
}
};
module.exports = IndexPage; And my src/_includes/home.liquid looks like this: <!DOCTYPE html>
<body>
<main>{{ content }}</main>
</body> OUTPUT<!DOCTYPE html>
<body>
<main>Eleventy 11ty.js templates -- home.liquid -- 2.0.1</main>
</body> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In my eleventy.config.cjs I have
And in my script.js I have
These variables expand just fine in my .liquid files, but not in my .js files. What else do I need to do?
Beta Was this translation helpful? Give feedback.
All reactions