Skip to content

Commit a93b137

Browse files
committed
doc: stable progress
1 parent e718664 commit a93b137

File tree

126 files changed

+3564
-1803
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+3564
-1803
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ sw.*
1515
.netlify
1616

1717
.content
18+
19+
.data

docs/app/app.config.ts

+29
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,35 @@ export default defineAppConfig({
88
radius: 0.25,
99
},
1010
ui: {
11+
icons: {
12+
caution: 'carbon-warning-alt',
13+
copy: 'carbon-copy',
14+
dark: 'carbon-moon',
15+
document: 'carbon-document',
16+
external: 'carbon-launch',
17+
hash: 'carbon-hash',
18+
light: 'carbon-sun',
19+
menu: 'carbon-menu',
20+
next: 'carbon-arrow-right',
21+
note: 'carbon-information',
22+
prev: 'carbon-arrow-left',
23+
system: 'carbon-computer',
24+
tip: 'carbon-lightbulb',
25+
warning: 'carbon-warning',
26+
chevronDoubleLeft: 'carbon-chevron-double-left',
27+
chevronDoubleRight: 'carbon-chevron-double-right',
28+
chevronDown: 'carbon-chevron-down',
29+
chevronLeft: 'carbon-chevron-left',
30+
chevronRight: 'carbon-chevron-right',
31+
arrowLeft: 'carbon-arrow-left',
32+
arrowRight: 'carbon-arrow-right',
33+
check: 'carbon-checkmark',
34+
close: 'carbon-close',
35+
ellipsis: 'carbon-overflow-menu-horizontal',
36+
loading: 'carbon-loading',
37+
minus: 'carbon-subtract',
38+
search: 'carbon-search',
39+
},
1140
colors: {
1241
primary: 'green',
1342
gray: 'slate',

docs/app/app.vue

+20-152
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,17 @@
11
<script setup lang="ts">
2-
import { titleCase } from 'scule'
32
import { fetchStats } from '~/composables/stats'
43
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-
}
684
695
const { data: stats } = await useAsyncData('stats', () => fetchStats())
706
71-
const route = useRoute()
727
const appConfig = useAppConfig()
73-
const colorMode = useColorMode()
748
759
provide('stats', stats)
7610
provide('modules', modules)
7711
7812
useSeoMeta({
7913
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.',
9015
})
9116
</script>
9217

@@ -100,80 +25,7 @@ useHead({
10025

10126
<ClientOnly />
10227

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 />
17729
</UApp>
17830
</template>
17931

@@ -182,8 +34,8 @@ useHead({
18234
@import "@nuxt/ui-pro";
18335
18436
@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;
18739
18840
--color-green-50: #EFFDF5;
18941
--color-green-100: #D9FBE8;
@@ -201,4 +53,20 @@ useHead({
20153
:root {
20254
--container-width: 90rem;
20355
}
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+
}
20472
</style>
Loading

docs/app/assets/icons/unhead.svg

+1
Loading
+12
Loading

docs/app/components/Banner.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<UBanner :actions="[{ label: 'Read the announcement post', to: 'https://ui.nuxt.com', trailingIcon: 'i-heroicons-arrow-right-20-solid', class: 'rounded-full' }]" :close="false">
33
<template #title>
4-
<UIcon name="i-noto-party-popper" class="mr-2" />
4+
<UIcon name="i-noto-party-popper" class="mr-2" />
55
<span class="font-semibold">Nuxt SEO v2 stable is here!</span>
66
</template>
77
</UBanner>
+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
<script setup lang="ts">
2+
const module = useModule()
3+
const searchTerm = ref('')
4+
const _nav = await useDocsNav()
5+
const nav = computed(() => {
6+
const { top = [], bottom = [] } = _nav.value?.nav.value || {}
7+
return {
8+
top,
9+
bottom,
10+
}
11+
})
12+
const files = computed(() => _nav.value?.files.value || [])
13+
</script>
14+
15+
<template>
16+
<div>
17+
<div class="isolate -ml-2.5 sticky pt-8 rounded bg-white dark:bg-gray-900 top-0 z-1">
18+
<ModuleCard :key="module.slug" :module="module" :version="false" class="mb-2" />
19+
</div>
20+
<div class="flex items-center gap-1 mb-3">
21+
<USelectMenu :search-input="false" size="sm" :model-value="module.version" :items="module.versions?.map(v => ({ label: v, disabled: v !== module.version }))" class="w-full" />
22+
23+
<UTooltip
24+
text="Search"
25+
:kbds="['meta', 'K']"
26+
>
27+
<UContentSearchButton class=" opacity-70 hover:opacity-100" />
28+
</UTooltip>
29+
30+
<UButton
31+
title="GitHub"
32+
aria-label="GitHub"
33+
:to="`https://github.com/${module.repo}`"
34+
target="_blank"
35+
color="neutral"
36+
variant="ghost"
37+
class="transition opacity-70 hover:opacity-100"
38+
icon="i-carbon-logo-github"
39+
/>
40+
<UButton
41+
title="NPM"
42+
aria-label="NPM"
43+
:to="`https://npmjs.com/package/${module.npm}`"
44+
target="_blank"
45+
color="neutral"
46+
variant="ghost"
47+
class="transition opacity-70 hover:opacity-100"
48+
icon="i-carbon-logo-npm"
49+
/>
50+
</div>
51+
<nav aria-title="Documentation Navigation">
52+
<ContentNavigation as="div" class="mb-5" default-open :collapsible="false" :navigation="nav.top" highlight :ui="{ listWithChildren: 'sm:ml-0 my-10' }">
53+
<template #link-leading="{ link, active }">
54+
<div v-if="link.icon" class="rounded-md p-1 inline-flex ring-inset ring-1 bg-gray-100/50 dark:bg-gray-800/50 ring-gray-300 dark:ring-gray-700 group-hover:bg-primary group-hover:ring-primary group-hover:text-background" :class="active ? 'dark:bg-teal-700' : ''">
55+
<UIcon :name="link.icon" class="w-4 h-4 text-primary-400 dark:text-sky-200" />
56+
</div>
57+
</template>
58+
</ContentNavigation>
59+
<div class="bg-gray-800 h-[1px] my-5 mr-5" />
60+
<ContentNavigation as="div" default-open :collapsible="false" :navigation="nav.bottom" highlight :ui="{ listWithChildren: 'sm:ml-0 my-10' }">
61+
<template #link="{ link }">
62+
<div v-if="!link.mdc" class="flex items-center gap-2">
63+
<UIcon v-if="link.icon" :name="link.icon" class="w-4 h-4 text-primary-400 dark:text-sky-200" />
64+
<div :class="link.children?.length ? 'text-sm font-bold' : ''">
65+
{{ link.title }}
66+
</div>
67+
</div>
68+
<div v-else>
69+
<MDC :value="link.title" unwrap="p" />
70+
</div>
71+
</template>
72+
</ContentNavigation>
73+
</nav>
74+
<ClientOnly>
75+
<LazyUContentSearch
76+
v-model:search-term="searchTerm"
77+
:files="files"
78+
:navigation="[{ title: 'Getting Started', _path: `/docs/${module.slug}/getting-started`, path: `/docs/${module.slug}/getting-started`, children: nav.top }, ...nav.bottom]"
79+
:fuse="{ resultLimit: 42 }"
80+
/>
81+
</ClientOnly>
82+
</div>
83+
</template>

0 commit comments

Comments
 (0)