refactor erb templates

removed logic from liquid template and moved it to erb
this fixes yaml error due to linebreaks