[{"data":1,"prerenderedAt":2189},["ShallowReactive",2],{"navigation_docs":3,"-docs-core-building-your-site-live-preview":478,"-docs-core-building-your-site-live-preview-surround":2184},[4,352,446],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":6},"Docs",false,"\u002Fdocs\u002Fcore","docs\u002F1.core",[10,35,141,174,195,212,242,318],{"title":11,"icon":6,"path":12,"stem":13,"children":14,"page":6},"Getting Started","\u002Fdocs\u002Fcore\u002Fgetting-started","docs\u002F1.core\u002F1.getting-started",[15,19,23,27,31],{"title":16,"path":17,"stem":18},"Introduction","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fintroduction","docs\u002F1.core\u002F1.getting-started\u002F1.introduction",{"title":20,"path":21,"stem":22},"Quick Start","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fquick-start","docs\u002F1.core\u002F1.getting-started\u002F2.quick-start",{"title":24,"path":25,"stem":26},"Add to an Existing Site","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fexisting-site","docs\u002F1.core\u002F1.getting-started\u002F3.existing-site",{"title":28,"path":29,"stem":30},"Configuration","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fconfiguration","docs\u002F1.core\u002F1.getting-started\u002F4.configuration",{"title":32,"path":33,"stem":34},"How Tenon works","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fhow-tenon-works","docs\u002F1.core\u002F1.getting-started\u002F5.how-tenon-works",{"title":36,"icon":6,"path":37,"stem":38,"children":39,"page":6},"Content Modeling","\u002Fdocs\u002Fcore\u002Fcontent-modeling","docs\u002F1.core\u002F2.content-modeling",[40,44,111,115,119],{"title":41,"path":42,"stem":43},"Collections and Globals","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fcollections-and-globals","docs\u002F1.core\u002F2.content-modeling\u002F1.collections-and-globals",{"title":45,"icon":6,"path":46,"stem":47,"children":48},"Fields","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002Findex",[49,51,55,59,63,67,71,75,79,83,87,91,95,99,103,107],{"title":50,"path":46,"stem":47},"Overview",{"title":52,"path":53,"stem":54},"Array","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Farray","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F01.array",{"title":56,"path":57,"stem":58},"Blocks","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fblocks","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F02.blocks",{"title":60,"path":61,"stem":62},"Boolean","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fboolean","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F03.boolean",{"title":64,"path":65,"stem":66},"Date","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fdate","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F04.date",{"title":68,"path":69,"stem":70},"File","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Ffile","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F05.file",{"title":72,"path":73,"stem":74},"Group","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fgroup","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F06.group",{"title":76,"path":77,"stem":78},"Image","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fimage","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F07.image",{"title":80,"path":81,"stem":82},"Link","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Flink","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F08.link",{"title":84,"path":85,"stem":86},"Number","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fnumber","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F09.number",{"title":88,"path":89,"stem":90},"Relation","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Frelation","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F10.relation",{"title":92,"path":93,"stem":94},"Rich text","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Frich-text","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F11.rich-text",{"title":96,"path":97,"stem":98},"Select","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fselect","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F12.select",{"title":100,"path":101,"stem":102},"Size","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fsize","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F13.size",{"title":104,"path":105,"stem":106},"Slug","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fslug","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F14.slug",{"title":108,"path":109,"stem":110},"Text","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Ftext","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F15.text",{"title":112,"path":113,"stem":114},"Relations","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Frelations","docs\u002F1.core\u002F2.content-modeling\u002F3.relations",{"title":116,"path":117,"stem":118},"Media","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fmedia","docs\u002F1.core\u002F2.content-modeling\u002F4.media",{"title":120,"icon":6,"path":121,"stem":122,"children":123},"Presets","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002Findex",[124,125,129,133,137],{"title":50,"path":121,"stem":122},{"title":126,"path":127,"stem":128},"Menu","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets\u002Fmenu","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002F1.menu",{"title":130,"path":131,"stem":132},"Pages","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets\u002Fpages","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002F2.pages",{"title":134,"path":135,"stem":136},"Settings","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets\u002Fsettings","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002F3.settings",{"title":138,"path":139,"stem":140},"Strings","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets\u002Fstrings","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002F4.strings",{"title":142,"icon":6,"path":143,"stem":144,"children":145,"page":6},"Working with Content","\u002Fdocs\u002Fcore\u002Fworking-with-content","docs\u002F1.core\u002F3.working-with-content",[146,150,154,158,162,166,170],{"title":147,"path":148,"stem":149},"Reading","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Freading","docs\u002F1.core\u002F3.working-with-content\u002F1.reading",{"title":151,"path":152,"stem":153},"Writing and Drafts","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fwriting","docs\u002F1.core\u002F3.working-with-content\u002F2.writing",{"title":155,"path":156,"stem":157},"Scheduled publishing","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fscheduled-publishing","docs\u002F1.core\u002F3.working-with-content\u002F3.scheduled-publishing",{"title":159,"path":160,"stem":161},"HTTP API and Client","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fhttp-api-and-client","docs\u002F1.core\u002F3.working-with-content\u002F4.http-api-and-client",{"title":163,"path":164,"stem":165},"Headless","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fheadless","docs\u002F1.core\u002F3.working-with-content\u002F5.headless",{"title":167,"path":168,"stem":169},"Localization","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Flocalization","docs\u002F1.core\u002F3.working-with-content\u002F6.localization",{"title":171,"path":172,"stem":173},"Hooks","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fhooks","docs\u002F1.core\u002F3.working-with-content\u002F7.hooks",{"title":175,"icon":6,"path":176,"stem":177,"children":178,"page":6},"Building Your Site","\u002Fdocs\u002Fcore\u002Fbuilding-your-site","docs\u002F1.core\u002F4.building-your-site",[179,183,187,191],{"title":180,"path":181,"stem":182},"Pages and SEO","\u002Fdocs\u002Fcore\u002Fbuilding-your-site\u002Fpages-and-seo","docs\u002F1.core\u002F4.building-your-site\u002F1.pages-and-seo",{"title":184,"path":185,"stem":186},"Components","\u002Fdocs\u002Fcore\u002Fbuilding-your-site\u002Fcomponents","docs\u002F1.core\u002F4.building-your-site\u002F2.components",{"title":188,"path":189,"stem":190},"Menus","\u002Fdocs\u002Fcore\u002Fbuilding-your-site\u002Fmenus","docs\u002F1.core\u002F4.building-your-site\u002F3.menus",{"title":192,"path":193,"stem":194},"Live Preview","\u002Fdocs\u002Fcore\u002Fbuilding-your-site\u002Flive-preview","docs\u002F1.core\u002F4.building-your-site\u002F4.live-preview",{"title":196,"icon":6,"path":197,"stem":198,"children":199,"page":6},"Users and Access","\u002Fdocs\u002Fcore\u002Fusers-and-access","docs\u002F1.core\u002F5.users-and-access",[200,204,208],{"title":201,"path":202,"stem":203},"Authentication","\u002Fdocs\u002Fcore\u002Fusers-and-access\u002Fauthentication","docs\u002F1.core\u002F5.users-and-access\u002F1.authentication",{"title":205,"path":206,"stem":207},"Access Control","\u002Fdocs\u002Fcore\u002Fusers-and-access\u002Faccess-control","docs\u002F1.core\u002F5.users-and-access\u002F2.access-control",{"title":209,"path":210,"stem":211},"API Keys","\u002Fdocs\u002Fcore\u002Fusers-and-access\u002Fapi-keys","docs\u002F1.core\u002F5.users-and-access\u002F3.api-keys",{"title":213,"icon":6,"path":214,"stem":215,"children":216},"Customization","\u002Fdocs\u002Fcore\u002Fcustomization","docs\u002F1.core\u002F6.customization\u002Findex",[217,218,222,226,230,234,238],{"title":50,"path":214,"stem":215},{"title":219,"path":220,"stem":221},"Admin","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fadmin","docs\u002F1.core\u002F6.customization\u002F1.admin",{"title":223,"path":224,"stem":225},"Custom Fields","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fcustom-fields","docs\u002F1.core\u002F6.customization\u002F2.custom-fields",{"title":227,"path":228,"stem":229},"Custom Pages and Actions","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fcustom-pages-and-actions","docs\u002F1.core\u002F6.customization\u002F3.custom-pages-and-actions",{"title":231,"path":232,"stem":233},"Styles and UI Libraries","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fstyles-and-ui-libraries","docs\u002F1.core\u002F6.customization\u002F4.styles-and-ui-libraries",{"title":235,"path":236,"stem":237},"Rich Text Extensions","\u002Fdocs\u002Fcore\u002Fcustomization\u002Frich-text-extensions","docs\u002F1.core\u002F6.customization\u002F5.rich-text-extensions",{"title":239,"path":240,"stem":241},"Plugins","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fplugins","docs\u002F1.core\u002F6.customization\u002F6.plugins",{"title":243,"icon":6,"path":244,"stem":245,"children":246},"Operations","\u002Fdocs\u002Fcore\u002Foperations","docs\u002F1.core\u002F7.operations\u002Findex",[247,248,266,288,306,310,314],{"title":50,"path":244,"stem":245},{"title":249,"icon":6,"path":250,"stem":251,"children":252},"Email","\u002Fdocs\u002Fcore\u002Foperations\u002Femail","docs\u002F1.core\u002F7.operations\u002F1.email\u002Findex",[253,254,258,262],{"title":50,"path":250,"stem":251},{"title":255,"path":256,"stem":257},"SMTP","\u002Fdocs\u002Fcore\u002Foperations\u002Femail\u002Fsmtp","docs\u002F1.core\u002F7.operations\u002F1.email\u002F1.smtp",{"title":259,"path":260,"stem":261},"Cloudflare","\u002Fdocs\u002Fcore\u002Foperations\u002Femail\u002Fcloudflare","docs\u002F1.core\u002F7.operations\u002F1.email\u002F2.cloudflare",{"title":263,"path":264,"stem":265},"Custom adapter","\u002Fdocs\u002Fcore\u002Foperations\u002Femail\u002Fcustom-adapter","docs\u002F1.core\u002F7.operations\u002F1.email\u002F3.custom-adapter",{"title":267,"icon":6,"path":268,"stem":269,"children":270},"Jobs","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002Findex",[271,272,276,280,284],{"title":50,"path":268,"stem":269},{"title":273,"path":274,"stem":275},"Queue jobs","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs\u002Fqueue-jobs","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002F1.queue-jobs",{"title":277,"path":278,"stem":279},"Recurring jobs","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs\u002Frecurring-jobs","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002F2.recurring-jobs",{"title":281,"path":282,"stem":283},"The clock","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs\u002Fclock","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002F3.clock",{"title":285,"path":286,"stem":287},"Manage jobs","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs\u002Fmanage-jobs","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002F4.manage-jobs",{"title":289,"icon":6,"path":290,"stem":291,"children":292},"Webhooks","\u002Fdocs\u002Fcore\u002Foperations\u002Fwebhooks","docs\u002F1.core\u002F7.operations\u002F3.webhooks\u002Findex",[293,294,298,302],{"title":50,"path":290,"stem":291},{"title":295,"path":296,"stem":297},"Send webhooks","\u002Fdocs\u002Fcore\u002Foperations\u002Fwebhooks\u002Fsend-webhooks","docs\u002F1.core\u002F7.operations\u002F3.webhooks\u002F1.send-webhooks",{"title":299,"path":300,"stem":301},"Receive webhooks","\u002Fdocs\u002Fcore\u002Foperations\u002Fwebhooks\u002Freceive-webhooks","docs\u002F1.core\u002F7.operations\u002F3.webhooks\u002F2.receive-webhooks",{"title":303,"path":304,"stem":305},"Rebuild on publish","\u002Fdocs\u002Fcore\u002Foperations\u002Fwebhooks\u002Frebuild-on-publish","docs\u002F1.core\u002F7.operations\u002F3.webhooks\u002F3.rebuild-on-publish",{"title":307,"path":308,"stem":309},"Backup and Restore","\u002Fdocs\u002Fcore\u002Foperations\u002Fbackup-and-restore","docs\u002F1.core\u002F7.operations\u002F4.backup-and-restore",{"title":311,"path":312,"stem":313},"Lifecycle Hooks","\u002Fdocs\u002Fcore\u002Foperations\u002Flifecycle-hooks","docs\u002F1.core\u002F7.operations\u002F5.lifecycle-hooks",{"title":315,"path":316,"stem":317},"Upgrades and Schema Changes","\u002Fdocs\u002Fcore\u002Foperations\u002Fupgrades-and-schema-changes","docs\u002F1.core\u002F7.operations\u002F6.upgrades-and-schema-changes",{"title":319,"icon":6,"path":320,"stem":321,"children":322,"page":6},"Reference","\u002Fdocs\u002Fcore\u002Freference","docs\u002F1.core\u002F8.reference",[323,326,344,348],{"title":28,"path":324,"stem":325},"\u002Fdocs\u002Fcore\u002Freference\u002Fconfiguration","docs\u002F1.core\u002F8.reference\u002F1.configuration",{"title":327,"icon":6,"path":328,"stem":329,"children":330},"API","\u002Fdocs\u002Fcore\u002Freference\u002Fapi","docs\u002F1.core\u002F8.reference\u002F2.api\u002Findex",[331,332,336,340],{"title":50,"path":328,"stem":329},{"title":333,"path":334,"stem":335},"Local API","\u002Fdocs\u002Fcore\u002Freference\u002Fapi\u002Flocal-api","docs\u002F1.core\u002F8.reference\u002F2.api\u002F1.local-api",{"title":337,"path":338,"stem":339},"Client","\u002Fdocs\u002Fcore\u002Freference\u002Fapi\u002Fclient","docs\u002F1.core\u002F8.reference\u002F2.api\u002F2.client",{"title":341,"path":342,"stem":343},"HTTP routes","\u002Fdocs\u002Fcore\u002Freference\u002Fapi\u002Fhttp-routes","docs\u002F1.core\u002F8.reference\u002F2.api\u002F3.http-routes",{"title":345,"path":346,"stem":347},"Errors and types","\u002Fdocs\u002Fcore\u002Freference\u002Ferrors-and-types","docs\u002F1.core\u002F8.reference\u002F3.errors-and-types",{"title":349,"path":350,"stem":351},"Package exports","\u002Fdocs\u002Fcore\u002Freference\u002Fpackage-exports","docs\u002F1.core\u002F8.reference\u002F4.package-exports",{"title":353,"icon":6,"path":354,"stem":355,"children":356,"page":6},"Guide","\u002Fdocs\u002Fguide","docs\u002F2.guide",[357,383,400,417],{"title":358,"icon":6,"path":359,"stem":360,"children":361},"Frameworks","\u002Fdocs\u002Fguide\u002Fframeworks","docs\u002F2.guide\u002F1.frameworks\u002Findex",[362,363,367,371,375,379],{"title":50,"path":359,"stem":360},{"title":364,"path":365,"stem":366},"Astro","\u002Fdocs\u002Fguide\u002Fframeworks\u002Fastro","docs\u002F2.guide\u002F1.frameworks\u002F1.astro",{"title":368,"path":369,"stem":370},"Nuxt","\u002Fdocs\u002Fguide\u002Fframeworks\u002Fnuxt","docs\u002F2.guide\u002F1.frameworks\u002F2.nuxt",{"title":372,"path":373,"stem":374},"TanStack Start","\u002Fdocs\u002Fguide\u002Fframeworks\u002Ftanstack-start","docs\u002F2.guide\u002F1.frameworks\u002F3.tanstack-start",{"title":376,"path":377,"stem":378},"Standalone","\u002Fdocs\u002Fguide\u002Fframeworks\u002Fstandalone","docs\u002F2.guide\u002F1.frameworks\u002F4.standalone",{"title":380,"path":381,"stem":382},"Other Frameworks","\u002Fdocs\u002Fguide\u002Fframeworks\u002Fother-frameworks","docs\u002F2.guide\u002F1.frameworks\u002F5.other-frameworks",{"title":384,"icon":6,"path":385,"stem":386,"children":387},"Deployment","\u002Fdocs\u002Fguide\u002Fdeployment","docs\u002F2.guide\u002F2.deployment\u002Findex",[388,389,393,397],{"title":50,"path":385,"stem":386},{"title":390,"path":391,"stem":392},"Node","\u002Fdocs\u002Fguide\u002Fdeployment\u002Fnode","docs\u002F2.guide\u002F2.deployment\u002F1.node",{"title":394,"path":395,"stem":396},"Vercel","\u002Fdocs\u002Fguide\u002Fdeployment\u002Fvercel","docs\u002F2.guide\u002F2.deployment\u002F2.vercel",{"title":259,"path":398,"stem":399},"\u002Fdocs\u002Fguide\u002Fdeployment\u002Fcloudflare","docs\u002F2.guide\u002F2.deployment\u002F3.cloudflare",{"title":401,"icon":6,"path":402,"stem":403,"children":404,"page":6},"Databases and Storage","\u002Fdocs\u002Fguide\u002Fdatabases-and-storage","docs\u002F2.guide\u002F3.databases-and-storage",[405,409,413],{"title":406,"path":407,"stem":408},"Databases","\u002Fdocs\u002Fguide\u002Fdatabases-and-storage\u002Fdatabases","docs\u002F2.guide\u002F3.databases-and-storage\u002F1.databases",{"title":410,"path":411,"stem":412},"Media Storage","\u002Fdocs\u002Fguide\u002Fdatabases-and-storage\u002Fmedia-storage","docs\u002F2.guide\u002F3.databases-and-storage\u002F2.media-storage",{"title":414,"path":415,"stem":416},"Image Providers","\u002Fdocs\u002Fguide\u002Fdatabases-and-storage\u002Fimage-providers","docs\u002F2.guide\u002F3.databases-and-storage\u002F3.image-providers",{"title":418,"icon":6,"path":419,"stem":420,"children":421,"page":6},"Recipes","\u002Fdocs\u002Fguide\u002Frecipes","docs\u002F2.guide\u002F4.recipes",[422,426,430,434,438,442],{"title":423,"path":424,"stem":425},"Seed Content","\u002Fdocs\u002Fguide\u002Frecipes\u002Fseed-content","docs\u002F2.guide\u002F4.recipes\u002F1.seed-content",{"title":427,"path":428,"stem":429},"Tracking and Consent","\u002Fdocs\u002Fguide\u002Frecipes\u002Ftracking-and-consent","docs\u002F2.guide\u002F4.recipes\u002F2.tracking-and-consent",{"title":431,"path":432,"stem":433},"Build a Custom Field","\u002Fdocs\u002Fguide\u002Frecipes\u002Fbuild-a-custom-field","docs\u002F2.guide\u002F4.recipes\u002F3.build-a-custom-field",{"title":435,"path":436,"stem":437},"Write a Plugin","\u002Fdocs\u002Fguide\u002Frecipes\u002Fwrite-a-plugin","docs\u002F2.guide\u002F4.recipes\u002F4.write-a-plugin",{"title":439,"path":440,"stem":441},"Build a Headless Site with Next.js","\u002Fdocs\u002Fguide\u002Frecipes\u002Fbuild-a-headless-site-with-nextjs","docs\u002F2.guide\u002F4.recipes\u002F5.build-a-headless-site-with-nextjs",{"title":443,"path":444,"stem":445},"Troubleshooting","\u002Fdocs\u002Fguide\u002Frecipes\u002Ftroubleshooting","docs\u002F2.guide\u002F4.recipes\u002F6.troubleshooting",{"title":447,"icon":6,"path":448,"stem":449,"children":450,"page":6},"CLI","\u002Fdocs\u002Fcli","docs\u002F3.cli",[451,454,458,462,466,470,474],{"title":50,"path":452,"stem":453},"\u002Fdocs\u002Fcli\u002Foverview","docs\u002F3.cli\u002F1.overview",{"title":455,"path":456,"stem":457},"create-tenoncms","\u002Fdocs\u002Fcli\u002Fcreate-tenoncms","docs\u002F3.cli\u002F2.create-tenoncms",{"title":459,"path":460,"stem":461},"tenon backup","\u002Fdocs\u002Fcli\u002Fbackup","docs\u002F3.cli\u002F3.backup",{"title":463,"path":464,"stem":465},"tenon users","\u002Fdocs\u002Fcli\u002Fusers","docs\u002F3.cli\u002F4.users",{"title":467,"path":468,"stem":469},"tenon media","\u002Fdocs\u002Fcli\u002Fmedia","docs\u002F3.cli\u002F5.media",{"title":471,"path":472,"stem":473},"tenon upgrade","\u002Fdocs\u002Fcli\u002Fupgrade","docs\u002F3.cli\u002F6.upgrade",{"title":475,"path":476,"stem":477},"tenon login","\u002Fdocs\u002Fcli\u002Flogin","docs\u002F3.cli\u002F7.login",{"id":479,"title":192,"body":480,"description":2178,"extension":2179,"links":2180,"meta":2181,"navigation":758,"path":193,"seo":2182,"stem":194,"__hash__":2183},"docs\u002Fdocs\u002F1.core\u002F4.building-your-site\u002F4.live-preview.md",{"type":481,"value":482,"toc":2166},"minimark",[483,487,494,499,1206,1210,1213,1585,1589,1598,1639,1657,1661,1664,1673,1749,1954,1966,1970,1977,2047,2053,2057,2065,2116,2136,2140,2162],[484,485,486],"p",{},"One of the most requested (and helpful) features that clients often request: A live preview where editors see the real site next to the form. In Tenons case, every change shows up on the page while they type, before they save in real-time.",[484,488,489],{},[490,491],"img",{"alt":492,"src":493},"Tenon CMS","\u002Fimages\u002Ftenon-live_preview_example.jpg",[495,496,498],"h2",{"id":497},"set-it-up","Set it up",[500,501,503,508,516,684,693,697,710,1163,1166],"steps",{"level":502},"3",[504,505,507],"h3",{"id":506},"say-where-a-document-lives","Say where a document lives",[484,509,510,511,515],{},"Set ",[512,513,514],"code",{},"permalink"," on each collection that has its own pages. The admin opens that URL in the frame:",[517,518,524],"pre",{"className":519,"code":520,"filename":521,"language":522,"meta":523,"style":523},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","export const posts = defineCollection({\n  permalink: \"\u002Fposts\u002F{slug}\",\n  fields: {\n    title: { type: \"text\", required: true },\n    slug: { type: \"slug\", from: \"title\" },\n  },\n});\n","cms\u002Fcollections\u002Fposts.ts","ts","",[512,525,526,557,580,591,629,666,672],{"__ignoreMap":523},[527,528,531,535,539,543,547,551,554],"span",{"class":529,"line":530},"line",1,[527,532,534],{"class":533},"s7zQu","export",[527,536,538],{"class":537},"spNyl"," const",[527,540,542],{"class":541},"sTEyZ"," posts ",[527,544,546],{"class":545},"sMK4o","=",[527,548,550],{"class":549},"s2Zo4"," defineCollection",[527,552,553],{"class":541},"(",[527,555,556],{"class":545},"{\n",[527,558,560,564,567,570,574,577],{"class":529,"line":559},2,[527,561,563],{"class":562},"swJcz","  permalink",[527,565,566],{"class":545},":",[527,568,569],{"class":545}," \"",[527,571,573],{"class":572},"sfazB","\u002Fposts\u002F{slug}",[527,575,576],{"class":545},"\"",[527,578,579],{"class":545},",\n",[527,581,583,586,588],{"class":529,"line":582},3,[527,584,585],{"class":562},"  fields",[527,587,566],{"class":545},[527,589,590],{"class":545}," {\n",[527,592,594,597,599,602,605,607,609,612,614,617,620,622,626],{"class":529,"line":593},4,[527,595,596],{"class":562},"    title",[527,598,566],{"class":545},[527,600,601],{"class":545}," {",[527,603,604],{"class":562}," type",[527,606,566],{"class":545},[527,608,569],{"class":545},[527,610,611],{"class":572},"text",[527,613,576],{"class":545},[527,615,616],{"class":545},",",[527,618,619],{"class":562}," required",[527,621,566],{"class":545},[527,623,625],{"class":624},"sfNiH"," true",[527,627,628],{"class":545}," },\n",[527,630,632,635,637,639,641,643,645,648,650,652,655,657,659,662,664],{"class":529,"line":631},5,[527,633,634],{"class":562},"    slug",[527,636,566],{"class":545},[527,638,601],{"class":545},[527,640,604],{"class":562},[527,642,566],{"class":545},[527,644,569],{"class":545},[527,646,647],{"class":572},"slug",[527,649,576],{"class":545},[527,651,616],{"class":545},[527,653,654],{"class":562}," from",[527,656,566],{"class":545},[527,658,569],{"class":545},[527,660,661],{"class":572},"title",[527,663,576],{"class":545},[527,665,628],{"class":545},[527,667,669],{"class":529,"line":668},6,[527,670,671],{"class":545},"  },\n",[527,673,675,678,681],{"class":529,"line":674},7,[527,676,677],{"class":545},"}",[527,679,680],{"class":541},")",[527,682,683],{"class":545},";\n",[484,685,686,687,692],{},"The pages preset sets it for you. See ",[688,689,691],"a",{"href":690},"\u002Fdocs\u002Fcore\u002Fbuilding-your-site\u002Fpages-and-seo#permalinks","Permalinks"," for placeholders and functions.",[504,694,696],{"id":695},"mark-the-elements","Mark the elements",[484,698,699,702,703,706,707,566],{},[512,700,701],{},"edit()"," from ",[512,704,705],{},"tenoncms\u002Fpreview"," names the field an element shows. Put it in ",[512,708,709],{},"data-cms",[711,712,714,884,1024],"code-group",{"sync":713},"framework",[517,715,719],{"className":716,"code":717,"filename":364,"language":718,"meta":523,"style":523},"language-astro shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","---\nimport { edit } from \"tenoncms\u002Fpreview\";\n---\n\n\u003Ch1 data-cms={edit(\"posts\", post.id, \"title\")}>{post.title}\u003C\u002Fh1>\n\u003Cp data-cms={edit(\"posts\", post.id, \"author.name\")}>{post.author.name}\u003C\u002Fp>\n","astro",[512,720,721,727,750,754,760,825],{"__ignoreMap":523},[527,722,723],{"class":529,"line":530},[527,724,726],{"class":725},"sHwdD","---\n",[527,728,729,732,734,737,740,742,744,746,748],{"class":529,"line":559},[527,730,731],{"class":533},"import",[527,733,601],{"class":545},[527,735,736],{"class":541}," edit",[527,738,739],{"class":545}," }",[527,741,654],{"class":533},[527,743,569],{"class":545},[527,745,705],{"class":572},[527,747,576],{"class":545},[527,749,683],{"class":545},[527,751,752],{"class":529,"line":582},[527,753,726],{"class":725},[527,755,756],{"class":529,"line":593},[527,757,759],{"emptyLinePlaceholder":758},true,"\n",[527,761,762,765,768,771,774,777,779,781,784,786,788,791,794,797,799,801,803,805,807,810,813,815,817,820,822],{"class":529,"line":631},[527,763,764],{"class":545},"\u003C",[527,766,767],{"class":562},"h1",[527,769,770],{"class":537}," data-cms",[527,772,773],{"class":545},"={",[527,775,776],{"class":549},"edit",[527,778,553],{"class":541},[527,780,576],{"class":545},[527,782,783],{"class":572},"posts",[527,785,576],{"class":545},[527,787,616],{"class":545},[527,789,790],{"class":541}," post",[527,792,793],{"class":545},".",[527,795,796],{"class":541},"id",[527,798,616],{"class":545},[527,800,569],{"class":545},[527,802,661],{"class":572},[527,804,576],{"class":545},[527,806,680],{"class":541},[527,808,809],{"class":545},"}>{",[527,811,812],{"class":541},"post",[527,814,793],{"class":545},[527,816,661],{"class":541},[527,818,819],{"class":545},"}\u003C\u002F",[527,821,767],{"class":562},[527,823,824],{"class":545},">\n",[527,826,827,829,831,833,835,837,839,841,843,845,847,849,851,853,855,857,860,862,864,866,868,870,873,875,878,880,882],{"class":529,"line":668},[527,828,764],{"class":545},[527,830,484],{"class":562},[527,832,770],{"class":537},[527,834,773],{"class":545},[527,836,776],{"class":549},[527,838,553],{"class":541},[527,840,576],{"class":545},[527,842,783],{"class":572},[527,844,576],{"class":545},[527,846,616],{"class":545},[527,848,790],{"class":541},[527,850,793],{"class":545},[527,852,796],{"class":541},[527,854,616],{"class":545},[527,856,569],{"class":545},[527,858,859],{"class":572},"author.name",[527,861,576],{"class":545},[527,863,680],{"class":541},[527,865,809],{"class":545},[527,867,812],{"class":541},[527,869,793],{"class":545},[527,871,872],{"class":541},"author",[527,874,793],{"class":545},[527,876,877],{"class":541},"name",[527,879,819],{"class":545},[527,881,484],{"class":562},[527,883,824],{"class":545},[517,885,889],{"className":886,"code":887,"filename":368,"language":888,"meta":523,"style":523},"language-vue shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u003Cscript setup lang=\"ts\">\nimport { edit } from \"tenoncms\u002Fpreview\";\n\u003C\u002Fscript>\n\n\u003Ctemplate>\n  \u003Ch1 :data-cms=\"edit('posts', post.id, 'title')\">{{ post.title }}\u003C\u002Fh1>\n  \u003Cp :data-cms=\"edit('posts', post.id, 'author.name')\">{{ post.author.name }}\u003C\u002Fp>\n\u003C\u002Ftemplate>\n","vue",[512,890,891,914,934,943,947,956,987,1015],{"__ignoreMap":523},[527,892,893,895,898,901,904,906,908,910,912],{"class":529,"line":530},[527,894,764],{"class":545},[527,896,897],{"class":562},"script",[527,899,900],{"class":537}," setup",[527,902,903],{"class":537}," lang",[527,905,546],{"class":545},[527,907,576],{"class":545},[527,909,522],{"class":572},[527,911,576],{"class":545},[527,913,824],{"class":545},[527,915,916,918,920,922,924,926,928,930,932],{"class":529,"line":559},[527,917,731],{"class":533},[527,919,601],{"class":545},[527,921,736],{"class":541},[527,923,739],{"class":545},[527,925,654],{"class":533},[527,927,569],{"class":545},[527,929,705],{"class":572},[527,931,576],{"class":545},[527,933,683],{"class":545},[527,935,936,939,941],{"class":529,"line":582},[527,937,938],{"class":545},"\u003C\u002F",[527,940,897],{"class":562},[527,942,824],{"class":545},[527,944,945],{"class":529,"line":593},[527,946,759],{"emptyLinePlaceholder":758},[527,948,949,951,954],{"class":529,"line":631},[527,950,764],{"class":545},[527,952,953],{"class":562},"template",[527,955,824],{"class":545},[527,957,958,961,963,966,968,970,973,975,978,981,983,985],{"class":529,"line":668},[527,959,960],{"class":545},"  \u003C",[527,962,767],{"class":562},[527,964,965],{"class":537}," :data-cms",[527,967,546],{"class":545},[527,969,576],{"class":545},[527,971,972],{"class":572},"edit('posts', post.id, 'title')",[527,974,576],{"class":545},[527,976,977],{"class":545},">",[527,979,980],{"class":541},"{{ post.title }}",[527,982,938],{"class":545},[527,984,767],{"class":562},[527,986,824],{"class":545},[527,988,989,991,993,995,997,999,1002,1004,1006,1009,1011,1013],{"class":529,"line":674},[527,990,960],{"class":545},[527,992,484],{"class":562},[527,994,965],{"class":537},[527,996,546],{"class":545},[527,998,576],{"class":545},[527,1000,1001],{"class":572},"edit('posts', post.id, 'author.name')",[527,1003,576],{"class":545},[527,1005,977],{"class":545},[527,1007,1008],{"class":541},"{{ post.author.name }}",[527,1010,938],{"class":545},[527,1012,484],{"class":562},[527,1014,824],{"class":545},[527,1016,1018,1020,1022],{"class":529,"line":1017},8,[527,1019,938],{"class":545},[527,1021,953],{"class":562},[527,1023,824],{"class":545},[517,1025,1029],{"className":1026,"code":1027,"filename":372,"language":1028,"meta":523,"style":523},"language-tsx shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { edit } from \"tenoncms\u002Fpreview\";\n\n\u003Ch1 data-cms={edit(\"posts\", post.id, \"title\")}>{post.title}\u003C\u002Fh1>\n\u003Cp data-cms={edit(\"posts\", post.id, \"author.name\")}>{post.author.name}\u003C\u002Fp>\n","tsx",[512,1030,1031,1051,1055,1107],{"__ignoreMap":523},[527,1032,1033,1035,1037,1039,1041,1043,1045,1047,1049],{"class":529,"line":530},[527,1034,731],{"class":533},[527,1036,601],{"class":545},[527,1038,736],{"class":541},[527,1040,739],{"class":545},[527,1042,654],{"class":533},[527,1044,569],{"class":545},[527,1046,705],{"class":572},[527,1048,576],{"class":545},[527,1050,683],{"class":545},[527,1052,1053],{"class":529,"line":559},[527,1054,759],{"emptyLinePlaceholder":758},[527,1056,1057,1059,1061,1063,1065,1067,1069,1071,1073,1075,1077,1079,1081,1083,1085,1087,1089,1091,1093,1095,1097,1099,1101,1103,1105],{"class":529,"line":582},[527,1058,764],{"class":545},[527,1060,767],{"class":562},[527,1062,770],{"class":537},[527,1064,773],{"class":545},[527,1066,776],{"class":549},[527,1068,553],{"class":541},[527,1070,576],{"class":545},[527,1072,783],{"class":572},[527,1074,576],{"class":545},[527,1076,616],{"class":545},[527,1078,790],{"class":541},[527,1080,793],{"class":545},[527,1082,796],{"class":541},[527,1084,616],{"class":545},[527,1086,569],{"class":545},[527,1088,661],{"class":572},[527,1090,576],{"class":545},[527,1092,680],{"class":541},[527,1094,809],{"class":545},[527,1096,812],{"class":541},[527,1098,793],{"class":545},[527,1100,661],{"class":541},[527,1102,819],{"class":545},[527,1104,767],{"class":562},[527,1106,824],{"class":545},[527,1108,1109,1111,1113,1115,1117,1119,1121,1123,1125,1127,1129,1131,1133,1135,1137,1139,1141,1143,1145,1147,1149,1151,1153,1155,1157,1159,1161],{"class":529,"line":593},[527,1110,764],{"class":545},[527,1112,484],{"class":562},[527,1114,770],{"class":537},[527,1116,773],{"class":545},[527,1118,776],{"class":549},[527,1120,553],{"class":541},[527,1122,576],{"class":545},[527,1124,783],{"class":572},[527,1126,576],{"class":545},[527,1128,616],{"class":545},[527,1130,790],{"class":541},[527,1132,793],{"class":545},[527,1134,796],{"class":541},[527,1136,616],{"class":545},[527,1138,569],{"class":545},[527,1140,859],{"class":572},[527,1142,576],{"class":545},[527,1144,680],{"class":541},[527,1146,809],{"class":545},[527,1148,812],{"class":541},[527,1150,793],{"class":545},[527,1152,872],{"class":541},[527,1154,793],{"class":545},[527,1156,877],{"class":541},[527,1158,819],{"class":545},[527,1160,484],{"class":562},[527,1162,824],{"class":545},[484,1164,1165],{},"A marked element gets the new text on every keystroke. In the visual editor, a click on it opens its field.",[1167,1168,1169,1180,1192],"ul",{},[1170,1171,1172,1173,1176,1177,793],"li",{},"For a global, pass ",[512,1174,1175],{},"null"," as the id: ",[512,1178,1179],{},"edit(\"general\", null, \"title\")",[1170,1181,1182,1183,1186,1187,1191],{},"For a field inside a list, use the position: ",[512,1184,1185],{},"edit(\"pages\", page.id, \"content.2.title\")",". For blocks, the ",[688,1188,1190],{"href":1189},"\u002Fdocs\u002Fcore\u002Fbuilding-your-site\u002Fcomponents#click-to-edit-inside-blocks","Blocks component"," does this for you.",[1170,1193,1194,1195,1198,1199,1203,1204,793],{},"For an image, add ",[512,1196,1197],{},"data-cms-attr=\"src,srcset,alt\"",", so the attributes change instead of the text. The ",[688,1200,1202],{"href":1201},"\u002Fdocs\u002Fcore\u002Fbuilding-your-site\u002Fcomponents#image","Image component"," does this when the element has ",[512,1205,709],{},[495,1207,1209],{"id":1208},"per-framework","Per framework",[484,1211,1212],{},"Marked elements update in every framework. What else follows while the editor types depends on how the framework renders:",[1214,1215,1216,1293,1333],"tabs",{"sync":713},[1217,1218,1219,1222,1225,1232],"tabs-item",{"label":364},[484,1220,1221],{},"The integration starts the preview on every page and reads drafts for you. There is nothing to add.",[484,1223,1224],{},"Astro pages render on the server. While an editor types, only marked elements change. After each save, the page loads again in the background and swaps in the new HTML, so lists and conditions catch up.",[484,1226,1227,1228,1231],{},"To leave the preview out, pass ",[512,1229,1230],{},"preview: false"," to the integration:",[517,1233,1236],{"className":519,"code":1234,"filename":1235,"language":522,"meta":523,"style":523},"export default defineConfig({\n  integrations: [tenonCms({ preview: false })],\n});\n","astro.config.ts",[512,1237,1238,1252,1285],{"__ignoreMap":523},[527,1239,1240,1242,1245,1248,1250],{"class":529,"line":530},[527,1241,534],{"class":533},[527,1243,1244],{"class":533}," default",[527,1246,1247],{"class":549}," defineConfig",[527,1249,553],{"class":541},[527,1251,556],{"class":545},[527,1253,1254,1257,1259,1262,1265,1267,1270,1273,1275,1278,1280,1283],{"class":529,"line":559},[527,1255,1256],{"class":562},"  integrations",[527,1258,566],{"class":545},[527,1260,1261],{"class":541}," [",[527,1263,1264],{"class":549},"tenonCms",[527,1266,553],{"class":541},[527,1268,1269],{"class":545},"{",[527,1271,1272],{"class":562}," preview",[527,1274,566],{"class":545},[527,1276,1277],{"class":624}," false",[527,1279,739],{"class":545},[527,1281,1282],{"class":541},")]",[527,1284,579],{"class":545},[527,1286,1287,1289,1291],{"class":529,"line":582},[527,1288,677],{"class":545},[527,1290,680],{"class":541},[527,1292,683],{"class":545},[1217,1294,1295,1298,1319],{"label":368},[484,1296,1297],{},"The module starts the preview on every page and reads drafts for you. There is nothing to add.",[484,1299,1300,1303,1304,1307,1308,1307,1311,1314,1315,1318],{},[512,1301,1302],{},"useTenon()"," merges the unsaved changes into the data of ",[512,1305,1306],{},"find",", ",[512,1309,1310],{},"findOne",[512,1312,1313],{},"findById"," and ",[512,1316,1317],{},"getGlobal",". The whole page follows while the editor types, lists and conditions included.",[484,1320,1321,1322,1326,1327,1329,1330,1332],{},"Every document a page reads also shows under ",[1323,1324,1325],"strong",{},"On this page"," in the visual editor. Editors can open it from there, even without ",[512,1328,701],{},". Add ",[512,1331,701],{}," for outlines and clicks.",[1217,1334,1335,1338,1366,1464,1572],{"label":372},[484,1336,1337],{},"TanStack Start needs three additions:",[1339,1340,1341,1352,1359],"ol",{},[1170,1342,1343,1344,1347,1348,793],{},"Read with ",[512,1345,1346],{},"cms.withSession(getRequest())"," in the server function, so the page shows drafts. See ",[688,1349,1351],{"href":1350},"\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Freading#drafts","Drafts",[1170,1353,1354,1355,1358],{},"Call ",[512,1356,1357],{},"preview()"," once in the root route. For visitors without a session, it does nothing.",[1170,1360,1361,1362,1365],{},"Pass the loader data through ",[512,1363,1364],{},"useDraft()",". It merges the unsaved changes, so the whole page follows while the editor types.",[517,1367,1370],{"className":1026,"code":1368,"filename":1369,"language":1028,"meta":523,"style":523},"import { useEffect } from \"react\";\nimport { preview } from \"tenoncms\u002Fpreview\";\n\nfunction Root() {\n  useEffect(() => preview(), []);\n  \u002F\u002F ...\n}\n","src\u002Froutes\u002F__root.tsx",[512,1371,1372,1394,1414,1418,1431,1454,1459],{"__ignoreMap":523},[527,1373,1374,1376,1378,1381,1383,1385,1387,1390,1392],{"class":529,"line":530},[527,1375,731],{"class":533},[527,1377,601],{"class":545},[527,1379,1380],{"class":541}," useEffect",[527,1382,739],{"class":545},[527,1384,654],{"class":533},[527,1386,569],{"class":545},[527,1388,1389],{"class":572},"react",[527,1391,576],{"class":545},[527,1393,683],{"class":545},[527,1395,1396,1398,1400,1402,1404,1406,1408,1410,1412],{"class":529,"line":559},[527,1397,731],{"class":533},[527,1399,601],{"class":545},[527,1401,1272],{"class":541},[527,1403,739],{"class":545},[527,1405,654],{"class":533},[527,1407,569],{"class":545},[527,1409,705],{"class":572},[527,1411,576],{"class":545},[527,1413,683],{"class":545},[527,1415,1416],{"class":529,"line":582},[527,1417,759],{"emptyLinePlaceholder":758},[527,1419,1420,1423,1426,1429],{"class":529,"line":593},[527,1421,1422],{"class":537},"function",[527,1424,1425],{"class":549}," Root",[527,1427,1428],{"class":545},"()",[527,1430,590],{"class":545},[527,1432,1433,1436,1438,1440,1443,1445,1447,1449,1452],{"class":529,"line":631},[527,1434,1435],{"class":549},"  useEffect",[527,1437,553],{"class":562},[527,1439,1428],{"class":545},[527,1441,1442],{"class":537}," =>",[527,1444,1272],{"class":549},[527,1446,1428],{"class":562},[527,1448,616],{"class":545},[527,1450,1451],{"class":562}," [])",[527,1453,683],{"class":545},[527,1455,1456],{"class":529,"line":668},[527,1457,1458],{"class":725},"  \u002F\u002F ...\n",[527,1460,1461],{"class":529,"line":674},[527,1462,1463],{"class":545},"}\n",[517,1465,1468],{"className":1026,"code":1466,"filename":1467,"language":1028,"meta":523,"style":523},"import { useDraft } from \"tenoncms\u002Fpreview\u002Freact\";\n\nfunction Post() {\n  const post = useDraft(\"posts\", Route.useLoaderData());\n  return \u003Ch1>{post.title}\u003C\u002Fh1>;\n}\n","src\u002Froutes\u002Fposts\u002F$slug.tsx",[512,1469,1470,1492,1496,1507,1542,1568],{"__ignoreMap":523},[527,1471,1472,1474,1476,1479,1481,1483,1485,1488,1490],{"class":529,"line":530},[527,1473,731],{"class":533},[527,1475,601],{"class":545},[527,1477,1478],{"class":541}," useDraft",[527,1480,739],{"class":545},[527,1482,654],{"class":533},[527,1484,569],{"class":545},[527,1486,1487],{"class":572},"tenoncms\u002Fpreview\u002Freact",[527,1489,576],{"class":545},[527,1491,683],{"class":545},[527,1493,1494],{"class":529,"line":559},[527,1495,759],{"emptyLinePlaceholder":758},[527,1497,1498,1500,1503,1505],{"class":529,"line":582},[527,1499,1422],{"class":537},[527,1501,1502],{"class":549}," Post",[527,1504,1428],{"class":545},[527,1506,590],{"class":545},[527,1508,1509,1512,1514,1517,1519,1521,1523,1525,1527,1529,1532,1534,1537,1540],{"class":529,"line":593},[527,1510,1511],{"class":537},"  const",[527,1513,790],{"class":541},[527,1515,1516],{"class":545}," =",[527,1518,1478],{"class":549},[527,1520,553],{"class":562},[527,1522,576],{"class":545},[527,1524,783],{"class":572},[527,1526,576],{"class":545},[527,1528,616],{"class":545},[527,1530,1531],{"class":541}," Route",[527,1533,793],{"class":545},[527,1535,1536],{"class":549},"useLoaderData",[527,1538,1539],{"class":562},"())",[527,1541,683],{"class":545},[527,1543,1544,1547,1550,1552,1555,1557,1559,1561,1563,1565],{"class":529,"line":631},[527,1545,1546],{"class":533},"  return",[527,1548,1549],{"class":545}," \u003C",[527,1551,767],{"class":562},[527,1553,1554],{"class":545},">{",[527,1556,812],{"class":541},[527,1558,793],{"class":545},[527,1560,661],{"class":541},[527,1562,819],{"class":545},[527,1564,767],{"class":562},[527,1566,1567],{"class":545},">;\n",[527,1569,1570],{"class":529,"line":668},[527,1571,1463],{"class":545},[484,1573,1574,1575,1578,1579,702,1581,1584],{},"For a global, pass its name: ",[512,1576,1577],{},"useDraft(\"footer\", footer)",". In Vue outside Nuxt, ",[512,1580,1364],{},[512,1582,1583],{},"tenoncms\u002Fpreview\u002Fvue"," returns a ref.",[495,1586,1588],{"id":1587},"a-cms-on-another-origin","A CMS on another origin",[484,1590,1591,1592,1595,1596,566],{},"When the CMS runs on another origin than the site, like ",[512,1593,1594],{},"cms.example.com",", pass the full URL of the admin to ",[512,1597,1357],{},[517,1599,1601],{"className":519,"code":1600,"language":522,"meta":523,"style":523},"preview({ admin: \"https:\u002F\u002Fcms.example.com\u002Fadmin\", morph: true });\n",[512,1602,1603],{"__ignoreMap":523},[527,1604,1605,1608,1610,1612,1615,1617,1619,1622,1624,1626,1629,1631,1633,1635,1637],{"class":529,"line":530},[527,1606,1607],{"class":549},"preview",[527,1609,553],{"class":541},[527,1611,1269],{"class":545},[527,1613,1614],{"class":562}," admin",[527,1616,566],{"class":545},[527,1618,569],{"class":545},[527,1620,1621],{"class":572},"https:\u002F\u002Fcms.example.com\u002Fadmin",[527,1623,576],{"class":545},[527,1625,616],{"class":545},[527,1627,1628],{"class":562}," morph",[527,1630,566],{"class":545},[527,1632,625],{"class":624},[527,1634,739],{"class":545},[527,1636,680],{"class":541},[527,1638,683],{"class":545},[1167,1640,1641,1644,1650],{},[1170,1642,1643],{},"The live preview trusts only that origin. The admin bar calls the API there, with the CMS's cookies.",[1170,1645,1646,1649],{},[512,1647,1648],{},"morph: true"," renders the page again from the server after each draft save.",[1170,1651,1652,1653,793],{},"The site and the CMS MUST share a parent domain, and the CMS MUST put its cookies on it. See ",[688,1654,1656],{"href":1655},"\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fheadless#share-the-cookies","Share the cookies",[495,1658,1660],{"id":1659},"prerendered-pages-and-preview-routes","Prerendered pages and preview routes",[484,1662,1663],{},"A prerendered page is built once, at deploy time. It cannot show drafts, so the preview would show the last deploy.",[484,1665,1666,1667,1669,1670,1672],{},"Give the collection a second route that renders on each request, and point ",[512,1668,1607],{}," at it. ",[512,1671,514],{}," stays the public URL:",[517,1674,1676],{"className":519,"code":1675,"filename":521,"language":522,"meta":523,"style":523},"export const posts = defineCollection({\n  permalink: \"\u002Fposts\u002F{slug}\",\n  preview: \"\u002Fpreview\u002Fposts\u002F{slug}\",\n  fields: {\n    \u002F\u002F ...\n  },\n});\n",[512,1677,1678,1694,1708,1724,1732,1737,1741],{"__ignoreMap":523},[527,1679,1680,1682,1684,1686,1688,1690,1692],{"class":529,"line":530},[527,1681,534],{"class":533},[527,1683,538],{"class":537},[527,1685,542],{"class":541},[527,1687,546],{"class":545},[527,1689,550],{"class":549},[527,1691,553],{"class":541},[527,1693,556],{"class":545},[527,1695,1696,1698,1700,1702,1704,1706],{"class":529,"line":559},[527,1697,563],{"class":562},[527,1699,566],{"class":545},[527,1701,569],{"class":545},[527,1703,573],{"class":572},[527,1705,576],{"class":545},[527,1707,579],{"class":545},[527,1709,1710,1713,1715,1717,1720,1722],{"class":529,"line":582},[527,1711,1712],{"class":562},"  preview",[527,1714,566],{"class":545},[527,1716,569],{"class":545},[527,1718,1719],{"class":572},"\u002Fpreview\u002Fposts\u002F{slug}",[527,1721,576],{"class":545},[527,1723,579],{"class":545},[527,1725,1726,1728,1730],{"class":529,"line":593},[527,1727,585],{"class":562},[527,1729,566],{"class":545},[527,1731,590],{"class":545},[527,1733,1734],{"class":529,"line":631},[527,1735,1736],{"class":725},"    \u002F\u002F ...\n",[527,1738,1739],{"class":529,"line":668},[527,1740,671],{"class":545},[527,1742,1743,1745,1747],{"class":529,"line":674},[527,1744,677],{"class":545},[527,1746,680],{"class":541},[527,1748,683],{"class":545},[517,1750,1753],{"className":716,"code":1751,"filename":1752,"language":718,"meta":523,"style":523},"---\nimport Post from \"..\u002F..\u002F..\u002Fcomponents\u002FPost.astro\";\n\nexport const prerender = false;\n\nconst post = await Astro.locals.tenon.findOne(\"posts\", {\n  where: { slug: Astro.params.slug },\n});\nif (!post) return new Response(null, { status: 404 });\n---\n\n\u003CPost post={post} \u002F>\n","src\u002Fpages\u002Fpreview\u002Fposts\u002F[slug].astro",[512,1754,1755,1759,1778,1782,1797,1801,1843,1872,1880,1926,1931,1936],{"__ignoreMap":523},[527,1756,1757],{"class":529,"line":530},[527,1758,726],{"class":725},[527,1760,1761,1763,1766,1769,1771,1774,1776],{"class":529,"line":559},[527,1762,731],{"class":533},[527,1764,1765],{"class":541}," Post ",[527,1767,1768],{"class":533},"from",[527,1770,569],{"class":545},[527,1772,1773],{"class":572},"..\u002F..\u002F..\u002Fcomponents\u002FPost.astro",[527,1775,576],{"class":545},[527,1777,683],{"class":545},[527,1779,1780],{"class":529,"line":582},[527,1781,759],{"emptyLinePlaceholder":758},[527,1783,1784,1786,1788,1791,1793,1795],{"class":529,"line":593},[527,1785,534],{"class":533},[527,1787,538],{"class":537},[527,1789,1790],{"class":541}," prerender ",[527,1792,546],{"class":545},[527,1794,1277],{"class":624},[527,1796,683],{"class":545},[527,1798,1799],{"class":529,"line":631},[527,1800,759],{"emptyLinePlaceholder":758},[527,1802,1803,1806,1809,1811,1814,1817,1819,1822,1824,1827,1829,1831,1833,1835,1837,1839,1841],{"class":529,"line":668},[527,1804,1805],{"class":537},"const",[527,1807,1808],{"class":541}," post ",[527,1810,546],{"class":545},[527,1812,1813],{"class":533}," await",[527,1815,1816],{"class":541}," Astro",[527,1818,793],{"class":545},[527,1820,1821],{"class":541},"locals",[527,1823,793],{"class":545},[527,1825,1826],{"class":541},"tenon",[527,1828,793],{"class":545},[527,1830,1310],{"class":549},[527,1832,553],{"class":541},[527,1834,576],{"class":545},[527,1836,783],{"class":572},[527,1838,576],{"class":545},[527,1840,616],{"class":545},[527,1842,590],{"class":545},[527,1844,1845,1848,1850,1852,1855,1857,1859,1861,1864,1866,1869],{"class":529,"line":674},[527,1846,1847],{"class":562},"  where",[527,1849,566],{"class":545},[527,1851,601],{"class":545},[527,1853,1854],{"class":562}," slug",[527,1856,566],{"class":545},[527,1858,1816],{"class":541},[527,1860,793],{"class":545},[527,1862,1863],{"class":541},"params",[527,1865,793],{"class":545},[527,1867,1868],{"class":541},"slug ",[527,1870,1871],{"class":545},"},\n",[527,1873,1874,1876,1878],{"class":529,"line":1017},[527,1875,677],{"class":545},[527,1877,680],{"class":541},[527,1879,683],{"class":545},[527,1881,1883,1886,1889,1892,1895,1898,1901,1904,1906,1909,1911,1914,1916,1920,1922,1924],{"class":529,"line":1882},9,[527,1884,1885],{"class":533},"if",[527,1887,1888],{"class":541}," (",[527,1890,1891],{"class":545},"!",[527,1893,1894],{"class":541},"post) ",[527,1896,1897],{"class":533},"return",[527,1899,1900],{"class":545}," new",[527,1902,1903],{"class":549}," Response",[527,1905,553],{"class":541},[527,1907,1908],{"class":545},"null,",[527,1910,601],{"class":545},[527,1912,1913],{"class":562}," status",[527,1915,566],{"class":545},[527,1917,1919],{"class":1918},"sbssI"," 404",[527,1921,739],{"class":545},[527,1923,680],{"class":541},[527,1925,683],{"class":545},[527,1927,1929],{"class":529,"line":1928},10,[527,1930,726],{"class":725},[527,1932,1934],{"class":529,"line":1933},11,[527,1935,759],{"emptyLinePlaceholder":758},[527,1937,1939,1941,1945,1947,1949,1951],{"class":529,"line":1938},12,[527,1940,764],{"class":545},[527,1942,1944],{"class":1943},"sBMFI","Post",[527,1946,790],{"class":537},[527,1948,773],{"class":545},[527,1950,812],{"class":541},[527,1952,1953],{"class":545},"} \u002F>\n",[1167,1955,1956,1959],{},[1170,1957,1958],{},"Both routes render the same component, so the preview matches the public page.",[1170,1960,1961,1962,1965],{},"To show published changes on the public page, rebuild the site. A ",[688,1963,1964],{"href":304},"webhook"," can start the build when an editor publishes.",[495,1967,1969],{"id":1968},"keep-content-out-of-edit-mode","Keep content out of edit mode",[484,1971,1972,1973,1976],{},"Some content is not for editors to change on the page, like comments that visitors write. ",[512,1974,1975],{},"visualEditing: false"," keeps it out of the visual editor:",[517,1978,1980],{"className":519,"code":1979,"language":522,"meta":523,"style":523},"export const comments = defineCollection({\n  visualEditing: false,\n  fields: { body: { type: \"text\" } },\n});\n",[512,1981,1982,1999,2010,2039],{"__ignoreMap":523},[527,1983,1984,1986,1988,1991,1993,1995,1997],{"class":529,"line":530},[527,1985,534],{"class":533},[527,1987,538],{"class":537},[527,1989,1990],{"class":541}," comments ",[527,1992,546],{"class":545},[527,1994,550],{"class":549},[527,1996,553],{"class":541},[527,1998,556],{"class":545},[527,2000,2001,2004,2006,2008],{"class":529,"line":559},[527,2002,2003],{"class":562},"  visualEditing",[527,2005,566],{"class":545},[527,2007,1277],{"class":624},[527,2009,579],{"class":545},[527,2011,2012,2014,2016,2018,2021,2023,2025,2027,2029,2031,2033,2035,2037],{"class":529,"line":582},[527,2013,585],{"class":562},[527,2015,566],{"class":545},[527,2017,601],{"class":545},[527,2019,2020],{"class":562}," body",[527,2022,566],{"class":545},[527,2024,601],{"class":545},[527,2026,604],{"class":562},[527,2028,566],{"class":545},[527,2030,569],{"class":545},[527,2032,611],{"class":572},[527,2034,576],{"class":545},[527,2036,739],{"class":545},[527,2038,628],{"class":545},[527,2040,2041,2043,2045],{"class":529,"line":593},[527,2042,677],{"class":545},[527,2044,680],{"class":541},[527,2046,683],{"class":545},[484,2048,2049,2050,2052],{},"Its elements get no outline, and ",[1323,2051,1325],{}," leaves the collection out. A click on one opens the marked element around it, if there is one.",[495,2054,2056],{"id":2055},"check-for-the-live-preview","Check for the live preview",[484,2058,2059,702,2062,2064],{},[512,2060,2061],{},"isLivePreview()",[512,2063,705],{}," tells whether the page runs inside the admin's preview, for example to skip an intro animation:",[517,2066,2068],{"className":519,"code":2067,"language":522,"meta":523,"style":523},"import { isLivePreview } from \"tenoncms\u002Fpreview\";\n\nif (!isLivePreview()) playIntro();\n",[512,2069,2070,2091,2095],{"__ignoreMap":523},[527,2071,2072,2074,2076,2079,2081,2083,2085,2087,2089],{"class":529,"line":530},[527,2073,731],{"class":533},[527,2075,601],{"class":545},[527,2077,2078],{"class":541}," isLivePreview",[527,2080,739],{"class":545},[527,2082,654],{"class":533},[527,2084,569],{"class":545},[527,2086,705],{"class":572},[527,2088,576],{"class":545},[527,2090,683],{"class":545},[527,2092,2093],{"class":529,"line":559},[527,2094,759],{"emptyLinePlaceholder":758},[527,2096,2097,2099,2101,2103,2106,2109,2112,2114],{"class":529,"line":582},[527,2098,1885],{"class":533},[527,2100,1888],{"class":541},[527,2102,1891],{"class":545},[527,2104,2105],{"class":549},"isLivePreview",[527,2107,2108],{"class":541},"()) ",[527,2110,2111],{"class":549},"playIntro",[527,2113,1428],{"class":541},[527,2115,683],{"class":545},[1167,2117,2118,2129],{},[1170,2119,2120,2121,2124,2125,2128],{},"On the server, pass the request's headers: ",[512,2122,2123],{},"isLivePreview(request.headers)",". They only show the admin's frame, so a preview tab is ",[512,2126,2127],{},"false"," until the page runs in the browser.",[1170,2130,2131,2132,2135],{},"In Nuxt, ",[512,2133,2134],{},"useLivePreview()"," returns the same answer as a ref.",[495,2137,2139],{"id":2138},"related-resources","Related resources",[1167,2141,2142,2147,2157],{},[1170,2143,2144,2146],{},[688,2145,147],{"href":1350},": how pages read drafts.",[1170,2148,2149,2151,2152,1314,2154,2156],{},[688,2150,184],{"href":185},": ",[512,2153,76],{},[512,2155,56],{}," mark their fields for you.",[1170,2158,2159,2161],{},[688,2160,219],{"href":220},": the admin bar, path and branding.",[2163,2164,2165],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}",{"title":523,"searchDepth":559,"depth":559,"links":2167},[2168,2172,2173,2174,2175,2176,2177],{"id":497,"depth":559,"text":498,"children":2169},[2170,2171],{"id":506,"depth":582,"text":507},{"id":695,"depth":582,"text":696},{"id":1208,"depth":559,"text":1209},{"id":1587,"depth":559,"text":1588},{"id":1659,"depth":559,"text":1660},{"id":1968,"depth":559,"text":1969},{"id":2055,"depth":559,"text":2056},{"id":2138,"depth":559,"text":2139},"Editors see changes on the real page while they type.","md",null,{},{"title":192,"description":2178},"09hNVfvcEs-7ryZ56W78FEjJv-aC4iRXQ22uGEMyDck",[2185,2187],{"title":188,"path":189,"stem":190,"description":2186,"children":-1},"Navigation menus that editors arrange as a tree.",{"title":201,"path":202,"stem":203,"description":2188,"children":-1},"How people sign in to the admin, and the methods to pick from.",1795884644456]