Edit part of a site file
patch_site_fileCall get_site_context first. Change an existing draft file IN PLACE — the way to modify a page. Each edit is {find, replace} (swap exact text) or {after, insert} (add text right after an anchor); the anchor must appear exactly once in the current file, else nothing is written and you are told why. Edits apply in order. Prefer this to rewriting the page with write_site_files: whole-file rewrites from memory drop or duplicate things. Same checks as write_site_files (keep sc-track.js, data-sc-carry tags and the sc-badge block; no noindex / 'Disallow: /' on a site with its own domain). Optional base_hash (from read_site_file) refuses the edit if the file changed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| slug | Yes | ||
| edits | Yes | ||
| base_hash | No |