Skip to content

Commit dffda49

Browse files
committed
fix ordering of faq entries
1 parent 40a36c1 commit dffda49

File tree

2 files changed

+45
-47
lines changed

2 files changed

+45
-47
lines changed

src/transform/docs.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -309,17 +309,15 @@ export async function transform_faq(
309309
});
310310
})
311311
)
312-
)
313-
.map((doc, i) => {
314-
return {
315-
title: doc.data.section_title,
316-
slug: doc.data.section_slug,
317-
file: blogs[i].name,
318-
content: doc.contents.toString(),
319-
order: orders[i],
320-
};
321-
})
322-
.sort((a, b) => (a.order < b.order ? 1 : -1));
312+
).map((doc, i) => {
313+
return {
314+
title: doc.data.section_title,
315+
slug: doc.data.section_slug,
316+
file: blogs[i].name,
317+
content: doc.contents.toString(),
318+
order: orders[i],
319+
};
320+
});
323321

324322
return {
325323
list: final_faq.map((d) => {

src/transform/fixtures/faq.ts

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,20 @@ export const faq_in = [
2828

2929
export const faq_out_full = [
3030
{
31-
title: "How do I document my components?",
32-
slug: "how-do-i-document-my-components",
33-
file: "450-how-do-i-document-my-components.md",
31+
title: "I'm new to Svelte. Where should I start?",
32+
slug: "im-new-to-svelte",
33+
file: "100-im-new-to-svelte.md",
3434
content:
35-
"<p>In editors which use the Svelte Language Server you can document Components, functions and exports using specially formatted comments.</p>\n<div class=\"code-block\"><pre class='language-undefined'><code>&lt;script&gt;\n\t/** What should we call the user? */\n\texport let name = 'world';\n&lt;/script&gt;\n\n&lt;!--\n@component\nHere's some documentation for this component.\nIt will show up on hover.\n\n- You can use markdown here.\n- You can also use code blocks here.\n- Usage:\n ```tsx\n &lt;main name=\"Arethra\"&gt;\n ```\n--&gt;\n&lt;main&gt;\n\t&lt;h1&gt;\n\t\tHello, {name}\n\t&lt;/h1&gt;\n&lt;/main&gt;</code></pre></div>\n<p>Note: The <code>@component</code> is necessary in the HTML comment which describes your component.</p>",
36-
order: 450,
35+
'<p>We think the best way to get started is playing through the interactive <a href="tutorial" rel="noopener noreferrer">Tutorial</a>. Each step there is mainly focused on one specific aspect and is easy to follow. You\'ll be editing and running real Svelte components right in your browser.</p>\n<p>Five to ten minutes should be enough to get you up and running. An hour and a half should get you through the entire tutorial.</p>',
36+
order: 100,
3737
},
3838
{
39-
title: "How can I get VS Code to syntax-highlight my .svelte files?",
40-
slug: "how-can-i-get-syntax-highlighting",
41-
file: "400-how-can-i-get-syntax-highlighting.md",
39+
title: "Are there any video courses?",
40+
slug: "are-there-any-video-courses",
41+
file: "200-are-there-any-video-courses.md",
4242
content:
43-
'<p>There is an <a href="https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode" target="_blank" rel="noopener noreferrer">official VS Code extension for Svelte</a>.</p>',
44-
order: 400,
43+
'<p>Rich Harris, the creator of Svelte, taught a course:</p>\n<ul>\n<li><a href="https://frontendmasters.com/courses/svelte/" target="_blank" rel="noopener noreferrer">Frontend Masters</a></li>\n</ul>\n<p>There are also a number of third-party courses:</p>\n<ul>\n<li><a href="https://egghead.io/browse/frameworks/svelte" target="_blank" rel="noopener noreferrer">Egghead</a></li>\n<li><a href="https://www.udemy.com/courses/search/?q=sveltejs+svelte" target="_blank" rel="noopener noreferrer">Udemy</a></li>\n</ul>\n<p>Note that Udemy very frequently has discounts over 90%.</p>',
44+
order: 200,
4545
},
4646
{
4747
title: "Are there any books?",
@@ -52,35 +52,35 @@ export const faq_out_full = [
5252
order: 250,
5353
},
5454
{
55-
title: "Are there any video courses?",
56-
slug: "are-there-any-video-courses",
57-
file: "200-are-there-any-video-courses.md",
55+
title: "How can I get VS Code to syntax-highlight my .svelte files?",
56+
slug: "how-can-i-get-syntax-highlighting",
57+
file: "400-how-can-i-get-syntax-highlighting.md",
5858
content:
59-
'<p>Rich Harris, the creator of Svelte, taught a course:</p>\n<ul>\n<li><a href="https://frontendmasters.com/courses/svelte/" target="_blank" rel="noopener noreferrer">Frontend Masters</a></li>\n</ul>\n<p>There are also a number of third-party courses:</p>\n<ul>\n<li><a href="https://egghead.io/browse/frameworks/svelte" target="_blank" rel="noopener noreferrer">Egghead</a></li>\n<li><a href="https://www.udemy.com/courses/search/?q=sveltejs+svelte" target="_blank" rel="noopener noreferrer">Udemy</a></li>\n</ul>\n<p>Note that Udemy very frequently has discounts over 90%.</p>',
60-
order: 200,
59+
'<p>There is an <a href="https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode" target="_blank" rel="noopener noreferrer">official VS Code extension for Svelte</a>.</p>',
60+
order: 400,
6161
},
6262
{
63-
title: "I'm new to Svelte. Where should I start?",
64-
slug: "im-new-to-svelte",
65-
file: "100-im-new-to-svelte.md",
63+
title: "How do I document my components?",
64+
slug: "how-do-i-document-my-components",
65+
file: "450-how-do-i-document-my-components.md",
6666
content:
67-
'<p>We think the best way to get started is playing through the interactive <a href="tutorial" rel="noopener noreferrer">Tutorial</a>. Each step there is mainly focused on one specific aspect and is easy to follow. You\'ll be editing and running real Svelte components right in your browser.</p>\n<p>Five to ten minutes should be enough to get you up and running. An hour and a half should get you through the entire tutorial.</p>',
68-
order: 100,
67+
"<p>In editors which use the Svelte Language Server you can document Components, functions and exports using specially formatted comments.</p>\n<div class=\"code-block\"><pre class='language-undefined'><code>&lt;script&gt;\n\t/** What should we call the user? */\n\texport let name = 'world';\n&lt;/script&gt;\n\n&lt;!--\n@component\nHere's some documentation for this component.\nIt will show up on hover.\n\n- You can use markdown here.\n- You can also use code blocks here.\n- Usage:\n ```tsx\n &lt;main name=\"Arethra\"&gt;\n ```\n--&gt;\n&lt;main&gt;\n\t&lt;h1&gt;\n\t\tHello, {name}\n\t&lt;/h1&gt;\n&lt;/main&gt;</code></pre></div>\n<p>Note: The <code>@component</code> is necessary in the HTML comment which describes your component.</p>",
68+
order: 450,
6969
},
7070
];
7171

7272
export const faq_out_list = [
7373
{
74-
title: "How do I document my components?",
75-
slug: "how-do-i-document-my-components",
76-
file: "450-how-do-i-document-my-components.md",
77-
order: 450,
74+
title: "I'm new to Svelte. Where should I start?",
75+
slug: "im-new-to-svelte",
76+
file: "100-im-new-to-svelte.md",
77+
order: 100,
7878
},
7979
{
80-
title: "How can I get VS Code to syntax-highlight my .svelte files?",
81-
slug: "how-can-i-get-syntax-highlighting",
82-
file: "400-how-can-i-get-syntax-highlighting.md",
83-
order: 400,
80+
title: "Are there any video courses?",
81+
slug: "are-there-any-video-courses",
82+
file: "200-are-there-any-video-courses.md",
83+
order: 200,
8484
},
8585
{
8686
title: "Are there any books?",
@@ -89,15 +89,15 @@ export const faq_out_list = [
8989
order: 250,
9090
},
9191
{
92-
title: "Are there any video courses?",
93-
slug: "are-there-any-video-courses",
94-
file: "200-are-there-any-video-courses.md",
95-
order: 200,
92+
title: "How can I get VS Code to syntax-highlight my .svelte files?",
93+
slug: "how-can-i-get-syntax-highlighting",
94+
file: "400-how-can-i-get-syntax-highlighting.md",
95+
order: 400,
9696
},
9797
{
98-
title: "I'm new to Svelte. Where should I start?",
99-
slug: "im-new-to-svelte",
100-
file: "100-im-new-to-svelte.md",
101-
order: 100,
98+
title: "How do I document my components?",
99+
slug: "how-do-i-document-my-components",
100+
file: "450-how-do-i-document-my-components.md",
101+
order: 450,
102102
},
103103
];

0 commit comments

Comments
 (0)