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;
});
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
});
}

@ -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: {

Loading…
Cancel
Save