File size: 6,542 Bytes
391c43e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | # Deployment Publishing
Publish and configure deployments directly from OSW Studio in **Server Mode**.
---
## Overview
Server Mode lets you publish static sites directly from your OSW Studio instance. Each deployment gets its own URL, configurable settings for analytics, SEO, compliance, and more.
**Key Features:**
- **One-click publishing** - Compile and deploy instantly
- **Deployment settings** - Scripts, CDN resources, analytics
- **SEO optimization** - Meta tags, Open Graph, sitemaps
- **Compliance** - Cookie consent, GDPR/CCPA banners
- **Custom domains** - Use your own domain (advanced)
---
## Creating a Deployment
### From Projects View
1. Right-click on a project card
2. Select **"Create Deployment"**
3. Enter deployment name
4. Click **"Create Deployment"**
### From Deployments View
1. Click **"+ New Deployment"** button
2. Select source project
3. Enter deployment details
4. Click **"Create Deployment"**
---
## Publishing Workflow
1. Create/edit deployment settings
2. Click **"Save & Close"**
3. Click **"Publish Now"** (or right-click deployment → Publish)
4. Static builder runs:
- Loads project files from server
- Compiles Handlebars templates (partials from `/templates/`, context from `/data.json`)
- Uses pre-built `bundle.js` for framework runtimes (React, Preact, Svelte, Vue)
- Rewrites internal links to include `/deployments/{id}/` prefix
- Injects configured settings (scripts, analytics, SEO)
- Generates sitemap.xml and robots.txt
- Writes to `/public/deployments/{id}/`
5. Site is live!
**Note**: Python and Lua projects cannot be published — they run only in the browser's WASM runtime. Use ZIP export for offline distribution instead.
### Accessing Published Deployments
**Default URL:**
```
https://your-osw-instance.com/deployments/{id}/
```
**Clean URLs** (Next.js rewrites):
```
/deployments/{id}/about → /deployments/{id}/about.html
/deployments/{id}/blog/post → /deployments/{id}/blog/post.html
```
---
## Deployment Settings
Access deployment settings by clicking the gear icon on any deployment card, or right-click → Settings.
### General
- **Deployment name** - Display name for the deployment
- **URL slug** - Optional custom slug
- **Custom domain** - For advanced setups (see below)
- **Under construction** - Show maintenance page
### Scripts
Add custom scripts to your deployment's HTML:
**Head Scripts:**
- Analytics code
- Meta tag generators
- Preload hints
**Body Scripts:**
- Chat widgets
- Tracking pixels
- Third-party integrations
**Options:**
- Inline or external URL
- Async/defer loading
- Enable/disable per script
### CDN Resources
Load external CSS and JavaScript libraries:
- Bootstrap, Tailwind CDN
- Font Awesome, Material Icons
- jQuery, Alpine.js
- Google Fonts
**Configuration:**
- Resource URL
- Type (CSS or JS)
- Integrity hash (optional)
- Crossorigin setting
### Analytics
Track visitors with built-in or third-party analytics:
**Built-in Analytics** (privacy-focused):
- No cookies required
- Basic pageview tracking
- Referrer tracking
- Privacy mode option
**Third-party Providers:**
- Google Analytics 4
- Google Tag Manager
- Plausible
- Custom tracking code
**Enhanced Features** (toggleable):
- Heatmaps
- Session recording
- Performance metrics
- Engagement tracking
- Custom events
**Data Retention:**
- Configurable retention periods
- Pageviews: 90 days default
- Interactions: 30 days default
- Sessions: 60 days default
### SEO
Optimize your deployment for search engines:
**Meta Tags:**
- Title
- Description
- Keywords
**Open Graph:**
- OG Title
- OG Description
- OG Image
**Twitter Card:**
- Summary or Large Image
**Advanced:**
- Canonical URL
- noindex/nofollow options
**Auto-generated:**
- sitemap.xml
- robots.txt
### Compliance
GDPR/CCPA cookie consent and privacy compliance:
**Banner Settings:**
- Position: Top, Bottom, or Corner
- Style: Bar, Modal, or Corner popup
- Custom message text
- Accept/Decline button text
**Behavior:**
- Opt-in mode (block until consent)
- Opt-out mode (allow until decline)
- Block analytics until consent
**Policy Links:**
- Privacy policy URL
- Cookie policy URL
---
## Managing Deployments
### Deployment Actions
Right-click any deployment card for actions:
| Action | Description |
|--------|-------------|
| **View Live** | Open published site in new tab |
| **Settings** | Configure deployment options |
| **Republish** | Rebuild and deploy |
| **Copy Link** | Copy deployment URL to clipboard |
| **View Source** | Open source project |
| **Analytics** | View deployment analytics dashboard |
| **Capture Thumbnail** | Update preview image |
| **Unpublish** | Disable deployment (keeps settings) |
| **Delete** | Permanently remove deployment |
### Unpublish vs Delete
- **Unpublish**: Disables the deployment but preserves all settings. You can re-publish later.
- **Delete**: Permanently removes the deployment and all its settings.
### Version Tracking
Each deployment shows:
- **Settings Version**: Current configuration version
- **Published Version**: Last published version
If these differ, the deployment has unpublished changes.
---
## Custom Domains
Use a custom domain (e.g., `sweetcandies.com`) for your published deployment. Enter the domain in Deployment Settings, add a DNS A record, and publish. See [Custom Domains Guide](CUSTOM_DOMAINS.md) for full details.
---
## Troubleshooting
### Publishing Errors
**Symptoms**: Deployment not building, empty `/public/deployments/`
**Solutions**:
1. Check build logs in terminal
2. Verify project has files synced to server
3. Check Handlebars syntax in templates
4. Verify disk permissions:
```bash
ls -la public/
chmod 755 public/
```
5. Check available disk space:
```bash
df -h
```
### Deployment Not Updating After Republish
**Symptoms**: Changes not showing on published site
**Solutions**:
1. Hard refresh browser (Ctrl+Shift+R)
2. Check `settingsVersion` vs `lastPublishedVersion` in deployment card
3. Verify "Publish" was clicked (not just "Save")
4. Check build succeeded in terminal logs
5. Inspect HTML source for changes
6. Clear CDN cache (if using one)
### Custom Domain Not Working
See troubleshooting section in [Custom Domains Guide](CUSTOM_DOMAINS.md#troubleshooting).
---
## Next Steps
- **[Backend](?doc=backend-features)** - Database, edge functions, secrets
- **[Server Mode](?doc=server-mode)** - Setup and deployment
- **[Troubleshooting](?doc=troubleshooting)** - Fix common issues
|