Haste is a simple command-line tool that brings templating and variables to HTML through the use of simple, ease-to-learn, syntax.
Simply expand the download links above or visit the Codeberg releases page and download the correct release for your platform: haste.exe
for windows, haste-osx
for MacOS or haste-linux
for linux platforms. Rename this to haste
if on linux or MacOS.
Once downloaded, move this file into your haste build directory. Open a command/terminal window in the same folder and you can run haste like so:
./haste
By default haste will recursively look for any *.haste.html
files in
your currently working directory and build them to a ./dist
folder.
You can run haste in watch mode. This will auto-build haste files on change
and also serves the files on an auto-reloading webserver. To run in watch mode
simply -w
option
./haste -w
Haste uses custom HTML tags for it's templating system. These define the path of the HTML file to be included. If haste parsed the HTML tag <t:parts.hello/>
it will look for a parts/hello.html
file, Relative to the root build directory. For Example:
index.haste.html
<div>
<t:parts.hello-world/>
</div>
parts/hello-world.html
<p>Hello World!</p>
dist/index.html
<div>
<p>Hello World!</p>
</div>
Within haste you have variables which are used with curly braces. The value of the variable hello
could be printed by placing {{hello}}
in your HTML file. Variables can be defined at the top of your HTML in the format @hello=Well hello there
. For Example:
index.haste.html
@greeting=Hello there fellow Human!
<p>{{greeting}}</p>
dist/index.html
<p>Hello there fellow Human!</p>