OOKB / behance-demo

Using Behance as a content management sysytem... basically templating and styling the JSON output from behance.net
The Unlicense
3 stars 3 forks source link

Should the mustache templates be in the HTML file where they'll be printed out? #2

Closed bjornmeansbear closed 7 years ago

bjornmeansbear commented 8 years ago

Or, do we include another JS file for each template?

webmasterkai commented 8 years ago

Regardless of template language it's always "better" to have a compile step. Almost all JS examples these days have a build step. Most of the time people babel is sufficient.

So I'd say keep your templates in unique files. Makes the option on have a build step easier. There are some tools for converting mustache files into plain javascript so you don't have to ship the mustache parser to the client. It's faster and takes less bandwidth doing it that way.

webmasterkai commented 8 years ago

Unless the audience isn't going to do more advanced JS, then keep it inline for ease of use.

bjornmeansbear commented 8 years ago

@webmasterkai you goof ball... Yeah, I was talking to some design students about this, who want to hopefully help flesh it out a little more for their peers that don't understand things, so we'll probably be keeping it inline, but this was going to be a question for them to answer 😛

bjornmeansbear commented 7 years ago

So, answer is yes, we'll leave them in HTML for now as it is the simplest scenario for understanding.