1
1
<script setup lang="ts">
2
- import { titleCase } from ' scule'
3
2
import { fetchStats } from ' ~/composables/stats'
4
3
import { modules } from ' ../../src/const'
5
- import { menu } from ' ./composables/nav'
6
-
7
- function mapPath(data , node = 0 ) {
8
- return data .map ((item ) => {
9
- if (item .children ?.length && ! item .page ) {
10
- item .title = titleCase (item .title )
11
- item .children = mapPath (item .children , node + 1 )
12
- }
13
- return {
14
- ... item ,
15
- _path: item .path ,
16
- }
17
- })
18
- }
19
-
20
- async function mapPath2(data , node = 0 ) {
21
- return await Promise .all (
22
- data
23
- .map ((item ) => {
24
- if (item .children ?.length && ! item .page ) {
25
- item .title = titleCase (item .title )
26
- item .children = mapPath (item .children , node + 1 )
27
- }
28
- return {
29
- ... item ,
30
- _path: item .path ,
31
- }
32
- })
33
- .map (async (m ) => {
34
- if (m .path .endsWith (' /api' )) {
35
- m .icon = ' i-logos-nuxt-icon'
36
- m .title = ' Nuxt API'
37
- }
38
- else if (m .path .endsWith (' /nitro-api' )) {
39
- m .icon = ' i-unjs-nitro'
40
- m .title = ' Nitro API'
41
- }
42
- else if (m .path .endsWith (' /releases' )) {
43
- m .icon = ' i-noto-sparkles'
44
- m .title = ' Releases'
45
- }
46
- else if (m .path .endsWith (' /guides' )) {
47
- m .icon = ' i-ph-book-duotone'
48
- m .title = ' Guides'
49
- }
50
- if (m .children ?.length ) {
51
- m .children = m .children .map ((c ) => {
52
- if (c .children ?.length === 1 ) {
53
- c = c .children [0 ]
54
- }
55
- return c
56
- })
57
- for (const k in m .children ) {
58
- if (m .children [k ].title .endsWith (' ()' )) {
59
- m .children [k ].mdc = true
60
- m .children [k ].title = await markdownParser (` \` ${m .children [k ].title }\` {lang="ts"}` )
61
- }
62
- }
63
- }
64
- return m
65
- })
66
- )
67
- }
68
4
69
5
const { data : stats } = await useAsyncData (' stats' , () => fetchStats ())
70
6
71
- const route = useRoute ()
72
7
const appConfig = useAppConfig ()
73
- const colorMode = useColorMode ()
74
8
75
9
provide (' stats' , stats )
76
10
provide (' modules' , modules )
77
11
78
12
useSeoMeta ({
79
13
ogTitle: ' Nuxt SEO · All the boring SEO work for Nuxt done.' ,
80
- // twitterTitle: 'Nuxt SEO - All the boring SEO work for Nuxt done.',
81
- })
82
-
83
- const color = computed (() => colorMode .value === ' dark' ? (colors as any )[appConfig .ui .colors .neutral ][900 ] : ' white' )
84
- const radius = computed (() => ` :root { --ui-radius: ${appConfig .theme .radius }rem; } ` )
85
-
86
- useHead ({
87
- style: [
88
- { innerHTML: radius , id: ' nuxt-ui-radius' , tagPriority: - 2 },
89
- ],
14
+ twitterTitle: ' Nuxt SEO - All the boring SEO work for Nuxt done.' ,
90
15
})
91
16
</script >
92
17
@@ -100,80 +25,7 @@ useHead({
100
25
101
26
<ClientOnly />
102
27
103
- <footer class =" relative z-10 antialiased font-sans dark:bg-[#131822] bg-neutral-50 text-sm text-gray-700 dark:text-gray-200 mt-20" >
104
- <svg viewBox="0 0 1440 181" fill="none" xmlns="http://www.w3.org/2000/svg" class="text-blue-900/30 pointer-events-none absolute w-full top-[1px] transition-all text-primary flex-shrink-0 opacity-100 duration-[400ms] opacity-30 z-20"><mask id="path-1-inside-1_414_5526" fill="white"><path d="M0 0H1440V181H0V0Z" /></mask><path d="M0 0H1440V181H0V0Z" fill="url(#paint0_linear_414_5526)" fill-opacity="0.22" /><path d="M0 2H1440V-2H0V2Z" fill="url(#paint1_linear_414_5526)" mask="url(#path-1-inside-1_414_5526)" /><defs><linearGradient id="paint0_linear_414_5526" x1="720" y1="0" x2="720" y2="181" gradientUnits="userSpaceOnUse"><stop stop-color="currentColor" /><stop offset="1" stop-color="currentColor" stop-opacity="0" /></linearGradient><linearGradient id="paint1_linear_414_5526" x1="0" y1="90.5" x2="1440" y2="90.5" gradientUnits="userSpaceOnUse"><stop stop-color="currentColor" stop-opacity="0" /><stop offset="0.395" stop-color="currentColor" /><stop offset="1" stop-color="currentColor" stop-opacity="0" /></linearGradient></defs></svg>
105
- <div class =" border-t border-gray-200 dark:border-gray-800" >
106
- <UContainer >
107
- <div class =" py-10 grid xl:grid-cols-3 lg:gap-20 gap-10" >
108
- <div v-for =" (category, cKey) in menu.filter(c => c.children?.length)" :key =" cKey" >
109
- <h3 class =" font-bold mb-5 flex items-center gap-1" >
110
- <UIcon dynamic :name =" category.icon" class =" w-5 h-5" />
111
- {{ category.label }}
112
- </h3 >
113
- <nav >
114
- <ul class =" grid grid-cols-2 gap-6" >
115
- <li v-for =" (link, key) in category.children" :key =" key" >
116
- <ULink :to =" link.to" class =" flex items-center gap-1 hover:underline transition" >
117
- <UIcon v-if =" link.icon" dynamic :name =" link.icon" class =" w-4 h-4" :class =" cKey === 0 ? 'text-blue-500 dark:text-blue-300' : ''" />
118
- {{ link.label }}
119
- </ULink >
120
- </li >
121
- </ul >
122
- </nav >
123
- </div >
124
- </div >
125
- <div class =" flex items-center gap-10 mb-6" >
126
- <NuxtLink to =" /" title =" Home" class =" flex items-end gap-1.5 font-bold text-xl text-gray-900 dark:text-white font-title" >
127
- <Logo />
128
- </NuxtLink >
129
- <div class =" w-sm bg-gray-50 dark:bg-gray-800 flex rounded-xl shadow p-5" >
130
- <div >
131
- <div class =" mb-2" >
132
- Hey <UIcon name =" i-noto-waving-hand" /> My name is <a href =" https://harlanzw.com" target =" _blank" class =" underline" >Harlan</a > and I'm the author and maintainer of Nuxt SEO.
133
- </div >
134
- <div >
135
- I'd love to have your <a href =" https://github.com/sponsors/harlan-zw" class =" underline" >support</a >!
136
- </div >
137
- </div >
138
- <div class =" gap-3" >
139
- <img alt =" Harlan Wilton" loading =" lazy" src =" https://avatars.githubusercontent.com/u/5326365?v=4" class =" mx-auto rounded-full w-10 h-10 mb-3" >
140
- <div class =" flex justify-center items-center opacity-70" >
141
- <UButton
142
- title =" Twitter"
143
- aria-label =" Twitter"
144
- to =" https://twitter.com/harlan_zw"
145
- target =" _blank"
146
- color =" gray"
147
- variant =" ghost"
148
- class =" hidden lg:inline-flex transition"
149
- icon =" i-simple-icons-x"
150
- />
151
-
152
- <UButton
153
- title =" GitHub"
154
- aria-label =" GitHub"
155
- to =" https://github.com/harlan-zw/nuxt-seo"
156
- target =" _blank"
157
- color =" gray"
158
- variant =" ghost"
159
- class =" hidden lg:inline-flex transition"
160
- icon =" i-simple-icons-github"
161
- />
162
- </div >
163
- </div >
164
- </div >
165
- </div >
166
- </UContainer >
167
- </div >
168
- <div class =" border-t border-gray-200 dark:border-gray-800" >
169
- <UContainer >
170
- <div class =" py-10" >
171
- Copyright © 2023-{{ new Date().getFullYear() }} Harlan Wilton - <a href =" https://github.com/harlan-zw/nuxt-seo/blob/main/LICENSE" >MIT License</a >
172
- </div >
173
- </UContainer >
174
- </div >
175
- </footer >
176
- <NuxtLoadingIndicator />
28
+ <Footer />
177
29
</UApp >
178
30
</template >
179
31
@@ -182,8 +34,8 @@ useHead({
182
34
@import " @nuxt/ui-pro" ;
183
35
184
36
@theme {
185
- --font-family-sans: 'Public Sans', sans-serif ;
186
- --font-family-mono: 'Fira Code ', monospace;
37
+ --font-family-sans: 'Hubot Sans', sans-serif ;
38
+ --font-family-mono: 'Hubot Sans ', monospace;
187
39
188
40
--color-green-50: #EFFDF5;
189
41
--color-green-100: #D9FBE8;
@@ -201,4 +53,20 @@ useHead({
201
53
:root {
202
54
--container-width : 90rem ;
203
55
}
56
+
57
+ body {
58
+ -webkit-font-smoothing : antialiased ;
59
+ }
60
+ p , h1 , h2 , h3 , h4 , h5 , h6 {
61
+ overflow-wrap : break-word ;
62
+ }
63
+ p {
64
+ text-wrap : pretty;
65
+ }
66
+ h1 , h2 , h3 , h4 , h5 , h6 {
67
+ text-wrap : balance ;
68
+ }
69
+ #root , #__nuxt {
70
+ isolation : isolate ;
71
+ }
204
72
</style >
0 commit comments