Hosting with 20% off when you buy through the link

Publish changes

Change a site that's already live without losing what the client published: the safe loop, versioned publishing, and how the AI merges other people's work.

Once a site is live, the live site is the real one: the client publishes posts, receives leads, uploads images. A new field, a new page or a different header is a theme change: you make it on a copy, check it, and publish only the theme.

Publishing is versioned: each publish adds a version on top of what's live and first takes in what others published, so nobody's work is overwritten.

The safe loop

  1. Bring production to your computer

    Your local copy is refreshed with the live theme, images and content, without personal data, so you work on the real thing. If it holds theme changes not yet published, the AI stops and asks: a refresh would overwrite them.

  2. Change it and check it locally

    Ask for the change, then look at it in the browser and in the admin, on a phone too.

  3. Publish only the theme

    Theme files go up. Content and the database never do.

  4. Check the live site

    Open the pages you changed.

Ask the AI

Bring the live site down to my computer, so I can work with the real content.

Do it at the start of every round of changes, not only the first time.

Ask the AI

Publish the theme to the live site: the new video field on the cases and the case page that shows it. Nothing else.

The AI sends the theme alone and reports the new version number, plus anything it merged from other people.

What the AI runs
# refresh the local copy from the live site $ scripts/local/content.sh --project . # preview at http://localhost:8080 $ ./bin/velk serve 8080 # publish the theme, versioned $ scripts/theme/publish.sh run --project . ▸ Bringing in what changed on the server ▸ Staging the new theme on the server ▸ Swapping it in ✓ Published as v5
Then, in plain words: “Published as v5. I merged the changes João published in v4: 2 files, no conflict.”

How versioned publishing works

The server keeps a record of what's live: a version number, who published it and when, and a fingerprint of each theme file. Your copy remembers the version it started from. When you publish, the AI compares where you started, your copy and what's live:

  • Nothing changed live since you started: your changes go up as the next version.
  • Someone published in between, or changed files by hand on the server: their changes are merged into your copy first, then everything is checked and published. A file they deleted leaves your copy too, and the AI names it.

Example: live is v3, and you and João start from it. João publishes v4. When you publish, your copy takes in his changes, gets checked and goes up as v5.

When the AI stops and asks

SituationWhat happens
You and someone else changed the same lines, or the same fileA conflict. The AI shows in plain words what the file was, what each side changed and the combination it proposes, or you keep one side whole. Nothing goes live without your OK.
The publish would delete live filesIt lists them and asks. No yes, no deletion.
Someone is publishing right nowIt tells you who and offers to try again in a minute.
A publish stopped halfway 15 or more minutes agoIt explains and asks before taking over. A publish cut off halfway is finished or undone by the next action: the site never stays half-published.
The site was already failing before your publishIt says what fails, that your change didn't cause it, and asks before publishing anyway, to send a fix, say.

The checks on the way

With a local copy, before anything leaves your computer, the AI checks the theme's PHP files and runs schema:validate, which catches structure mistakes in site.json (since v3.9.0 it also warns about declared templates whose file is missing, without stopping the publish). On the server, the new theme is staged beside the live one, checked, swapped in with two instant renames and tested live: schema:validate, page:sync (which creates pages newly declared in site.json and keeps what was typed in the admin) and the home page answering without a server error. Any failure brings the previous theme back at once, and the version doesn't change.

If CSS or JavaScript changed and the theme loads them without a version in their address, the AI warns you: browsers keep those files for a month, so returning visitors would see the old style.

What a publish carries

The theme alone: site.json, templates, partials, functions.php, styles, scripts and the theme's images. Never the content, storage/uploads/, the server's .env or the database, and never backup or system files (*.bak, .DS_Store) or PHP files at the theme's root other than functions.php. New Velk versions are a separate request (Update Velk).

Common questions

Two of us work on the same theme. Do we need Git?

Not to publish: each publish takes in what the others published. Git still helps with your own history, but nothing of .git goes to or comes from the server.

The first publish asks about every file I changed. Why?

Your copy has no starting point yet, because it was never brought down from the live site: the folder you deployed from, say, or a site that went live before versioned publishing. Each theme file that differs from the live one becomes a question; the AI asks and, when your copy is the one to keep, keeps it. After that publish, it remembers.