dependabot[bot] on npm_and_yarn
chore(deps): bump node-fetch fr… (compare)
shadowtime2000 on npm_and_yarn
shadowtime2000 on master
chore(deps): bump jsdom from 16… Merge pull request #174 from et… (compare)
dependabot[bot] on npm_and_yarn
chore(deps): bump jsdom from 16… (compare)
shadowtime2000 on master
README.ms: Fix rawgit links Merge pull request #170 from To… (compare)
i18n-express
translation block not being available: Error: {} translate is not defined
handlebars
it will just silently resolve to empty (which is preferred) whereas ETA will throw an error. Is it possible to configure ETA to continue on error?
Hi, I'm trying to write a plugin for eta for cachebusting but I'm struggling a bit.
Here is my code:
const regex = /^\s*@cachebust\s*\(\s*["'`]([^"'`]*)["'`],?([^]*)\)$/gu
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function processAST(buffer: Array<string | { t: string; val: string }>, _: unknown): Array<string | { t: string; val: string }> {
buffer.forEach(currItem => {
if (typeof currItem === 'string') return
if (regex.test(currItem.val)) {
const firstHalf = currItem.val?.split('@cachebust(')[1]?.trim() as string
currItem.val = firstHalf?.slice(0, firstHalf.lastIndexOf(')')).replace(/'/gu, ``) + Date.now()
}
})
return buffer
}
export default { processAST }
Then in my index.eta I have :
<link rel="stylesheet" href="<% @cachebust( '/css/index.css') %>" />
But I get an error message of css is not defined
.
I'm just trying to append something to the string in the html.
What does eta mean by TypeScript support out of the box is it in the .eta templates? For example can we do this:
<% const student: Student = new Student();%>
<% student.name = "Nerd" %>;
<p> This students name is: <%- student.name %></p>
And more over will there be syntax highlighting and type-completion / inference.
Can I include a file with "includeFile" inside a .eta file but also pass a value to the next eta that is being included?
For example index.eta has <head><%~ includeFile("style.eta") %></head>
but the style.eta file has a string passed. Something like <head><%~ includeFile("style.eta", {path: newPath}) %></head>
and inside the style.eta <link rel='stylesheet' href='<%~ it.path%>css/style.css'>
In other words how do I pass a value to the next eta file from within a eta file?