From 579b36b085f6cbfa2fcd73294345b0bb40ab408e Mon Sep 17 00:00:00 2001 From: liyunze <50455574+liyunze-coding@users.noreply.github.com> Date: Sat, 1 Jun 2024 15:26:04 +0800 Subject: [PATCH] added tutorials section --- .gitignore | 3 +- src/components/blocks/TableOfContent.astro | 2 +- src/components/blocks/verticalNav.astro | 73 +++++++++++------- src/components/ui/BlurBackground.astro | 8 +- src/components/ui/card-hover-effect.tsx | 2 +- src/layouts/BlogsLayout.astro | 11 ++- src/layouts/GuideLayout.astro | 13 ++-- src/layouts/Layout.astro | 24 +++++- .../_images/introduction/ellyskey.webp | Bin 0 -> 14898 bytes .../_images/introduction/petition.webp | Bin 0 -> 17788 bytes .../_images/introduction/rythondev.webp | Bin 0 -> 13358 bytes .../_images/introduction/seiji.webp | Bin 0 -> 14660 bytes .../{introduction.md => introduction.mdx} | 46 +++++------ src/pages/get-started/pre-requisites.md | 7 +- src/pages/guide/_images/bots/mohcitrus.webp | Bin 0 -> 5868 bytes ...NounProject_brandmark_horizontal_black.png | Bin 0 -> 10818 bytes src/pages/guide/_images/layouts/canva.webp | Bin 0 -> 15958 bytes src/pages/guide/_images/layouts/figma.webp | Bin 0 -> 92596 bytes src/pages/guide/_images/layouts/pexels.webp | Bin 0 -> 84567 bytes .../guide/_images/music-and-audio/6klabs.webp | Bin 0 -> 3052 bytes .../music-and-audio/audio_settings.webp | Bin 0 -> 12488 bytes .../_images/music-and-audio/pixelchat.webp | Bin 0 -> 2260 bytes .../guide/_images/widgets/mayuko-pomo.webp | Bin 0 -> 2460 bytes .../_images/widgets/moh-minimal-timer.webp | Bin 0 -> 1534 bytes .../guide/_images/widgets/multitask.webp | Bin 0 -> 7306 bytes .../guide/_images/widgets/pomofocus.webp | Bin 0 -> 3624 bytes .../guide/_images/widgets/rythontaskbot.webp | Bin 0 -> 4968 bytes .../guide/_images/widgets/supersweetbot.webp | Bin 0 -> 3622 bytes src/pages/guide/general-tips.md | 32 ++++---- ...music-and-audio.md => music-and-audio.mdx} | 12 ++- src/pages/guide/stream-bots.md | 3 +- .../{stream-layout.md => stream-layouts.mdx} | 30 ++++++- .../{stream-widgets.md => stream-widgets.mdx} | 41 +++++++--- src/pages/tutorials/Ad-manager.mdx | 31 ++++++++ src/pages/tutorials/OBS.mdx | 42 ++++++++++ src/pages/tutorials/Simulcast.mdx | 14 ++++ .../ad-manager/Docks-to-Custom-Docks.webp | Bin 0 -> 10756 bytes .../obs/study-with-me-youtube-live.webp | Bin 0 -> 18762 bytes .../tutorials/_images/sery-bot/sery_bot.webp | Bin 0 -> 37842 bytes src/pages/tutorials/closed-captions.md | 16 ++++ src/pages/tutorials/sery-bot.mdx | 28 +++++++ tailwind.config.cjs | 24 ++++-- 42 files changed, 352 insertions(+), 110 deletions(-) create mode 100644 src/pages/get-started/_images/introduction/ellyskey.webp create mode 100644 src/pages/get-started/_images/introduction/petition.webp create mode 100644 src/pages/get-started/_images/introduction/rythondev.webp create mode 100644 src/pages/get-started/_images/introduction/seiji.webp rename src/pages/get-started/{introduction.md => introduction.mdx} (84%) create mode 100644 src/pages/guide/_images/bots/mohcitrus.webp create mode 100644 src/pages/guide/_images/layouts/NounProject_brandmark_horizontal_black.png create mode 100644 src/pages/guide/_images/layouts/canva.webp create mode 100644 src/pages/guide/_images/layouts/figma.webp create mode 100644 src/pages/guide/_images/layouts/pexels.webp create mode 100644 src/pages/guide/_images/music-and-audio/6klabs.webp create mode 100644 src/pages/guide/_images/music-and-audio/audio_settings.webp create mode 100644 src/pages/guide/_images/music-and-audio/pixelchat.webp create mode 100644 src/pages/guide/_images/widgets/mayuko-pomo.webp create mode 100644 src/pages/guide/_images/widgets/moh-minimal-timer.webp create mode 100644 src/pages/guide/_images/widgets/multitask.webp create mode 100644 src/pages/guide/_images/widgets/pomofocus.webp create mode 100644 src/pages/guide/_images/widgets/rythontaskbot.webp create mode 100644 src/pages/guide/_images/widgets/supersweetbot.webp rename src/pages/guide/{music-and-audio.md => music-and-audio.mdx} (93%) rename src/pages/guide/{stream-layout.md => stream-layouts.mdx} (68%) rename src/pages/guide/{stream-widgets.md => stream-widgets.mdx} (61%) create mode 100644 src/pages/tutorials/Ad-manager.mdx create mode 100644 src/pages/tutorials/OBS.mdx create mode 100644 src/pages/tutorials/Simulcast.mdx create mode 100644 src/pages/tutorials/_images/ad-manager/Docks-to-Custom-Docks.webp create mode 100644 src/pages/tutorials/_images/obs/study-with-me-youtube-live.webp create mode 100644 src/pages/tutorials/_images/sery-bot/sery_bot.webp create mode 100644 src/pages/tutorials/closed-captions.md create mode 100644 src/pages/tutorials/sery-bot.mdx diff --git a/.gitignore b/.gitignore index 91f8086..8ed6e2b 100644 --- a/.gitignore +++ b/.gitignore @@ -23,4 +23,5 @@ pnpm-debug.log* # PageFind public/pagefind -md-to-html.exe \ No newline at end of file +md-to-html.exe +to-do-list.md \ No newline at end of file diff --git a/src/components/blocks/TableOfContent.astro b/src/components/blocks/TableOfContent.astro index b9e5304..711ca8e 100644 --- a/src/components/blocks/TableOfContent.astro +++ b/src/components/blocks/TableOfContent.astro @@ -35,5 +35,5 @@ const { headings } = Astro.props; }) } -
+
diff --git a/src/components/blocks/verticalNav.astro b/src/components/blocks/verticalNav.astro index 50eb4ec..73cf7da 100644 --- a/src/components/blocks/verticalNav.astro +++ b/src/components/blocks/verticalNav.astro @@ -19,18 +19,23 @@ export function formatTitle(title: string): string { export async function setup() { // setup navigation + + // Define the order of categories + let categoryOrder = ["Get Started", "Guide", "Tutorials"]; + const getStartedFiles = await Astro.glob("../../pages/get-started/*"); const guideFiles = await Astro.glob("../../pages/guide/*"); + const tutorialFiles = await Astro.glob("../../pages/tutorials/*"); - const markdownFiles = [...getStartedFiles, ...guideFiles]; - const navigation: Navigation = {}; + let markdownFiles = [...getStartedFiles, ...guideFiles, ...tutorialFiles]; + let navigation: Navigation = {}; for (const file of markdownFiles) { - const filePath = file.url; - const [_, category] = filePath!.split("/"); - const formattedCategory = formatTitle(category); - const formattedTitle = file.frontmatter.title; - const order = file.frontmatter.order ?? 0; + let filePath = file.url; + let [_, category] = filePath!.split("/"); + let formattedCategory = formatTitle(category).toLowerCase(); + let formattedTitle = file.frontmatter.title; + let order = file.frontmatter.order ?? 0; if (!navigation[formattedCategory]) { navigation[formattedCategory] = []; @@ -43,18 +48,18 @@ export async function setup() { }); } - // sort by "order" - const sortedNavigation: Navigation = {}; - Object.keys(navigation) - .sort() - .forEach((key) => { - sortedNavigation[key] = navigation[key].sort( - (a, b) => a.order - b.order - ); - }); + // Create a new navigation object with the desired order + let orderedNavigation: Navigation = {}; + for (let category of categoryOrder) { + if (navigation[category.toLowerCase()]) { + orderedNavigation[category] = navigation[ + category.toLowerCase() + ].sort((a, b) => a.order - b.order); + } + } return { - navigation: sortedNavigation, + navigation: orderedNavigation, }; } @@ -84,7 +89,7 @@ const { showHome } = Astro.props;
Home @@ -96,7 +101,7 @@ const { showHome } = Astro.props; { Object.entries(navigation).map(([category, links]) => (
-
+
{category}