Skip to content

Commit bfa179e

Browse files
committed
docs: add content components and improve og image
1 parent 32e3467 commit bfa179e

File tree

15 files changed

+138
-27
lines changed

15 files changed

+138
-27
lines changed

docs/app.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default defineAppConfig({
2828
}]
2929
},
3030
footer: {
31-
credits: 'Copyright © 2024',
31+
credits: 'Copyright NuxtLabs © 2024',
3232
colorMode: false,
3333
links: [{
3434
icon: 'i-simple-icons-nuxtdotjs',

docs/components/OgImage/OgImageDocs.vue

+42-6
Large diffs are not rendered by default.

docs/components/content/Alert.vue

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
<script setup lang="ts">
3+
import type uiColors from '#ui-colors'
4+
5+
const props = defineProps({
6+
title: { type: String },
7+
icon: { type: String },
8+
color: { type: String as PropType<(typeof uiColors)[number]> },
9+
to: { type: String },
10+
})
11+
12+
const target = computed(() => (props.to?.startsWith('https://') ? '_blank' : ''))
13+
</script>
14+
15+
<template>
16+
<Callout :icon="icon" :color="color" :to="to" :target="target">
17+
<ContentSlot :use="$slots.default" unwrap="p" />
18+
</Callout>
19+
</template>

docs/components/content/Caution.vue

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<template>
2+
<Alert
3+
title="Caution"
4+
icon="i-ph-warning-octagon-duotone"
5+
color="red"
6+
class="prose-a:text-red-500 hover:prose-a:border-red-500 dark:prose-a:text-red-400 dark:hover:prose-a:border-red-400 dark:!bg-red-800/40 !bg-red-200/40 dark:!border-red-600/30 !border-red-400/30"
7+
:class="$attrs.to ? 'dark:hover:!border-red-600/50 hover:!border-red-400/50' : ''"
8+
>
9+
<ContentSlot :use="$slots.default" unwrap="p" />
10+
</Alert>
11+
</template>

docs/components/content/Important.vue

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<template>
2+
<Alert
3+
title="Important"
4+
icon="i-ph-warning-diamond-duotone"
5+
color="violet"
6+
class="prose-a:text-violet-500 hover:prose-a:border-violet-500 dark:prose-a:text-violet-400 dark:hover:prose-a:border-violet-400 dark:!bg-violet-800/30 !bg-violet-200/50 dark:!border-violet-600/30 !border-violet-400/30"
7+
:class="$attrs.to ? 'dark:hover:!border-violet-600/50 hover:!border-violet-400/50' : ''"
8+
>
9+
<ContentSlot :use="$slots.default" unwrap="p" />
10+
</Alert>
11+
</template>

docs/components/content/Note.vue

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<template>
2+
<Alert
3+
title="Note"
4+
icon="i-ph-info-duotone"
5+
color="blue"
6+
class="prose-a:text-blue-500 hover:prose-a:border-blue-500 dark:prose-a:text-blue-400 dark:hover:prose-a:border-blue-400 dark:!bg-blue-800/40 !bg-blue-200/40 dark:!border-blue-600/30 !border-blue-400/30"
7+
:class="$attrs.to ? 'dark:hover:!border-blue-600/50 hover:!border-blue-400/50' : ''"
8+
>
9+
<ContentSlot :use="$slots.default" unwrap="p" />
10+
</Alert>
11+
</template>

docs/components/content/Tip.vue

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<template>
2+
<Alert
3+
title="Tip"
4+
icon="i-ph-lightbulb-duotone"
5+
color="green"
6+
class="dark:!bg-green-800/40 !bg-green-200/40 dark:!border-green-600/30 !border-green-400/30"
7+
:class="$attrs.to ? 'dark:hover:!border-green-600/50 hover:!border-green-400/50' : ''"
8+
>
9+
<ContentSlot :use="$slots.default" unwrap="p" />
10+
</Alert>
11+
</template>

docs/components/content/Warning.vue

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<template>
2+
<Alert
3+
title="Warning"
4+
icon="i-ph-warning-duotone"
5+
color="amber"
6+
class="prose-a:text-amber-500 hover:prose-a:border-amber-500 dark:prose-a:text-amber-400 dark:hover:prose-a:border-amber-400 dark:!bg-amber-800/40 dark:!border-amber-800/40 !bg-amber-200/30 !border-amber-400/30"
7+
:class="$attrs.to ? 'dark:hover:!border-amber-600/50 hover:!border-amber-400/50' : ''"
8+
>
9+
<ContentSlot :use="$slots.default" unwrap="p" />
10+
</Alert>
11+
</template>

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ NuxtHub comes with a powerful proxy system to connect to your project's resource
2424

2525
## Packages
2626

27-
We plan to provide a complete backend experience for Nuxt apps through various `@nuxthub` modules.
27+
We plan to provide a complete backend experience for Nuxt apps through various `@nuxthub` packages.
2828

2929
- [`@nuxthub/core`](https://github.com/nuxt-hub/core): Main package to provide storage features
3030
- `@nuxthub/auth`: Add authentication for user management (soon)
3131
- `@nuxthub/email`: Send transactional emails to your users (soon)
3232
- `@nuxthub/analytics`: Understand your traffic and track events within your application and API (soon)
3333
- `@nuxthub/...`: You name it!
3434

35-
::callout
36-
We are currently in the early stages of development and are looking for feedback from the community. If you are interested in contributing, please join us on [nuxt-hub/core](https://github.com/nuxt-hub/core).
35+
::important
36+
We are currently in the early stages of development (alpha) and are looking for feedback from the community. If you are interested in contributing, please join us on [nuxt-hub/core](https://github.com/nuxt-hub/core).
3737
::
3838

3939
## Console (alpha)
@@ -52,6 +52,6 @@ The [NuxtHub console](https://console.hub.nuxt.com) is a web based dashboard to
5252
- Give access to team members to manage the application without sharing your Cloudflare account
5353
- Monitor your application with logs and analytics
5454

55-
::callout
55+
::note
5656
The NuxtHub Console is currently in private alpha and is not yet open to the public. We are looking for early adopters to help us shape the platform. If you are interested, please register on [console.hub.nuxt.com](https://console.hub.nuxt.com) and tell us what you plan to build with NuxtHub.
5757
::

docs/content/docs/1.getting-started/2.installation.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export default defineNuxtConfig({
6060

6161
That's it! You can now use NuxtHub features in your Nuxt project.
6262

63-
::callout
63+
::note
6464
NuxtHub will create a `.data/hub` directory in your project root, which contains the necessary configuration files and resources for the features to work. It will also add it to the `.gitignore` file to avoid committing it to your repository.
6565
::
6666

@@ -85,6 +85,6 @@ export default defineNuxtConfig({
8585
::
8686
::
8787

88-
::callout
88+
::tip{icon="i-ph-rocket-launch-duotone"}
8989
You're all set! Now, let's dive into connecting to your Cloudflare account and [deploying it on the Edge](/docs/getting-started/deploy).
9090
::

docs/content/docs/1.getting-started/3.deploy.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ To deploy your Nuxt application on the Edge, we use Cloudflare Pages. Therefore,
77

88
## NuxtHub Console (alpha)
99

10-
The [NuxtHub Console](https://console.hub.nuxt.com) is made to simplify your experience with the NuxtHub module, enabling you to effortlessly manage teams and projects, as well as deploy in seconds combined with the NuxtHub CLI.
10+
The [NuxtHub Console](https://console.hub.nuxt.com) is made to simplify your experience with NuxtHub, enabling you to effortlessly manage teams and projects, as well as deploy in seconds combined with the NuxtHub CLI.
1111

1212
After linking your Cloudflare account in the console, deploy your project with a single command:
1313

@@ -49,7 +49,9 @@ export default defineNuxtConfig({
4949
})
5050
```
5151

52+
::note
5253
Nuxt will use the remote storage from your deployed project **as long as you are logged in with the [NuxtHub CLI](https://github.com/nuxt-hub/cli) and the local project is linked to a NuxtHub project**.
54+
::
5355

5456
## Self-hosted
5557

@@ -91,4 +93,7 @@ Then, start your Nuxt project with:
9193
npx nuxt dev --remote
9294
```
9395

94-
NuxtHub will use the remote data from your deployed project as long as the `NUXT_HUB_PROJECT_SECRET` matches the one in your Cloudflare Pages project settings.
96+
::warning
97+
NuxtHub will use the remote data from your deployed project as long as the `NUXT_HUB_PROJECT_SECRET` matches the one in
98+
your Cloudflare Pages project settings.
99+
::

docs/content/docs/2.storage/1.database.md

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ description: How to create a database and store entries with NuxtHub.
55

66
NuxtHub Database is a layer on top of [Cloudflare D1](https://developers.cloudflare.com/d1), a serverless SQLite databases.
77

8-
Once properly configured, NuxtHub module exposes a server composable to the application.
9-
108
## `hubDatabase()`
119

1210
Server composable that returns a [D1 database client](https://developers.cloudflare.com/d1/build-databases/query-databases/).

docs/content/docs/2.storage/3.blob.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ title: Blob
33
description: How to store objects with NuxtHub.
44
---
55

6-
NuxtHub Blob is a layer to [Cloudflare R2](https://developers.cloudflare.com/r2){target=_blank}, allowing to store large amounts of unstructured data.
7-
8-
Once properly configured, NuxtHub module exposes a server composable to the application.
6+
NuxtHub Blob is a layer on top of [Cloudflare R2](https://developers.cloudflare.com/r2), allowing to store large amounts of unstructured data (images, videos, etc.).
97

108
## `hubBlob()`
119

docs/content/docs/3.recipes/1.hooks.md

+3-7
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ description: Use lifecycle hooks to stay synced with NuxtHub.
77

88
Use `onHubReady()` to ensure the execution of some code once NuxtHub environment bindings are set up.
99

10-
::callout
11-
It is a shortcut using the [`hubHooks`](#hubhooks) object under the hood to listen to the `bindings:ready` event.
10+
::note
11+
`onHubReady()` is a shortcut using the [`hubHooks`](#hubhooks) object under the hood to listen to the `bindings:ready` event.
1212
::
1313

1414
This is useful to run database migrations inside your [server/plugins/](https://nuxt.com/docs/guide/directory-structure/server#server-plugins).
@@ -31,10 +31,6 @@ export default defineNitroPlugin(() => {
3131

3232
```
3333

34-
This is similar to
35-
36-
<!-- TODO -->
37-
3834
## `hubHooks`
3935

4036
The `hubHooks` object is a collection of hooks that can be used to stay synced with NuxtHub.
@@ -60,7 +56,7 @@ export default defineNitroPlugin(() => {
6056
})
6157
```
6258

63-
::callout{icon="i-ph-info-duotone"}
59+
::note
6460
Note that `hubHooks` is a [hookable](https://hookable.unjs.io) instance.
6561
::
6662

docs/content/docs/3.recipes/2.drizzle.md

+4
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ When running the `npm run migrate` command, `drizzle-kit` will generate the migr
9191

9292
### Migrations
9393

94+
::important
95+
We are planning to update this section to leverage [Nitro Tasks](https://nitro.unjs.io/guide/tasks) instead of a server plugin very soon.
96+
::
97+
9498
We can create a server plugin to run the migrations in development automatically:
9599

96100
```ts [server/plugins/migrations.ts]

0 commit comments

Comments
 (0)