Skip to content

Commit d4c98d3

Browse files
committed
docs: improve content and add cache note
1 parent e524bfe commit d4c98d3

File tree

8 files changed

+74
-14
lines changed

8 files changed

+74
-14
lines changed

docs/components/content/Caution.vue

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,20 @@
33
title="Caution"
44
icon="i-ph-warning-octagon-duotone"
55
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"
6+
class="_caution"
77
:class="$attrs.to ? 'dark:hover:!border-red-600/50 hover:!border-red-400/50' : ''"
88
>
99
<ContentSlot :use="$slots.default" unwrap="p" />
1010
</Alert>
1111
</template>
12+
13+
<style lang="postcss">
14+
._caution {
15+
@apply prose-a:text-red-500 hover:prose-a:border-red-500 !bg-red-200/40 !border-red-400/30 prose-code:text-red-700 text-red-900;
16+
@apply dark:!border-red-600 dark:prose-a:text-red-400 dark:hover:prose-a:border-red-400 dark:!bg-red-900/70 dark:text-red-200 dark:prose-code:text-red-200;
17+
a code {
18+
@apply hover:!text-red-600 hover:!border-red-400;
19+
@apply dark:hover:!text-red-400 dark:hover:!border-red-400;
20+
}
21+
}
22+
</style>

docs/components/content/Important.vue

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,20 @@
33
title="Important"
44
icon="i-ph-warning-diamond-duotone"
55
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"
6+
class="_important"
77
:class="$attrs.to ? 'dark:hover:!border-violet-600/50 hover:!border-violet-400/50' : ''"
88
>
99
<ContentSlot :use="$slots.default" unwrap="p" />
1010
</Alert>
1111
</template>
12+
13+
<style lang="postcss">
14+
._important {
15+
@apply prose-a:text-violet-500 hover:prose-a:border-violet-500 !bg-violet-200/40 !border-violet-400/30 prose-code:text-violet-700 text-violet-950;
16+
@apply dark:!border-violet-600 dark:prose-a:text-violet-400 dark:hover:prose-a:border-violet-400 dark:!bg-violet-900/50 dark:text-violet-200 dark:prose-code:text-violet-200;
17+
a code {
18+
@apply hover:!text-violet-700 hover:!border-violet-400;
19+
@apply dark:hover:!text-violet-400 dark:hover:!border-violet-400;
20+
}
21+
}
22+
</style>

docs/components/content/Note.vue

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,20 @@
33
title="Note"
44
icon="i-ph-info-duotone"
55
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"
6+
class="_note"
77
:class="$attrs.to ? 'dark:hover:!border-blue-600/50 hover:!border-blue-400/50' : ''"
88
>
99
<ContentSlot :use="$slots.default" unwrap="p" />
1010
</Alert>
1111
</template>
12+
13+
<style lang="postcss">
14+
._note {
15+
@apply prose-a:text-blue-500 hover:prose-a:border-blue-500 !bg-blue-200/40 !border-blue-400/30 prose-code:text-blue-700 text-blue-900;
16+
@apply dark:!border-blue-600 dark:prose-a:text-blue-400 dark:hover:prose-a:border-blue-400 dark:!bg-blue-900/70 dark:text-blue-200 dark:prose-code:text-blue-200;
17+
a code {
18+
@apply hover:!text-blue-600 hover:!border-blue-400;
19+
@apply dark:hover:!text-blue-400 dark:hover:!border-blue-400;
20+
}
21+
}
22+
</style>

docs/components/content/Tip.vue

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,20 @@
33
title="Tip"
44
icon="i-ph-lightbulb-duotone"
55
color="green"
6-
class="prose-a:text-green-500 hover:prose-a:border-green-500 dark:prose-a:text-green-400 dark:hover:prose-a:border-green-400 dark:!bg-green-800/40 !bg-green-200/40 dark:!border-green-600/30 !border-green-400/30"
6+
class="_tip"
77
:class="$attrs.to ? 'dark:hover:!border-green-600/50 hover:!border-green-400/50' : ''"
88
>
99
<ContentSlot :use="$slots.default" unwrap="p" />
1010
</Alert>
1111
</template>
12+
13+
<style lang="postcss">
14+
._tip {
15+
@apply prose-a:text-green-500 hover:prose-a:border-green-500 !bg-green-200/40 !border-green-400/30 prose-code:text-green-700 text-green-900;
16+
@apply dark:!border-green-600 dark:prose-a:text-green-400 dark:hover:prose-a:border-green-400 dark:!bg-green-900/70 dark:text-green-200 dark:prose-code:text-green-200;
17+
a code {
18+
@apply hover:!text-green-600 hover:!border-green-400;
19+
@apply dark:hover:!text-green-400 dark:hover:!border-green-400;
20+
}
21+
}
22+
</style>

docs/components/content/Warning.vue

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,20 @@
33
title="Warning"
44
icon="i-ph-warning-duotone"
55
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"
6+
class="_warning"
77
:class="$attrs.to ? 'dark:hover:!border-amber-600/50 hover:!border-amber-400/50' : ''"
88
>
99
<ContentSlot :use="$slots.default" unwrap="p" />
1010
</Alert>
1111
</template>
12+
13+
<style lang="postcss">
14+
._warning {
15+
@apply prose-a:text-amber-500 hover:prose-a:border-amber-500 !bg-amber-200/40 !border-amber-400/30 prose-code:text-amber-700 text-amber-900;
16+
@apply dark:!border-amber-600/80 dark:prose-a:text-amber-400 dark:hover:prose-a:border-amber-400 dark:!bg-amber-800/50 dark:text-amber-200 dark:prose-code:text-amber-200;
17+
a code {
18+
@apply hover:!text-amber-600 hover:!border-amber-400;
19+
@apply dark:hover:!text-amber-400 dark:hover:!border-amber-400;
20+
}
21+
}
22+
</style>

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,24 @@ title: Introduction
33
description: NuxtHub helps you build full-stack applications on the Edge.
44
---
55

6-
NuxtHub aims to provide a complete backend experience for [Nuxt](https://nuxt.com) apps, allowing developers to build full-stack applications on the Edge.
6+
NuxtHub aims to provide a complete backend experience for [Nuxt](https://nuxt.com) apps, allowing developers to build full-stack applications on the Edge, read more about [Nuxt on the edge](https://nuxt.com/blog/nuxt-on-the-edge).
77

88
::callout
99
It is **currently made to be deployed on [Cloudflare Pages](https://pages.cloudflare.com)** as it leverages many Cloudflare features such as KV, D1, and R2. We are looking to support other platforms in the future.
1010
::
1111

12-
## Storage
12+
## Features
1313

14-
NuxtHub provides different storage to help you build full-stack applications:
14+
NuxtHub provides multiple features to help you build full-stack applications:
1515
- **SQL database** to store your application's data with [`hubDatabase()`](/docs/storage/database)
1616
- **Key-Value** to store JSON data accessible globally with low-latency with [`hubKV()`](/docs/storage/kv)
1717
- **Blob storage** to store static assets, such as images, videos and more with [`hubBlob()`](/docs/storage/blob)
18+
- **Cache storage** to cache your server route responses or functions using Nitro's [`cachedEventHandler`](https://nitro.unjs.io/guide/cache#cached-event-handlers) and [`cachedFunction`](https://nitro.unjs.io/guide/cache#cached-functions)
1819

19-
Each storage utils is auto-imported and ready to be used in your [Nuxt's server directory](https://nuxt.com/docs/guide/directory-structure/server).
20+
Each storage utils is auto-imported and configured to be used in your [Nuxt's server directory](https://nuxt.com/docs/guide/directory-structure/server).
2021

2122
::callout{icon="i-ph-plugs-connected-duotone" to="/docs/getting-started/deploy#remote-storage"}
22-
NuxtHub comes with a powerful proxy system to connect to your project's resources from your local environment, allowing you to work with your remote storage as if it was local.
23+
NuxtHub comes with a powerful proxy system to connect to your project's resources from your local environment, allowing you to work with your remote storage as if it was local with `npx nuxi dev --remote`.
2324
::
2425

2526
## Packages

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,19 @@ Nuxt will use the remote storage from your deployed project **as long as you are
5959

6060
You can deploy your project on your own Cloudflare account without using the NuxtHub Console.
6161

62-
For that, you need to create the necessary resources in your Cloudflare account and configure your project to use them.
62+
For that, you need to create the necessary resources in your Cloudflare account and configure your project to use them:
6363

64-
1. Create a D1 database, KV namespace and R2 bucket in your Cloudflare account.
65-
2. Create a Cloudflare Pages project and link it to your GitHub or Gitlab repository and choose the Nuxt Framework preset in the build settings.
64+
- One [D1 database](https://dash.cloudflare.com/?to=/:account/workers/d1)
65+
- Two [KV namespaces](https://dash.cloudflare.com/?to=/:account/workers/kv/namespaces) (one for `hubKV()` and one for [server caching](https://nitro.unjs.io/guide/cache))
66+
- One [R2 bucket](https://dash.cloudflare.com/?to=/:account/r2/new)
67+
68+
Then, create a [Cloudflare Pages project](https://dash.cloudflare.com/?to=/:account/pages/new/provider/github) and link your GitHub or Gitlab repository and choose the Nuxt Framework preset in the build settings.
6669

6770
Once your project is created, open the `Settings -> Functions` tab and set:
6871
- Placement: Smart
6972
- KV namespace bindings
7073
- `KV` -> select your KV namespace created
74+
- `CACHE` -> select your KV namespace for caching created
7175
- R2 bucket bindings
7276
- `BLOB` -> select your R2 bucket created
7377
- D1 database bindings

docs/pages/[...slug].vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const links = computed(() => [toc?.bottom?.edit && {
4747
<UPage>
4848
<UPageHeader :title="page.title" :description="page.description" :links="page.links" :headline="headline" />
4949

50-
<UPageBody prose class="dark:text-gray-300">
50+
<UPageBody prose class="dark:text-gray-300 dark:prose-pre:!bg-gray-800/60">
5151
<ContentRenderer v-if="page.body" :value="page" />
5252

5353
<hr v-if="surround?.length">

0 commit comments

Comments
 (0)