Skip to content

Commit 69f4e26

Browse files
authored
Merge pull request #133 from justserdar/nuxt-docs-pro-v3
Nuxt docs pro v3
2 parents f035697 + 0e85bf0 commit 69f4e26

Some content is hidden

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

43 files changed

+20300
-264
lines changed

Dockerfile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Dockerfile with PNPM for Nuxt - v1.2.1
2+
# https://gist.github.com/sandros94/03675514546f17af1fd6db3863c043b4
3+
4+
# Base configuration
5+
ARG node_tag=22-alpine
6+
FROM node:${node_tag} AS base
7+
WORKDIR /app
8+
9+
# Builder
10+
FROM base AS builder
11+
ENV PNPM_HOME="/pnpm"
12+
ENV PATH="$PNPM_HOME:$PATH"
13+
14+
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc /app/
15+
COPY /docs/package.json /app/docs/
16+
COPY /playground/package.json /app/playground/
17+
RUN npm i -g --force corepack && corepack enable
18+
19+
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
20+
pnpm install --frozen-lockfile --shamefully-hoist
21+
22+
ARG NUXT_UI_PRO_LICENSE
23+
24+
COPY . .
25+
RUN pnpm run dev:prepare
26+
RUN --mount=type=cache,id=nuxt,target=/app/node_modules/.cache/nuxt/.nuxt \
27+
pnpm run docs:build
28+
29+
# Final production container
30+
FROM base AS runtime
31+
ARG NODE_ENV=production
32+
ENV NODE_ENV=${NODE_ENV}
33+
34+
USER node
35+
EXPOSE 3000
36+
HEALTHCHECK --retries=10 --start-period=5s \
37+
CMD wget --no-verbose --spider http://0.0.0.0:80/ || exit 1
38+
39+
COPY --link --from=builder /app/docs/.output/ ./
40+
41+
ENTRYPOINT [ "node", "server/index.mjs" ]

docs/.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_size = 2
6+
indent_style = space
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

docs/.env.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Production license for @nuxt/ui-pro, get one at https://ui.nuxt.com/pro/purchase
2+
NUXT_UI_PRO_LICENSE=
3+
4+
# Public URL, used for OG Image when running nuxt generate
5+
NUXT_PUBLIC_SITE_URL=

docs/.github/workflows/ci.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: ci
2+
3+
on: push
4+
5+
jobs:
6+
ci:
7+
runs-on: ${{ matrix.os }}
8+
9+
strategy:
10+
matrix:
11+
os: [ubuntu-latest]
12+
node: [22]
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Install pnpm
19+
uses: pnpm/action-setup@v4
20+
21+
- name: Install node
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: ${{ matrix.node }}
25+
cache: pnpm
26+
27+
- name: Install dependencies
28+
run: pnpm install
29+
30+
- name: Lint
31+
run: pnpm run lint
32+
33+
- name: Typecheck
34+
run: pnpm run typecheck

docs/.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Nuxt dev/build outputs
2+
.output
3+
.data
4+
.nuxt
5+
.nitro
6+
.cache
7+
dist
8+
9+
# Node dependencies
10+
node_modules
11+
12+
# Logs
13+
logs
14+
*.log
15+
16+
# Misc
17+
.DS_Store
18+
.fleet
19+
.idea
20+
21+
# Local env files
22+
.env
23+
.env.*
24+
!.env.example
25+
26+
# VSC
27+
.history

docs/.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
shamefully-hoist=true

docs/README.md

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
![nuxt-ui-docs-social-card](https://github.com/nuxt-ui-pro/docs/assets/739984/f64e13d9-9ae0-4e03-bf7f-6be4c36cd9ba)
2+
3+
# Nuxt UI Pro - Docs template
4+
5+
[![Nuxt UI Pro](https://img.shields.io/badge/Made%20with-Nuxt%20UI%20Pro-00DC82?logo=nuxt.js&labelColor=020420)](https://ui.nuxt.com/pro)
6+
[![Nuxt Studio](https://img.shields.io/badge/Open%20in%20Nuxt%20Studio-18181B?&logo=nuxt.js&logoColor=3BB5EC)](https://nuxt.studio/themes/docs)
7+
8+
- [Live demo](https://docs-template.nuxt.dev)
9+
- [Documentation](https://ui.nuxt.com/getting-started/installation/pro/nuxt)
10+
- [Clone on Nuxt Studio](https://content.nuxt.com/templates/docs)
11+
12+
[![Deploy to NuxtHub](https://hub.nuxt.com/button.svg)](https://hub.nuxt.com/new?repo=nuxt-ui-pro/docs)
13+
14+
## Quick Start
15+
16+
```bash [Terminal]
17+
npx nuxi init -t github:nuxt-ui-pro/docs
18+
```
19+
20+
## Setup
21+
22+
Make sure to install the dependencies:
23+
24+
```bash
25+
# npm
26+
npm install
27+
28+
# pnpm
29+
pnpm install
30+
31+
# yarn
32+
yarn install
33+
34+
# bun
35+
bun install
36+
```
37+
38+
## Development Server
39+
40+
Start the development server on `http://localhost:3000`:
41+
42+
```bash
43+
# npm
44+
npm run dev
45+
46+
# pnpm
47+
pnpm run dev
48+
49+
# yarn
50+
yarn dev
51+
52+
# bun
53+
bun run dev
54+
```
55+
56+
## Production
57+
58+
Build the application for production:
59+
60+
```bash
61+
# npm
62+
npm run build
63+
64+
# pnpm
65+
pnpm run build
66+
67+
# yarn
68+
yarn build
69+
70+
# bun
71+
bun run build
72+
```
73+
74+
Locally preview production build:
75+
76+
```bash
77+
# npm
78+
npm run preview
79+
80+
# pnpm
81+
pnpm run preview
82+
83+
# yarn
84+
yarn preview
85+
86+
# bun
87+
bun run preview
88+
```
89+
90+
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
91+
92+
## Nuxt Studio integration
93+
94+
Studio is an intuitive CMS interface to edit your Nuxt Content websites.
95+
96+
It take advantage of the Preview API included in Nuxt Content to propose the best editing experience for your content files. Editors can benefit from a user-friendly interface to edit their Markdown, YAML or JSON files.
97+
98+
You can import your project on the platform without any extra setup.
99+
100+
However to enable the live preview on the platform, you just need to activate studio in the content configuration of your `nuxt.config.ts` file.
101+
102+
```ts [nuxt.config.ts]
103+
export default defineNuxtConfig({
104+
content: {
105+
preview: {
106+
api: 'https://api.nuxt.studio'
107+
}
108+
}
109+
})
110+
```
111+
112+
Read more on [Nuxt Studio docs](https://content.nuxt.com/studio/setup).
113+
114+
## Renovate integration
115+
116+
Install [Renovate GitHub app](https://github.com/apps/renovate/installations/select_target) on your repository and you are good to go.

docs/app/app.config.ts

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
export default defineAppConfig({
2+
ui: {
3+
colors: {
4+
primary: 'green',
5+
neutral: 'slate'
6+
}
7+
},
8+
uiPro: {
9+
footer: {
10+
slots: {
11+
root: 'border-t border-(--ui-border)',
12+
left: 'text-sm text-(--ui-text-muted)'
13+
}
14+
}
15+
},
16+
seo: {
17+
siteName: 'Nuxt Codemirror'
18+
},
19+
header: {
20+
title: 'Nuxt Codemirror',
21+
to: '/',
22+
logo: {
23+
alt: '',
24+
light: '',
25+
dark: ''
26+
},
27+
search: true,
28+
colorMode: true,
29+
links: [{
30+
'icon': 'i-simple-icons-github',
31+
'to': 'https://github.com/ThimoDEV/nuxt-codemirror',
32+
'target': '_blank',
33+
'aria-label': 'GitHub'
34+
}]
35+
},
36+
footer: {
37+
credits: `Copyright © ${new Date().getFullYear()}`,
38+
colorMode: false,
39+
links: [{
40+
'icon': 'i-simple-icons-nuxtdotjs',
41+
'to': 'https://nuxt.com',
42+
'target': '_blank',
43+
'aria-label': 'Nuxt Website'
44+
}, {
45+
'icon': 'i-simple-icons-discord',
46+
'to': 'https://discord.com/invite/ps2h6QT',
47+
'target': '_blank',
48+
'aria-label': 'Nuxt UI on Discord'
49+
}, {
50+
'icon': 'i-simple-icons-x',
51+
'to': 'https://x.com/nuxt_js',
52+
'target': '_blank',
53+
'aria-label': 'Nuxt on X'
54+
}, {
55+
'icon': 'i-simple-icons-github',
56+
'to': 'https://github.com/ThimoDEV/nuxt-codemirror',
57+
'target': '_blank',
58+
'aria-label': 'Nuxt Codemirror Module on GitHub'
59+
}]
60+
},
61+
toc: {
62+
title: 'Table of Contents',
63+
bottom: {
64+
title: 'Community',
65+
edit: 'https://github.com/nuxt-ui-pro/docs/edit/main/content',
66+
links: [{
67+
icon: 'i-lucide-star',
68+
label: 'Star on GitHub',
69+
to: 'https://github.com/ThimoDEV/nuxt-codemirror',
70+
target: '_blank'
71+
}, {
72+
icon: 'i-lucide-book-open',
73+
label: 'Nuxt UI Pro docs',
74+
to: 'https://ui.nuxt.com/getting-started/installation/pro/nuxt',
75+
target: '_blank'
76+
}, {
77+
icon: 'i-simple-icons-nuxtdotjs',
78+
label: 'Purchase a license',
79+
to: 'https://ui.nuxt.com/pro/purchase',
80+
target: '_blank'
81+
}]
82+
}
83+
}
84+
})

docs/app/app.vue

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<script setup lang="ts">
2+
const { seo } = useAppConfig()
3+
4+
const { data: navigation } = await useAsyncData('navigation', () => queryCollectionNavigation('docs'))
5+
const { data: files } = useLazyAsyncData('search', () => queryCollectionSearchSections('docs'), {
6+
server: false
7+
})
8+
9+
useHead({
10+
meta: [
11+
{ name: 'viewport', content: 'width=device-width, initial-scale=1' }
12+
],
13+
link: [
14+
{ rel: 'icon', href: '/favicon.ico' }
15+
],
16+
htmlAttrs: {
17+
lang: 'en'
18+
}
19+
})
20+
21+
useSeoMeta({
22+
titleTemplate: `%s - ${seo?.siteName}`,
23+
ogSiteName: seo?.siteName,
24+
twitterCard: 'summary_large_image'
25+
})
26+
27+
provide('navigation', navigation)
28+
</script>
29+
30+
<template>
31+
<UApp>
32+
<NuxtLoadingIndicator />
33+
34+
<AppHeader />
35+
36+
<UMain>
37+
<NuxtLayout>
38+
<NuxtPage />
39+
</NuxtLayout>
40+
</UMain>
41+
42+
<AppFooter />
43+
44+
<ClientOnly>
45+
<LazyUContentSearch
46+
:files="files"
47+
:navigation="navigation"
48+
/>
49+
</ClientOnly>
50+
</UApp>
51+
</template>

0 commit comments

Comments
 (0)