Sites and deploy
For old links and extension-free page addresses, see Redirects and plain addresses.
Publish a site
What this is-
Prepare
index.htmland use relative links for the other files. Keep servers and build tools out of the upload; upload their static output. -
Publish it.
“Publish these files as my bakery site.” Confirm the name and address before the first publish.SendPOST /v1/sites/{sitename}/fileswith{"files":{"index.html":"..."}}, or send an archive toPOST /v1/sites/{sitename}withContent-Type: application/zip. Send your key inX-API-Key.Select the event and team first. Use your team key and its exact site name. Organisers send JSON files to
PUT /v1/hack/events/{slug}/website/files?create=1with their account key. Build an event website fromhack_get_page_recipetopiceventso the public feed keeps its stage, dates, announcements, gallery and results live. -
Open the returned address and test the links and form saves.
Publish before your team’s submission deadline. Read the event’s Website screen for the current deadline and the entry’s status. When returning from chat, check that the selected team is still yours before sending another update.
Update files
What this is-
Read the current file list before replacing files.
-
Send the change.
“On my bakery site, change the opening time to 8 am. Keep the other pages.”SendPUT /v1/sites/{sitename}/files?keep=1with the changedfiles. To replace the whole file tree, omitkeep=1and send every file. -
Open the live address and check the changed page.
Preview and publish a version
What this is- Save the update with
publish=false. ReadGET /v1/sites/{sitename}/versionsand note its version number. - Create a preview with
POST /v1/sites/{sitename}/versions/2/preview-link. Open the returned link; it stops working after an hour. - Publish it with
PUT /v1/sites/{sitename}/active-versionand{"version_number":2}. To roll back, read the version list and send the earlier number instead.
Errors you may see
| Code | Means | Do this |
|---|---|---|
site_exists (409) |
Name already used | Update that site or choose another name |
not_found (404) |
Update files: no matching site | Read the site list |
site_not_found (404) |
Rename or roll back: no matching site | Read the site list |
item_too_large (413) |
Upload exceeds a cap | Check Limits and errors |