From f11ee9e7f57632afc255c9e034248601fe67de5b Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Sun, 10 Mar 2019 13:43:58 -0400 Subject: [PATCH] more tidying up --- site/src/routes/api/examples/[slug].js | 7 +------ site/src/routes/gist/create.js | 6 +----- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/site/src/routes/api/examples/[slug].js b/site/src/routes/api/examples/[slug].js index 03bf723766..d6bdf5b3a5 100644 --- a/site/src/routes/api/examples/[slug].js +++ b/site/src/routes/api/examples/[slug].js @@ -39,14 +39,9 @@ function createExample(slug) { return a.name < b.name ? -1 : 1; }); - const json5 = fs.existsSync(`content/examples/${slug}/data.json5`) - ? fs.readFileSync(`content/examples/${slug}/data.json5`, 'utf-8') - : '{}'; - return JSON.stringify({ title: titles.get(slug), - components, - json5 + components }); } diff --git a/site/src/routes/gist/create.js b/site/src/routes/gist/create.js index 601f21d466..1f55a51498 100644 --- a/site/src/routes/gist/create.js +++ b/site/src/routes/gist/create.js @@ -13,7 +13,7 @@ export async function post(req, res) { } try { - const { name, components, json5 } = await body(req); + const { name, components } = await body(req); const files = { 'meta.json': { @@ -33,10 +33,6 @@ export async function post(req, res) { files[file] = { content: component.source }; }); - if (json5) { - files['data.json5'] = { content: json5 }; - } - const r = await fetch(`https://api.github.com/gists`, { method: 'POST', headers: {