more tidying up

pull/2199/head
Richard Harris 6 years ago
parent 26e783b078
commit e27028e780

@ -39,14 +39,9 @@ function createExample(slug) {
return a.name < b.name ? -1 : 1; 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({ return JSON.stringify({
title: titles.get(slug), title: titles.get(slug),
components, components
json5
}); });
} }

@ -13,7 +13,7 @@ export async function post(req, res) {
} }
try { try {
const { name, components, json5 } = await body(req); const { name, components } = await body(req);
const files = { const files = {
'meta.json': { 'meta.json': {
@ -33,10 +33,6 @@ export async function post(req, res) {
files[file] = { content: component.source }; files[file] = { content: component.source };
}); });
if (json5) {
files['data.json5'] = { content: json5 };
}
const r = await fetch(`https://api.github.com/gists`, { const r = await fetch(`https://api.github.com/gists`, {
method: 'POST', method: 'POST',
headers: { headers: {

Loading…
Cancel
Save