Skip to content

Commit 6a50e46

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/v4
2 parents b0d2111 + 3813eb8 commit 6a50e46

File tree

6 files changed

+756
-541
lines changed

6 files changed

+756
-541
lines changed

app/components/PageHeaderLinks.vue

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<script setup lang="ts">
2+
import { useClipboard } from '@vueuse/core'
3+
4+
const route = useRoute()
5+
const toast = useToast()
6+
const { copy, copied } = useClipboard()
7+
const site = useSiteConfig()
8+
const isCopying = ref(false)
9+
console.log(site)
10+
11+
const mdPath = computed(() => `${site.url}/raw${route.path}.md`)
12+
13+
const items = [
14+
{
15+
label: 'Copy Markdown link',
16+
icon: 'i-lucide-link',
17+
onSelect() {
18+
copy(mdPath.value)
19+
toast.add({
20+
title: 'Copied to clipboard',
21+
icon: 'i-lucide-check-circle'
22+
})
23+
}
24+
},
25+
{
26+
label: 'View as Markdown',
27+
icon: 'i-simple-icons:markdown',
28+
target: '_blank',
29+
to: `/raw${route.path}.md`
30+
},
31+
{
32+
label: 'Open in ChatGPT',
33+
icon: 'i-simple-icons:openai',
34+
target: '_blank',
35+
to: `https://chatgpt.com/?hints=search&q=${encodeURIComponent(`Read ${mdPath.value} so I can ask questions about it.`)}`
36+
},
37+
{
38+
label: 'Open in Claude',
39+
icon: 'i-simple-icons:anthropic',
40+
target: '_blank',
41+
to: `https://claude.ai/new?q=${encodeURIComponent(`Read ${mdPath.value} so I can ask questions about it.`)}`
42+
}
43+
]
44+
45+
async function copyPage() {
46+
isCopying.value = true
47+
copy(await $fetch<string>(`/raw${route.path}.md`))
48+
isCopying.value = false
49+
}
50+
</script>
51+
52+
<template>
53+
<UButtonGroup>
54+
<UButton
55+
label="Copy page"
56+
:icon="copied ? 'i-lucide-copy-check' : 'i-lucide-copy'"
57+
color="neutral"
58+
variant="outline"
59+
:loading="isCopying"
60+
:ui="{
61+
leadingIcon: [copied ? 'text-primary' : 'text-neutral', 'size-3.5']
62+
}"
63+
@click="copyPage"
64+
/>
65+
<UDropdownMenu
66+
:items="items"
67+
:content="{
68+
align: 'end',
69+
side: 'bottom',
70+
sideOffset: 8
71+
}"
72+
:ui="{
73+
content: 'w-48'
74+
}"
75+
>
76+
<UButton
77+
icon="i-lucide-chevron-down"
78+
size="sm"
79+
color="neutral"
80+
variant="outline"
81+
/>
82+
</UDropdownMenu>
83+
</UButtonGroup>
84+
</template>

app/pages/[...slug].vue

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,18 @@ const links = computed(() => {
5757
<UPageHeader
5858
:title="page.title"
5959
:description="page.description"
60-
:links="page.links"
6160
:headline="headline"
62-
/>
61+
>
62+
<template #links>
63+
<UButton
64+
v-for="(link, index) in page.links"
65+
:key="index"
66+
v-bind="link"
67+
/>
68+
69+
<PageHeaderLinks />
70+
</template>
71+
</UPageHeader>
6372

6473
<UPageBody>
6574
<ContentRenderer

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@
1212
"typecheck": "nuxt typecheck"
1313
},
1414
"dependencies": {
15-
"@iconify-json/lucide": "^1.2.57",
16-
"@iconify-json/simple-icons": "^1.2.43",
17-
"@iconify-json/vscode-icons": "^1.2.23",
15+
"@iconify-json/lucide": "^1.2.63",
16+
"@iconify-json/simple-icons": "^1.2.48",
17+
"@iconify-json/vscode-icons": "^1.2.29",
1818
"@nuxt/content": "^3.6.3",
19-
"@nuxt/image": "^1.10.0",
19+
"@nuxt/image": "^1.11.0",
2020
"@nuxt/ui": "^4.0.0-alpha.0",
2121
"better-sqlite3": "^12.2.0",
2222
"nuxt": "^4.0.3",
2323
"nuxt-llms": "0.1.3",
2424
"nuxt-og-image": "^5.1.9"
2525
},
2626
"devDependencies": {
27-
"@nuxt/eslint": "^1.5.2",
28-
"eslint": "^9.31.0",
29-
"typescript": "^5.8.3",
30-
"vue-tsc": "^3.0.1"
27+
"@nuxt/eslint": "^1.9.0",
28+
"eslint": "^9.34.0",
29+
"typescript": "^5.9.2",
30+
"vue-tsc": "^3.0.6"
3131
},
3232
"resolutions": {
3333
"unimport": "4.1.1"
@@ -40,5 +40,5 @@
4040
"vue-demi"
4141
]
4242
},
43-
"packageManager": "pnpm@10.13.1"
43+
"packageManager": "pnpm@10.15.0"
4444
}

0 commit comments

Comments
 (0)