CSS templater + Scaml options

27 views
Skip to first unread message

Mathew de Detrich

unread,
May 23, 2012, 1:05:27 AM5/23/12
to scalatra-user
I have 2 questions regarding scalatra

Is there a CSS templater (similar to scaml) which allows basic CSS
templating. I basically need to implement dynamic renaming for static
files (due to using the never-expires header on static files for
faster web reloading) and for this I obviously need to dynamically
change the references to image/font files in the CSS

Also is there a way to alter how the scalatra templateEngine outputs
the HTML. Right now there default output is pretty printed HTML,
however I would obviously want to compact this (remove whitespace etc
etc)

Thanks

Ivan Porto Carerro

unread,
May 23, 2012, 3:00:42 AM5/23/12
to scalat...@googlegroups.com
Hi

You can use ssp files for those css files or some other template
engine like stringtemplate. the render call in scalatra returns a
string so you can manipulate the result if you want to.

To minify the html you can use something like jTidy or htmlcompressor
to post process that string.

http://code.google.com/p/htmlcompressor/#Using_HTML_Compressor_from_Java_API
Reply all
Reply to author
Forward
0 new messages