site: migrate to new docs format (#13120)

mirrors sveltejs/kit#12459
pull/13474/head
Ben McCann 4 months ago committed by GitHub
parent 42c217f08c
commit 89cacf72b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,3 @@
---
title: Getting Started
---

@ -1,3 +0,0 @@
{
"title": "Getting Started"
}

@ -0,0 +1,3 @@
---
title: Template Syntax
---

@ -1,3 +0,0 @@
{
"title": "Template Syntax"
}

@ -0,0 +1,3 @@
---
title: Runtime
---

@ -1,3 +0,0 @@
{
"title": "Runtime"
}

@ -0,0 +1,3 @@
---
title: Compiler and API
---

@ -1,3 +0,0 @@
{
"title": "Compiler and API"
}

@ -0,0 +1,3 @@
---
title: Misc
---

@ -1,3 +0,0 @@
{
"title": "Misc"
}

@ -0,0 +1,3 @@
---
title: Legacy
---

@ -1,3 +0,0 @@
{
"title": "Legacy"
}

@ -41,10 +41,10 @@ export async function get_docs_data(base = CONTENT_BASE_PATHS.DOCS) {
const category_slug = match[1]; const category_slug = match[1];
// Read the meta.json // Read the index.md
const { title: category_title, draft = 'false' } = JSON.parse( const { title: category_title, draft = 'false' } = extractFrontmatter(
await readFile(`${base}/${category_dir}/meta.json`, 'utf-8') await readFile(`${base}/${category_dir}/index.md`, 'utf-8')
); ).metadata;
if (draft === 'true') continue; if (draft === 'true') continue;
@ -56,7 +56,7 @@ export async function get_docs_data(base = CONTENT_BASE_PATHS.DOCS) {
}; };
for (const filename of await readdir(`${base}/${category_dir}`)) { for (const filename of await readdir(`${base}/${category_dir}`)) {
if (filename === 'meta.json') continue; if (filename === 'index.md') continue;
const match = /\d{2}-(.+)/.exec(filename); const match = /\d{2}-(.+)/.exec(filename);
if (!match) continue; if (!match) continue;

Loading…
Cancel
Save