---
title: Publishing & code injection
description: Drafts vs. publish, device previews, and adding analytics, custom fonts, or global CSS via the custom head code panel.
sidebar:
order: 5
---
import { Aside } from '@astrojs/starlight/components';
import Beta from '~/content/partials/beta-callout.mdx';
import Support from '~/content/partials/support-link.mdx';
## Drafts vs. publish
Site Builder separates "save my edits" from "make these edits live."
- **Save** stores your edits as a draft on the server. You can close the editor and come back; your work is preserved. The live site doesn't change.
- **Publish** renders the site, writes the resulting HTML and assets to the site's docroot, and serves it to visitors on the next request.
The two buttons are in the top right of the editor.
## Preview before publishing
Two previews are available, both without affecting the live site:
- **Inline preview** — the desktop/tablet/mobile toggle on the top bar swaps the canvas viewport so you can see how the page reflows.
- **Full-window preview** — click **Preview** at the top to see your draft rendered without the editor chrome. Use this to read the page like a visitor.
If you want to share a preview with someone outside your account, save the draft, then publish to a staging site (a separate WHP site you keep around for review).
## Custom head code
The **Code** button at the top of the editor opens a modal where you can paste content into the `
` of every page on the site.

Common uses:
- **Google Analytics, Plausible, Fathom, or other analytics** — paste the tracking snippet they give you.
- **Custom fonts** — `` tags pointing at Google Fonts, Fontsource, or your own hosted font.
- **Global CSS overrides** — inline `