Skip to content

Commit 7e44809

Browse files
committed
Moar website details
1 parent f345b7d commit 7e44809

File tree

4 files changed

+20
-5
lines changed

4 files changed

+20
-5
lines changed

build.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
curl -L https://github.com/WebAssembly/wabt/releases/download/1.0.12/wabt-1.0.12-linux.tar.gz | tar -xz -C /opt -f -
4+
5+
export PATH=$(echo /opt/wabt-*)/:$PATH
6+
7+
cd /usr/src
8+
npm i
9+
npm run build:website

genwebsite.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@ const md = require("markdown-it")();
22
const ejs = require("ejs");
33
const fsp = require("fs").promises;
44

5-
65
async function init() {
76
const readmeSrc = await fsp.readFile("./README.md", "utf8");
87
const readme = md.render(readmeSrc);
98

9+
await fsp.mkdir("website").catch(e => {});
1010
await fsp.copyFile("./dist/esm/index.js", "./website/wasm-feature-detect.js");
1111

1212
const template = await fsp.readFile("./website.ejs", "utf8");
13-
const output = ejs.render(template, {readme});
14-
await fsp.mkdir("website").catch(e => {});
13+
const output = ejs.render(template, { readme });
1514
await fsp.writeFile("./website/index.html", output);
1615
}
1716

18-
init();
17+
init();

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"build:readme": "node --experimental-modules ./render-readme.mjs",
1010
"build": "npm run build:library && npm run build:readme && npm run fmt",
1111
"build:website": "npm run build && node genwebsite.js",
12+
"build:website:docker": "docker run -ti --rm -v `pwd`:/usr/src node:12 ./build.sh",
1213
"fmt": "prettier --write ./{,{src,rollup-plugins}/**/}*.{mjs,js,md}"
1314
},
1415
"repository": "GoogleChromeLabs/wasm-feature-detect",

website.ejs

+7-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
--tint: 30;
1111
--contrast: 70;
1212
--saturation: 10%;
13+
--padding: 4em;
1314
}
1415
html {
1516
background: hsl(
@@ -24,9 +25,14 @@
2425
body {
2526
max-width: 960px;
2627
margin: 0 auto;
27-
padding: 0 4em;
28+
padding: 4em;
2829
box-sizing: border-box;
2930
}
31+
pre, table {
32+
margin: 0 -4em;
33+
padding: 0 4em;
34+
overflow-x: auto;
35+
}
3036
section {
3137
margin: 4em 0;
3238
}

0 commit comments

Comments
 (0)