Skip to content

Commit 144fb75

Browse files
authored
chore(site): refactor meta.json to index.md (#12459)
1 parent dd8b69f commit 144fb75

File tree

15 files changed

+34
-29
lines changed

15 files changed

+34
-29
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
title: Getting started
3+
---

documentation/docs/10-getting-started/meta.json

-3
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
title: Core concepts
3+
---

documentation/docs/20-core-concepts/meta.json

-3
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
title: Build and deploy
3+
---

documentation/docs/25-build-and-deploy/meta.json

-3
This file was deleted.
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
title: Advanced
3+
---

documentation/docs/30-advanced/meta.json

-3
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
title: Best practices
3+
---

documentation/docs/40-best-practices/meta.json

-3
This file was deleted.
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
title: Reference
3+
---

documentation/docs/50-reference/meta.json

-3
This file was deleted.
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
title: Appendix
3+
---

documentation/docs/60-appendix/meta.json

-3
This file was deleted.

sites/kit.svelte.dev/src/lib/server/docs/index.js

+13-8
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,30 @@ import { render_content } from '../renderer';
1212
import { read } from '$app/server';
1313
import { error } from '@sveltejs/kit';
1414

15-
const meta = import.meta.glob('../../../../../../documentation/docs/*/meta.json', {
15+
const meta = import.meta.glob('../../../../../../documentation/docs/*/index.md', {
1616
query: '?url',
1717
import: 'default',
1818
eager: true
1919
});
2020

21-
const markdown = import.meta.glob('../../../../../../documentation/docs/*/*.md', {
22-
query: '?url',
23-
import: 'default',
24-
eager: true
25-
});
21+
const markdown = import.meta.glob(
22+
'../../../../../../documentation/docs/*/[[:digit:]][[:digit:]]-*.md',
23+
{
24+
query: '?url',
25+
import: 'default',
26+
eager: true
27+
}
28+
);
2629

2730
export const categories = {};
2831
export const pages = {};
2932

3033
for (const [file, asset] of Object.entries(meta)) {
31-
const slug = /\/\d{2}-(.+)\/meta\.json$/.exec(file)[1];
34+
const slug = /\/\d{2}-(.+)\/index\.md$/.exec(file)[1];
3235

33-
const { title, draft } = await read(asset).json();
36+
const {
37+
metadata: { title, draft }
38+
} = extractFrontmatter(await read(asset).text());
3439

3540
if (draft) continue;
3641

0 commit comments

Comments
 (0)