DEV Community

Discussion on: I built a JS template engine 3x faster than EJS

Collapse
 
vandisefano profile image
vandisefano

Cool, I was wondering if it was possible to generate static files with Eta (pre-build).

I have a project where users can create posts with a wysiwyg editor.
What I want to achieve is try to take that post, inject it into a predefined Eta template and export a static (HTML) page from it (with header, footer, sidebar...). Then I would host that page on a CDN for quick access.

Since the content will never change there is no need to compile the HTML at runtime.
I was wondering if something like that would be possible with Eta?

User creates post -> server compiles it to a static HTML file from pre-define Eta templates -> server uploads to CDN -> user can access page from CDN

Would this be suited for my needs? Thanks!

Collapse
 
nebrelbug profile image
Ben Gubler

It sure would! One of the best use cases for Eta is generating static content. Right now, for example, Docusaurus uses Eta to generate static HTML for SSR builds.