From aa5bb4a3db85005b4507927cec7ffc6de944d9c9 Mon Sep 17 00:00:00 2001 From: Puru Vijay <47742487+PuruVJ@users.noreply.github.com> Date: Mon, 12 Jun 2023 21:59:34 +0530 Subject: [PATCH] feat: Better docs nav (#8605) * DocsNav * Push * Nav title on each page * Install jridgewell sourcemap codec. Why it breaking suddenly * Use theme store * Use $nav_title * use $page.data.nav_title * Disable global prerendering * Fix Suppprters section * use new method * Initially hidden nav functionality * Minor fixes * Simplify into one single nav * Accomodate to the bottom nav * Minor fixes * nit * Add selected to other pages as well * New way of passing to navbar * Code cleanup * Directly pass list instead of components * 14 days * Fix comment * Discord icon * Bump site-kit finally --- .../01-svelte-components.md | 4 - pnpm-lock.yaml | 17 +- sites/svelte.dev/package.json | 2 +- sites/svelte.dev/src/global.d.ts | 11 ++ .../src/lib/components/ReplWidget.svelte | 2 +- .../src/lib/components/ScreenToggle.svelte | 2 +- sites/svelte.dev/src/lib/server/blog/index.js | 2 +- sites/svelte.dev/src/lib/server/docs/index.js | 2 +- .../routes/(authed)/repl/[id]/+page.svelte | 2 +- sites/svelte.dev/src/routes/+layout.server.js | 74 ++++++++ sites/svelte.dev/src/routes/+layout.svelte | 69 +++++--- sites/svelte.dev/src/routes/+page.svelte | 6 +- .../_components/Supporters/index.svelte | 2 +- .../_components/WhosUsingSvelte/index.svelte | 2 +- .../src/routes/blog/[slug]/+page.svelte | 1 - .../svelte.dev/src/routes/docs/+layout.svelte | 53 +----- .../src/routes/docs/Contents.svelte | 162 ----------------- .../src/routes/docs/[slug]/+page.js | 18 ++ .../src/routes/docs/[slug]/+page.svelte | 4 +- .../src/routes/docs/[slug]/OnThisPage.svelte | 163 ------------------ .../src/routes/examples/[slug]/+page.svelte | 2 +- .../src/routes/tutorial/[slug]/+page.svelte | 2 +- 22 files changed, 184 insertions(+), 418 deletions(-) create mode 100644 sites/svelte.dev/src/global.d.ts create mode 100644 sites/svelte.dev/src/routes/+layout.server.js delete mode 100644 sites/svelte.dev/src/routes/docs/Contents.svelte create mode 100644 sites/svelte.dev/src/routes/docs/[slug]/+page.js delete mode 100644 sites/svelte.dev/src/routes/docs/[slug]/OnThisPage.svelte diff --git a/documentation/docs/02-template-syntax/01-svelte-components.md b/documentation/docs/02-template-syntax/01-svelte-components.md index 06fff25138..cb8d351465 100644 --- a/documentation/docs/02-template-syntax/01-svelte-components.md +++ b/documentation/docs/02-template-syntax/01-svelte-components.md @@ -36,8 +36,6 @@ Svelte uses the `export` keyword to mark a variable declaration as a _property_ ``` ---- - You can specify a default initial value for a prop. It will be used if the component's consumer doesn't specify the prop on the component (or if its initial value is `undefined`) when instantiating the component. Note that if the values of props are subsequently updated, then any prop whose value is not specified will be set to `undefined` (rather than its initial value). In development mode (see the [compiler options](/docs/svelte-compiler#svelte-compile)), a warning will be printed if no default initial value is provided and the consumer does not specify a value. To squelch this warning, ensure that a default initial value is specified, even if it is `undefined`. @@ -130,8 +128,6 @@ Svelte's ` @@ -17,10 +18,14 @@