Skip to content

Commit

Permalink
feat: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Flosciante committed Sep 14, 2023
1 parent 71b169c commit f346754
Show file tree
Hide file tree
Showing 93 changed files with 1,369 additions and 1,556 deletions.
29 changes: 17 additions & 12 deletions docs/app.vue
Original file line number Diff line number Diff line change
@@ -1,36 +1,41 @@
<script setup>
<script setup lang="ts">
import { withoutTrailingSlash } from 'ufo'
const { mapContentNavigation } = useElementsHelpers()
const route = useRoute()
useServerSeoMeta({
ogSiteName: 'Nuxt DevTools',
ogSiteName: 'Nuxt Content',
twitterCard: 'summary_large_image',
})
useHead({
htmlAttrs: {
lang: 'en',
},
link: () => [
{ rel: 'canonical', href: `https://devtools.nuxtjs.org${withoutTrailingSlash(route.path)}` },
{ rel: 'canonical', href: `https://content.nuxtjs.org${withoutTrailingSlash(route.path)}` },
],
})
const links = [{
label: 'Documentation',
to: '/guide/getting-started',
to: '/get-started',
}, {
label: 'Playground',
to: '/playground',
}, {
label: 'Releases',
to: 'https://github.com/nuxt/devtools/releases',
to: 'https://github.com/nuxt/content/releases',
target: '_blank',
}]
const { data: files } = useLazyFetch('/api/search.json', {
default: () => [],
server: false,
})
const { data: navigation } = await useAsyncData('navigation', () => fetchContentNavigation())
// Provide
Expand All @@ -47,8 +52,8 @@ provide('navigation', navigation)
<UColorModeButton v-if="!$colorMode.forced" />
<USocialButton aria-label="Nuxt Website" icon="i-simple-icons-nuxtdotjs" to="https://nuxt.com" />
<USocialButton aria-label="Nuxt on X" icon="i-simple-icons-x" to="https://x.com/nuxt_js" />
<USocialButton aria-label="Nuxt DevTools on GitHub" icon="i-simple-icons-github"
to="https://github.com/nuxt/devtools" />
<USocialButton aria-label="Nuxt Content on GitHub" icon="i-simple-icons-github"
to="https://github.com/nuxt/content" />
</template>
<!-- Mobile panel -->
<template v-if="$route.path !== '/'" #panel>
Expand All @@ -64,17 +69,17 @@ provide('navigation', navigation)
<UFooter :links="links">
<template #left>
<span class="text-sm">
Published under <NuxtLink to="https://github.com/nuxt/devtools" target="_blank" class="underline">
MIT License
</NuxtLink>
</span>
Published under <NuxtLink to="https://github.com/nuxt/content" target="_blank" class="underline">
MIT License
</NuxtLink>
</span>
</template>
<template #right>
<UColorModeButton v-if="!$colorMode.forced" />
<USocialButton aria-label="Nuxt Website" icon="i-simple-icons-nuxtdotjs" to="https://nuxt.com" />
<USocialButton aria-label="Nuxt on X" icon="i-simple-icons-x" to="https://x.com/nuxt_js" />
<USocialButton aria-label="Nuxt Devtools on GitHub" icon="i-simple-icons-github"
to="https://github.com/nuxt/devtools" />
to="https://github.com/nuxt/content" />
</template>
</UFooter>
<ClientOnly>
Expand Down
15 changes: 4 additions & 11 deletions docs/components/VideoPlayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,14 @@ defineProps({
default: '',
},
})
const videoWrapper = ref()
const videoPlayer = ref()
</script>

<template>
<div
ref="videoWrapper"
class="relative flex items-center justify-center border border-slate-200/10 rounded-xl bg-slate-700/20"
>
<div ref="videoWrapper"
class="relative flex items-center justify-center border border-slate-200/10 rounded-xl bg-slate-700/20">
<div class="p-4">
<video
ref="videoPlayer" :poster="poster" :src="source.src" :type="source.type" controls
class="rounded-lg bg-slate-800" autoplay muted
/>
<video ref="videoPlayer" :poster="poster" :src="source.src" :type="source.type" controls
class="rounded-lg bg-slate-800" muted />
</div>
</div>
</template>
Expand Down
24 changes: 24 additions & 0 deletions docs/components/content/ButtonLink.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<script setup lang="ts">
defineProps({
to: {
type: String,
default: ''
},
icon: {
type: String,
default: ''
},
label: {
type: String,
default: ''
},
size: {
type: String,
default: 'md'
}
})
</script>

<template>
<UButton color="primary" :to="to" :label="label" :icon="icon" :size="size" />
</template>
5 changes: 5 additions & 0 deletions docs/components/content/CodeBlock.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<template>
<div class="bg-gray-600">
<slot />
</div>
</template>
5 changes: 0 additions & 5 deletions docs/components/content/CodeInline.vue

This file was deleted.

2 changes: 1 addition & 1 deletion docs/components/content/Example/ExampleCard.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="p-6 border bg-white dark:bg-black dark:border-gray-700 rounded">
<div class="p-6 border bg-white dark:bg-gray-800 dark:border-gray-700 rounded">
<slot />
</div>
</template>
8 changes: 0 additions & 8 deletions docs/components/content/Example/ExampleHero.vue

This file was deleted.

5 changes: 0 additions & 5 deletions docs/components/content/Example/ExampleTheTitle.vue

This file was deleted.

21 changes: 0 additions & 21 deletions docs/components/content/HeroAnnouncement.vue

This file was deleted.

23 changes: 0 additions & 23 deletions docs/components/content/PropInspector.vue

This file was deleted.

35 changes: 35 additions & 0 deletions docs/components/content/ProseCode.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<template>
<slot />
</template>

<script setup lang="ts">
defineProps({
code: {
type: String,
default: ''
},
language: {
type: String,
default: null
},
filename: {
type: String,
default: null
},
highlights: {
type: Array as () => number[],
default: () => []
},
meta: {
type: String,
default: null
}
})
</script>

<style>
pre code .line {
display: block;
min-height: 1rem;
}
</style>
51 changes: 0 additions & 51 deletions docs/components/content/V1DocsLinks.vue

This file was deleted.

23 changes: 9 additions & 14 deletions docs/content/1.get-started.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
---
icon: heroicons-outline:lightning-bolt
layout: docs-page
title: Get Started
description: Get started with Nuxt Content by creating a new project or adding it to an existing Nuxt application.
---

# Get Started

Get started with Nuxt Content by creating a new project or adding it to an existing Nuxt application.

## Play online

You can start playing with Nuxt Content in your browser using our online sandboxes:

:button-link[Play on StackBlitz]{icon="IconStackBlitz" href="https://stackblitz.com/github/nuxt/starter/tree/content" blank style="margin-right: var(--space-4);"}
:button-link[Play on CodeSandbox]{icon="IconCodeSandBox" href="https://codesandbox.io/s/github/nuxt/starter/tree/content" blank}
:button-link{icon="i-simple-icons-stackblitz" to="https://stackblitz.com/github/nuxt/starter/tree/content" blank label="Play on StackBlitz" .mr-4}
:button-link{icon="i-simple-icons-codesandbox" to="https://codesandbox.io/s/github/nuxt/starter/tree/content" label="Play on CodeSandbox" blank}

## New Project

Expand Down Expand Up @@ -70,11 +65,11 @@ npm run dev
```
::

::alert{type="success"}
::callout{type="success"}
✨ Well done! A browser window should automatically open for <http://localhost:3000>
::

::alert{type="info"}
::callout{type="info"}
👉 Next step is to head over the [Writing section](/guide/writing/content-directory) to learn how to use Nuxt Content.
::

Expand Down Expand Up @@ -131,14 +126,14 @@ To render content pages, add a [catch-all route](https://nuxt.com/docs/guide/dir
</template>
```

::alert{type="warning"}
::callout{type="warning"}
⚠️ If you have an `app.vue` file at the project's root, ensure that you include [`<NuxtPage />`](https://nuxt.com/docs/api/components/nuxt-page#nuxtpage) in its template to render pages.
::

::alert{type="warning"}
::callout{type="warning"}
⚠️ Content v2 requires [Nuxt 3](https://nuxt.com). If you are using Nuxt 2, checkout [Content v1 documentation](/v1/getting-started/installation).
::

::alert{type="info"}
::callout{type="info"}
👉 Next step is to head over the [Writing section](/guide/writing/content-directory) to learn how to use Nuxt Content.
::
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Content directory

The Content module parses `.md` and `.yaml` files inside the content/ directory and provides paths according to the directory structure.
---
title: Content directory
description: The Content module parses .md and .yaml files inside the content/ directory and provides paths according to the directory structure.
---

## Paths

Expand Down Expand Up @@ -36,7 +37,7 @@ content/
index.md
```

::alert{type="info"}
::callout{type="info"}
Separate number from file name using `.` character. Using any other separator will not work.
::

Expand Down Expand Up @@ -74,7 +75,7 @@ content/
1.messages.md // Partial content because of its grand parent
```

::alert{type="info"}
::callout{type="info"}
Starting a directory name with `_` will mark its entire nested content as partial.
::

Expand Down

0 comments on commit f346754

Please sign in to comment.