Live Embeds
In Share and Embed you published a snippet, and pasted its link and its embed in a few places.
Then your code changes. It always does. 😅
You don't have to export it again, or paste anything again. A snippet that you publish from the editor is live: you edit it, you save it, and every place where it's embedded shows the new version.
Change a published snippet
Keep working in the draft that you shared from.
The strip above the preview shows the state of the snippet. Right now it says:
Live · up to date
Now change something: the code, the theme, an effect. The strip changes to:
Unsaved changes · not live yet
And two buttons appear above the preview: Discard and Save changes.
Note
Nothing public changes while you edit. Your link and your embeds keep showing the last version you saved, until you save again.
Save your changes
Click Save changes.
You can also press ⌘S, or Ctrl+S on Windows and Linux.
The strip goes back to Live · up to date.
And that's it. Everywhere the snippet is embedded shows the new version within a few minutes. There's nothing to paste again. 🎉
Check it
Click View live, next to Export & Share. It opens the page of your snippet, and you will see the new version there.
Tip
Saving is the only thing that updates a published snippet.
Copy link and Copy embed copy the same address as before. They don't change what's published.
Discard your changes
Did you change your mind?
Click Discard. The editor asks you first, because this can't be undone:
Discard your changes to “users”?
If you confirm with Discard changes, your unsaved changes are thrown away and the editor goes back to the version that is live.
The published snippet doesn't change. It never had those changes.
If you leave before saving
If you try to go to another page with unsaved changes, the editor asks what to do:
- Save and leave saves the changes, and then goes.
- Leave goes without saving. Your changes are kept in the draft, in this browser, so you can come back and save them later.
- Keep editing stays where you are.
Find your published snippets
Open the Library tab. At the top there's a Published list, with every snippet you have published.
For each one you see its name, its link, how many views it has this month, and whether it's the one you are editing.
Click a snippet to open it in the editor. There are also two small buttons, to copy its link and to open its page.
You can open a snippet from your dashboard too, with its Edit button. That's the way to continue on another computer, where you don't have the draft.
If it was changed somewhere else
Imagine you edit a snippet on your laptop, and then save an older draft of it from another computer.
The editor doesn't overwrite the newer version. It tells you:
This embed was changed somewhere else. Open it again from your dashboard to get the latest version.
Open the snippet again from the dashboard, and make your change on top of the latest version.
Go back to an earlier version
Every time you save, the version that was live until then is kept. The last 20 are.
To see them:
- Go to your dashboard and click Report on the snippet.
- Scroll to Version history.
Each version shows when it was live, its filename, and how many lines and steps it has.
Click Restore on one, and it's the live version again, at the same address.
The version that it replaced joins the list. So if you restore the wrong one, you can restore your way back.
Live and Fixed URL
In the dashboard, a snippet has one of two marks:
- Live: its address is permanent and its contents can change. Every snippet that you publish from the editor is live.
- Fixed URL: its address is made from its contents, so it can never change. You get these from the API, when you create a snippet without asking for a live one.
To change a snippet with a fixed URL, open it in the editor and publish it. That gives you a new, live one.
Recap
A snippet that you publish from the editor is live:
- Edit it, click Save changes, and every embed shows the new version in a few minutes.
- Nothing is public until you save. Discard takes you back to the live version.
- The last 20 versions are kept, and you can Restore any of them.
Next, you will find out who is watching, in Reports.