Leon4gr45/builder
0
1# Deployment Publishing2 3Publish and configure deployments directly from OSW Studio in **Server Mode**.4 5---6 7## Overview8 9Server 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.10 11**Key Features:**12- **One-click publishing** - Compile and deploy instantly13- **Deployment settings** - Scripts, CDN resources, analytics14- **SEO optimization** - Meta tags, Open Graph, sitemaps15- **Compliance** - Cookie consent, GDPR/CCPA banners16- **Custom domains** - Use your own domain (advanced)17 18---19 20## Creating a Deployment21 22### From Projects View23 241. Right-click on a project card252. Select **"Create Deployment"**263. Enter deployment name274. Click **"Create Deployment"**28 29### From Deployments View30 311. Click **"+ New Deployment"** button322. Select source project333. Enter deployment details344. Click **"Create Deployment"**35 36---37 38## Publishing Workflow39 401. Create/edit deployment settings412. Click **"Save & Close"**423. Click **"Publish Now"** (or right-click deployment → Publish)434. Static builder runs:44 - Loads project files from server45 - Compiles Handlebars templates (partials from `/templates/`, context from `/data.json`)46 - Uses pre-built `bundle.js` for framework runtimes (React, Preact, Svelte, Vue)47 - Rewrites internal links to include `/deployments/{id}/` prefix48 - Injects configured settings (scripts, analytics, SEO)49 - Generates sitemap.xml and robots.txt50 - Writes to `/public/deployments/{id}/`515. Site is live!52 53**Note**: Python and Lua projects cannot be published — they run only in the browser's WASM runtime. Use ZIP export for offline distribution instead.54 55### Accessing Published Deployments56 57**Default URL:**58```59https://your-osw-instance.com/deployments/{id}/60```61 62**Clean URLs** (Next.js rewrites):63```64/deployments/{id}/about → /deployments/{id}/about.html65/deployments/{id}/blog/post → /deployments/{id}/blog/post.html66```67 68---69 70## Deployment Settings71 72Access deployment settings by clicking the gear icon on any deployment card, or right-click → Settings.73 74### General75 76- **Deployment name** - Display name for the deployment77- **URL slug** - Optional custom slug78- **Custom domain** - For advanced setups (see below)79- **Under construction** - Show maintenance page80 81### Scripts82 83Add custom scripts to your deployment's HTML:84 85**Head Scripts:**86- Analytics code87- Meta tag generators88- Preload hints89 90**Body Scripts:**91- Chat widgets92- Tracking pixels93- Third-party integrations94 95**Options:**96- Inline or external URL97- Async/defer loading98- Enable/disable per script99 100### CDN Resources101 102Load external CSS and JavaScript libraries:103 104- Bootstrap, Tailwind CDN105- Font Awesome, Material Icons106- jQuery, Alpine.js107- Google Fonts108 109**Configuration:**110- Resource URL111- Type (CSS or JS)112- Integrity hash (optional)113- Crossorigin setting114 115### Analytics116 117Track visitors with built-in or third-party analytics:118 119**Built-in Analytics** (privacy-focused):120- No cookies required121- Basic pageview tracking122- Referrer tracking123- Privacy mode option124 125**Third-party Providers:**126- Google Analytics 4127- Google Tag Manager128- Plausible129- Custom tracking code130 131**Enhanced Features** (toggleable):132- Heatmaps133- Session recording134- Performance metrics135- Engagement tracking136- Custom events137 138**Data Retention:**139- Configurable retention periods140- Pageviews: 90 days default141- Interactions: 30 days default142- Sessions: 60 days default143 144### SEO145 146Optimize your deployment for search engines:147 148**Meta Tags:**149- Title150- Description151- Keywords152 153**Open Graph:**154- OG Title155- OG Description156- OG Image157 158**Twitter Card:**159- Summary or Large Image160 161**Advanced:**162- Canonical URL163- noindex/nofollow options164 165**Auto-generated:**166- sitemap.xml167- robots.txt168 169### Compliance170 171GDPR/CCPA cookie consent and privacy compliance:172 173**Banner Settings:**174- Position: Top, Bottom, or Corner175- Style: Bar, Modal, or Corner popup176- Custom message text177- Accept/Decline button text178 179**Behavior:**180- Opt-in mode (block until consent)181- Opt-out mode (allow until decline)182- Block analytics until consent183 184**Policy Links:**185- Privacy policy URL186- Cookie policy URL187 188---189 190## Managing Deployments191 192### Deployment Actions193 194Right-click any deployment card for actions:195 196| Action | Description |197|--------|-------------|198| **View Live** | Open published site in new tab |199| **Settings** | Configure deployment options |200| **Republish** | Rebuild and deploy |201| **Copy Link** | Copy deployment URL to clipboard |202| **View Source** | Open source project |203| **Analytics** | View deployment analytics dashboard |204| **Capture Thumbnail** | Update preview image |205| **Unpublish** | Disable deployment (keeps settings) |206| **Delete** | Permanently remove deployment |207 208### Unpublish vs Delete209 210- **Unpublish**: Disables the deployment but preserves all settings. You can re-publish later.211- **Delete**: Permanently removes the deployment and all its settings.212 213### Version Tracking214 215Each deployment shows:216- **Settings Version**: Current configuration version217- **Published Version**: Last published version218 219If these differ, the deployment has unpublished changes.220 221---222 223## Custom Domains224 225Use 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.226 227---228 229## Troubleshooting230 231### Publishing Errors232 233**Symptoms**: Deployment not building, empty `/public/deployments/`234 235**Solutions**:2361. Check build logs in terminal2372. Verify project has files synced to server2383. Check Handlebars syntax in templates2394. Verify disk permissions:240 ```bash241 ls -la public/242 chmod 755 public/243 ```2445. Check available disk space:245 ```bash246 df -h247 ```248 249### Deployment Not Updating After Republish250 251**Symptoms**: Changes not showing on published site252 253**Solutions**:2541. Hard refresh browser (Ctrl+Shift+R)2552. Check `settingsVersion` vs `lastPublishedVersion` in deployment card2563. Verify "Publish" was clicked (not just "Save")2574. Check build succeeded in terminal logs2585. Inspect HTML source for changes2596. Clear CDN cache (if using one)260 261### Custom Domain Not Working262 263See troubleshooting section in [Custom Domains Guide](CUSTOM_DOMAINS.md#troubleshooting).264 265---266 267## Next Steps268 269- **[Backend](?doc=backend-features)** - Database, edge functions, secrets270- **[Server Mode](?doc=server-mode)** - Setup and deployment271- **[Troubleshooting](?doc=troubleshooting)** - Fix common issues272 