From ca3a9f79e0029a58f3ade41d77bbf3f9fab1ba6a Mon Sep 17 00:00:00 2001 From: Harsh Mangalam <57381638+harshmangalam@users.noreply.github.com> Date: Sat, 9 Nov 2024 05:50:45 +0530 Subject: [PATCH] fix slug and removed click to edit btn (#234) Fixes #211 --- .../editors/CompositeMarkdownEditor.svelte | 6 ------ src/routes/(app)/[username]/[slug]/+page.svelte | 9 +-------- src/routes/(app)/[username]/new/+page.svelte | 13 +++++-------- 3 files changed, 6 insertions(+), 22 deletions(-) diff --git a/src/lib/components/editors/CompositeMarkdownEditor.svelte b/src/lib/components/editors/CompositeMarkdownEditor.svelte index 227d03a9..8e5106c9 100644 --- a/src/lib/components/editors/CompositeMarkdownEditor.svelte +++ b/src/lib/components/editors/CompositeMarkdownEditor.svelte @@ -56,12 +56,6 @@ - - {#if !markdownMode} - - {/if} {#if !markdownMode} diff --git a/src/routes/(app)/[username]/[slug]/+page.svelte b/src/routes/(app)/[username]/[slug]/+page.svelte index 77bb3703..d4e0f8eb 100644 --- a/src/routes/(app)/[username]/[slug]/+page.svelte +++ b/src/routes/(app)/[username]/[slug]/+page.svelte @@ -79,10 +79,6 @@ {#if !editingState.editing} {data.page.display_name} {:else} - Page Slug
-
-
 {slugifiedSlug}
-
diff --git a/src/routes/(app)/[username]/new/+page.svelte b/src/routes/(app)/[username]/new/+page.svelte index 49214d54..02cb80a3 100644 --- a/src/routes/(app)/[username]/new/+page.svelte +++ b/src/routes/(app)/[username]/new/+page.svelte @@ -47,6 +47,10 @@ function handleSubmit(e: SubmitEvent) { page.slug = slugifiedSlug; } + + $effect(() => { + page.slug = slugify(page.display_name || 'untitled', { strict: true, lower: true }); + }); @@ -57,10 +61,6 @@

-

@@ -68,10 +68,7 @@