Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
Mike Henriquez
i have an array with 10 articles, i want to display them but in the middle of the list i want to display a 300x250 ad
5 articles, Ad, 5 more articles
Justin Hileman
@mikehenriquezf Is it always 5 / ad / 5?
split your articles list in half (in code, before it goes to the template). Then do {{# first_set }}{{> article }}{{/ first_set }} {{> ad }} {{# second_set }}{{ > article }}{{/ second_set }}
Jakob Damgaard Møller
Can i get this output with mustachejs: https://dpaste.de/itfU ?
Justin Hileman
You'll need to prepare your data first.
Jakob Damgaard Møller
So Mustache cant do the "ifchanged" thing?
Justin Hileman
nope, because that’s logic, and mustache doesn’t logic ;)
Jakob Damgaard Møller
Frank Pinto
hello all!
Trying to get rails to use mustache as the templating engine when it generates scaffolds, etc., anybody know how?
google gave me a couple leads but if anybody here's done it before, I'd appreciate the help :)
Ricardo Mendes
hey @frankpinto, I'm not sure you can?
Richard Doe
Is there any way to use Rails fragment caching with Mustache?
Leonardo "Alemax" Fonseca Ferreira
hello guys, i`m trying to render a template like this:
```<div id="{{renderwithmustach}}" ng-click="{{letangularrender}}" > ````
how to not render the angular tag?
just the mustach one?
Justin Hileman
@leualemax mustache lets you change delimiters to one that doesn't conflict:
{{=<% %>=}}
<div id="<% renderwithmustache %>" ng-click="{{ letangularrender }}">
John Arnold
Does anyone know why trying to render a variable that contains a url, it hides the "http:" part and only shows "//restoftheurl.com"? even when using triple braces to cancel escaping? ie {{{myUrl}}}
Ricardo Mendes
@Surreal9 that's the first I've heard of
Does anybody know if a npm package exists that let's me pass a partial, views (and data) directory to it and in turn outputs html to a given directory?
Ricardo Mendes
@Siilwyn I don't think so
I suggest a bash script to feed the necessary files to the mustache binary
@locks :smile: never expected an answer
hmm that doesn't sound ideal since I'm using npm scripts. Would that be a long bash script?
John Arnold
@locks I think it's an express view engine thing.. I noticed switching from Mustache I still saw the same behaviour with another engine
@locks I wrote a npm package to do it: https://npmjs.com/mustache-prestatic
Hi guys, i have a big Problem. Input : {{{text}}} expected output {text}. i need to have braces around my {{text}} template. how to do this?
Justin Hileman
{{=<% %>=}}{<% text %>}<%={{ }}=%>
@Frodi2_twitter ^
Andrew Sharp
given a list of integers [1, 2, 3] and an operator +, could i use mustache to produce 1 + 2 + 3? something like {{#list}}{{integer}}+{{/list}}?
Curious if the ruby lib is still maintained. I'd love to get a review for mustache/mustache#240
Hugo Peixoto
@drewish_twitter the fix looks good to me, I commented on the issue
I'm using gulp-mustache. I want to render each page with a specific data like a JSON file for example. How can i do this task?
Now my task is like that :
gulp.task('partials:assemble', () => {
  return gulp.src(`${PATHS.SRC}/*.html`)


Hi guys! I try to practice Mustache js template engine. Here is my codepen project


I do not know why I did the exact same code with the tutorial site. But nothing shows up. Anyone can help me?

TeeKen Lau
is that way to perform addition for mustache attribute before rendering in ruby?
Martin Skou
whats the rules for newlines and removel of newline chars in templates? cannot find it described in the specs.
sandeep s
I need help in mustache template
I am using this in aws elasticserach service for alerting
any one here??????????????????