Hypertekt › Docs › Concepts

The draft and publishing

Every site is a git repository: changes go to its draft, which is built and previewed, and publishing makes the draft a release that can be rolled back.

Every site on Hypertekt is a git repository. That’s true however a change is made, so a developer working in git and an owner working in the dashboard are always working on the same thing.

The path from a change to what visitors see:

tekt push, git push ────┐
                        ├──▶ draft ──▶ built ──▶ preview   for anyone with its link
Save in the dashboard ──┘                │
                                         └─ Publish ──▶ release ──▶ live   for visitors, at the site's domain

The draft

The draft is a branch, draft, and it’s where every change goes:

  • A save in the dashboard, from the Content tab or the Code tab, is a commit to the draft by whoever saved it.
  • tekt push or git push sends your commits to the draft. tekt push first brings in anything new on the draft, like an owner’s change to the menu, so nobody’s work is lost. Then it waits for the draft to build, and says where the preview is or what’s wrong.

When what’s new on the draft and what you changed are in different files, or in different parts of one file, tekt push merges them automatically. When you and someone else changed the same lines, tekt push stops and names the files. In each file, keep the text that should stay, and take out git’s <<<<<<<, ======= and >>>>>>> lines. Then run tekt push again.

Each time the draft changes, it’s built. A draft that builds becomes the site’s preview, at a link nobody can guess. The dashboard’s Preview tab shows the same build. If the draft doesn’t build, the preview keeps showing the last version that did, and the Checks tab lists the problems.

Publishing

Publishing builds the draft as it will be served, and makes that build a release. A release is a tag on the commit it was built from. The tag is named for the time of the publish, like release/20261123T190512Z-3fa2c1. Visitors see the new release within about a minute and a half.

  • A draft that doesn’t build can’t be published.
  • Publishing sends the whole draft, including what anyone else on the site has saved.
  • Anyone on the site can publish: from the dashboard’s Publish button, or with tekt publish.
  • A release is served at the site’s domains. A site with no domain yet isn’t served anywhere, so its preview is the only place to see it.

Rolling back

Any earlier release can be made live again. Undo the last publish in the dashboard’s Publish menu goes back one release, and so does tekt rollback. tekt rollback <release> goes back to any release, and tekt releases lists them. Rolling back doesn’t change the draft, so nothing that’s saved is lost. The next publish makes the draft live again.

History

The dashboard’s History tab lists the draft’s commits, with who made each change, how its build went, and which commits were published. In the Content tab, an item’s own History shows how the item has changed. Restore puts an earlier version back in the item’s form. In a clone, the same history is in git log.

Beside an older commit in History, Revert to this puts the draft’s files back as they were at that commit. The revert is a new commit, made by whoever pressed the button. Nothing in the history is lost, and a revert can be reverted too. The dashboard lists the files that will change back and asks first. If someone changes the draft before you confirm, nothing is reverted, and the dashboard tells you.

In Manage, Undo beside one of the Overview’s Recent changes does the same for owners. It reverts to the commit before that change. Neither one changes the live site until the next publish. In a clone, run git revert --no-commit <commit>..HEAD, then commit.

Built again automatically

Hypertekt builds a site again automatically on the day an item’s or a page’s showFrom or showUntil comes. It builds the live commit again for the new day, as a release of its own, and makes that release live. Nothing on the draft is published with it.