When you are coding with Google Apps Script you don’t always have to hard code all of your data into every page. There is a decent templating engine available for you to use.
This is a demonstration of how to use those templates to make your scripts more dynamic.