How to make data available on all partials #83
Unanswered
newbieexplorer212
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Solved using: Since this template engine is from squirrelly, i found the solution from: https://squirrelly.js.org/docs/syntax/partials-layouts#file-partials |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, thank you for this amazing template engine.
My data is stored in json file
eta.renderFile(file, JSON.parse(fs.readFileSync('src/eta/data.json')))
How to make data available on all partials, so I don't have to pass data every time I
includeFile
I can not and do not want to run the script below:
<%~ includeFile('include/_sidebar', JSON.parse(fs.readFileSync('src/eta/data.json'))) %>
Beta Was this translation helpful? Give feedback.
All reactions