Hsoy Templates – client- and server side templating

Introducing “Hsoy Templates”, a html templating library for modern web. The main goal was to make a templating library with easy to use syntax, that can be used on both server and client side. It have HAML syntax, and compiles into Java on server side and JavaScript on client side.

Actually it’s a version of Google Closure Templates (.soy templates) with HAML syntax.

Why you need this?

In modern web development it’s very common to update some parts of current page by data received from server, but the problem that it’s annoying to write and support same HTML view two times – for Client and for Server. Just breaks DRY principle.

Hsoy Templates gives you a way to write such templates just once, and use it on client-side, and on backend.


  • one template (a *.hsoy file)
  • HAML syntax (see http://haml.info/)
  • fast
    • compiled into Java (so can be used from Groovy, Scala, Clojure, etc)
    • compiled into Javascript (so can be used from Node.js)
  • based on Google Closure Templates library
  • commercial friendly (Apache 2.0 licence)
    • Example:

      Source template

      If you met HAML syntax first time, take a look at http://haml.info/tutorial.html

      and use it

      from JavaScript:

      from Java:

      As a result you’ll get

      Same HTML on server and client side, generated from same template file.

      See full documentation at http://splix.github.io/hsoy-templates/


      Currently the project consists of following parts:


      • test test test
      • support most Google Closure Templates features
      • JSP taglib
      • native OS listener for sources modification
      • a Gradle plugin
      Share this post: Tweet about this on TwitterShare on RedditShare on FacebookShare on LinkedInShare on TumblrShare on StumbleUponShare on Google+Email this to someone

Igor Artamonov

Professional software developer since 2001, have been writing code since 1995. Data processing for Cloud, Ethereum & Blockchain