Skip to content

Commit 12d79e0

Browse files
committed
Document --html-template in distribution.md.
1 parent 155c012 commit 12d79e0

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

site/docs/guides/distribution.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,37 @@ For saving disks, the localStorage key used will be based on the game title you
1414
Alternatively, you can specify a localStorage key prefix manually with `--html-disk-prefix <prefix>`.
1515
This is useful to prevent disk conflicts between games.
1616

17+
You can customize the generated HTML file by giving a [Mustache](https://mustache.github.io/) template file with option `--html-template <file>`.
18+
Example of a template file:
19+
```html
20+
<!doctype html>
21+
<html lang="en">
22+
<head>
23+
<meta charset="utf-8">
24+
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
25+
{{#html.metadata}}
26+
<meta name="{{name}}" content="{{content}}">
27+
{{/html.metadata}}
28+
{{#html.description}}
29+
<meta name="description" content="{{html.description}}">
30+
{{/html.description}}
31+
{{#html.iconUrl}}
32+
<link rel="shortcut icon" href="{{html.iconUrl}}">
33+
{{/html.iconUrl}}
34+
{{#html.diskPrefix}}
35+
<script id="wasm4-disk-prefix" type="text/plain">{{{html.diskPrefix}}}</script>
36+
{{/html.diskPrefix}}
37+
<title>{{html.title}}</title>
38+
<style>{{{html.wasm4Css}}}</style>
39+
</head>
40+
<body>
41+
<script id="wasm4-cart-json" type="application/json">{{{html.wasmCartJson}}}</script>
42+
<script>{{{html.wasm4js}}}</script>
43+
<wasm4-app></wasm4-app>
44+
</body>
45+
</html>
46+
```
47+
1748
## Bundle to Windows/Mac/Linux executable
1849

1950
Native executables for multiple platforms can also be bundled:

0 commit comments

Comments
 (0)