Skip to content

Commit 2fff72c

Browse files
committed
chore(playground): sync content docs
1 parent 43106e7 commit 2fff72c

File tree

8 files changed

+241
-12
lines changed

8 files changed

+241
-12
lines changed

playground/docus/content/2.studio/.navigation.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
icon: i-lucide-monitor
2+
title: Studio

playground/docus/content/2.studio/1.introduction.md renamed to playground/docus/content/9.studio/1.introduction.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,22 @@ seo:
66
description: Nuxt Studio has evolved into an open-source Nuxt module that you can self-host alongside your Nuxt Content website.
77
navigation:
88
title: Introduction
9-
icon: i-lucide-info
109
---
1110

1211
## The new Nuxt Studio module
1312

1413
When NuxtLabs joined Vercel, the team promised to release [nuxt.studio](https://nuxt.studio) as a free open-source, self-hosted module for Nuxt projects.
1514

15+
::u-button{to="https://github.com/nuxt-content/studio" icon="i-simple-icons-github" target="_blank" color="neutral" variant="subtle"}
16+
Discover the Nuxt Studio module on GitHub.
17+
::
18+
1619
That promise is now fulfilled. Thanks to vercel support the first version of the **Nuxt Studio module** is available.
1720

1821
You can now enable **content editing directly in production**, with real-time preview and GitHub integration, all from within your own Nuxt application.
1922

20-
::prose-note
21-
**Alpha Release**
22-
23-
:br
24-
25-
The current version includes a Monaco code editor for Markdown, YAML, and JSON files. The visual Notion-like editor will be available in the beta release.
23+
::u-button{to="/admin?redirect=/docs/studio/introduction" icon="i-lucide-mouse-pointer-click" external color="neutral"}
24+
Try editing this page
2625
::
2726

2827
## How does it differ from the standalone platform?
Lines changed: 233 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,233 @@
1+
---
2+
title: Setup Nuxt Studio
3+
description: Learn how to install and configure Nuxt Studio to edit your content in production with GitHub authentication.
4+
navigation:
5+
title: Setup
6+
seo:
7+
title: Nuxt Studio Setup Guide
8+
description: Learn how to install and configure the self-hosted Nuxt Studio module for your Nuxt Content website. Edit content in production with GitHub authentication.
9+
---
10+
11+
::note{to="https://nuxt.studio/docs/setup"}
12+
This documentation covers only the new open-source Nuxt Studio module.
13+
Click here to view the documentation for the legacy standalone platform.
14+
::
15+
16+
## Install
17+
18+
Add the Nuxt Studio module to your project:
19+
20+
::code-group
21+
```bash [pnpm]
22+
pnpm add nuxt-studio@alpha
23+
```
24+
25+
```bash [npm]
26+
npm install nuxt-studio@alpha
27+
```
28+
29+
```bash [yarn]
30+
yarn add nuxt-studio@alpha
31+
```
32+
33+
```bash [bun]
34+
bun add nuxt-studio@alpha
35+
```
36+
::
37+
38+
Alternatively, use the Nuxt CLI to automatically add the module:
39+
40+
```bash [Terminal]
41+
npx nuxi module add nuxt-studio@alpha
42+
```
43+
44+
## Configure
45+
46+
Add the module to your `nuxt.config.ts` and configure your GitHub repository:
47+
48+
```ts [nuxt.config.ts]
49+
export default defineNuxtConfig({
50+
modules: [
51+
'@nuxt/content',
52+
'nuxt-studio'
53+
],
54+
55+
studio: {
56+
// Studio admin route (default: '/_studio')
57+
route: '/_studio',
58+
59+
// GitHub repository configuration (owner and repo are required)
60+
repository: {
61+
provider: 'github', // only GitHub is currently supported
62+
owner: 'your-username', // your GitHub username or organization
63+
repo: 'your-repo', // your repository name
64+
branch: 'main', // the branch to commit to (default: main)
65+
rootDir: '' // optional: if your Nuxt app is in a subdirectory (default: '')
66+
}
67+
}
68+
})
69+
```
70+
71+
::callout
72+
If your Nuxt Content application is in a monorepo or subdirectory, specify the `rootDir` option to point to the correct location.
73+
::
74+
75+
## GitHub OAuth App
76+
77+
Nuxt Studio uses GitHub OAuth for authentication.
78+
79+
::prose-steps
80+
81+
### Navigate to GitHub Developer Settings
82+
83+
Go to [GitHub Developer Settings](https://github.com/settings/developers) and click **New OAuth App**
84+
85+
### Configure the OAuth Application
86+
87+
Fill in the required fields:
88+
- **Application name**: Your app name
89+
- **Homepage URL**: `https://yourdomain.com`
90+
- **Authorization callback URL**: `https://yourdomain.com`
91+
92+
:note[If you want to try studio locally, set the callback url to your local url `http://localhost:3000`]
93+
94+
### Copy Your Credentials
95+
96+
After creating the OAuth app, you'll receive:
97+
98+
- A **Client ID** (visible immediately)
99+
- A **Client Secret** (click **Generate a new client secret**)
100+
101+
### Set your environment Variables
102+
103+
Add the GitHub OAuth credentials to your deployment platform's environment variables or in your `.env` file in local
104+
105+
```bash [.env]
106+
STUDIO_GITHUB_CLIENT_ID=<your_github_client_id>
107+
STUDIO_GITHUB_CLIENT_SECRET=<your_github_client_secret>
108+
```
109+
::
110+
111+
## Deployment
112+
113+
Nuxt Studio requires a server-side route for authentication.
114+
115+
While static generation remains supported with [Nuxt hybrid rendering](https://nuxt.com/docs/4.x/guide/concepts/rendering#hybrid-rendering), your site must be **deployed on a platform that supports server-side rendering (SSR)** using `nuxt build` command.
116+
117+
If you want to pre-render all your pages, use the following configuration:
118+
119+
```ts [nuxt.config.ts]
120+
export default defineNuxtConfig({
121+
nitro: {
122+
prerender: {
123+
// Pre-render the homepage
124+
routes: ['/'],
125+
// Then crawl all the links on the page
126+
crawlLinks: true
127+
}
128+
}
129+
})
130+
```
131+
132+
## Working with Staging/Preview Branches
133+
134+
By default, Studio commits changes to the branch specified in your configuration (typically `main`). However, you can configure Studio to work with a staging or preview branch instead.
135+
136+
This is useful when you want to review changes on a preview environment before merging to production. You can currently handle pull requests manually from GitHub, but automatic PR creation is included in our roadmap and will be implemented in a future release.
137+
138+
::prose-steps
139+
### Configure
140+
141+
Update your `nuxt.config.ts` to target your staging branch.
142+
143+
:::tip
144+
You can use environment variables to manage multiple branches for different environments.
145+
:::
146+
147+
```ts [nuxt.config.ts]
148+
export default defineNuxtConfig({
149+
studio: {
150+
repository: {
151+
owner: 'your-username',
152+
repo: 'your-repo',
153+
branch: PROCESS.ENV.STUDIO_GITHUB_BRANCH_NAME, // Target your staging branch instead of main
154+
}
155+
}
156+
})
157+
```
158+
159+
### Deploy
160+
161+
Configure your hosting platform to deploy the staging branch to a preview URL (e.g., `staging.yourdomain.com`).
162+
163+
### Create a Separate GitHub OAuth App
164+
165+
Create a new OAuth App specifically for your staging environment:
166+
167+
- **Application name**: Your App Name (Staging)
168+
- **Homepage URL**: `https://staging.yourdomain.com`
169+
- **Authorization callback URL**: `https://staging.yourdomain.com`
170+
171+
### Set Environment Variables
172+
173+
Configure your staging deployment with the staging OAuth credentials and your br
174+
175+
```bash [.env.staging]
176+
STUDIO_GITHUB_CLIENT_ID=<your_staging_github_client_id>
177+
STUDIO_GITHUB_CLIENT_SECRET=<your_staging_github_client_secret>
178+
STUDIO_GITHUB_BRANCH_NAME=<your_staging_branch_name>
179+
```
180+
181+
### Access Studio on Staging
182+
183+
Navigate to `https://staging.yourdomain.com/_studio` to edit content. All commits will be pushed to your configured staging branch.
184+
185+
### Merging to Production
186+
187+
Once you're satisfied with changes on your staging branch, create a pull request from your staging branch to your main branch on GitHub to deploy to production.
188+
189+
:::note
190+
**Pull Request Automation Coming Soon**
191+
192+
:br
193+
194+
Automatic pull request creation from Studio is planned for a future release. For now, you'll need to manually create PRs on GitHub to merge staging changes into your main branch.
195+
:::
196+
::
197+
198+
### Accessing Studio
199+
200+
After deployment, access the Studio interface by navigating to your configured route (default: `/_studio`):
201+
202+
1. Click **Login with GitHub** if it does not directly redirect to the OAuth app authorization page
203+
2. Authorize the OAuth application
204+
3. You'll be redirected back to Studio, ready to edit your content
205+
206+
::note
207+
Secure OAuth-based login with **Google** should be available quickly in the Beta release.
208+
::
209+
210+
::tip
211+
You can also use the shortcut :kbd{value="meta"} + :kbd{value="."} to redirect to the Studio route.
212+
::
213+
214+
## Development mode
215+
216+
Nuxt Studio includes an **experimental** development mode that enables real-time file system synchronization:
217+
218+
```ts [nuxt.config.ts]
219+
export default defineNuxtConfig({
220+
studio: {
221+
development: {
222+
sync: true // Enable development mode
223+
}
224+
}
225+
})
226+
```
227+
228+
When enabled, Nuxt Studio will:
229+
230+
- ✅ Write changes directly to your local `content/` directory
231+
- ✅ Write media changes to your local `public/` directory
232+
- ❌ Listen for file system changes and update the editor
233+
- ❌ Commit changes to your repository (use your classical workflow instead)

playground/docus/content/2.studio/3.github.md renamed to playground/docus/content/9.studio/3.github.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ title: Synchronization
33
description: Understand how Nuxt Studio synchronizes content between your production website and your GitHub repository.
44
navigation:
55
title: Synchronization
6-
icon: i-lucide-git-branch
76
seo:
87
title: Real time synchronization between Studio and GitHub
98
description: Understand how Nuxt Studio synchronizes content between your production website and your GitHub repository.

playground/docus/content/2.studio/4.content.md renamed to playground/docus/content/9.studio/4.content.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ title: Edit your content
33
description: Discover and select your favorite way to manage your content between the visual or the code editor.
44
navigation:
55
title: Content Editors
6-
icon: i-lucide-file-edit
76
seo:
87
title: Edit your Nuxt Content website with our editors
98
description: Overview of our different Studio CMS editors to manage your content and your medias. Choose between our visual editors and our code editor.

playground/docus/content/2.studio/5.medias.md renamed to playground/docus/content/9.studio/5.medias.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ title: Manage and integrate Medias in Nuxt Content Studio CMS
33
description: Explore how to browse and manage media files, and integrate them into your projects using Nuxt Content Studio CMS features.
44
navigation:
55
title: Media Library
6-
icon: i-lucide-images
76
---
87

98
## Browse your medias

playground/docus/content/2.studio/6.roadmap.md renamed to playground/docus/content/9.studio/6.roadmap.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ seo:
66
description: Follow the development roadmap of the self-hosted Nuxt Studio module. See what's completed, in progress, and planned for future releases.
77
navigation:
88
title: Roadmap
9-
icon: i-lucide-map
109
---
1110

1211
This roadmap outlines the development phases of the self-hosted Nuxt Studio module. We're committed to build a powerful open-source content management system for Nuxt Content websites.

0 commit comments

Comments
 (0)