4 ms·
> Being able to do things like evaluate functions and iterate collections inline with HTML templates has allowed me to sidestep a lot of pain over the years. E
by vips7L 2y ago
> Being able to do things like evaluate functions and iterate collections inline with HTML templates has allowed me to sidestep a lot of pain over the years.
Every single templating engine supports this. It doesn't need to be built into the core language. Here's an example from JTE [0]:
@import org.example.Page
@param Page page
<head>
@if(page.getDescription() != null)
<meta name="description" content="${page.getDescription()}">
@endif
<title>${page.getTitle()}</title>
</head>
<body>
<h1>${page.getTitle()}</h1>
<p>Welcome to my example page!</p>
</body>
[0] https://jte.gg/#__tabbed_2_1 https://jte.gg/#__tabbed_2_1
- deleted 2y ago[deleted]