Skip to content

Commit 21167b5

Browse files
committed
docs(readme): update
1 parent 140b316 commit 21167b5

File tree

1 file changed

+55
-27
lines changed

1 file changed

+55
-27
lines changed

README.md

Lines changed: 55 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -59,75 +59,103 @@ Originally offered as a standalone premium platform at https://nuxt.studio, Stud
5959

6060
> **Note**: This alpha release provides both a Monaco code editor and a TipTap visual WYSIWYG editor for Markdown content. You can switch between them at any time.
6161
62-
### 1. Module Installation
62+
### 1. Install
6363

64-
Install the module in your Nuxt application with one command:
64+
Install the module in your Nuxt application:
6565

6666
```bash
6767
npx nuxi module add nuxt-studio@alpha
6868
```
6969

70-
Add it to your `nuxt.config` and configure your repository.
70+
### 2. Configure
71+
72+
Add it to your `nuxt.config.ts` and configure your repository:
7173

7274
```ts
7375
export default defineNuxtConfig({
7476
modules: [
7577
'@nuxt/content',
7678
'nuxt-studio'
7779
],
80+
7881
studio: {
79-
// Your configuration
82+
// Studio admin route (default: '/_studio')
83+
route: '/_studio',
84+
85+
// Git repository configuration (owner and repo are required)
8086
repository: {
81-
provider: 'github', // default: only GitHub supported currently
82-
owner: 'your-username', // your GitHub owner
83-
repo: 'your-repo', // your GitHub repository name
84-
branch: 'main',
85-
rootDir: '' // optional: location of your content app
87+
provider: 'github', // 'github' or 'gitlab'
88+
owner: 'your-username', // your GitHub/GitLab username or organization
89+
repo: 'your-repo', // your repository name
90+
branch: 'main', // the branch to commit to (default: main)
8691
}
8792
}
8893
})
8994
```
9095

91-
### 2. Create a GitHub OAuth App
96+
### 3. Dev Mode
97+
98+
🚀 **That's all you need to enable Studio locally!**
99+
100+
Run your Nuxt app and navigate to `/_studio` to start editing. Any file changes will be synchronized in real time with the file system.
101+
102+
> **Note**: The publish system is only available in production mode. Use your classical workflow (IDE, CLI, GitHub Desktop...) to publish your changes locally.
103+
104+
### 4. Production Mode
105+
106+
To enable publishing directly from your production website, you need to configure OAuth authentication.
107+
108+
#### Create a GitHub OAuth App
92109

93110
1. Go to [GitHub Developer Settings](https://github.com/settings/developers)
94111
2. Click **"New OAuth App"**
95112
3. Fill in the application details:
96113
- **Application name**: Your App Name
97114
- **Homepage URL**: Your website homepage URL
98-
- **Authorization callback URL**: `${YOUR_WEBSITE_URL}/${options.route}/auth/github` (default: `${YOUR_WEBSITE_URL}/_studio/auth/github`)
115+
- **Authorization callback URL**: `${YOUR_WEBSITE_URL}/_studio/auth/github`
99116
4. Copy the **Client ID** and generate a **Client Secret**
100-
5. Add them to your deployment environment variables (see next section)
101-
102-
### 3. Environment Variables
103-
104-
Nuxt Studio requires environment variables for authentication and publication on your repository.
105-
106-
Add the previsously generated Client ID and Client Secret to your deployment environment variables.
117+
5. Add them to your deployment environment variables:
107118

108119
```bash
109120
STUDIO_GITHUB_CLIENT_ID=your_github_client_id
110121
STUDIO_GITHUB_CLIENT_SECRET=your_github_client_secret
111122
```
112123

113-
## Configuration
124+
> **Note**: GitLab is also supported. See the [providers documentation](https://content.nuxt.com/docs/studio/providers) for setup instructions.
125+
126+
#### Deployment
127+
128+
Nuxt Studio requires server-side routes for authentication. Your site must be **deployed on a platform that supports SSR** using `nuxt build`.
129+
130+
If you want to pre-render all your pages, use hybrid rendering:
131+
132+
```ts
133+
export default defineNuxtConfig({
134+
nitro: {
135+
prerender: {
136+
routes: ['/'],
137+
crawlLinks: true
138+
}
139+
}
140+
})
141+
```
114142

115-
Configure Nuxt Studio in your `nuxt.config.ts`:
143+
## Configuration Options
116144

117145
```ts
118146
export default defineNuxtConfig({
119-
modules: ['nuxt-studio'],
120147
studio: {
121148
// Studio admin login route
122149
route: '/_studio', // default
123150

124-
// Git repository configuration (required)
151+
// Git repository configuration
125152
repository: {
126-
provider: 'github', // only GitHub is supported currently (default)
127-
owner: 'your-username', // your GitHub owner
128-
repo: 'your-repo', // your GitHub repository name
129-
branch: 'main', // your GitHub branch
130-
rootDir: '' // optional: root directory for
153+
provider: 'github', // 'github' or 'gitlab' (default: 'github')
154+
owner: 'your-username', // your GitHub/GitLab owner (required)
155+
repo: 'your-repo', // your repository name (required)
156+
branch: 'main', // branch to commit to (default: 'main')
157+
rootDir: '', // subdirectory for monorepos (default: '')
158+
private: true, // request access to private repos (default: true)
131159
},
132160
}
133161
})

0 commit comments

Comments
 (0)