Skip to content

Commit 2c522f1

Browse files
author
Philipp Ehrenberg
committed
docs: Update README for passing data to partials
1 parent 4f67789 commit 2c522f1

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,16 @@ __index.html__
5555
<title>index.html</title>
5656
</head>
5757
<body>
58-
<include src="components/button.html"></include>
58+
<include src="components/button.html" data='{
59+
"text": "Button"
60+
}'></include>
5961
</body>
6062
</html>
6163
```
6264

6365
__components/button.html__
6466
```html
65-
<button class="button"><div class="button__text">Button</div></button>
67+
<button class="button"><div class="button__text">{{ text }}</div></button>
6668
```
6769

6870
```js
@@ -85,7 +87,7 @@ posthtml([ include({ encoding: 'utf8' }) ])
8587
</head>
8688
<body>
8789
<button class="button">
88-
<div class="button__text">Text</div>
90+
<div class="button__text">Button</div>
8991
</button>
9092
</body>
9193
</html>

0 commit comments

Comments
 (0)