eta icon indicating copy to clipboard operation
eta copied to clipboard

Passing HTML to templates?

Open Tikolu opened this issue 3 months ago • 2 comments

Is there a way to pass HTML data to a template?

For example;

<!-- main.eta-->
<%~ include("template.html", {content: () => { %>
	<h1>Content</h1>
<% }}) %>
<!-- template.eta-->
<div id="template">
	<%~ it.content() %>
</div>

Alternatively, is there a way to temporarily render to a variable instead of the output?

(related issue #245)

Tikolu avatar Oct 02 '25 21:10 Tikolu

this is the only thing missing to elevate this library into a serious contender for NodeJS SSR

damusix avatar Oct 03 '25 19:10 damusix

Couldn't agree more! I've been using Eta over the past few months and it's amazing. This is the only thing that it's missing in my opinion

Tikolu avatar Oct 03 '25 19:10 Tikolu