Javascript templating using trimpath example