From fa725c97c0c0d48c58bd3b903bc8470181a3866c Mon Sep 17 00:00:00 2001 From: Ahad Birang Date: Mon, 11 Jul 2022 15:48:27 +0200 Subject: [PATCH 1/3] docs: add deploy section --- .../content/3.guide/5.deploy/1.node-server.md | 15 +++++++++ .../3.guide/5.deploy/2.static-hosting.md | 33 +++++++++++++++++++ docs/content/3.guide/5.deploy/_dir.yml | 1 + 3 files changed, 49 insertions(+) create mode 100644 docs/content/3.guide/5.deploy/1.node-server.md create mode 100644 docs/content/3.guide/5.deploy/2.static-hosting.md create mode 100644 docs/content/3.guide/5.deploy/_dir.yml diff --git a/docs/content/3.guide/5.deploy/1.node-server.md b/docs/content/3.guide/5.deploy/1.node-server.md new file mode 100644 index 000000000..1713ca72e --- /dev/null +++ b/docs/content/3.guide/5.deploy/1.node-server.md @@ -0,0 +1,15 @@ +# Node Server + +Use the [`nuxi build` command](https://v3.nuxtjs.org//api/commands/build) to build your application. The JS files will be generated in the `.output` directory. + +```bash +npx nuxi build +``` + +Generated files are ready-to-run on Node environment. + +```bash +node .output/server/index.mjs +``` + +Read more about [Node Server deploy](https://v3.nuxtjs.org/guide/deploy/node-server) on Nuxt official docs. \ No newline at end of file diff --git a/docs/content/3.guide/5.deploy/2.static-hosting.md b/docs/content/3.guide/5.deploy/2.static-hosting.md new file mode 100644 index 000000000..8cf4d8baa --- /dev/null +++ b/docs/content/3.guide/5.deploy/2.static-hosting.md @@ -0,0 +1,33 @@ +# Static Hosting + +There are two ways to deploy a Content application to any static hosting services: + +- Static site generation (SSG) prerenders every route of your application at build time. For every page, Nuxt uses a crawler to generate a corresponding HTML file. +- Using `ssr: false` and `service-worker` preset to produce a pure client-side output. + + +## Prerendering + +Use the [`nuxi generate` command](https://v3.nuxtjs.org//api/commands/generate) to build your application. The HTML files will be generated in the `.output/public` directory. + +```bash +npx nuxi generate +``` + +## Client-side only rendering + +If you don't want to prerender your routes, another way of using static hosting is to set the `ssr` property to `false` and `nitro.preset` to `service-worker` in the `nuxt.config` file. The `nuxi build` command will then output an `index.html` entrypoint like a classic client-side Vue.js application. + +```ts [nuxt.config.ts|js] +defineNuxtConfig({ + ssr: false, + nitro: { + preset: 'service-worker' + } +}) +``` + +::alert{type=warning} +Nuxt Content is highly depends on [Nuxt's server engine](https://v3.nuxtjs.org/guide/concepts/server-engine). The only way to have server engine in client only rendering is to use Service Workers. +:: + diff --git a/docs/content/3.guide/5.deploy/_dir.yml b/docs/content/3.guide/5.deploy/_dir.yml new file mode 100644 index 000000000..667e034cd --- /dev/null +++ b/docs/content/3.guide/5.deploy/_dir.yml @@ -0,0 +1 @@ +icon: heroicons-outline:book-open From e31784c49ce05b2d91bcb328bbace21cf4245b3f Mon Sep 17 00:00:00 2001 From: Ahad Birang Date: Mon, 11 Jul 2022 22:57:34 +0200 Subject: [PATCH 2/3] Update docs/content/3.guide/5.deploy/2.static-hosting.md Co-authored-by: nobkd <44443899+nobkd@users.noreply.github.com> --- docs/content/3.guide/5.deploy/2.static-hosting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/3.guide/5.deploy/2.static-hosting.md b/docs/content/3.guide/5.deploy/2.static-hosting.md index 8cf4d8baa..008c34d19 100644 --- a/docs/content/3.guide/5.deploy/2.static-hosting.md +++ b/docs/content/3.guide/5.deploy/2.static-hosting.md @@ -28,6 +28,6 @@ defineNuxtConfig({ ``` ::alert{type=warning} -Nuxt Content is highly depends on [Nuxt's server engine](https://v3.nuxtjs.org/guide/concepts/server-engine). The only way to have server engine in client only rendering is to use Service Workers. +Nuxt Content highly depends on [Nuxt's server engine](https://v3.nuxtjs.org/guide/concepts/server-engine). The only way to have server engine in client only rendering is to use Service Workers. :: From 4dd8e9247a8d26f8d4045b0145effcd176b1746b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Wed, 13 Jul 2022 14:05:57 +0200 Subject: [PATCH 3/3] docs: add deploy fourth --- docs/content/3.guide/{5.deploy => 4.deploy}/1.node-server.md | 0 docs/content/3.guide/{5.deploy => 4.deploy}/2.static-hosting.md | 0 docs/content/3.guide/{5.deploy => 4.deploy}/_dir.yml | 0 docs/content/3.guide/{4.migration => 5.migration}/1.from-v1.md | 0 .../3.guide/{4.migration => 5.migration}/2.edge-channel.md | 0 docs/content/3.guide/{4.migration => 5.migration}/_dir.yml | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename docs/content/3.guide/{5.deploy => 4.deploy}/1.node-server.md (100%) rename docs/content/3.guide/{5.deploy => 4.deploy}/2.static-hosting.md (100%) rename docs/content/3.guide/{5.deploy => 4.deploy}/_dir.yml (100%) rename docs/content/3.guide/{4.migration => 5.migration}/1.from-v1.md (100%) rename docs/content/3.guide/{4.migration => 5.migration}/2.edge-channel.md (100%) rename docs/content/3.guide/{4.migration => 5.migration}/_dir.yml (100%) diff --git a/docs/content/3.guide/5.deploy/1.node-server.md b/docs/content/3.guide/4.deploy/1.node-server.md similarity index 100% rename from docs/content/3.guide/5.deploy/1.node-server.md rename to docs/content/3.guide/4.deploy/1.node-server.md diff --git a/docs/content/3.guide/5.deploy/2.static-hosting.md b/docs/content/3.guide/4.deploy/2.static-hosting.md similarity index 100% rename from docs/content/3.guide/5.deploy/2.static-hosting.md rename to docs/content/3.guide/4.deploy/2.static-hosting.md diff --git a/docs/content/3.guide/5.deploy/_dir.yml b/docs/content/3.guide/4.deploy/_dir.yml similarity index 100% rename from docs/content/3.guide/5.deploy/_dir.yml rename to docs/content/3.guide/4.deploy/_dir.yml diff --git a/docs/content/3.guide/4.migration/1.from-v1.md b/docs/content/3.guide/5.migration/1.from-v1.md similarity index 100% rename from docs/content/3.guide/4.migration/1.from-v1.md rename to docs/content/3.guide/5.migration/1.from-v1.md diff --git a/docs/content/3.guide/4.migration/2.edge-channel.md b/docs/content/3.guide/5.migration/2.edge-channel.md similarity index 100% rename from docs/content/3.guide/4.migration/2.edge-channel.md rename to docs/content/3.guide/5.migration/2.edge-channel.md diff --git a/docs/content/3.guide/4.migration/_dir.yml b/docs/content/3.guide/5.migration/_dir.yml similarity index 100% rename from docs/content/3.guide/4.migration/_dir.yml rename to docs/content/3.guide/5.migration/_dir.yml