Skip to content

Commit 62211cf

Browse files
authored
feat: studio compatibility (#13)
1 parent ea22f3c commit 62211cf

31 files changed

+315
-445
lines changed

.env.example

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
# Specify the path of @nuxt/ui-pro locally
2-
NUXT_UI_PRO_PATH=
3-
# License to build Nuxt UI Pro in production, https://ui.nuxt.com/pro/purchase
1+
# Production license for @nuxt/ui-pro, get one at https://ui.nuxt.com/pro/purchase
42
NUXT_UI_PRO_LICENSE=

.eslintignore

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
.nuxt/
2-
node_modules/
1+
dist
2+
node_modules
3+
.output
4+
.nuxt

.eslintrc

-15
This file was deleted.

.eslintrc.cjs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
root: true,
3+
extends: [
4+
'@nuxt/eslint-config'
5+
],
6+
rules: {
7+
// Global
8+
semi: ['error', 'never'],
9+
quotes: ['error', 'single'],
10+
'quote-props': ['error', 'as-needed'],
11+
// Vue
12+
'vue/multi-word-component-names': 0,
13+
'vue/max-attributes-per-line': 'off',
14+
'vue/no-v-html': 0
15+
}
16+
}

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ logs
2222
.env
2323
.env.*
2424
!.env.example
25+
26+
# VSC
27+
.history

.nuxtrc

-1
This file was deleted.

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
# Nuxt UI Pro: Docs template
1+
# Nuxt UI Pro - Docs template
22

33
Look at [Nuxt docs](https://nuxt.com/docs/getting-started/introduction) and [Nuxt UI Pro docs](https://ui.nuxt.com/pro) to learn more.
44

5+
Clone and play on [Nuxt Studio](https://nuxt.studio/themes/docs).
6+
57
## Setup
68

79
Make sure to install the dependencies:

app.config.ts

+28-10
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,50 @@
11
export default defineAppConfig({
22
ui: {
3-
primary: 'emerald',
3+
primary: 'green',
44
gray: 'slate',
5+
footer: {
6+
bottom: {
7+
left: 'text-sm text-gray-500 dark:text-gray-400',
8+
wrapper: 'border-t border-gray-200 dark:border-gray-800'
9+
}
10+
}
511
},
612
header: {
13+
logo: {
14+
src: ''
15+
},
16+
search: true,
17+
colorMode: true,
718
links: [{
8-
icon: 'i-heroicons-book-open',
9-
to: 'https://ui.nuxt.com/getting-started',
10-
target: '_blank',
11-
'aria-label': 'Nuxt UI docs'
12-
}, {
1319
icon: 'i-simple-icons-github',
1420
to: 'https://github.com/nuxt-ui-pro/docs',
1521
target: '_blank',
1622
'aria-label': 'Docs template on GitHub'
1723
}]
1824
},
1925
footer: {
26+
credits: 'Copyright © 2023',
27+
colorMode: false,
2028
links: [{
21-
icon: 'i-simple-icons-github',
22-
to: 'https://github.com/nuxt-ui-pro/docs',
29+
icon: 'i-simple-icons-nuxtdotjs',
30+
to: 'https://nuxt.com',
2331
target: '_blank',
24-
'aria-label': 'Nuxt UI Pro Docs on GitHub'
32+
'aria-label': 'Nuxt Website'
33+
}, {
34+
icon: 'i-simple-icons-discord',
35+
to: 'https://discord.com/invite/ps2h6QT',
36+
target: '_blank',
37+
'aria-label': 'Nuxt UI on Discord'
2538
}, {
2639
icon: 'i-simple-icons-x',
2740
to: 'https://x.com/nuxt_js',
2841
target: '_blank',
2942
'aria-label': 'Nuxt on X'
43+
}, {
44+
icon: 'i-simple-icons-github',
45+
to: 'https://github.com/nuxt/ui',
46+
target: '_blank',
47+
'aria-label': 'Nuxt UI on GitHub'
3048
}]
3149
}
32-
})
50+
})

app.vue

+20-27
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,48 @@
11
<script setup lang="ts">
22
import type { ParsedContent } from '@nuxt/content/dist/runtime/types'
33
4-
useSeoMeta({
5-
ogSiteName: 'Nuxt UI Pro - Docs template',
6-
twitterCard: 'summary_large_image'
4+
const { data: navigation } = await useAsyncData('navigation', () => fetchContentNavigation())
5+
const { data: files } = useLazyFetch<ParsedContent[]>('/api/search.json', {
6+
default: () => [],
7+
server: false
78
})
89
910
useHead({
11+
meta: [
12+
{ name: 'viewport', content: 'width=device-width, initial-scale=1' }
13+
],
14+
link: [
15+
{ rel: 'icon', href: '/favicon.ico' }
16+
],
1017
htmlAttrs: {
1118
lang: 'en'
1219
}
1320
})
1421
15-
const { data: navigation } = await useAsyncData('navigation', () => fetchContentNavigation())
16-
const { data: files } = useLazyFetch<ParsedContent[]>('/api/search.json', {
17-
default: () => [],
18-
server: false
22+
useSeoMeta({
23+
ogSiteName: 'Nuxt UI Pro - Docs template',
24+
twitterCard: 'summary_large_image'
1925
})
2026
2127
provide('navigation', navigation)
2228
</script>
2329

2430
<template>
2531
<div>
26-
<span v-if="$route.path === '/'" class="gradient" />
27-
28-
<AppHeader />
32+
<Header />
2933

3034
<UMain>
31-
<UContainer>
35+
<NuxtLayout>
3236
<NuxtPage />
33-
</UContainer>
37+
</NuxtLayout>
3438
</UMain>
3539

36-
<AppFooter />
40+
<Footer />
3741

3842
<ClientOnly>
3943
<LazyUDocsSearch :files="files" :navigation="navigation" />
4044
</ClientOnly>
45+
46+
<UNotifications />
4147
</div>
42-
</template>
43-
44-
<style scoped>
45-
.gradient {
46-
position: fixed;
47-
top: 25vh;
48-
width: 100%;
49-
height: 30vh;
50-
background: radial-gradient(50% 50% at 50% 50%, #00DC82 0%, rgba(0, 220, 130, 0) 100%);
51-
filter: blur(180px);
52-
opacity: 0.6;
53-
z-index: -1;
54-
}
55-
</style>
48+
</template>

components/AppFooter.vue

-27
This file was deleted.

components/Footer.vue

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<script setup lang="ts">
2+
const { footer } = useAppConfig()
3+
</script>
4+
5+
<template>
6+
<UFooter>
7+
<template #left>
8+
{{ footer.credits }}
9+
</template>
10+
11+
<template #right>
12+
<UColorModeButton v-if="footer?.colorMode" />
13+
14+
<template v-if="footer?.links">
15+
<UButton
16+
v-for="(link, index) of footer?.links"
17+
:key="index"
18+
v-bind="{ color: 'gray', variant: 'ghost', ...link }"
19+
/>
20+
</template>
21+
</template>
22+
</UFooter>
23+
</template>

components/AppHeader.vue renamed to components/Header.vue

+12-8
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,28 @@ const { header } = useAppConfig()
99
<template>
1010
<UHeader>
1111
<template #logo>
12-
<Logo class="hidden sm:block h-5 w-auto self-center" />
13-
<LogoOnly class="sm:hidden h-5 w-auto self-center" />
14-
<LogoBadge>Docs template</LogoBadge>
12+
<template v-if="header?.logo?.src">
13+
<img v-bind="{ class: 'h-6 w-auto', ...header.logo }">
14+
</template>
15+
<template v-else>
16+
Nuxt UI Pro <UBadge label="Docs" variant="subtle" class="mb-0.5" />
17+
</template>
1518
</template>
1619

17-
<template #center>
20+
<template v-if="header?.search" #center>
1821
<UDocsSearchButton class="hidden lg:flex" />
1922
</template>
2023

2124
<template #right>
22-
<UDocsSearchButton label="" class="lg:hidden" />
25+
<UDocsSearchButton v-if="header?.search" :label="null" class="lg:hidden" />
26+
27+
<UColorModeButton v-if="header?.colorMode" />
28+
2329
<template v-if="header?.links">
2430
<UButton
2531
v-for="(link, index) of header.links"
2632
:key="index"
27-
v-bind="link"
28-
color="gray"
29-
variant="ghost"
33+
v-bind="{ color: 'gray', variant: 'ghost', ...link }"
3034
/>
3135
</template>
3236
</template>

components/Logo.vue

-11
This file was deleted.

components/LogoBadge.vue

-13
This file was deleted.

components/LogoOnly.vue

-5
This file was deleted.

content/1.getting-started/1.index.md

+16-12
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,27 @@ title: 'Introduction'
33
description: 'Welcome to Nuxt UI Pro documentation template.'
44
---
55

6-
## Introduction
6+
This template is a ready-to-use documentation template made with [Nuxt UI Pro](https://ui.nuxt.com/pro), a collection of premium components built on top of Nuxt UI to create beautiful & responsive Nuxt applications in minutes.
77

8-
1. Open https://github.com/nuxt-ui-pro/docs
9-
2. Click on "Use this template" button
10-
3. Enter repository name and click on "Create repository from template" button
11-
4. Clone your new repository
12-
5. Install dependencies with your favorite package manager
13-
6. Start development server
8+
There are already many websites based on this template:
9+
10+
- [Nuxt](https://nuxt.com) - The Nuxt website
11+
- [Nuxt UI](https://ui.nuxt.com) - The documentation of `@nuxt/ui` and `@nuxt/ui-pro`
12+
- [Nuxt Image](https://image.nuxt.com) - The documentation of `@nuxt/image`
13+
- [Nuxt Content](https://content.nuxt.com) - The documentation of `@nuxt/content`
14+
- [Nuxt Devtools](https://devtools.nuxt.com) - The documentation of `@nuxt/devtools`
15+
- [Nuxt Studio](https://nuxt.studio) - The pro version of Nuxt Content
1416

1517
## Features
1618

17-
- Write pages in Markdown with [Nuxt Content](https://content.nuxt.com)
18-
- Auto-generated sidebar navigation
19-
- Beautiful Typography
20-
- Surround navigation
21-
- Multi-level sidebar
2219
- Powered by [Nuxt 3](https://nuxt.com)
20+
- Built with [Nuxt UI](https://ui.nuxt.com) and [Nuxt UI Pro](https://ui.nuxt.com/pro)
21+
- Write content with [MDC syntax](https://content.nuxt.com/usage/markdown) thanks to [Nuxt Content](https://content.nuxt.com)
22+
- Compatible with [Nuxt Studio](https://nuxt.studio)
23+
- Auto-generated sidebar navigation
24+
- Full-Text Search out of the box
25+
- Beautiful Typography styles
26+
- Dark mode support
2327
- And more...
2428

2529
## Play online

0 commit comments

Comments
 (0)