Skip to content

Commit

Permalink
chore(app): initial commit by Nuxt Studio
Browse files Browse the repository at this point in the history
  • Loading branch information
huang-julien authored Sep 15, 2024
1 parent b6c229e commit 57eace0
Show file tree
Hide file tree
Showing 31 changed files with 14,487 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# editorconfig.org
root = true

[*]
indent_size = 2
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
5 changes: 5 additions & 0 deletions docs/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Production license for @nuxt/ui-pro, get one at https://ui.nuxt.com/pro/purchase
NUXT_UI_PRO_LICENSE=

# Public URL, used for OG Image when running nuxt generate
NUXT_PUBLIC_SITE_URL=
27 changes: 27 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Nuxt dev/build outputs
.output
.data
.nuxt
.nitro
.cache
dist

# Node dependencies
node_modules

# Logs
logs
*.log

# Misc
.DS_Store
.fleet
.idea

# Local env files
.env
.env.*
!.env.example

# VSC
.history
1 change: 1 addition & 0 deletions docs/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shamefully-hoist=true
125 changes: 125 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
![nuxt-ui-docs-social-card](https://github.com/nuxt-ui-pro/docs/assets/739984/f64e13d9-9ae0-4e03-bf7f-6be4c36cd9ba)

# Nuxt UI Pro - Docs template

[![Nuxt UI Pro](https://img.shields.io/badge/Made%20with-Nuxt%20UI%20Pro-00DC82?logo=nuxt.js&labelColor=020420)](https://ui.nuxt.com/pro)
[![Nuxt Studio](https://img.shields.io/badge/Open%20in%20Nuxt%20Studio-18181B?&logo=nuxt.js&logoColor=3BB5EC)](https://nuxt.studio/themes/docs)

- [Live demo](https://docs-template.nuxt.dev/)
- [Play on Stackblitz](https://stackblitz.com/github/nuxt-ui-pro/docs)
- [Documentation](https://ui.nuxt.com/pro/getting-started)
- [Clone on Nuxt Studio](https://nuxt.studio/themes/docs)

## Quick Start

```bash [Terminal]
npx nuxi init -t github:nuxt-ui-pro/docs
```

## Setup

Make sure to install the dependencies:

```bash
# npm
npm install

# pnpm
pnpm install

# yarn
yarn install

# bun
bun install
```

## Development Server

Start the development server on `http://localhost:3000`:

```bash
# npm
npm run dev

# pnpm
pnpm run dev

# yarn
yarn dev

# bun
bun run dev
```

## Production

Build the application for production:

```bash
# npm
npm run build

# pnpm
pnpm run build

# yarn
yarn build

# bun
bun run build
```

Locally preview production build:

```bash
# npm
npm run preview

# pnpm
pnpm run preview

# yarn
yarn preview

# bun
bun run preview
```

Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.

## Nuxt Studio integration

Add `@nuxthq/studio` dependency to your package.json:

```bash
# npm
npm install --save-dev @nuxthq/studio

# pnpm
pnpm add -D @nuxthq/studio

# yarn
yarn add -D @nuxthq/studio

# bun
bun add -d @nuxthq/studio
```

Add this module to your `nuxt.config.ts`:

```ts
export default defineNuxtConfig({
...
modules: [
...
'@nuxthq/studio'
]
})
```

Read more on [Nuxt Studio docs](https://nuxt.studio/docs/get-started/setup).

## Renovate integration

Install [Renovate GitHub app](https://github.com/apps/renovate/installations/select_target) on your repository and you are good to go.
78 changes: 78 additions & 0 deletions docs/app/app.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
export default defineAppConfig({

Check failure on line 1 in docs/app/app.config.ts

View workflow job for this annotation

GitHub Actions / ci

Cannot find name 'defineAppConfig'.
ui: {
primary: 'green',
gray: 'slate',
footer: {
bottom: {
left: 'text-sm text-gray-500 dark:text-gray-400',
wrapper: 'border-t border-gray-200 dark:border-gray-800'
}
}
},
seo: {
siteName: 'Nuxt UI Pro - Docs template'
},
header: {
logo: {
alt: '',
light: '',
dark: ''
},
search: true,
colorMode: true,
links: [{
'icon': 'i-simple-icons-github',
'to': 'https://github.com/nuxt-ui-pro/docs',
'target': '_blank',
'aria-label': 'Docs template on GitHub'
}]
},
footer: {
credits: 'Copyright © 2023',
colorMode: false,
links: [{
'icon': 'i-simple-icons-nuxtdotjs',
'to': 'https://nuxt.com',
'target': '_blank',
'aria-label': 'Nuxt Website'
}, {
'icon': 'i-simple-icons-discord',
'to': 'https://discord.com/invite/ps2h6QT',
'target': '_blank',
'aria-label': 'Nuxt UI on Discord'
}, {
'icon': 'i-simple-icons-x',
'to': 'https://x.com/nuxt_js',
'target': '_blank',
'aria-label': 'Nuxt on X'
}, {
'icon': 'i-simple-icons-github',
'to': 'https://github.com/nuxt/ui',
'target': '_blank',
'aria-label': 'Nuxt UI on GitHub'
}]
},
toc: {
title: 'Table of Contents',
bottom: {
title: 'Community',
edit: 'https://github.com/nuxt-ui-pro/docs/edit/main/content',
links: [{
icon: 'i-heroicons-star',
label: 'Star on GitHub',
to: 'https://github.com/nuxt/ui',
target: '_blank'
}, {
icon: 'i-heroicons-book-open',
label: 'Nuxt UI Pro docs',
to: 'https://ui.nuxt.com/pro/guide',
target: '_blank'
}, {
icon: 'i-simple-icons-nuxtdotjs',
label: 'Purchase a license',
to: 'https://ui.nuxt.com/pro/purchase',
target: '_blank'
}]
}
}
})
58 changes: 58 additions & 0 deletions docs/app/app.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<script setup lang="ts">
import type { ParsedContent } from '@nuxt/content'

Check failure on line 2 in docs/app/app.vue

View workflow job for this annotation

GitHub Actions / ci

Cannot find module '@nuxt/content' or its corresponding type declarations.
const { seo } = useAppConfig()

Check failure on line 4 in docs/app/app.vue

View workflow job for this annotation

GitHub Actions / ci

Cannot find name 'useAppConfig'.
const { data: navigation } = await useAsyncData('navigation', () => fetchContentNavigation())

Check failure on line 6 in docs/app/app.vue

View workflow job for this annotation

GitHub Actions / ci

Cannot find name 'useAsyncData'.

Check failure on line 6 in docs/app/app.vue

View workflow job for this annotation

GitHub Actions / ci

Cannot find name 'fetchContentNavigation'.
const { data: files } = useLazyFetch<ParsedContent[]>('/api/search.json', {

Check failure on line 7 in docs/app/app.vue

View workflow job for this annotation

GitHub Actions / ci

Cannot find name 'useLazyFetch'.
default: () => [],
server: false
})
useHead({

Check failure on line 12 in docs/app/app.vue

View workflow job for this annotation

GitHub Actions / ci

Cannot find name 'useHead'.
meta: [
{ name: 'viewport', content: 'width=device-width, initial-scale=1' }
],
link: [
{ rel: 'icon', href: '/favicon.ico' }
],
htmlAttrs: {
lang: 'en'
}
})
useSeoMeta({

Check failure on line 24 in docs/app/app.vue

View workflow job for this annotation

GitHub Actions / ci

Cannot find name 'useSeoMeta'.
titleTemplate: `%s - ${seo?.siteName}`,
ogSiteName: seo?.siteName,
ogImage: 'https://docs-template.nuxt.dev/social-card.png',
twitterImage: 'https://docs-template.nuxt.dev/social-card.png',
twitterCard: 'summary_large_image'
})
provide('navigation', navigation)

Check failure on line 32 in docs/app/app.vue

View workflow job for this annotation

GitHub Actions / ci

Cannot find name 'provide'.
</script>

<template>
<div>
<NuxtLoadingIndicator />

<AppHeader />

<UMain>
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</UMain>

<AppFooter />

<ClientOnly>
<LazyUContentSearch
:files="files"
:navigation="navigation"
/>
</ClientOnly>

<UNotifications />
</div>
</template>
23 changes: 23 additions & 0 deletions docs/app/components/AppFooter.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<script setup lang="ts">
const { footer } = useAppConfig()

Check failure on line 2 in docs/app/components/AppFooter.vue

View workflow job for this annotation

GitHub Actions / ci

Cannot find name 'useAppConfig'.
</script>

<template>
<UFooter>
<template #left>
{{ footer.credits }}
</template>

<template #right>
<UColorModeButton v-if="footer?.colorMode" />

<template v-if="footer?.links">
<UButton
v-for="(link, index) of footer?.links"
:key="index"
v-bind="{ color: 'gray', variant: 'ghost', ...link }"
/>
</template>
</template>
</UFooter>
</template>
53 changes: 53 additions & 0 deletions docs/app/components/AppHeader.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<script setup lang="ts">
import type { NavItem } from '@nuxt/content'
const navigation = inject<NavItem[]>('navigation', [])
const { header } = useAppConfig()
</script>

<template>
<UHeader>
<template #logo>
<template v-if="header?.logo?.dark || header?.logo?.light">
<UColorModeImage v-bind="{ class: 'h-6 w-auto', ...header?.logo }" />
</template>
<template v-else>
Nuxt UI Pro <UBadge
label="Docs"
variant="subtle"
class="mb-0.5"
/>
</template>
</template>

<template
v-if="header?.search"
#center
>
<UContentSearchButton class="hidden lg:flex" />
</template>

<template #right>
<UContentSearchButton
v-if="header?.search"
:label="null"
class="lg:hidden"
/>

<UColorModeButton v-if="header?.colorMode" />

<template v-if="header?.links">
<UButton
v-for="(link, index) of header.links"
:key="index"
v-bind="{ color: 'gray', variant: 'ghost', ...link }"
/>
</template>
</template>

<template #panel>
<UNavigationTree :links="mapContentNavigation(navigation)" />
</template>
</UHeader>
</template>
Loading

0 comments on commit 57eace0

Please sign in to comment.