Skip to content

Commit 40b3a07

Browse files
committed
docs: update to @nuxt/fonts
1 parent f5ac6f5 commit 40b3a07

File tree

13 files changed

+345
-79
lines changed

13 files changed

+345
-79
lines changed

docs/app.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ provide('navigation', navigation)
9090
</template>
9191
<!-- Mobile panel -->
9292
<template v-if="$route.path !== '/'" #panel>
93-
<LazyUDocsSearchButton size="md" class="mb-4 w-full" />
93+
<LazyUContentSearchButton size="md" class="mb-4 w-full" />
9494
<LazyUNavigationTree :links="mapContentNavigation(navigation!)" default-open :multiple="false" />
9595
</template>
9696
</UHeader>
@@ -136,6 +136,6 @@ provide('navigation', navigation)
136136
</template>
137137
</UFooter>
138138
<ClientOnly>
139-
<LazyUDocsSearch :files="files" :navigation="navigation" :links="links" />
139+
<LazyUContentSearch :files="files" :navigation="navigation" :links="links" />
140140
</ClientOnly>
141141
</template>

docs/components/AdsCarbon.vue

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

docs/components/ads/Ads.vue

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<script setup lang="ts">
2+
const { $ads } = useNuxtApp()
3+
const uiPro = useState('uiProAd', () => Math.round(Math.random()))
4+
if (!useNuxtApp().isHydrating) {
5+
uiPro.value = Math.round(Math.random())
6+
}
7+
</script>
8+
9+
<template>
10+
<div class="space-y-3">
11+
<AdsUIPro v-if="uiPro" />
12+
<AdsFallback v-else-if="$ads.adBlocked.value" />
13+
<AdsCarbon v-else :key="$route.path" />
14+
</div>
15+
</template>

docs/components/ads/AdsCarbon.vue

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
<template>
2+
<div ref="carbonads" class="Carbon border border-gray-200 dark:border-gray-800 rounded-lg bg-white dark:bg-white/5" />
3+
</template>
4+
5+
<script setup lang="ts">
6+
const carbonads = ref(null)
7+
8+
onMounted(() => {
9+
if (carbonads.value) {
10+
const script = document.createElement('script')
11+
script.setAttribute('type', 'text/javascript')
12+
script.setAttribute('src', 'https://cdn.carbonads.com/carbon.js?serve=CWYIPK7W&placement=contentnuxtcom')
13+
script.setAttribute('id', '_carbonads_js')
14+
carbonads.value.appendChild(script)
15+
}
16+
})
17+
</script>
18+
19+
<style lang="postcss">
20+
.dark .Carbon {
21+
min-height: 220px;
22+
.carbon-text {
23+
@apply text-gray-400;
24+
25+
&:hover {
26+
@apply text-gray-200;
27+
}
28+
}
29+
}
30+
31+
.light .Carbon {
32+
.carbon-text {
33+
@apply text-gray-600;
34+
35+
&:hover {
36+
@apply text-gray-800;
37+
}
38+
}
39+
}
40+
41+
.Carbon {
42+
@apply p-3 flex flex-col max-w-full;
43+
44+
@screen sm {
45+
@apply max-w-xs;
46+
}
47+
48+
@screen lg {
49+
@apply mt-0;
50+
}
51+
52+
#carbonads span {
53+
@apply flex flex-col justify-between;
54+
55+
.carbon-wrap {
56+
@apply flex flex-col;
57+
58+
flex: 1;
59+
60+
@media (min-width: 320px) {
61+
@apply flex-row;
62+
}
63+
64+
@screen lg {
65+
@apply flex-col;
66+
}
67+
68+
.carbon-img {
69+
@apply flex items-start justify-center mb-4;
70+
71+
@media (min-width: 320px) {
72+
@apply mb-0;
73+
}
74+
75+
@screen lg {
76+
@apply mb-4;
77+
}
78+
}
79+
80+
.carbon-text {
81+
@apply flex-1 text-sm w-full m-0 text-left block;
82+
83+
&:hover {
84+
@apply no-underline;
85+
}
86+
87+
@media (min-width: 320px) {
88+
@apply ml-4;
89+
}
90+
91+
@screen lg {
92+
@apply ml-0;
93+
}
94+
}
95+
}
96+
}
97+
98+
img {
99+
@apply w-full;
100+
}
101+
102+
& .carbon-poweredby {
103+
@apply ml-2 text-xs text-right text-gray-400 block pt-2;
104+
105+
&:hover {
106+
@apply no-underline text-gray-500;
107+
}
108+
}
109+
}
110+
</style>

docs/components/ads/AdsFallback.vue

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<template>
2+
<div class="nui-support-nuxt">
3+
<div>
4+
<p class="pt-2 m-0 font-bold sm:text-sm text-gray-900 dark:text-white">
5+
Nuxt needs you!
6+
</p>
7+
<p class="pb-2 m-0 leading-normal text-gray-600 dark:text-white sm:text-xs">
8+
By allowing nuxt.com on your Ad-Blocker, you support our work and help us financially.
9+
</p>
10+
</div>
11+
</div>
12+
</template>
13+
14+
<style lang="postcss">
15+
.nui-support-nuxt {
16+
@apply py-2 px-4 rounded-md bg-gray-100 dark:bg-white dark:bg-opacity-10 flex flex-row w-full items-center mt-4;
17+
}
18+
19+
@screen sm {
20+
.nui-support-nuxt {
21+
@apply flex-col w-40 mt-0;
22+
}
23+
}
24+
</style>

docs/components/ads/AdsUIPro.vue

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<template>
2+
<UPageCard to="https://ui.nuxt.com/pro?utm_source=nuxtcontent_website&utm_medium=banner" target="_blank" :ui="{ header: { padding: 'p-0 sm:p-0' }, rounded: 'rounded', body: { padding: 'p-2 sm:p-2', base: 'text-center' } }">
3+
<template #header>
4+
<UColorModeImage dark="https://ui.nuxt.com/_ipx/s_1152x720/templates/dashboard3.png" light="https://ui.nuxt.com/_ipx/s_1152x720/templates/dashboard2.png" alt="Nuxt UI Pro" />
5+
</template>
6+
<div class="inline-flex gap-1 my-2">
7+
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 inline-block" fill="none" viewBox="0 0 83 16"><path fill="currentColor" d="M30.7412 16.0001c.1728 0 .32-.1433.32-.32V8.24002s.4.72001 1.12 1.91998l3.12 5.3601c.1428.2992.4595.48.72.48h2.16V4h-2.16c-.1438 0-.32.11953-.32.32v7.52l-1.44-2.55997L31.3812 4.4c-.1402-.2487-.4417-.4-.72-.4h-2.08v12.0001h2.16ZM58.6613 7.36002h1.04c.2651 0 .48-.21491.48-.48V4.8h2.2401v2.56002h2.16v1.92001h-2.16V12.72c0 .8401.4046 1.2001 1.12 1.2001h1.04v2.08h-1.36c-1.8442 0-3.0401-1.1943-3.0401-3.2001V9.28003h-1.52V7.36002ZM47.8613 7.36002V12.32c0 1.1203-.4206 2.0648-1.04 2.7201-.6194.6552-1.4747.96-2.64.96-1.1653 0-2.1007-.3048-2.7201-.96-.6088-.6553-1.04-1.5998-1.04-2.7201V7.36002h1.28c.273 0 .5416.04976.7201.24.1784.17967.24.28521.24.56V12.32c0 .6447.0365 1.043.32 1.3601.2834.3064.6331.4 1.2.4.5774 0 .8365-.0936 1.12-.4.2834-.3171.32-.7154.32-1.3601V8.16002c0-.27479.0615-.44976.24-.64.1568-.16714.3222-.16321.56-.16.0328.00044.1268 0 .16 0h1.28ZM54.6613 11.52l2.72-4.15998h-2.08c-.2621 0-.495.09406-.64.32l-1.28 1.92001-1.2-1.84001c-.1449-.22594-.4579-.4-.72-.4h-2l2.72 4.07998-2.96 4.5601h2.08c.26 0 .4946-.2571.64-.48l1.44-2.16 1.52 2.24c.1454.2229.38.4.64.4h2.08l-2.96-4.4801Z" /><path fill="#00DC82" d="M14.0211 16.0001h8.8801c.2834 0 .5546-.0996.8-.24.2454-.1405.4984-.3168.64-.56.1416-.2433.2401-.5192.24-.8001-.0001-.2809-.0982-.5567-.24-.7999l-6-10.32008c-.1417-.2432-.3147-.41959-.5601-.56001-.2453-.14041-.5966-.24-.88-.24-.2833 0-.5546.09959-.8.24-.2453.14042-.4183.31681-.56.56001l-1.52 2.64001-3.04-5.120214c-.1417-.243185-.3146-.499421-.56-.639815C10.1757.0196071 9.90447 0 9.6211 0c-.28336 0-.55458.0196071-.8.160001-.24542.140394-.49826.39663-.64.639815L.741056 13.6001c-.141843.2432-.159878.519-.160001.7999-.000123.2809.018372.5568.160001.8.141628.2433.394594.4196.640004.5601.2454.1404.51662.24.8.24h5.60003c2.21891 0 3.83401-.9954 4.96001-2.88l2.72-4.72005 1.44-2.48002 4.4001 7.52007h-5.8401l-1.44 2.56Zm-6.32001-2.56H3.78107L9.6211 3.36002l2.96 5.04003-1.9607 3.41805c-.74775 1.2228-1.60029 1.622-2.91931 1.622ZM77.2214 4.79981h-1.6c-.358 0-.6459-.00485-.88.24-.2341.23124-.16.36634-.16.72v5.51999c0 .8298-.1082 1.272-.48 1.6801-.3718.3944-.8426.56-1.6.56-.7436 0-1.3082-.1656-1.68-.56-.3718-.4081-.4-.8503-.4-1.6801V5.75982c0-.35367-.0059-.48877-.24-.72001-.2341-.24484-.522-.24-.88-.24h-1.52v6.47999c0 1.4419.4013 2.5967 1.2 3.4401.8125.8433 1.9914 1.28 3.52 1.28s2.7075-.4367 3.52-1.28c.8125-.8434 1.2-1.9982 1.2-3.4401V4.79981Z" /><path fill="#00DC82" fill-rule="evenodd" d="m80.5814 4.80167 1.6-.00187v10.3204c0 .3147-.0013.434-.24.6398-.2386.2178-.5949.2399-.96.2399h-1.5199v-1.5195l-.0001-4.0796V5.60153c0-.30911.0013-.43777.24-.63988.2256-.19098.515-.15998.88-.15998Z" clip-rule="evenodd" /></svg>
8+
<UBadge variant="subtle" size="xs" class="text-[10px]">
9+
PRO
10+
</UBadge>
11+
</div>
12+
<p class="text-sm dark:text-gray-400 text-gray-500 pb-1">
13+
Premium Vue Components for Nuxt applications.
14+
</p>
15+
</UPageCard>
16+
</template>

docs/layouts/docs.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const navigation = inject('navigation')
1818
<template #left>
1919
<UAside>
2020
<template #top>
21-
<UDocsSearchButton size="md" />
21+
<UContentSearchButton size="md" />
2222
</template>
2323
<UNavigationTree :links="mapContentNavigation(navigation)" />
2424
</UAside>

docs/nuxt.config.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,10 @@ export default defineNuxtConfig({
5555
},
5656
modules: [
5757
'@nuxt/content',
58+
'@nuxt/fonts',
5859
'@nuxt/ui',
5960
'@nuxthq/studio',
6061
'@vueuse/nuxt',
61-
'@nuxtjs/fontaine',
62-
'@nuxtjs/google-fonts',
6362
'nuxt-og-image',
6463
'@nuxtjs/plausible'
6564
],
@@ -71,18 +70,6 @@ export default defineNuxtConfig({
7170
icons: ['heroicons', 'simple-icons', 'ph']
7271
},
7372

74-
fontMetrics: {
75-
fonts: ['DM Sans']
76-
},
77-
78-
googleFonts: {
79-
display: 'swap',
80-
download: true,
81-
families: {
82-
'DM+Sans': [400, 500, 600, 700]
83-
}
84-
},
85-
8673
hooks: {
8774
// Related to https://github.com/nuxt/nuxt/pull/22558
8875
// Adding all global components to the main entry

docs/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"@iconify-json/ph": "^1.1.11",
1313
"@iconify-json/simple-icons": "^1.1.94",
1414
"@nuxt/content": "^2.12.0",
15+
"@nuxt/fonts": "^0.2.0",
1516
"@nuxt/ui-pro": "^1.0.2",
1617
"@nuxthq/studio": "^1.0.12",
1718
"@nuxtjs/fontaine": "^0.4.1",

docs/pages/[...slug].vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,22 +84,22 @@ const ecosystemLinks = [
8484

8585
<hr v-if="surround?.length">
8686

87-
<UDocsSurround :surround="surround" />
87+
<UContentSurround :surround="surround" />
8888
</UPageBody>
8989

9090
<template v-if="page.body?.toc?.links?.length" #right>
91-
<UDocsToc :links="page.body.toc.links">
91+
<UContentToc :links="page.body.toc.links">
9292
<template #bottom>
9393
<div class="hidden !mt-6 lg:block space-y-6">
9494
<UDivider v-if="page.body?.toc?.links?.length" type="dashed" />
9595
<UPageLinks title="Community" :links="communityLinks" />
9696
<UDivider type="dashed" />
9797
<UPageLinks title="Ecosystem" :links="ecosystemLinks" />
9898
<UDivider type="dashed" />
99-
<AdsCarbon />
99+
<Ads />
100100
</div>
101101
</template>
102-
</UDocsToc>
102+
</UContentToc>
103103
</template>
104104
</UPage>
105105
</template>

0 commit comments

Comments
 (0)