Skip to content

Commit 043975e

Browse files
committed
docs
1 parent 218c880 commit 043975e

File tree

16 files changed

+2095
-1241
lines changed

16 files changed

+2095
-1241
lines changed

packages/docs/src/components/LogoContextMenu.svelte

Lines changed: 0 additions & 63 deletions
This file was deleted.

packages/docs/src/components/Navbar.svelte

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
<script>
2+
import { goto } from "$app/navigation"
23
import TopBanner from "$components/TopBanner.svelte"
34
import ThemeChange from "$components/ThemeChange.svelte"
45
import LangChange from "$components/LangChange.svelte"
56
import Search from "$components/Search.svelte"
6-
import LogoContextMenu from "$components/LogoContextMenu.svelte"
77
import ChangelogMenu from "$components/ChangelogMenu.svelte"
88
9-
let contextMenuEl = $state()
109
import { t } from "$lib/i18n.svelte.js"
1110
let {
1211
pages,
@@ -76,7 +75,7 @@
7675
class="btn btn-ghost flex-0 gap-1 px-2 md:gap-2"
7776
oncontextmenu={(e) => {
7877
e.preventDefault()
79-
contextMenuEl.openContextMenu(e)
78+
goto("/brand")
8079
}}
8180
>
8281
<svg
@@ -94,7 +93,6 @@
9493

9594
<span class="font-title text-base-content text-lg md:text-xl">daisyUI</span>
9695
</a>
97-
<LogoContextMenu bind:this={contextMenuEl} />
9896
{#if showVersion}
9997
<ChangelogMenu {version} />
10098
{/if}

packages/docs/src/components/SEO.svelte

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,19 @@
2323
if (lang === "zh_hant") return "zh-tw"
2424
return lang
2525
}
26+
27+
const getCanonicalUrl = (pathname) => {
28+
const compareRegex = /^\/compare\/(.+)-vs-(.+)\/$/
29+
const match = pathname.match(compareRegex)
30+
31+
if (match) {
32+
const [, first, second] = match
33+
const [smaller, larger] = [first, second].sort()
34+
return `https://daisyui.com/compare/${smaller}-vs-${larger}/`
35+
}
36+
37+
return `https://daisyui.com${pathname}`
38+
}
2639
</script>
2740

2841
<svelte:head>
@@ -38,7 +51,7 @@
3851
<meta property="og:image" content={img} />
3952

4053
<link rel="sitemap" type="application/xml" title="Sitemap" href="/sitemap.xml" />
41-
<link rel="canonical" href={`https://daisyui.com${page.url.pathname}`} />
54+
<link rel="canonical" href={getCanonicalUrl(page.url.pathname)} />
4255

4356
{#each langs as lang}
4457
<link

packages/docs/src/components/Sidebar.svelte

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
<script>
2+
import { goto } from "$app/navigation"
23
import { page } from "$app/stores"
34
import Search from "$components/Search.svelte"
4-
// import LogoContextMenu from "$components/LogoContextMenu.svelte"
55
import SidebarMenuItem from "$components/SidebarMenuItem.svelte"
6-
// import ChangelogMenu from "$components/ChangelogMenu.svelte"
7-
let contextMenuEl
6+
import ChangelogMenu from "$components/ChangelogMenu.svelte"
87
98
let { closeDrawer, openDrawer, pages, drawerSidebarScrollY, version } = $props()
109
let switchNavbarStyle = $derived(drawerSidebarScrollY > 40)
@@ -27,7 +26,7 @@
2726
class="btn btn-ghost flex-0 px-2"
2827
oncontextmenu={(e) => {
2928
e.preventDefault()
30-
contextMenuEl.openContextMenu(e)
29+
goto("/brand")
3130
}}
3231
>
3332
<svg width="32" height="32" viewBox="0 0 415 415" xmlns="http://www.w3.org/2000/svg">
@@ -39,13 +38,7 @@
3938

4039
<div class="font-title inline-flex text-lg md:text-2xl">daisyUI</div>
4140
</a>
42-
43-
{#await import("./LogoContextMenu.svelte") then Module}
44-
<Module.default bind:this={contextMenuEl} />
45-
{/await}
46-
{#await import("./ChangelogMenu.svelte") then Module}
47-
<Module.default {version} />
48-
{/await}
41+
<ChangelogMenu {version} />
4942
</div>
5043

5144
{#if innerWidth < 1024}

0 commit comments

Comments
 (0)