# Drafts and publishing

Every change saves as a draft on its own. Publish makes the draft live, after Smoodly checks it. This page covers the three states, what publish checks, and the two ways back.

## Autosave

There is no Save button. Each change in the editor saves the draft after a moment, and the indicator in the top bar says *Saved* when it has. Nothing reaches the site until an editor publishes; a draft can stay unpublished for as long as it likes. Entries and globals autosave the same way.

Saving is lenient: a draft may be incomplete, with required fields still empty.

## The three states

The badge next to *Publish* shows the page's state in the selected language:

| State | Meaning |
| --- | --- |
| `Draft` | Nothing is live. The page has never been published in this language. |
| `Published` | The live page matches the draft. |
| `Unpublished changes` | The page is live, and the draft has moved on. This is the state that asks for a click. |

Publishing is per language. A page published in English and edited in Finnish shows *Unpublished changes* in Finnish only.

## What publish checks

*Publish* validates the whole draft first. A required field left empty, a list past its `.max()`, a choice outside its options or a refused CSS snippet stops the publish, and the editor lists the fields to fix. Hidden fields are skipped.

Publish also checks references. A page cannot go live in a language while it shows an entry or a global that is unpublished, or does not exist, in that language, and an entry or a global cannot go live while a reference field of its points at such an entry. The message names the offenders; publish those first.

On a passing publish the live page updates at once, and so do the pages that list it.

## Two ways back

The ⋯ menu next to *Publish* offers two more actions, disabled when they do not apply:

- **Discard changes** throws the draft away and restores the published version, so the page shows *Published* again.
- **Unpublish** takes the page off the site. Its URL returns a 404 until it is published again. A page whose child is still published in that language cannot be unpublished, so that no page serves under a parent the site no longer shows: unpublish the children first. The home page and every fixed page stay published.

*History*, the first item in the same menu, is on the [next page](https://smoodly.io/docs/pages/version-history.md).

## Entries and globals

The entry form and a global's form carry the same badge, the same *Publish* and the same menu, and follow the same rules. Publishing a page never publishes a global it shows: a footer going live on every page is a click of its own, in the global's card in the canvas or on its own page under *Site*.

Next, [Version history](https://smoodly.io/docs/pages/version-history.md).
