Skip to content

Instantly share code, notes, and snippets.

@MyklClason
Last active September 25, 2019 23:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MyklClason/95066a962eac4c6e2fd730de3ed2edfb to your computer and use it in GitHub Desktop.
Save MyklClason/95066a962eac4c6e2fd730de3ed2edfb to your computer and use it in GitHub Desktop.
Handlebars/Mustache helpers
/* global $, HandlebarsTemplates */
// For use with https://github.com/leshill/handlebars_assets
function renderTemplate(template, context) {
return HandlebarsTemplates[template](context)
}
function renderTemplateAt(query, template, context) {
return (
$(query).html(
renderTemplate(template, context)
)
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment