<input <% if (root.title) %>title="<%-root.title%>"<% } %>>
WORKPATH=$PWD/src
#minify
echo 'minify'
for f in $(ls $WORKPATH/template | grep .hbs)
do html-minifier $WORKPATH/template/$f -o $WORKPATH/template/$f.min \
--collapse-whitespace --remove-comments
done
for f in $(ls $WORKPATH/template.server | grep .hbs)
do html-minifier $WORKPATH/template.server/$f -o $WORKPATH/template.server/$f.min \
--collapse-whitespace --remove-comments
done
#tmpl
echo 'tmpl'
handlebars $WORKPATH/template -e hbs.min -f $WORKPATH/js.client/templates.js \
-c handlebars/runtime -n module.exports
handlebars $WORKPATH/template.server -e hbs.min -f $WORKPATH/js.server/templates.server.js \
-c handlebars/runtime -n module.exports
cp $WORKPATH/js.client/templates.js $WORKPATH/js.server/templates.client.js
#clean
echo 'clean'
rm $WORKPATH/template/*.hbs.min
rm $WORKPATH/template.server/*.hbs.min