Skip to content

Commit

Permalink
Moar website details
Browse files Browse the repository at this point in the history
  • Loading branch information
surma committed Oct 1, 2019
1 parent f345b7d commit 7e44809
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
9 changes: 9 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

curl -L https://github.com/WebAssembly/wabt/releases/download/1.0.12/wabt-1.0.12-linux.tar.gz | tar -xz -C /opt -f -

export PATH=$(echo /opt/wabt-*)/:$PATH

cd /usr/src
npm i
npm run build:website
7 changes: 3 additions & 4 deletions genwebsite.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@ const md = require("markdown-it")();
const ejs = require("ejs");
const fsp = require("fs").promises;


async function init() {
const readmeSrc = await fsp.readFile("./README.md", "utf8");
const readme = md.render(readmeSrc);

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

const template = await fsp.readFile("./website.ejs", "utf8");
const output = ejs.render(template, {readme});
await fsp.mkdir("website").catch(e => {});
const output = ejs.render(template, { readme });
await fsp.writeFile("./website/index.html", output);
}

init();
init();
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"build:readme": "node --experimental-modules ./render-readme.mjs",
"build": "npm run build:library && npm run build:readme && npm run fmt",
"build:website": "npm run build && node genwebsite.js",
"build:website:docker": "docker run -ti --rm -v `pwd`:/usr/src node:12 ./build.sh",
"fmt": "prettier --write ./{,{src,rollup-plugins}/**/}*.{mjs,js,md}"
},
"repository": "GoogleChromeLabs/wasm-feature-detect",
Expand Down
8 changes: 7 additions & 1 deletion website.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
--tint: 30;
--contrast: 70;
--saturation: 10%;
--padding: 4em;
}
html {
background: hsl(
Expand All @@ -24,9 +25,14 @@
body {
max-width: 960px;
margin: 0 auto;
padding: 0 4em;
padding: 4em;
box-sizing: border-box;
}
pre, table {
margin: 0 -4em;
padding: 0 4em;
overflow-x: auto;
}
section {
margin: 4em 0;
}
Expand Down

0 comments on commit 7e44809

Please sign in to comment.