`;
-function page({ slug, title, description, body }) {
+// JSON for a `;
+
+function page({ slug, title, description, body, head = '' }) {
const url = slug ? `${SITE}${slug}/` : SITE;
const set = (s, re, value) => {
if (!re.test(s)) throw new Error(`index.html: ${re} not found`);
@@ -39,6 +42,7 @@ function page({ slug, title, description, body }) {
s = set(s, //, ``);
s = set(s, //, ``);
s = set(s, //, ``);
+ if (head) s = set(s, /<\/head>/, `${head}\n`);
if (slug) s = set(s, /
/, ``);
s = set(s, /<\/main>/, `${body}`);
const file = path.join(out, slug, 'index.html');
@@ -56,6 +60,19 @@ urls.push(
description: 'Learn to read Rust and make small changes to it, using the Python you already know. Side-by-side examples, quizzes and runnable exercises.',
body: `
Learn to read Rust using the Python you already know