[{"data":1,"prerenderedAt":1924},["ShallowReactive",2],{"navigation_docs":3,"-docs-core-customization-plugins":478,"-docs-core-customization-plugins-surround":1919},[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":239,"body":480,"description":1913,"extension":1914,"links":1915,"meta":1916,"navigation":577,"path":240,"seo":1917,"stem":241,"__hash__":1918},"docs\u002Fdocs\u002F1.core\u002F6.customization\u002F6.plugins.md",{"type":481,"value":482,"toc":1902},"minimark",[483,492,497,504,636,639,690,693,697,736,740,750,838,861,896,901,911,1564,1592,1596,1609,1619,1623,1629,1829,1850,1854,1864,1868,1898],[484,485,486,487,491],"p",{},"A plugin bundles a feature into one import: collections and globals, hooks, API routes and admin pieces. You add it once in ",[488,489,490],"code",{},"tenon.config.ts",", with nothing else to wire up. This page shows how to use a plugin and the plugins that come with Tenon.",[493,494,496],"h2",{"id":495},"use-a-plugin","Use a plugin",[484,498,499,500,503],{},"List plugins in ",[488,501,502],{},"plugins",":",[505,506,511],"pre",{"className":507,"code":508,"filename":490,"language":509,"meta":510,"style":510},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { defineCms } from \"tenoncms\";\nimport { RedirectsPlugin } from \"tenoncms\u002Fplugins\u002Fredirects\";\n\nexport default defineCms({\n  \u002F\u002F ...\n  plugins: [RedirectsPlugin()],\n});\n","ts","",[488,512,513,549,572,579,597,604,625],{"__ignoreMap":510},[514,515,518,522,526,530,533,536,539,543,546],"span",{"class":516,"line":517},"line",1,[514,519,521],{"class":520},"s7zQu","import",[514,523,525],{"class":524},"sMK4o"," {",[514,527,529],{"class":528},"sTEyZ"," defineCms",[514,531,532],{"class":524}," }",[514,534,535],{"class":520}," from",[514,537,538],{"class":524}," \"",[514,540,542],{"class":541},"sfazB","tenoncms",[514,544,545],{"class":524},"\"",[514,547,548],{"class":524},";\n",[514,550,552,554,556,559,561,563,565,568,570],{"class":516,"line":551},2,[514,553,521],{"class":520},[514,555,525],{"class":524},[514,557,558],{"class":528}," RedirectsPlugin",[514,560,532],{"class":524},[514,562,535],{"class":520},[514,564,538],{"class":524},[514,566,567],{"class":541},"tenoncms\u002Fplugins\u002Fredirects",[514,569,545],{"class":524},[514,571,548],{"class":524},[514,573,575],{"class":516,"line":574},3,[514,576,578],{"emptyLinePlaceholder":577},true,"\n",[514,580,582,585,588,591,594],{"class":516,"line":581},4,[514,583,584],{"class":520},"export",[514,586,587],{"class":520}," default",[514,589,529],{"class":590},"s2Zo4",[514,592,593],{"class":528},"(",[514,595,596],{"class":524},"{\n",[514,598,600],{"class":516,"line":599},5,[514,601,603],{"class":602},"sHwdD","  \u002F\u002F ...\n",[514,605,607,611,613,616,619,622],{"class":516,"line":606},6,[514,608,610],{"class":609},"swJcz","  plugins",[514,612,503],{"class":524},[514,614,615],{"class":528}," [",[514,617,618],{"class":590},"RedirectsPlugin",[514,620,621],{"class":528},"()]",[514,623,624],{"class":524},",\n",[514,626,628,631,634],{"class":516,"line":627},7,[514,629,630],{"class":524},"}",[514,632,633],{"class":528},")",[514,635,548],{"class":524},[484,637,638],{},"A plugin can add:",[640,641,642,650,662,669,675,680],"ul",{},[643,644,645,646,649],"li",{},"collections and globals. They are typed like yours, so ",[488,647,648],{},"cms.find(\"redirects\")"," works.",[643,651,652,653,657,658,661],{},"hooks for every collection, and ",[654,655,656],"a",{"href":312},"lifecycle hooks"," like ",[488,659,660],{},"seed",".",[643,663,664,665,668],{},"API routes under ",[488,666,667],{},"\u002F_tenon\u002F\u003Cplugin name>",", and middleware for the API.",[643,670,671,674],{},[654,672,673],{"href":268},"jobs"," and their schedules.",[643,676,677,661],{},[654,678,679],{"href":236},"rich text extensions",[643,681,682,685,686,689],{},[654,683,684],{"href":224},"fields",", ",[654,687,688],{"href":228},"pages and actions",", and admin bar items.",[484,691,692],{},"A plugin's additions come before yours. Its hooks run before your root hooks, and its lifecycle hooks before yours. A collection, global, field or page name that you and a plugin both use stops the server at startup.",[493,694,696],{"id":695},"bundled-plugins","Bundled plugins",[698,699,700,713],"table",{},[701,702,703],"thead",{},[704,705,706,710],"tr",{},[707,708,709],"th",{},"Plugin",[707,711,712],{},"What it does",[714,715,716,726],"tbody",{},[704,717,718,723],{},[719,720,721],"td",{},[488,722,567],{},[719,724,725],{},"Redirects from old paths, created when a page moves",[704,727,728,733],{},[719,729,730],{},[488,731,732],{},"tenoncms\u002Fplugins\u002Fexample",[719,734,735],{},"A starting point to copy. It uses every plugin option once.",[493,737,739],{"id":738},"redirects","Redirects",[484,741,742,745,746,749],{},[488,743,744],{},"RedirectsPlugin()"," adds a ",[747,748,739],"strong",{}," collection to the admin. When the path of a page changes, it creates a redirect from the old path:",[505,751,753],{"className":507,"code":752,"filename":490,"language":509,"meta":510,"style":510},"plugins: [RedirectsPlugin({ collections: [\"pages\"], field: \"path\", locales: [\"en\", \"de\"] })],\n",[488,754,755],{"__ignoreMap":510},[514,756,757,760,762,764,766,768,771,774,776,778,780,783,785,788,791,794,796,798,801,803,805,808,810,812,814,817,819,821,823,826,828,831,833,836],{"class":516,"line":517},[514,758,502],{"class":759},"sBMFI",[514,761,503],{"class":524},[514,763,615],{"class":528},[514,765,618],{"class":590},[514,767,593],{"class":528},[514,769,770],{"class":524},"{",[514,772,773],{"class":609}," collections",[514,775,503],{"class":524},[514,777,615],{"class":528},[514,779,545],{"class":524},[514,781,782],{"class":541},"pages",[514,784,545],{"class":524},[514,786,787],{"class":528},"]",[514,789,790],{"class":524},",",[514,792,793],{"class":609}," field",[514,795,503],{"class":524},[514,797,538],{"class":524},[514,799,800],{"class":541},"path",[514,802,545],{"class":524},[514,804,790],{"class":524},[514,806,807],{"class":609}," locales",[514,809,503],{"class":524},[514,811,615],{"class":528},[514,813,545],{"class":524},[514,815,816],{"class":541},"en",[514,818,545],{"class":524},[514,820,790],{"class":524},[514,822,538],{"class":524},[514,824,825],{"class":541},"de",[514,827,545],{"class":524},[514,829,830],{"class":528},"] ",[514,832,630],{"class":524},[514,834,835],{"class":528},")]",[514,837,624],{"class":524},[839,840,841,850,857],"field-group",{},[842,843,846,847,661],"field",{"name":844,"type":845},"collections","string[]","The collections whose path changes create a redirect. Default ",[488,848,849],{},"[\"pages\"]",[842,851,853,854,661],{"name":842,"type":852},"string","The path field in those collections. Default ",[488,855,856],{},"\"path\"",[842,858,860],{"name":859,"type":845},"locales","The languages to pick for a redirect. Without it, the language is a text input. An empty language applies to all.",[640,862,863,887,890],{},[643,864,865,866,685,869,685,872,875,876,879,880,883,884,661],{},"A redirect has ",[488,867,868],{},"from",[488,870,871],{},"to",[488,873,874],{},"permanent"," (",[488,877,878],{},"301",", the default, or ",[488,881,882],{},"302",") and ",[488,885,886],{},"locale",[643,888,889],{},"Redirects that pointed to the old path follow the move, so there is never more than one hop.",[643,891,892,895],{},[747,893,894],{},"Redirect Tools"," in the admin tests a path and imports many redirects at once.",[897,898,900],"h3",{"id":899},"resolve-redirects-on-your-site","Resolve redirects on your site",[484,902,903,904,907,908,503],{},"The plugin stores redirects. Your site follows them in a middleware, before any page renders. ",[488,905,906],{},"resolveRedirect()"," returns the target and the status, or ",[488,909,910],{},"undefined",[912,913,915,1126,1285],"code-group",{"sync":914},"framework",[505,916,918],{"className":507,"code":917,"filename":364,"language":509,"meta":510,"style":510},"\u002F\u002F src\u002Fmiddleware.ts\nimport { defineMiddleware } from \"astro:middleware\";\nimport { resolveRedirect } from \"tenoncms\u002Fplugins\u002Fredirects\";\nimport cms from \"..\u002Ftenon.config\";\n\nexport const onRequest = defineMiddleware(async (context, next) => {\n  const redirect = await resolveRedirect(cms, context.url.pathname);\n  return redirect ? context.redirect(redirect.to, redirect.status) : next();\n});\n",[488,919,920,925,947,968,986,990,1030,1070,1117],{"__ignoreMap":510},[514,921,922],{"class":516,"line":517},[514,923,924],{"class":602},"\u002F\u002F src\u002Fmiddleware.ts\n",[514,926,927,929,931,934,936,938,940,943,945],{"class":516,"line":551},[514,928,521],{"class":520},[514,930,525],{"class":524},[514,932,933],{"class":528}," defineMiddleware",[514,935,532],{"class":524},[514,937,535],{"class":520},[514,939,538],{"class":524},[514,941,942],{"class":541},"astro:middleware",[514,944,545],{"class":524},[514,946,548],{"class":524},[514,948,949,951,953,956,958,960,962,964,966],{"class":516,"line":574},[514,950,521],{"class":520},[514,952,525],{"class":524},[514,954,955],{"class":528}," resolveRedirect",[514,957,532],{"class":524},[514,959,535],{"class":520},[514,961,538],{"class":524},[514,963,567],{"class":541},[514,965,545],{"class":524},[514,967,548],{"class":524},[514,969,970,972,975,977,979,982,984],{"class":516,"line":581},[514,971,521],{"class":520},[514,973,974],{"class":528}," cms ",[514,976,868],{"class":520},[514,978,538],{"class":524},[514,980,981],{"class":541},"..\u002Ftenon.config",[514,983,545],{"class":524},[514,985,548],{"class":524},[514,987,988],{"class":516,"line":599},[514,989,578],{"emptyLinePlaceholder":577},[514,991,992,994,998,1001,1004,1006,1008,1011,1013,1017,1019,1022,1024,1027],{"class":516,"line":606},[514,993,584],{"class":520},[514,995,997],{"class":996},"spNyl"," const",[514,999,1000],{"class":528}," onRequest ",[514,1002,1003],{"class":524},"=",[514,1005,933],{"class":590},[514,1007,593],{"class":528},[514,1009,1010],{"class":996},"async",[514,1012,875],{"class":524},[514,1014,1016],{"class":1015},"sHdIc","context",[514,1018,790],{"class":524},[514,1020,1021],{"class":1015}," next",[514,1023,633],{"class":524},[514,1025,1026],{"class":996}," =>",[514,1028,1029],{"class":524}," {\n",[514,1031,1032,1035,1038,1041,1044,1046,1048,1051,1053,1056,1058,1061,1063,1066,1068],{"class":516,"line":627},[514,1033,1034],{"class":996},"  const",[514,1036,1037],{"class":528}," redirect",[514,1039,1040],{"class":524}," =",[514,1042,1043],{"class":520}," await",[514,1045,955],{"class":590},[514,1047,593],{"class":609},[514,1049,1050],{"class":528},"cms",[514,1052,790],{"class":524},[514,1054,1055],{"class":528}," context",[514,1057,661],{"class":524},[514,1059,1060],{"class":528},"url",[514,1062,661],{"class":524},[514,1064,1065],{"class":528},"pathname",[514,1067,633],{"class":609},[514,1069,548],{"class":524},[514,1071,1073,1076,1078,1081,1083,1085,1088,1090,1092,1094,1096,1098,1100,1102,1105,1108,1110,1112,1115],{"class":516,"line":1072},8,[514,1074,1075],{"class":520},"  return",[514,1077,1037],{"class":528},[514,1079,1080],{"class":524}," ?",[514,1082,1055],{"class":528},[514,1084,661],{"class":524},[514,1086,1087],{"class":590},"redirect",[514,1089,593],{"class":609},[514,1091,1087],{"class":528},[514,1093,661],{"class":524},[514,1095,871],{"class":528},[514,1097,790],{"class":524},[514,1099,1037],{"class":528},[514,1101,661],{"class":524},[514,1103,1104],{"class":528},"status",[514,1106,1107],{"class":609},") ",[514,1109,503],{"class":524},[514,1111,1021],{"class":590},[514,1113,1114],{"class":609},"()",[514,1116,548],{"class":524},[514,1118,1120,1122,1124],{"class":516,"line":1119},9,[514,1121,630],{"class":524},[514,1123,633],{"class":528},[514,1125,548],{"class":524},[505,1127,1129],{"className":507,"code":1128,"filename":368,"language":509,"meta":510,"style":510},"\u002F\u002F server\u002Fmiddleware\u002Fredirects.ts\nimport cms from \"#tenon\u002Fconfig\";\nimport { resolveRedirect } from \"tenoncms\u002Fplugins\u002Fredirects\";\n\nexport default defineEventHandler(async (event) => {\n  const redirect = await resolveRedirect(cms, getRequestURL(event).pathname);\n  if (redirect) return sendRedirect(event, redirect.to, redirect.status);\n});\n",[488,1130,1131,1136,1153,1173,1177,1201,1236,1277],{"__ignoreMap":510},[514,1132,1133],{"class":516,"line":517},[514,1134,1135],{"class":602},"\u002F\u002F server\u002Fmiddleware\u002Fredirects.ts\n",[514,1137,1138,1140,1142,1144,1146,1149,1151],{"class":516,"line":551},[514,1139,521],{"class":520},[514,1141,974],{"class":528},[514,1143,868],{"class":520},[514,1145,538],{"class":524},[514,1147,1148],{"class":541},"#tenon\u002Fconfig",[514,1150,545],{"class":524},[514,1152,548],{"class":524},[514,1154,1155,1157,1159,1161,1163,1165,1167,1169,1171],{"class":516,"line":574},[514,1156,521],{"class":520},[514,1158,525],{"class":524},[514,1160,955],{"class":528},[514,1162,532],{"class":524},[514,1164,535],{"class":520},[514,1166,538],{"class":524},[514,1168,567],{"class":541},[514,1170,545],{"class":524},[514,1172,548],{"class":524},[514,1174,1175],{"class":516,"line":581},[514,1176,578],{"emptyLinePlaceholder":577},[514,1178,1179,1181,1183,1186,1188,1190,1192,1195,1197,1199],{"class":516,"line":599},[514,1180,584],{"class":520},[514,1182,587],{"class":520},[514,1184,1185],{"class":590}," defineEventHandler",[514,1187,593],{"class":528},[514,1189,1010],{"class":996},[514,1191,875],{"class":524},[514,1193,1194],{"class":1015},"event",[514,1196,633],{"class":524},[514,1198,1026],{"class":996},[514,1200,1029],{"class":524},[514,1202,1203,1205,1207,1209,1211,1213,1215,1217,1219,1222,1224,1226,1228,1230,1232,1234],{"class":516,"line":606},[514,1204,1034],{"class":996},[514,1206,1037],{"class":528},[514,1208,1040],{"class":524},[514,1210,1043],{"class":520},[514,1212,955],{"class":590},[514,1214,593],{"class":609},[514,1216,1050],{"class":528},[514,1218,790],{"class":524},[514,1220,1221],{"class":590}," getRequestURL",[514,1223,593],{"class":609},[514,1225,1194],{"class":528},[514,1227,633],{"class":609},[514,1229,661],{"class":524},[514,1231,1065],{"class":528},[514,1233,633],{"class":609},[514,1235,548],{"class":524},[514,1237,1238,1241,1243,1245,1247,1250,1253,1255,1257,1259,1261,1263,1265,1267,1269,1271,1273,1275],{"class":516,"line":627},[514,1239,1240],{"class":520},"  if",[514,1242,875],{"class":609},[514,1244,1087],{"class":528},[514,1246,1107],{"class":609},[514,1248,1249],{"class":520},"return",[514,1251,1252],{"class":590}," sendRedirect",[514,1254,593],{"class":609},[514,1256,1194],{"class":528},[514,1258,790],{"class":524},[514,1260,1037],{"class":528},[514,1262,661],{"class":524},[514,1264,871],{"class":528},[514,1266,790],{"class":524},[514,1268,1037],{"class":528},[514,1270,661],{"class":524},[514,1272,1104],{"class":528},[514,1274,633],{"class":609},[514,1276,548],{"class":524},[514,1278,1279,1281,1283],{"class":516,"line":1072},[514,1280,630],{"class":524},[514,1282,633],{"class":528},[514,1284,548],{"class":524},[505,1286,1288],{"className":507,"code":1287,"filename":372,"language":509,"meta":510,"style":510},"\u002F\u002F src\u002Fstart.ts\nimport { createMiddleware, createStart } from \"@tanstack\u002Freact-start\";\nimport { resolveRedirect } from \"tenoncms\u002Fplugins\u002Fredirects\";\nimport cms from \"..\u002Ftenon.config\";\n\nconst redirects = createMiddleware().server(async ({ request, next }) => {\n  const redirect = await resolveRedirect(cms, new URL(request.url).pathname);\n  if (redirect) return Response.redirect(new URL(redirect.to, request.url), redirect.status);\n  return next();\n});\n\nexport const startInstance = createStart(() => ({ requestMiddleware: [redirects] }));\n",[488,1289,1290,1295,1322,1342,1358,1362,1402,1445,1501,1511,1520,1525],{"__ignoreMap":510},[514,1291,1292],{"class":516,"line":517},[514,1293,1294],{"class":602},"\u002F\u002F src\u002Fstart.ts\n",[514,1296,1297,1299,1301,1304,1306,1309,1311,1313,1315,1318,1320],{"class":516,"line":551},[514,1298,521],{"class":520},[514,1300,525],{"class":524},[514,1302,1303],{"class":528}," createMiddleware",[514,1305,790],{"class":524},[514,1307,1308],{"class":528}," createStart",[514,1310,532],{"class":524},[514,1312,535],{"class":520},[514,1314,538],{"class":524},[514,1316,1317],{"class":541},"@tanstack\u002Freact-start",[514,1319,545],{"class":524},[514,1321,548],{"class":524},[514,1323,1324,1326,1328,1330,1332,1334,1336,1338,1340],{"class":516,"line":574},[514,1325,521],{"class":520},[514,1327,525],{"class":524},[514,1329,955],{"class":528},[514,1331,532],{"class":524},[514,1333,535],{"class":520},[514,1335,538],{"class":524},[514,1337,567],{"class":541},[514,1339,545],{"class":524},[514,1341,548],{"class":524},[514,1343,1344,1346,1348,1350,1352,1354,1356],{"class":516,"line":581},[514,1345,521],{"class":520},[514,1347,974],{"class":528},[514,1349,868],{"class":520},[514,1351,538],{"class":524},[514,1353,981],{"class":541},[514,1355,545],{"class":524},[514,1357,548],{"class":524},[514,1359,1360],{"class":516,"line":599},[514,1361,578],{"emptyLinePlaceholder":577},[514,1363,1364,1367,1370,1372,1374,1376,1378,1381,1383,1385,1388,1391,1393,1395,1398,1400],{"class":516,"line":606},[514,1365,1366],{"class":996},"const",[514,1368,1369],{"class":528}," redirects ",[514,1371,1003],{"class":524},[514,1373,1303],{"class":590},[514,1375,1114],{"class":528},[514,1377,661],{"class":524},[514,1379,1380],{"class":590},"server",[514,1382,593],{"class":528},[514,1384,1010],{"class":996},[514,1386,1387],{"class":524}," ({",[514,1389,1390],{"class":1015}," request",[514,1392,790],{"class":524},[514,1394,1021],{"class":1015},[514,1396,1397],{"class":524}," })",[514,1399,1026],{"class":996},[514,1401,1029],{"class":524},[514,1403,1404,1406,1408,1410,1412,1414,1416,1418,1420,1423,1426,1428,1431,1433,1435,1437,1439,1441,1443],{"class":516,"line":627},[514,1405,1034],{"class":996},[514,1407,1037],{"class":528},[514,1409,1040],{"class":524},[514,1411,1043],{"class":520},[514,1413,955],{"class":590},[514,1415,593],{"class":609},[514,1417,1050],{"class":528},[514,1419,790],{"class":524},[514,1421,1422],{"class":524}," new",[514,1424,1425],{"class":590}," URL",[514,1427,593],{"class":609},[514,1429,1430],{"class":528},"request",[514,1432,661],{"class":524},[514,1434,1060],{"class":528},[514,1436,633],{"class":609},[514,1438,661],{"class":524},[514,1440,1065],{"class":528},[514,1442,633],{"class":609},[514,1444,548],{"class":524},[514,1446,1447,1449,1451,1453,1455,1457,1460,1462,1464,1466,1469,1471,1473,1475,1477,1479,1481,1483,1485,1487,1489,1491,1493,1495,1497,1499],{"class":516,"line":1072},[514,1448,1240],{"class":520},[514,1450,875],{"class":609},[514,1452,1087],{"class":528},[514,1454,1107],{"class":609},[514,1456,1249],{"class":520},[514,1458,1459],{"class":528}," Response",[514,1461,661],{"class":524},[514,1463,1087],{"class":590},[514,1465,593],{"class":609},[514,1467,1468],{"class":524},"new",[514,1470,1425],{"class":590},[514,1472,593],{"class":609},[514,1474,1087],{"class":528},[514,1476,661],{"class":524},[514,1478,871],{"class":528},[514,1480,790],{"class":524},[514,1482,1390],{"class":528},[514,1484,661],{"class":524},[514,1486,1060],{"class":528},[514,1488,633],{"class":609},[514,1490,790],{"class":524},[514,1492,1037],{"class":528},[514,1494,661],{"class":524},[514,1496,1104],{"class":528},[514,1498,633],{"class":609},[514,1500,548],{"class":524},[514,1502,1503,1505,1507,1509],{"class":516,"line":1119},[514,1504,1075],{"class":520},[514,1506,1021],{"class":590},[514,1508,1114],{"class":609},[514,1510,548],{"class":524},[514,1512,1514,1516,1518],{"class":516,"line":1513},10,[514,1515,630],{"class":524},[514,1517,633],{"class":528},[514,1519,548],{"class":524},[514,1521,1523],{"class":516,"line":1522},11,[514,1524,578],{"emptyLinePlaceholder":577},[514,1526,1528,1530,1532,1535,1537,1539,1541,1543,1545,1547,1549,1552,1554,1557,1559,1562],{"class":516,"line":1527},12,[514,1529,584],{"class":520},[514,1531,997],{"class":996},[514,1533,1534],{"class":528}," startInstance ",[514,1536,1003],{"class":524},[514,1538,1308],{"class":590},[514,1540,593],{"class":528},[514,1542,1114],{"class":524},[514,1544,1026],{"class":996},[514,1546,875],{"class":528},[514,1548,770],{"class":524},[514,1550,1551],{"class":609}," requestMiddleware",[514,1553,503],{"class":524},[514,1555,1556],{"class":528}," [redirects] ",[514,1558,630],{"class":524},[514,1560,1561],{"class":528},"))",[514,1563,548],{"class":524},[640,1565,1566,1573],{},[643,1567,1568,1569,1572],{},"With languages, pass the page's language as the third argument: ",[488,1570,1571],{},"resolveRedirect(cms, path, \"de\")",". A redirect for that language wins over one for all.",[643,1574,1575,1576,1579,1580,1583,1584,1587,1588,1591],{},"A site on another origin asks ",[488,1577,1578],{},"GET \u002F_tenon\u002Fredirects\u002Flookup?path=\u002Fold-page",". It answers ",[488,1581,1582],{},"{ to, status }",", or ",[488,1585,1586],{},"404",". Add ",[488,1589,1590],{},"&locale=de"," for a language.",[493,1593,1595],{"id":1594},"the-example-plugin","The example plugin",[484,1597,1598,1601,1602,1604,1605,1608],{},[488,1599,1600],{},"ExamplePlugin()"," from ",[488,1603,732],{}," is not a feature. It is code to copy when you write your own plugin. It adds a ",[488,1606,1607],{},"quotes"," collection with a custom field, a settings global, a scheduled job, API routes, admin pages, admin bar items and a rich text extension.",[484,1610,1611,1612,1615,1616,661],{},"Its browser code exists in plain DOM, Vue and React. ",[488,1613,1614],{},"renderer: \"html\" | \"vue\" | \"react\""," picks one. Its source is in the Tenon repository, under ",[488,1617,1618],{},"packages\u002Fplugins\u002Fsrc\u002Fexample\u002F",[493,1620,1622],{"id":1621},"what-a-plugin-can-define","What a plugin can define",[484,1624,1625,1626,1628],{},"A plugin's additions merge before yours, in the order of ",[488,1627,502],{},". A collection, global, task or field name that you and a plugin both use stops the server at startup.",[839,1630,1631,1691,1702,1714,1721,1729,1749,1755,1767,1778,1796,1807,1821],{},[842,1632,1635,1636,1639,1640,685,1643,685,1646,685,1649,685,1652,685,1655,685,1658,685,1661,685,1663,685,1665,685,1668,685,1670,685,1673,685,1675,685,1678,685,1681,685,1684,1687,1688,661],{"name":1633,"type":852,":required":1634},"name","true","Unique, with lowercase letters, digits and ",[488,1637,1638],{},"-",". It prefixes the plugin's routes and task names. Names of core routes are reserved: ",[488,1641,1642],{},"account",[488,1644,1645],{},"admin",[488,1647,1648],{},"admin-bar",[488,1650,1651],{},"admin-brand",[488,1653,1654],{},"api-keys",[488,1656,1657],{},"auth",[488,1659,1660],{},"auth-status",[488,1662,844],{},[488,1664,584],{},[488,1666,1667],{},"globals",[488,1669,521],{},[488,1671,1672],{},"invites",[488,1674,673],{},[488,1676,1677],{},"localization",[488,1679,1680],{},"media",[488,1682,1683],{},"preview",[488,1685,1686],{},"schema"," and ",[488,1689,1690],{},"setup",[842,1692,1694,1695,1698,1699,649],{"name":844,"type":1693},"Record\u003Cstring, Collection>","Collections from ",[488,1696,1697],{},"defineCollection()",". They are typed for the site, so ",[488,1700,1701],{},"cms.find(\"announcements\")",[842,1703,1705,1706,1709,1710,1713],{"name":1667,"type":1704},"Record\u003Cstring, Global>","Globals from ",[488,1707,1708],{},"defineGlobal()",". A global with ",[488,1711,1712],{},"nav: { display: \"settings\" }"," makes a settings page for the plugin.",[842,1715,1718,1720],{"name":1716,"type":1717},"hooks","RootHooks",[654,1719,171],{"href":172}," for every collection and global. They run after the collection's own hooks and before your root hooks.",[842,1722,1725,1726,661],{"name":1723,"type":1724},"mediaHooks","MediaHooks","Hooks of the media library. They run after the hooks in ",[488,1727,1728],{},"media.hooks",[842,1730,1733,1734,1737,1738,1741,1742,1745,1746,661],{"name":1731,"type":1732},"routes","(api: Hono) => void","Routes at ",[488,1735,1736],{},"\u002F_tenon\u002F\u003Cname>"," that need a session, for the plugin's admin pages. They run after the CSRF and session checks. ",[488,1739,1740],{},"c.var.user"," is the signed-in user, and ",[488,1743,1744],{},"c.var.cms"," runs with that user. API keys get ",[488,1747,1748],{},"403",[842,1750,1733,1752,1754],{"name":1751,"type":1732},"publicRoutes",[488,1753,1736],{}," without a session, for the site. They run before the CSRF and session checks, so a public route that writes MUST protect itself.",[842,1756,1759,1760,1763,1764,1766],{"name":1757,"type":1758},"publicMiddleware","MiddlewareHandler","Hono middleware for every request under ",[488,1761,1762],{},"\u002F_tenon",", sign-in included, before any route. ",[488,1765,1744],{}," has no user. Return a response to stop the request, for example for a rate limit.",[842,1768,1770,1771,1774,1775,1777],{"name":1769,"type":1758},"middleware","Hono middleware for requests with a session: content writes, ",[488,1772,1773],{},"\u002Fschema"," and the ",[488,1776,1731],{}," of every plugin. Writes without a session skip it, API key writes included.",[842,1779,1781,1783,1784,1787,1788,1791,1792,1795],{"name":673,"type":1780},"{ tasks, scheduledTasks }",[654,1782,267],{"href":268}," of the plugin. A task name MUST start with ",[488,1785,1786],{},"\u003Cname>:",", like ",[488,1789,1790],{},"announcements:expire",". ",[488,1793,1794],{},"scheduledTasks"," MAY name only the plugin's own tasks.",[842,1797,1800,1804,1805,661],{"name":1798,"type":1799},"richtext","RichtextOptions",[654,1801,1803],{"href":1802},"\u002Fdocs\u002Fcore\u002Fcustomization\u002Frich-text-extensions#in-a-plugin","Rich text extensions",", like your own ",[488,1806,1798],{},[842,1808,1810,685,1812,1814,1815,1804,1818,1820],{"name":1645,"type":1809},"PluginAdminOptions",[654,1811,45],{"href":224},[654,1813,688],{"href":228}," and admin bar ",[488,1816,1817],{},"items",[488,1819,1645],{},". A plugin never sets the bar's position and never turns the bar off.",[842,1822,1825,1828],{"name":1823,"type":1824},"seed, onInit, afterImport, afterError","function",[654,1826,1827],{"href":312},"Lifecycle hooks",". They run before yours.",[484,1830,1831,1832,1835,1836,1839,1840,1835,1843,1846,1847,661],{},"Routes and middleware map errors like core does: a ",[488,1833,1834],{},"ValidationError"," answers ",[488,1837,1838],{},"400"," with the field errors, a ",[488,1841,1842],{},"ConflictError",[488,1844,1845],{},"409",", anything else ",[488,1848,1849],{},"500",[493,1851,1853],{"id":1852},"write-your-own","Write your own",[484,1855,1856,1857,1860,1861,661],{},"A plugin is an object from ",[488,1858,1859],{},"definePlugin()",". Use one to share a feature between projects, or to keep a feature of your own site in one place. See ",[654,1862,1863],{"href":436},"Write a plugin",[493,1865,1867],{"id":1866},"related-resources","Related resources",[640,1869,1870,1878,1884,1893],{},[643,1871,1872,1874,1875,1877],{},[654,1873,1863],{"href":436},": ",[488,1876,1859],{},", and how to publish a plugin.",[643,1879,1880,1883],{},[654,1881,1882],{"href":224},"Custom fields",": the admin pieces a plugin adds.",[643,1885,1886,1892],{},[654,1887,1889],{"href":1888},"\u002Fdocs\u002Fcore\u002Fcustomization#clientref",[488,1890,1891],{},"clientRef()",": how a plugin points to its browser code.",[643,1894,1895,1897],{},[654,1896,171],{"href":172},": when plugin hooks run.",[1899,1900,1901],"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 .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}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 .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}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 .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}",{"title":510,"searchDepth":551,"depth":551,"links":1903},[1904,1905,1906,1909,1910,1911,1912],{"id":495,"depth":551,"text":496},{"id":695,"depth":551,"text":696},{"id":738,"depth":551,"text":739,"children":1907},[1908],{"id":899,"depth":574,"text":900},{"id":1594,"depth":551,"text":1595},{"id":1621,"depth":551,"text":1622},{"id":1852,"depth":551,"text":1853},{"id":1866,"depth":551,"text":1867},"Add features from one import.","md",null,{},{"title":239,"description":1913},"TAKitM40EoHmTSw4TyLBE1Am5elKD5-erz3SuVJWhZA",[1920,1922],{"title":235,"path":236,"stem":237,"description":1921,"children":-1},"Add your own nodes and marks to the rich text editor.",{"title":50,"path":244,"stem":245,"description":1923,"children":-1},"Run work in the background, tell other services about changes, and keep your data safe.",1795884647063]