Skip to content

Commit

Permalink
fix mustache example
Browse files Browse the repository at this point in the history
  • Loading branch information
barakplasma authored Sep 1, 2024
1 parent 3b34c6d commit 95cac4c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/client-side-templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ a [`<template>` tag](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/t
<meta name="viewport" content="width=device-width">
<meta name="htmx-config" content='{"selfRequestsOnly":false}'>
<title>JS Bin</title>
<script src="https://unpkg.com/htmx.org"></script>
<script src="https://unpkg.com/htmx.org@2.0.0"></script>
<script src="https://unpkg.com/htmx-ext-client-side-templates@2.0.0/client-side-templates.js"></script>
<script src="https://unpkg.com/mustache@latest"></script>
</head>
Expand All @@ -79,14 +79,13 @@ a [`<template>` tag](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/t
<p id="content">Start</p>

<template id="foo">
<p> {% raw %}{{userID}}{% endraw %} and {% raw %}{{id}}{% endraw %} and {% raw %}{{title}}{% endraw %} and {% raw %}{{completed}}{% endraw %}</p>
<p> {{userID}} and {{id}} and {{title}} and {{completed}}</p>
</template>
</div>
</body>
</html>
```

Here is a [jsbin](https://jsbin.com/qonutovico/edit?html,output) playground to try this out.
[demo (external link)](https://barakplasma.github.io/htmx-weather/mustache)

Here's a working example using the `mustache-array-template` working against an API that returns an array:
```html
Expand Down Expand Up @@ -121,6 +120,7 @@ Here's a working example using the `mustache-array-template` working against an
</body>
</html>
```
[demo (external link)](https://barakplasma.github.io/htmx-weather/mustache-array)

### Full XSLT HTML Example

Expand Down

0 comments on commit 95cac4c

Please sign in to comment.