Questions tagged [amp-mustache]

amp-mustache is the AMP implementation of mustache, a logic-less template syntax.

27 questions
4
votes
1 answer

Error trying to implement amp-mustache

I am trying to replicate this example with no success. I want to add a list using a mustache template, like this:
Alejandro Alcalde
  • 5,990
  • 6
  • 39
  • 79
2
votes
0 answers

AMP: mustache template loop variable in amp-list?

I'm using amp-list together with amp-mustache templates to display a list of blog articles on my AMP page, like this example:
steventh
  • 21
  • 1
2
votes
1 answer

Getting the index when iterating with amp-mustache

How do you get the index of the current element for a given iteration when using amp-mustache? I would expect it to look something like this: {{#thing}}

Thing #{{index}}

\{{/thing}} but that doesn't seem to work... Is this even…
Taylor Caldwell
  • 381
  • 2
  • 7
2
votes
1 answer

AMP: How to handle complex conditional logic in AMP?

We want to insert some conditional dynamic content on our AMP pages. We are using mustache to add the dynamic content. Mustache is logic less (with support for basic if else) i.e. mentioned here. They have also suggested to use Handlebar JS for such…
Sahil Sharma
  • 3,847
  • 6
  • 48
  • 98
2
votes
2 answers

Amp-List with Flex CSS and Amp-Mustache does not work

I'm totally at a loss as to how to apply the flex css to amp-list. I'd like all child items to be evenly spaced in the horizontal with spaces between the items. When I remove float:left; from the child item, all I get is a column, not rows. It seems…
I am Alta
  • 41
  • 7
2
votes
0 answers

amp-mustache template, how can i use it without JSON source external file?

Can i just define some json inside my AMP (accelerated mobile pages) page and use it as amp-mustache source? Something like this: