Looking for a Simple CLI Tool for HTML Templating

May 17, 2025 4 answers
Asked by bus fare exact
I'm searching for an easy command-line tool that allows me to include other HTML files into a main HTML document. The goal is to generate a single HTML file that I can host on a server. I've found a lot of solutions that involve setting up Node or similar environments, but I really prefer something more straightforward. I'm tempted to script a solution myself, but if there's a ready-made tool out there, I'd love to know about it!

Answers

!checkO2
I'd recommend trying out 11ty! It uses Node.js but is pretty simple to work with. They have a quick tutorial that shows how to set up a site in just a few minutes. Just make sure you're okay with doing the setup beforehand, not on the server.
Reply to this answer
team+captain
Many current tools are built in JavaScript and need a Node/Bun/Deno setup. However, you might want to check out Hugo. It's a static site generator in Go that comes as a prebuilt binary with a CLI. It's a bit more complex than you need, but it's a solid option! If you're still leaning toward scripting your own tool, that could work too.
Reply to this answer
clk.48m
If you're open to using Node, EJS could be a good choice for templating. Otherwise, for a plug-and-play option, you might be looking at rolling your own solution, as I can't think of an easy alternative.
Reply to this answer
+31 seconds elapsed
Hey, have you thought about using PHP hosting with server-side includes? It's a classic method that can simplify the process for you!
Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions