[{"data":1,"prerenderedAt":5939},["ShallowReactive",2],{"navigation_docs":3,"-developers-frameworks":613,"-developers-frameworks-surround":5936},[4,39,101,378,540,562,584,606],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":38},"Start","i-lucide-rocket","\u002Fstart","1.start",[10,14,18,22,26,30,34],{"title":11,"path":12,"stem":13},"Our approach","\u002Fstart\u002Four-approach","1.start\u002F0.our-approach",{"title":15,"path":16,"stem":17},"Introduction","\u002Fstart\u002Fintroduction","1.start\u002F1.introduction",{"title":19,"path":20,"stem":21},"Concepts","\u002Fstart\u002Fconcepts","1.start\u002F2.concepts",{"title":23,"path":24,"stem":25},"Glossary","\u002Fstart\u002Fglossary","1.start\u002F3.glossary",{"title":27,"path":28,"stem":29},"Try it locally","\u002Fstart\u002Ftry-it-locally","1.start\u002F4.try-it-locally",{"title":31,"path":32,"stem":33},"Features","\u002Fstart\u002Ffeatures","1.start\u002F5.features",{"title":35,"path":36,"stem":37},"Questions","\u002Fstart\u002Ffaq","1.start\u002F6.faq",false,{"title":40,"icon":41,"path":42,"stem":43,"children":44,"page":38},"Run SHADE","i-lucide-server","\u002Frun","2.run",[45,49,53,57,61,65,69,73,77,81,85,89,93,97],{"title":46,"path":47,"stem":48},"Setting up an instance (Coolify)","\u002Frun\u002Fcoolify","2.run\u002F1.coolify",{"title":50,"path":51,"stem":52},"Console commands","\u002Frun\u002Fconsole","2.run\u002F10.console",{"title":54,"path":55,"stem":56},"Rotating APP_SECRET","\u002Frun\u002Frotating-app-secret","2.run\u002F11.rotating-app-secret",{"title":58,"path":59,"stem":60},"Checking an instance","\u002Frun\u002Fdoctor","2.run\u002F12.doctor",{"title":62,"path":63,"stem":64},"Self-hosting by hand","\u002Frun\u002Fown-server-by-hand","2.run\u002F13.own-server-by-hand",{"title":66,"path":67,"stem":68},"NixOS (experimental)","\u002Frun\u002Fnixos","2.run\u002F14.nixos",{"title":70,"path":71,"stem":72},"Self-hosting without Coolify","\u002Frun\u002Fown-server","2.run\u002F2.own-server",{"title":74,"path":75,"stem":76},"Hosting the site on a static host","\u002Frun\u002Fstatic-hosts","2.run\u002F3.static-hosts",{"title":78,"path":79,"stem":80},"Licence","\u002Frun\u002Flicence","2.run\u002F4.licence",{"title":82,"path":83,"stem":84},"Updating and backups","\u002Frun\u002Fupdating-and-backups","2.run\u002F5.updating-and-backups",{"title":86,"path":87,"stem":88},"Troubleshooting","\u002Frun\u002Ftroubleshooting","2.run\u002F6.troubleshooting",{"title":90,"path":91,"stem":92},"Logs, request ids, traces and metrics","\u002Frun\u002Flogs","2.run\u002F7.logs",{"title":94,"path":95,"stem":96},"Maintenance mode","\u002Frun\u002Fmaintenance-mode","2.run\u002F8.maintenance-mode",{"title":98,"path":99,"stem":100},"Usage limits","\u002Frun\u002Fusage-limits","2.run\u002F9.usage-limits",{"title":102,"icon":103,"path":104,"stem":105,"children":106},"Guide","i-lucide-book-open","\u002Fguide","3.guide",[107,109,147,192,210,280,310,364],{"title":102,"path":104,"stem":108},"3.guide\u002Findex",{"title":110,"icon":111,"path":112,"stem":113,"children":114,"page":38},"Content","i-lucide-file-text","\u002Fguide\u002Fcontent","3.guide\u002F1.content",[115,119,123,127,131,135,139,143],{"title":116,"path":117,"stem":118},"Collections and entries","\u002Fguide\u002Fcontent\u002Fcollections","3.guide\u002F1.content\u002F1.collections",{"title":120,"path":121,"stem":122},"Field types","\u002Fguide\u002Fcontent\u002Ffields","3.guide\u002F1.content\u002F2.fields",{"title":124,"path":125,"stem":126},"Drafts, publishing and version history","\u002Fguide\u002Fcontent\u002Fversions","3.guide\u002F1.content\u002F3.versions",{"title":128,"path":129,"stem":130},"Languages","\u002Fguide\u002Fcontent\u002Flanguages","3.guide\u002F1.content\u002F4.languages",{"title":132,"path":133,"stem":134},"Data sources","\u002Fguide\u002Fcontent\u002Fdata-sources","3.guide\u002F1.content\u002F5.data-sources",{"title":136,"path":137,"stem":138},"Media","\u002Fguide\u002Fcontent\u002Fmedia","3.guide\u002F1.content\u002F6.media",{"title":140,"path":141,"stem":142},"Search","\u002Fguide\u002Fcontent\u002Fsearch","3.guide\u002F1.content\u002F7.search",{"title":144,"path":145,"stem":146},"Trash","\u002Fguide\u002Fcontent\u002Ftrash","3.guide\u002F1.content\u002F8.trash",{"title":148,"icon":149,"path":150,"stem":151,"children":152,"page":38},"Website","i-lucide-globe","\u002Fguide\u002Fwebsite","3.guide\u002F2.website",[153,156,160,164,168,172,176,180,184,188],{"title":148,"path":154,"stem":155},"\u002Fguide\u002Fwebsite\u002Fwebsite","3.guide\u002F2.website\u002F1.website",{"title":157,"path":158,"stem":159},"Scroll scenes","\u002Fguide\u002Fwebsite\u002Fscroll-scenes","3.guide\u002F2.website\u002F10.scroll-scenes",{"title":161,"path":162,"stem":163},"Pages and posts","\u002Fguide\u002Fwebsite\u002Fpages","3.guide\u002F2.website\u002F2.pages",{"title":165,"path":166,"stem":167},"The visual editor","\u002Fguide\u002Fwebsite\u002Fvisual-editor","3.guide\u002F2.website\u002F3.visual-editor",{"title":169,"path":170,"stem":171},"Roles and locks","\u002Fguide\u002Fwebsite\u002Froles-and-locks","3.guide\u002F2.website\u002F4.roles-and-locks",{"title":173,"path":174,"stem":175},"Header and footer","\u002Fguide\u002Fwebsite\u002Fheader-and-footer","3.guide\u002F2.website\u002F5.header-and-footer",{"title":177,"path":178,"stem":179},"Theme","\u002Fguide\u002Fwebsite\u002Ftheme","3.guide\u002F2.website\u002F6.theme",{"title":181,"path":182,"stem":183},"Redirects","\u002Fguide\u002Fwebsite\u002Fredirects","3.guide\u002F2.website\u002F7.redirects",{"title":185,"path":186,"stem":187},"Site settings","\u002Fguide\u002Fwebsite\u002Fsite-settings","3.guide\u002F2.website\u002F8.site-settings",{"title":189,"path":190,"stem":191},"The site","\u002Fguide\u002Fwebsite\u002Fthe-site","3.guide\u002F2.website\u002F9.the-site",{"title":193,"icon":194,"path":195,"stem":196,"children":197,"page":38},"Publishing","i-lucide-send","\u002Fguide\u002Fpublishing","3.guide\u002F3.publishing",[198,202,206],{"title":199,"path":200,"stem":201},"Publishing and preview","\u002Fguide\u002Fpublishing\u002Fpublishing","3.guide\u002F3.publishing\u002F1.publishing",{"title":203,"path":204,"stem":205},"Builds","\u002Fguide\u002Fpublishing\u002Fbuilds","3.guide\u002F3.publishing\u002F2.builds",{"title":207,"path":208,"stem":209},"CDN caches","\u002Fguide\u002Fpublishing\u002Fcaches","3.guide\u002F3.publishing\u002F3.caches",{"title":211,"icon":212,"path":213,"stem":214,"children":215,"page":38},"People, security and privacy","i-lucide-shield","\u002Fguide\u002Fpeople-and-security","3.guide\u002F4.people-and-security",[216,220,224,228,232,236,240,244,248,252,256,260,264,268,272,276],{"title":217,"path":218,"stem":219},"People in SHADE","\u002Fguide\u002Fpeople-and-security\u002Fpeople-in-shade","3.guide\u002F4.people-and-security\u002F0.people-in-shade",{"title":221,"path":222,"stem":223},"Team and roles","\u002Fguide\u002Fpeople-and-security\u002Fteam","3.guide\u002F4.people-and-security\u002F1.team",{"title":225,"path":226,"stem":227},"Errors and security alerts","\u002Fguide\u002Fpeople-and-security\u002Ferrors","3.guide\u002F4.people-and-security\u002F10.errors",{"title":229,"path":230,"stem":231},"Exporting an instance","\u002Fguide\u002Fpeople-and-security\u002Fexporting","3.guide\u002F4.people-and-security\u002F11.exporting",{"title":233,"path":234,"stem":235},"Organisations","\u002Fguide\u002Fpeople-and-security\u002Forganisations","3.guide\u002F4.people-and-security\u002F12.organisations",{"title":237,"path":238,"stem":239},"Signing in through an identity provider (team)","\u002Fguide\u002Fpeople-and-security\u002Fidentity-providers","3.guide\u002F4.people-and-security\u002F13.identity-providers",{"title":241,"path":242,"stem":243},"System status","\u002Fguide\u002Fpeople-and-security\u002Fsystem-status","3.guide\u002F4.people-and-security\u002F14.system-status",{"title":245,"path":246,"stem":247},"Appearance","\u002Fguide\u002Fpeople-and-security\u002Fappearance","3.guide\u002F4.people-and-security\u002F15.appearance",{"title":249,"path":250,"stem":251},"Accounts and personal pages","\u002Fguide\u002Fpeople-and-security\u002Faccounts","3.guide\u002F4.people-and-security\u002F2.accounts",{"title":253,"path":254,"stem":255},"Signing in (team)","\u002Fguide\u002Fpeople-and-security\u002Fsign-in","3.guide\u002F4.people-and-security\u002F3.sign-in",{"title":257,"path":258,"stem":259},"API tokens","\u002Fguide\u002Fpeople-and-security\u002Fapi-tokens","3.guide\u002F4.people-and-security\u002F4.api-tokens",{"title":261,"path":262,"stem":263},"Audit log","\u002Fguide\u002Fpeople-and-security\u002Faudit","3.guide\u002F4.people-and-security\u002F5.audit",{"title":265,"path":266,"stem":267},"Request protection","\u002Fguide\u002Fpeople-and-security\u002Fprotection","3.guide\u002F4.people-and-security\u002F6.protection",{"title":269,"path":270,"stem":271},"Personal data per person","\u002Fguide\u002Fpeople-and-security\u002Fprivacy","3.guide\u002F4.people-and-security\u002F7.privacy",{"title":273,"path":274,"stem":275},"Data retention","\u002Fguide\u002Fpeople-and-security\u002Fretention","3.guide\u002F4.people-and-security\u002F8.retention",{"title":277,"path":278,"stem":279},"Consent banner","\u002Fguide\u002Fpeople-and-security\u002Fconsent","3.guide\u002F4.people-and-security\u002F9.consent",{"title":281,"icon":282,"path":283,"stem":284,"children":285,"page":38},"Services","i-lucide-plug","\u002Fguide\u002Fservices","3.guide\u002F5.services",[286,290,294,298,302,306],{"title":287,"path":288,"stem":289},"Email","\u002Fguide\u002Fservices\u002Femail","3.guide\u002F5.services\u002F1.email",{"title":291,"path":292,"stem":293},"Opening hours","\u002Fguide\u002Fservices\u002Fopening-hours","3.guide\u002F5.services\u002F4.opening-hours",{"title":295,"path":296,"stem":297},"Webhooks","\u002Fguide\u002Fservices\u002Fwebhooks","3.guide\u002F5.services\u002F5.webhooks",{"title":299,"path":300,"stem":301},"Locations","\u002Fguide\u002Fservices\u002Flocations","3.guide\u002F5.services\u002F6.locations",{"title":303,"path":304,"stem":305},"VAT rates","\u002Fguide\u002Fservices\u002Fvat-rates","3.guide\u002F5.services\u002F7.vat-rates",{"title":307,"path":308,"stem":309},"Channels","\u002Fguide\u002Fservices\u002Fchannels","3.guide\u002F5.services\u002F8.channels",{"title":311,"icon":312,"path":313,"stem":314,"children":315,"page":38},"InstalledModules","i-lucide-puzzle","\u002Fguide\u002Fmodules","3.guide\u002F6.modules",[316,320,324,328,332,336,340,344,348,352,356,360],{"title":317,"path":318,"stem":319},"Modules","\u002Fguide\u002Fmodules\u002Fmanaging","3.guide\u002F6.modules\u002F1.managing",{"title":321,"path":322,"stem":323},"Dutch services (module)","\u002Fguide\u002Fmodules\u002Fnl","3.guide\u002F6.modules\u002F10.nl",{"title":325,"path":326,"stem":327},"Editorial (module)","\u002Fguide\u002Fmodules\u002Feditorial","3.guide\u002F6.modules\u002F11.editorial",{"title":329,"path":330,"stem":331},"Appointments (module)","\u002Fguide\u002Fmodules\u002Fappointments","3.guide\u002F6.modules\u002F2.appointments",{"title":333,"path":334,"stem":335},"Shop (the commerce module)","\u002Fguide\u002Fmodules\u002Fshop","3.guide\u002F6.modules\u002F3.shop",{"title":337,"path":338,"stem":339},"Untrusted modules","\u002Fguide\u002Fmodules\u002Funtrusted","3.guide\u002F6.modules\u002F4.untrusted",{"title":341,"path":342,"stem":343},"Analytics (module)","\u002Fguide\u002Fmodules\u002Fanalytics","3.guide\u002F6.modules\u002F5.analytics",{"title":345,"path":346,"stem":347},"Error forwarding (module)","\u002Fguide\u002Fmodules\u002Ferror-forwarding","3.guide\u002F6.modules\u002F6.error-forwarding",{"title":349,"path":350,"stem":351},"Client programs","\u002Fguide\u002Fmodules\u002Fprograms","3.guide\u002F6.modules\u002F7.programs",{"title":353,"path":354,"stem":355},"Import and export (module)","\u002Fguide\u002Fmodules\u002Fimport","3.guide\u002F6.modules\u002F8.import",{"title":357,"path":358,"stem":359},"Payments (module)","\u002Fguide\u002Fmodules\u002Fpayments","3.guide\u002F6.modules\u002F8.payments",{"title":361,"path":362,"stem":363},"Forms (module)","\u002Fguide\u002Fmodules\u002Fforms","3.guide\u002F6.modules\u002F9.forms",{"title":365,"icon":366,"path":367,"stem":368,"children":369,"page":38},"AI assistants","i-lucide-bot","\u002Fguide\u002Fai","3.guide\u002F7.ai",[370,374],{"title":371,"path":372,"stem":373},"AI assistants (MCP)","\u002Fguide\u002Fai\u002Fassistants","3.guide\u002F7.ai\u002F1.assistants",{"title":375,"path":376,"stem":377},"Connecting an AI assistant","\u002Fguide\u002Fai\u002Fconnecting","3.guide\u002F7.ai\u002F2.connecting",{"title":379,"icon":380,"path":381,"stem":382,"children":383,"page":38},"Developers","i-lucide-code","\u002Fdevelopers","4.developers",[384,388,392,396,400,404,408,412,416,420,424,428,432,435,489,493,497,501,536],{"title":385,"path":386,"stem":387},"Architecture","\u002Fdevelopers\u002Farchitecture","4.developers\u002F1.architecture",{"title":389,"path":390,"stem":391},"Capabilities","\u002Fdevelopers\u002Fcapabilities","4.developers\u002F10.capabilities",{"title":393,"path":394,"stem":395},"Trust","\u002Fdevelopers\u002Ftrust","4.developers\u002F11.trust",{"title":397,"path":398,"stem":399},"Redis and the ports","\u002Fdevelopers\u002Fredis","4.developers\u002F12.redis",{"title":401,"path":402,"stem":403},"The worker container role","\u002Fdevelopers\u002Fworker","4.developers\u002F13.worker",{"title":405,"path":406,"stem":407},"kv: a module's own key-value storage","\u002Fdevelopers\u002Fkv","4.developers\u002F14.kv",{"title":409,"path":410,"stem":411},"Processes: long-running work on the worker","\u002Fdevelopers\u002Fprocesses","4.developers\u002F15.processes",{"title":413,"path":414,"stem":415},"Network: a module's outgoing calls","\u002Fdevelopers\u002Fnetwork","4.developers\u002F16.network",{"title":417,"path":418,"stem":419},"Realtime","\u002Fdevelopers\u002Frealtime","4.developers\u002F17.realtime",{"title":421,"path":422,"stem":423},"Private files","\u002Fdevelopers\u002Ffiles","4.developers\u002F18.files",{"title":425,"path":426,"stem":427},"Notify","\u002Fdevelopers\u002Fnotify","4.developers\u002F19.notify",{"title":429,"path":430,"stem":431},"Collections","\u002Fdevelopers\u002Fcollections","4.developers\u002F2.collections",{"title":337,"path":433,"stem":434},"\u002Fdevelopers\u002Funtrusted","4.developers\u002F20.untrusted",{"title":436,"icon":312,"path":437,"stem":438,"children":439},"Writing a plugin","\u002Fdevelopers\u002Fmodules","4.developers\u002F3.modules\u002Findex",[440,442,446,450,454,458,462,466,470,473,477,481,485],{"title":441,"path":437,"stem":438},"Writing a module",{"title":443,"path":444,"stem":445},"Module SDK and tooling","\u002Fdevelopers\u002Fmodules\u002Fsdk-and-tooling","4.developers\u002F3.modules\u002F1.sdk-and-tooling",{"title":447,"path":448,"stem":449},"Connecting accounts with OAuth2","\u002Fdevelopers\u002Fmodules\u002Foauth","4.developers\u002F3.modules\u002F10.oauth",{"title":451,"path":452,"stem":453},"Calls between modules","\u002Fdevelopers\u002Fmodules\u002Fcalls-between-modules","4.developers\u002F3.modules\u002F11.calls-between-modules",{"title":455,"path":456,"stem":457},"Experimental parts","\u002Fdevelopers\u002Fmodules\u002Fexperimental-parts","4.developers\u002F3.modules\u002F12.experimental-parts",{"title":459,"path":460,"stem":461},"The manifest","\u002Fdevelopers\u002Fmodules\u002Fmanifest","4.developers\u002F3.modules\u002F2.manifest",{"title":463,"path":464,"stem":465},"Routes","\u002Fdevelopers\u002Fmodules\u002Froutes","4.developers\u002F3.modules\u002F3.routes",{"title":467,"path":468,"stem":469},"Admin screens and the site part","\u002Fdevelopers\u002Fmodules\u002Fadmin-and-site","4.developers\u002F3.modules\u002F4.admin-and-site",{"title":110,"path":471,"stem":472},"\u002Fdevelopers\u002Fmodules\u002Fcontent","4.developers\u002F3.modules\u002F5.content",{"title":474,"path":475,"stem":476},"Background work and services","\u002Fdevelopers\u002Fmodules\u002Fbackground-and-services","4.developers\u002F3.modules\u002F6.background-and-services",{"title":478,"path":479,"stem":480},"SDK reference","\u002Fdevelopers\u002Fmodules\u002Fsdk-reference","4.developers\u002F3.modules\u002F7.sdk-reference",{"title":482,"path":483,"stem":484},"The website module's SDK","\u002Fdevelopers\u002Fmodules\u002Fwebsite-sdk","4.developers\u002F3.modules\u002F8.website-sdk",{"title":486,"path":487,"stem":488},"Incoming webhooks","\u002Fdevelopers\u002Fmodules\u002Fincoming-webhooks","4.developers\u002F3.modules\u002F9.incoming-webhooks",{"title":490,"path":491,"stem":492},"Core and the website module","\u002Fdevelopers\u002Fcore-and-website-module","4.developers\u002F4.core-and-website-module",{"title":494,"path":495,"stem":496},"The API","\u002Fdevelopers\u002Fapi","4.developers\u002F6.api",{"title":498,"path":499,"stem":500},"API reference","\u002Fdevelopers\u002Fapi-reference","4.developers\u002F6.api-reference",{"title":502,"icon":503,"path":504,"stem":505,"children":506},"Sites in other frameworks","i-lucide-layout-template","\u002Fdevelopers\u002Fframeworks","4.developers\u002F7.frameworks\u002Findex",[507,508,512,516,520,524,528,532],{"title":502,"path":504,"stem":505},{"title":509,"path":510,"stem":511},"Accounts: sign-in and modules' routes","\u002Fdevelopers\u002Fframeworks\u002Faccounts","4.developers\u002F7.frameworks\u002F1.accounts",{"title":513,"path":514,"stem":515},"`@shadestack\u002Ftree`","\u002Fdevelopers\u002Fframeworks\u002Ftree","4.developers\u002F7.frameworks\u002F2.tree",{"title":517,"path":518,"stem":519},"Expressions and styles","\u002Fdevelopers\u002Fframeworks\u002Fexpressions-and-styles","4.developers\u002F7.frameworks\u002F3.expressions-and-styles",{"title":521,"path":522,"stem":523},"`@shadestack\u002Frender`","\u002Fdevelopers\u002Fframeworks\u002Frender","4.developers\u002F7.frameworks\u002F4.render",{"title":525,"path":526,"stem":527},"`@shadestack\u002Finteractions`","\u002Fdevelopers\u002Fframeworks\u002Finteractions","4.developers\u002F7.frameworks\u002F5.interactions",{"title":529,"path":530,"stem":531},"`@shadestack\u002Fa11y`","\u002Fdevelopers\u002Fframeworks\u002Fa11y","4.developers\u002F7.frameworks\u002F6.a11y",{"title":533,"path":534,"stem":535},"Your own page for SHADE's links","\u002Fdevelopers\u002Fframeworks\u002Flinks","4.developers\u002F7.frameworks\u002F7.links",{"title":537,"path":538,"stem":539},"Build a client module","\u002Fdevelopers\u002Fclient-module","4.developers\u002F9.client-module",{"title":541,"icon":542,"path":543,"stem":544,"children":545,"page":38},"Security","i-lucide-shield-check","\u002Fsecurity","5.security",[546,550,554,558],{"title":547,"path":548,"stem":549},"Reporting a vulnerability","\u002Fsecurity\u002Freporting","5.security\u002F0.reporting",{"title":551,"path":552,"stem":553},"Security testing","\u002Fsecurity\u002Ftesting","5.security\u002F1.testing",{"title":555,"path":556,"stem":557},"Hardening a production instance","\u002Fsecurity\u002Fhardening","5.security\u002F2.hardening",{"title":559,"path":560,"stem":561},"Manual testing with Kali Linux","\u002Fsecurity\u002Fmanual-testing","5.security\u002F3.manual-testing",{"title":563,"icon":564,"path":565,"stem":566,"children":567,"page":38},"Contributing","i-lucide-git-pull-request","\u002Fcontributing","6.contributing",[568,572,576,580],{"title":569,"path":570,"stem":571},"Reading the code","\u002Fcontributing\u002Freading-the-code","6.contributing\u002F1.reading-the-code",{"title":573,"path":574,"stem":575},"Docs site","\u002Fcontributing\u002Fdocs-site","6.contributing\u002F2.docs-site",{"title":577,"path":578,"stem":579},"Releases","\u002Fcontributing\u002Freleases","6.contributing\u002F3.releases",{"title":581,"path":582,"stem":583},"Load tests","\u002Fcontributing\u002Fload-tests","6.contributing\u002F4.load-tests",{"title":585,"icon":586,"path":587,"stem":588,"children":589,"page":38},"Project","i-lucide-map","\u002Fproject","7.project",[590,594,598,602],{"title":591,"path":592,"stem":593},"Roadmap","\u002Fproject\u002Froadmap","7.project\u002F1.roadmap",{"title":595,"path":596,"stem":597},"Known issues","\u002Fproject\u002Fknown-issues","7.project\u002F2.known-issues",{"title":599,"path":600,"stem":601},"Changelog","\u002Fproject\u002Fchangelog","7.project\u002F3.changelog",{"title":603,"path":604,"stem":605},"Decisions","\u002Fproject\u002Fdecisions","7.project\u002F4.decisions",{"title":607,"path":608,"stem":609,"children":610,"icon":612},"Community","\u002Fcommunity","8.community\u002Findex",[611],{"title":607,"path":608,"stem":609},"i-lucide-users",{"id":614,"title":502,"body":615,"description":1255,"extension":5931,"links":5932,"meta":5933,"navigation":1283,"path":504,"seo":5934,"stem":505,"__hash__":5935},"docs\u002F4.developers\u002F7.frameworks\u002Findex.md",{"type":616,"value":617,"toc":5913},"minimark",[618,656,661,698,702,724,842,849,853,880,918,935,940,946,1198,1219,1223,1246,1249,1399,1417,1424,1452,1455,1510,1515,1531,1555,1729,1749,1847,1879,1921,1951,1954,2246,2250,2253,2269,2328,2360,2391,2403,2416,2419,2424,2427,2490,2845,2899,2964,3005,3015,3018,3028,3104,3119,3122,3137,3226,3246,3261,3266,3363,3368,3371,3429,3870,3886,3891,3894,4114,4155,4174,4533,4553,4557,4579,4685,4696,4842,4852,4857,4860,4903,5156,5159,5448,5900,5910],[619,620,621,622,626,627,636,637,640,641,644,645,647,648,651,652,655],"p",{},"SHADE's own website is Astro (",[623,624,625],"code",{},"site\u002F","), but any site can show SHADE's content. A site in Next.js, SvelteKit, Nuxt or Astro connects through a few packages. They live in their own repository, ",[628,629,633],"a",{"href":630,"rel":631},"https:\u002F\u002Fgithub.com\u002Fshadehq-dev\u002Fshade-frontend",[632],"nofollow",[623,634,635],{},"shade-frontend"," (",[623,638,639],{},"frontend\u002F"," in the SHADE workspace), with the starter sites. They are workspace packages for now, ready to publish to npm under ",[623,642,643],{},"@shadestack"," from GitHub Actions (",[628,646,577],{"href":578},"). The paths below, ",[623,649,650],{},"packages\u002F…"," and ",[623,653,654],{},"starters\u002F…",", are in that repository.",[657,658,660],"h2",{"id":659},"working-on-the-kit","Working on the kit",[619,662,663,664,667,668,671,672,675,676,679,680,682,683,686,687,690,691,693,694,697],{},"The kit has one version line of its own, starting at 0.1.0. ",[623,665,666],{},"@shadestack\u002Fclient"," depends on ",[623,669,670],{},"@shadestack\u002Fcore"," within ",[623,673,674],{},"^0.1.0",", and the kit's ",[623,677,678],{},"CHANGELOG.md"," names the SHADE range each release works with (SHADE ",[623,681,674],{}," to start). The kit is on npm as a pre-release under the ",[623,684,685],{},"next"," tag; the Next.js, Nuxt and SvelteKit adapters are too, each at its own version (",[623,688,689],{},"npm install @shadestack\u002Fnuxt@next","). Work on the kit itself happens inside the SHADE workspace, which holds its lockfile and is where its CI runs. Issues and pull requests for the kit and the starters go to ",[623,692,635],{},"; those for the API, the admin, core and the module SDK go to ",[623,695,696],{},"shade",".",[657,699,701],{"id":700},"supported-versions","Supported versions",[619,703,704,651,707,709,710,712,713,651,716,719,720,723],{},[623,705,706],{},"@shadestack\u002Fastro",[623,708,666],{}," have the kit's version. The Next.js, Nuxt and SvelteKit adapters keep their own lines: a new major of their framework comes as an adapter release, without a kit release. Each adapter's peer dependencies name the kit versions it supports (one range on ",[623,711,666],{},", ",[623,714,715],{},"@shadestack\u002Frender",[623,717,718],{},"@shadestack\u002Finteractions",") and the framework versions. Its changelog (",[623,721,722],{},"packages\u002F\u003Cadapter>\u002FCHANGELOG.md",") says what each release changed. Install the adapter with kit packages of a version its range holds.",[725,726,727,746],"table",{},[728,729,730],"thead",{},[731,732,733,737,740,743],"tr",{},[734,735,736],"th",{},"Package",[734,738,739],{},"Its version",[734,741,742],{},"SHADE",[734,744,745],{},"Framework",[747,748,749,774,801,824],"tbody",{},[731,750,751,757,760,764],{},[752,753,754],"td",{},[623,755,756],{},"@shadestack\u002Fnext",[752,758,759],{},"its own (0.1.0)",[752,761,762],{},[623,763,674],{},[752,765,766,767,770,771],{},"Next.js ",[623,768,769],{},"^15.0.0 || ^16.0.0",", React ",[623,772,773],{},"^19.0.0",[731,775,776,781,783,787],{},[752,777,778],{},[623,779,780],{},"@shadestack\u002Fnuxt",[752,782,759],{},[752,784,785],{},[623,786,674],{},[752,788,789,790,793,794,797,798],{},"Nuxt and ",[623,791,792],{},"@nuxt\u002Fkit"," ",[623,795,796],{},"^4.0.0",", Vue ",[623,799,800],{},"^3.5.0",[731,802,803,808,810,814],{},[752,804,805],{},[623,806,807],{},"@shadestack\u002Fsveltekit",[752,809,759],{},[752,811,812],{},[623,813,674],{},[752,815,816,817,820,821],{},"SvelteKit ",[623,818,819],{},"^2.26.0 || ^3.0.0",", Svelte ",[623,822,823],{},"^5.0.0",[731,825,826,830,833,836],{},[752,827,828],{},[623,829,706],{},[752,831,832],{},"the kit's",[752,834,835],{},"the same version",[752,837,838,839],{},"Astro ",[623,840,841],{},"^7.4.0",[619,843,844,845,848],{},"Every night the adapters' tests and the render bundles' browser tests run against the framework version SHADE is tested with, the newest release of every older major an adapter's range still promises, and the newest version of the next major once there is one (",[628,846,577],{"href":847},"\u002Fcontributing\u002Freleases#the-framework-matrix","). A major joins an adapter's range in an adapter release once they pass. Today the tested versions are Next.js 16.4, Nuxt 4.6 and Svelte 5.57; Next.js 17, Nuxt 5 and Svelte 6 have no version to test yet (7 November 2026). Next.js 15 stays in the range without a nightly run.",[657,850,852],{"id":851},"starters","Starters",[619,854,855,856,858,859,862,863,712,866,712,868,651,871,874,875,879],{},"The ",[623,857,635],{}," repository has a starter site per framework in ",[623,860,861],{},"starters\u002F",": ",[623,864,865],{},"astro",[623,867,685],{},[623,869,870],{},"nuxt",[623,872,873],{},"sveltekit",". Copy one to begin a site (Shade Desk's ",[876,877,878],"em",{},"New site"," does). Each is a minimal site with:",[881,882,883,891,905],"ul",{},[884,885,886,887,890],"li",{},"pages written by hand on the read client: the home page from the site's settings, and a collection's published entries at ",[623,888,889],{},"\u002Fcollections\u002F\u003Cslug>",";",[884,892,893,894,636,897,900,901,904],{},"the website module's pages (a catch-all route), the editor's ",[876,895,896],{},"Preview",[623,898,899],{},"\u002Fpreview",") and the visual editor's canvas (",[623,902,903],{},"\u002Fpreview\u002Fcanvas"," and its render route), in files its README lists, to delete when the site doesn't use the website module;",[884,906,907,908,911,912,651,915,697],{},"a ",[623,909,910],{},".env.example"," with ",[623,913,914],{},"SHADE_API_URL",[623,916,917],{},"SHADE_API_TOKEN",[619,919,920,921,923,924,927,928,931,932,934],{},"Every page renders on the server per request, so a publish shows at once and a build needs no SHADE; each README says how to prerender instead. In ",[623,922,635],{}," the starters use the packages by ",[623,925,926],{},"workspace:*",", and ",[623,929,930],{},"pnpm test:starters"," typechecks and builds each. A copy elsewhere depends on the published packages, or links them from a ",[623,933,635],{}," checkout.",[936,937,939],"h3",{"id":938},"use-case-starters","Use-case starters",[619,941,942,943,945],{},"Beside the minimal starters, SHADE has starters for real kinds of sites and tools. Each is written once, in Astro, without the website module, and ",[623,944,930],{}," runs its tests and builds it. They use the read client's and the framework packages' shared parts, so the same site in Next, Nuxt or SvelteKit uses the same calls in its own routes.",[881,947,948,1014,1049,1108,1159,1190],{},[884,949,950,956,957,960,961,712,964,967,968,971,972,975,976,979,980,982,983,986,987,990,991,994,995,999,1000,636,1002,1005,1006,1009,1010,1013],{},[951,952,953],"strong",{},[623,954,955],{},"content-site",": a blog or news site in the site's languages. Its articles are one public collection (",[623,958,959],{},"articles",", from the client's own module; its README has the definition), and every page is under its language (",[623,962,963],{},"\u002Fnl\u002F…",[623,965,966],{},"\u002Fen\u002F…","). It shows lists (",[623,969,970],{},"client.collection('articles').list({ locale, page, perPage: 10, sort: '-date' })","), an article by slug with links to its other languages (",[623,973,974],{},"collection.get(slug, locale)","), rich text through ",[623,977,978],{},"richTextNodes(body, …)"," from ",[623,981,715],{}," (written with the framework's node renderer, never as HTML), search (",[623,984,985],{},"client.search(q, { locale, collections: ['articles'] })",", each highlight's text escaped), a sitemap with ",[623,988,989],{},"hreflang"," alternates (",[623,992,993],{},"sitemapXml(entries)","), the ",[628,996,998],{"href":997},"#the-consent-banner","consent banner",", and drafts at ",[623,1001,899],{},[623,1003,1004],{},"readContentPreview",", below). Reads are kept for five minutes and cleared by the rebuild route (",[623,1007,1008],{},"\u002Fshade-rebuild",") that ",[876,1011,1012],{},"Settings → Other frontends"," calls.",[884,1015,1016,1021,1022,1025,1026,1029,1030,1033,1034,636,1037,1040,1041,1044,1045,1048],{},[951,1017,1018],{},[623,1019,1020],{},"lead-site",": a landing page with a contact form, without the website module. The form is one of the ",[628,1023,1024],{"href":362},"forms module","'s, read on the server as published (",[623,1027,1028],{},"GET \u002Fapi\u002Fv1\u002Faccount\u002Fforms\u002Fpublished\u002F\u003Ckey>?language=\u003Ccode>","; set the key in ",[623,1031,1032],{},"LEAD_FORM_KEY","). The browser solves the forms module's proof-of-work challenge with ",[623,1035,1036],{},"solveChallenge",[623,1038,1039],{},"@shadestack\u002Fclient\u002Fchallenge","), then sends the form with ",[623,1042,1043],{},"callAccountRoute"," to ",[623,1046,1047],{},"POST \u002Fapi\u002Fv1\u002Faccount\u002Fforms\u002Fsubmit",", so SHADE's spam check and its limit per address count the visitor. A sent form lands in the forms inbox in the admin.",[884,1050,1051,1056,1057,1060,1061,1064,1065,1068,1069,712,1072,1075,1076],{},[951,1052,1053],{},[623,1054,1055],{},"internal-tool",": a small app for the team, on Astro with the Node server: a stock view that lists a collection's items (",[623,1058,1059],{},"stock",": a title and a whole-number ",[623,1062,1063],{},"quantity",", without drafts, declared by the client's own module) and lets the team set a new count per row. It uses no SHADE package. It calls the data API (",[623,1066,1067],{},"\u002Fapi\u002Fv1\u002Fdata\u002Fcollections\u002F\u003Cslug>",", plain JSON) on the server only, with a data token (kind ",[623,1070,1071],{},"data",[623,1073,1074],{},"write"," on the collection):\n",[881,1077,1078,1084,1094,1105],{},[884,1079,1080,1081,890],{},"50 items to a page: ",[623,1082,1083],{},"GET \u002Fapi\u002Fv1\u002Fdata\u002Fcollections\u002Fstock",[884,1085,1086,1087,651,1090,1093],{},"a save per row sends ",[623,1088,1089],{},"baseVersionId",[623,1091,1092],{},"baseUpdatedAt"," from the item as the page read it; when someone saved in between, SHADE answers 409 and the page says so;",[884,1095,1096,1097,1100,1101,1104],{},"the tool is behind a password (",[623,1098,1099],{},"TOOL_PASSWORD",", HTTP Basic, any account name). Without one it answers nobody, except under ",[623,1102,1103],{},"astro dev",". Serve it over HTTPS;",[884,1106,1107],{},"the token holds what both it and its member's role allow, so a member whose role limits the stock to \"Only their own\" makes a token that changes only their own items.",[884,1109,1110,1115,1116,1120,1121,1124,1125,1128,1129,1132,1133,1136,1137,1140,1141,1044,1144,1147,1148,1151,1152,1155,1156,697],{},[951,1111,1112],{},[623,1113,1114],{},"shop",": a site that sells things, on the commerce module's client package (",[628,1117,1119],{"href":1118},"\u002Fguide\u002Fmodules\u002Fshop#without-the-website-module","Shop",") and SHADE's accounts. It reads the products collection and ",[623,1122,1123],{},"shade.data('commerce.products')"," on the server, and uses ",[623,1126,1127],{},"getProduct(slug)"," for variants. ",[623,1130,1131],{},"createCart()"," keeps its id under ",[623,1134,1135],{},"shade.kept.cart"," (as the editor's starter components do, so both share one cart); checkout sends one idempotency key per attempt. ",[623,1138,1139],{},"\u002Forder"," (set the commerce module's ",[876,1142,1143],{},"Order page",[623,1145,1146],{},"order",") follows an order with ",[623,1149,1150],{},"createOrderStatus()",", and the account page signs in with ",[623,1153,1154],{},"\u002Fapi\u002Fv1\u002Faccount\u002Fsign-in"," and lists orders with ",[623,1157,1158],{},"createMyOrders()",[884,1160,1161,1166,1167,636,1170,1173,1174,1178,1179,1182,1183,1186,1187,697],{},[951,1162,1163],{},[623,1164,1165],{},"bookings",": a site that takes appointments, at ",[623,1168,1169],{},"\u002F",[623,1171,1172],{},"\u002Fbook"," in the combined starter), on the appointments module's client package (",[628,1175,1177],{"href":1176},"\u002Fguide\u002Fmodules\u002Fappointments#without-the-website-module","Appointments",") and SHADE's accounts. It reads nothing from SHADE on the server. ",[623,1180,1181],{},"createBooking({ live: true })"," shows free times a fortnight at a time, removes a time someone else takes (with the module's optional realtime capability on), sends SHADE's spam fields and the consent text, and offers the waitlist for a full time. The account page uses ",[623,1184,1185],{},"createMyAppointments()"," (with cancelling) and ",[623,1188,1189],{},"createReminderChoice()",[884,1191,1192,1197],{},[951,1193,1194],{},[623,1195,1196],{},"shop-and-booking",": the two on one site, with one account page for orders, appointments and the reminders choice.",[619,1199,1200,1201,712,1203,651,1205,1207,1208,1211,1212,1214,1215,1218],{},"In ",[623,1202,1114],{},[623,1204,1165],{},[623,1206,1196],{},", every status message is said in a live region, and a refused field is marked and gets the focus. Their browser tests run against SHADE's test instance in the SHADE workspace (",[623,1209,1210],{},"pnpm test:e2e:starters"," in ",[623,1213,635],{},", or ",[623,1216,1217],{},"pnpm test:e2e:starters shop"," for one).",[936,1220,1222],{"id":1221},"the-shop-and-bookings-in-other-frameworks","The shop and bookings in other frameworks",[619,1224,1225,1226,1229,1230,1233,1234,1237,1238,1241,1242,1245],{},"The client packages have no framework of their own. Every store has ",[623,1227,1228],{},"subscribe"," (which tells a new listener the state at once) and ",[623,1231,1232],{},"getSnapshot",", so each framework reads it in a few lines. Make the stores per component, never at a module's top level, where a server would share one visitor's cart with the next. They call ",[623,1235,1236],{},"\u002Fapi\u002Fv1\u002Faccount\u002F*"," on the site's own origin, which the framework's development proxy sends to SHADE (",[628,1239,1240],{"href":510},"Accounts","); ",[623,1243,1244],{},"baseUrl"," is for SHADE on another address.",[619,1247,1248],{},"A cart in Next.js, as a client component:",[1250,1251,1256],"pre",{"className":1252,"code":1253,"language":1254,"meta":1255,"style":1255},"language-tsx shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","'use client'\nimport { useEffect, useState, useSyncExternalStore } from 'react'\nimport { createCart } from '@shadestack\u002Fcommerce-client'\n\nexport function Cart() {\n  const [cart] = useState(() => createCart({ locale: 'en' }))\n  const { data } = useSyncExternalStore(cart.store.subscribe, cart.store.getSnapshot, cart.store.getServerSnapshot)\n  useEffect(() => {\n    cart.load().catch(() => {})\n    return cart.stop\n  }, [cart])\n  if (!data.view) return \u003Cp role=\"status\">Loading…\u003C\u002Fp>\n  return (\n    \u003Cul>\n      {data.view.lines.map(line => (\n        \u003Cli key={line.sku}>\n          {line.title}: {line.amount}\n          \u003Cbutton type=\"button\" onClick={() => cart.remove(line.sku)}>Remove {line.title}\u003C\u002Fbutton>\n        \u003C\u002Fli>\n      ))}\n    \u003C\u002Ful>\n  )\n}\n","tsx","",[623,1257,1258,1266,1272,1278,1285,1291,1297,1303,1309,1315,1321,1327,1333,1339,1345,1351,1357,1363,1369,1375,1381,1387,1393],{"__ignoreMap":1255},[1259,1260,1263],"span",{"class":1261,"line":1262},"line",1,[1259,1264,1265],{},"'use client'\n",[1259,1267,1269],{"class":1261,"line":1268},2,[1259,1270,1271],{},"import { useEffect, useState, useSyncExternalStore } from 'react'\n",[1259,1273,1275],{"class":1261,"line":1274},3,[1259,1276,1277],{},"import { createCart } from '@shadestack\u002Fcommerce-client'\n",[1259,1279,1281],{"class":1261,"line":1280},4,[1259,1282,1284],{"emptyLinePlaceholder":1283},true,"\n",[1259,1286,1288],{"class":1261,"line":1287},5,[1259,1289,1290],{},"export function Cart() {\n",[1259,1292,1294],{"class":1261,"line":1293},6,[1259,1295,1296],{},"  const [cart] = useState(() => createCart({ locale: 'en' }))\n",[1259,1298,1300],{"class":1261,"line":1299},7,[1259,1301,1302],{},"  const { data } = useSyncExternalStore(cart.store.subscribe, cart.store.getSnapshot, cart.store.getServerSnapshot)\n",[1259,1304,1306],{"class":1261,"line":1305},8,[1259,1307,1308],{},"  useEffect(() => {\n",[1259,1310,1312],{"class":1261,"line":1311},9,[1259,1313,1314],{},"    cart.load().catch(() => {})\n",[1259,1316,1318],{"class":1261,"line":1317},10,[1259,1319,1320],{},"    return cart.stop\n",[1259,1322,1324],{"class":1261,"line":1323},11,[1259,1325,1326],{},"  }, [cart])\n",[1259,1328,1330],{"class":1261,"line":1329},12,[1259,1331,1332],{},"  if (!data.view) return \u003Cp role=\"status\">Loading…\u003C\u002Fp>\n",[1259,1334,1336],{"class":1261,"line":1335},13,[1259,1337,1338],{},"  return (\n",[1259,1340,1342],{"class":1261,"line":1341},14,[1259,1343,1344],{},"    \u003Cul>\n",[1259,1346,1348],{"class":1261,"line":1347},15,[1259,1349,1350],{},"      {data.view.lines.map(line => (\n",[1259,1352,1354],{"class":1261,"line":1353},16,[1259,1355,1356],{},"        \u003Cli key={line.sku}>\n",[1259,1358,1360],{"class":1261,"line":1359},17,[1259,1361,1362],{},"          {line.title}: {line.amount}\n",[1259,1364,1366],{"class":1261,"line":1365},18,[1259,1367,1368],{},"          \u003Cbutton type=\"button\" onClick={() => cart.remove(line.sku)}>Remove {line.title}\u003C\u002Fbutton>\n",[1259,1370,1372],{"class":1261,"line":1371},19,[1259,1373,1374],{},"        \u003C\u002Fli>\n",[1259,1376,1378],{"class":1261,"line":1377},20,[1259,1379,1380],{},"      ))}\n",[1259,1382,1384],{"class":1261,"line":1383},21,[1259,1385,1386],{},"    \u003C\u002Ful>\n",[1259,1388,1390],{"class":1261,"line":1389},22,[1259,1391,1392],{},"  )\n",[1259,1394,1396],{"class":1261,"line":1395},23,[1259,1397,1398],{},"}\n",[619,1400,1401,1402,636,1405,1408,1409,1412,1413,1416],{},"Vue stores need a ",[623,1403,1404],{},"shallowRef",[623,1406,1407],{},"onScopeDispose(booking.store.subscribe(next => { state.value = next }))","); a Svelte store is the store as it is (",[623,1410,1411],{},"$state"," on ",[623,1414,1415],{},"orders.store",").",[619,1418,1419,1420,1423],{},"On a server the stores stay ",[623,1421,1422],{},"idle"," and open nothing, so these render empty on the server and fill in the browser.",[619,1425,1426,1427,712,1430,712,1435,712,1438,1442,1443,651,1447,697],{},"This page covers the packages a site imports. The website editor's packages, which those build on, have pages of their own: ",[628,1428,1429],{"href":510},"accounts: sign-in and modules' routes",[628,1431,1432],{"href":514},[623,1433,1434],{},"@shadestack\u002Ftree",[628,1436,1437],{"href":518},"expressions and styles",[628,1439,1440],{"href":522},[623,1441,715],{}," with the editor's canvas, ",[628,1444,1445],{"href":526},[623,1446,718],{},[628,1448,1449],{"href":530},[623,1450,1451],{},"@shadestack\u002Fa11y",[619,1453,1454],{},"What a site needs from SHADE:",[881,1456,1457,1463,1485,1504],{},[884,1458,1459,1460,1462],{},"a read token (",[876,1461,257],{},"), and the API's address;",[884,1464,1465,1466,712,1469,1472,1473,1476,1477,1480,1481,1484],{},"the content: ",[623,1467,1468],{},"client.site()",[623,1470,1471],{},"client.collection(slug)"," and the rest of ",[628,1474,1475],{"href":495},"the API",", and with the website module ",[623,1478,1479],{},"client.page(slug, locale)"," (the site client, ",[623,1482,1483],{},"createSiteClient",");",[884,1486,1487,1488,1491,1492,1495,1496,1499,1500,1503],{},"with the website module, its theme: ",[623,1489,1490],{},"themeToCss(site.theme)"," (or the module's ",[623,1493,1494],{},"GET \u002Fapi\u002Fv1\u002Fcontent\u002Fwebsite\u002Ftheme.css","), so the theme's CSS variables exist. An instance without the module gives no ",[623,1497,1498],{},"theme",", and the site styles itself. The site's styles (the module's ",[623,1501,1502],{},"styles.css",") refer to the theme's variables but leave them out, so they are written once, from the current theme;",[884,1505,1506,1507,1509],{},"its address listed under ",[876,1508,1012],{}," when its visitors use forms, page views or accounts.",[657,1511,1513],{"id":1512},"shadestackclient",[623,1514,666],{},[619,1516,1517,1518,712,1520,651,1522,1524,1525,651,1528,697],{},"Framework-free; the framework packages build on it. Its root entry is core's read client and needs none of the website editor's packages. A site whose pages the website module keeps also installs ",[623,1519,715],{},[623,1521,1434],{},[623,1523,718],{}," (the client's optional peer dependencies) for ",[623,1526,1527],{},"@shadestack\u002Fclient\u002Frender",[623,1529,1530],{},"@shadestack\u002Fclient\u002Fcanvas",[619,1532,1533,1534,712,1537,1540,1541,712,1543,712,1546,1549,1550,651,1552,1554],{},"Each framework package gives its own API (the next sections), plus ",[623,1535,1536],{},"createShadeClient",[623,1538,1539],{},"ShadeApiError"," and the types of what the read client answers. The rest of the client's names (",[623,1542,1483],{},[623,1544,1545],{},"themeToCss",[623,1547,1548],{},"slugOfSegments"," and the others below) come from ",[623,1551,666],{},[623,1553,1527],{},", never from a framework package.",[1250,1556,1560],{"className":1557,"code":1558,"language":1559,"meta":1255,"style":1255},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { createSiteClient, themeToCss } from '@shadestack\u002Fclient\u002Frender'\n\nconst shade = createSiteClient({ baseUrl: 'https:\u002F\u002Fadmin.example.com', token: process.env.SHADE_API_TOKEN! })\nconst [site, page] = await Promise.all([shade.site(), shade.page('about')])\n","ts",[623,1561,1562,1597,1601,1664],{"__ignoreMap":1255},[1259,1563,1564,1568,1572,1576,1579,1582,1585,1588,1591,1594],{"class":1261,"line":1262},[1259,1565,1567],{"class":1566},"s7zQu","import",[1259,1569,1571],{"class":1570},"sMK4o"," {",[1259,1573,1575],{"class":1574},"sTEyZ"," createSiteClient",[1259,1577,1578],{"class":1570},",",[1259,1580,1581],{"class":1574}," themeToCss",[1259,1583,1584],{"class":1570}," }",[1259,1586,1587],{"class":1566}," from",[1259,1589,1590],{"class":1570}," '",[1259,1592,1527],{"class":1593},"sfazB",[1259,1595,1596],{"class":1570},"'\n",[1259,1598,1599],{"class":1261,"line":1268},[1259,1600,1284],{"emptyLinePlaceholder":1283},[1259,1602,1603,1607,1610,1613,1616,1619,1622,1626,1629,1631,1634,1637,1639,1642,1644,1647,1649,1652,1654,1656,1659,1661],{"class":1261,"line":1274},[1259,1604,1606],{"class":1605},"spNyl","const",[1259,1608,1609],{"class":1574}," shade ",[1259,1611,1612],{"class":1570},"=",[1259,1614,1575],{"class":1615},"s2Zo4",[1259,1617,1618],{"class":1574},"(",[1259,1620,1621],{"class":1570},"{",[1259,1623,1625],{"class":1624},"swJcz"," baseUrl",[1259,1627,1628],{"class":1570},":",[1259,1630,1590],{"class":1570},[1259,1632,1633],{"class":1593},"https:\u002F\u002Fadmin.example.com",[1259,1635,1636],{"class":1570},"'",[1259,1638,1578],{"class":1570},[1259,1640,1641],{"class":1624}," token",[1259,1643,1628],{"class":1570},[1259,1645,1646],{"class":1574}," process",[1259,1648,697],{"class":1570},[1259,1650,1651],{"class":1574},"env",[1259,1653,697],{"class":1570},[1259,1655,917],{"class":1574},[1259,1657,1658],{"class":1570},"!",[1259,1660,1584],{"class":1570},[1259,1662,1663],{"class":1574},")\n",[1259,1665,1666,1668,1671,1674,1676,1679,1682,1685,1688,1692,1694,1697,1700,1702,1704,1707,1709,1712,1714,1717,1719,1721,1724,1726],{"class":1261,"line":1280},[1259,1667,1606],{"class":1605},[1259,1669,1670],{"class":1570}," [",[1259,1672,1673],{"class":1574},"site",[1259,1675,1578],{"class":1570},[1259,1677,1678],{"class":1574}," page",[1259,1680,1681],{"class":1570},"]",[1259,1683,1684],{"class":1570}," =",[1259,1686,1687],{"class":1566}," await",[1259,1689,1691],{"class":1690},"sBMFI"," Promise",[1259,1693,697],{"class":1570},[1259,1695,1696],{"class":1615},"all",[1259,1698,1699],{"class":1574},"([shade",[1259,1701,697],{"class":1570},[1259,1703,1673],{"class":1615},[1259,1705,1706],{"class":1574},"()",[1259,1708,1578],{"class":1570},[1259,1710,1711],{"class":1574}," shade",[1259,1713,697],{"class":1570},[1259,1715,1716],{"class":1615},"page",[1259,1718,1618],{"class":1574},[1259,1720,1636],{"class":1570},[1259,1722,1723],{"class":1593},"about",[1259,1725,1636],{"class":1570},[1259,1727,1728],{"class":1574},")])\n",[619,1730,1731,1732,1735,1736,636,1739,1741,1742,1745,1746,1748],{},"The website module's pages are built from elements: their content is ",[623,1733,1734],{},"page.tree",". Render it with ",[623,1737,1738],{},"resolvePage",[623,1740,715],{},") and the package's ",[623,1743,1744],{},"ShadeTree",". ",[623,1747,1527],{}," does the server side, the same for every framework:",[881,1750,1751,1760,1770,1806,1826],{},[884,1752,1753,1756,1757,1416],{},[623,1754,1755],{},"renderPublishedPage(page, { client })"," fetches the site and the data sources' items and resolves the page (",[623,1758,1759],{},"{ site, result }",[884,1761,1762,1765,1766,1769],{},[623,1763,1764],{},"renderPublishedPart(part, layout, { client })"," does a header or footer under its own tree id (",[623,1767,1768],{},"defaultLayout(client, locale)"," for a site's own pages).",[884,1771,1772,1775,1776,712,1779,1782,1783,1786,1787,712,1790,636,1792,1795,1796,1799,1800,911,1803,1416],{},[623,1773,1774],{},"renderInputFor(page, { site, sources })"," is the input alone, for a site that fetched the data itself. It takes the page's ",[623,1777,1778],{},"media",[623,1780,1781],{},"localStyles"," (so nodes with local styles get their ",[623,1784,1785],{},"data-s"," key), ",[623,1788,1789],{},"entry",[623,1791,1673],{},[623,1793,1794],{},"{ name, url }",") and the items of the data sources the page's Each nodes loop over (",[623,1797,1798],{},"pageSources",", then ",[623,1801,1802],{},"shade.data(source, parameters, locale, page)",[623,1804,1805],{},"pageAddress(page)",[884,1807,1808,1809,1812,1813,712,1816,651,1819,1822,1823,1825],{},"Options: ",[623,1810,1811],{},"tree"," (the editor's unsaved one), ",[623,1814,1815],{},"edit",[623,1817,1818],{},"deferIslands",[623,1820,1821],{},"strict"," (on by default: a data source that could not be read fails the render; off, it renders empty with an issue ",[623,1824,1071],{},"; a source that is gone, 404, renders empty either way).",[884,1827,1828,1829,712,1832,712,1835,712,1838,712,1841,651,1844,697],{},"Also: ",[623,1830,1831],{},"mergeInteractions",[623,1833,1834],{},"nodesWithInteractions",[623,1836,1837],{},"pageLanguages",[623,1839,1840],{},"pageComponents",[623,1842,1843],{},"mediaFile",[623,1845,1846],{},"visitorProjection",[619,1848,1849,1850,712,1853,1856,1857,1860,1861,1863,1864,1867,1868,1871,1872,1874,1875,1878],{},"SHADE's own site renders with it (",[623,1851,1852],{},"site\u002Fsrc\u002Flib\u002Fpage.ts",[623,1854,1855],{},"src\u002Fpages\u002F[...slug].astro","). The library components a page uses come with it (",[623,1858,1859],{},"page.components","): give them to ",[623,1862,1738],{}," as ",[623,1865,1866],{},"components",", each with ",[623,1869,1870],{},"treeId: component-\u003Cname>",", and their ",[623,1873,1781],{}," under those tree ids. On the canvas, ",[623,1876,1877],{},"page.component"," previews a component alone.",[619,1880,1881,1882,1885,1886,911,1888,1891,1892,1895,1896,1900,1901,636,1904,1907,1908,651,1911,1745,1914,1916,1917,1920],{},"A prerendered page defers its server islands (",[623,1883,1884],{},"serverIslands: 'defer'","; in Astro ",[623,1887,1744],{},[623,1889,1890],{},"accountApi","; in Next, Nuxt and SvelteKit ",[623,1893,1894],{},"deferServerIslands"," and the island route: ",[628,1897,1899],{"href":1898},"\u002Fdevelopers\u002Fframeworks\u002Frender#deferred-server-islands","deferred server islands","), so they render per request for whoever is signed in. Their bindings read ",[623,1902,1903],{},"visitor.signedIn",[623,1905,1906],{},"{ signedIn: false }"," for nobody) and the projection's ",[623,1909,1910],{},"name",[623,1912,1913],{},"email",[623,1915,1846],{}," sends SHADE only the visitor's ",[623,1918,1919],{},"shade_account.*"," cookies, never the site's others, and renders the island as signed out when SHADE doesn't answer within 3 seconds.",[619,1922,1923,1924,1927,1928,1931,1932,1935,1936,1939,1940,1943,1944,1947,1948,1950],{},"The site's compiled styles are at ",[623,1925,1926],{},"\u002Fapi\u002Fv1\u002Fcontent\u002Fwebsite\u002Fstyles.css",". SHADE's own site writes them, after the theme's web fonts and variables, into its build as one cached file (",[623,1929,1930],{},"\u002Fstyles\u002F\u003Chash>.css",") and keeps them in the page only on the preview and edit routes. On the edit route, ",[623,1933,1934],{},"connectCanvas"," puts the editor's unsaved styles (the canvas protocol's ",[623,1937,1938],{},"styles",") in a constructed style sheet (",[623,1941,1942],{},"document.adoptedStyleSheets",") in place of the page's ",[623,1945,1946],{},"\u003Cstyle data-shade-styles>",", which it removes. In edit mode every element carries its ",[623,1949,1785],{}," key.",[619,1952,1953],{},"Entry points:",[881,1955,1956,1976,2016,2059,2070,2088,2097,2123,2131],{},[884,1957,1958,1960,1961,1964,1965,1968,1969,1972,1973,1416],{},[623,1959,1536],{}," (the root entry): core's typed read client (",[623,1962,1963],{},"\u002Fapi\u002Fv1\u002Fcontent","): the site data, media, data sources, collections, and any module's read model by its path (",[623,1966,1967],{},"read\u003CT>(path, query)","). It knows no module. ",[623,1970,1971],{},"shade-types",", the package's command, writes the instance's collection types for it (",[628,1974,429],{"href":1975},"\u002Fdevelopers\u002Fcollections#using-entries-on-the-site",[884,1977,1978,636,1980,1982,1983,1241,1986,1989,1990,712,1993,712,1996,712,1999,2002,2003,2005,2006,2009,2010,2012,2013,1416],{},[623,1979,1483],{},[623,1981,1527],{},"): core's client with the site's pages, redirects, layout, preview and canvas from the website module's read models, and the site data with its theme (",[623,1984,1985],{},"SiteData",[623,1987,1988],{},"pagesPlugin"," names another module that gives a site its pages. The pages' shapes (",[623,1991,1992],{},"PublishedPage",[623,1994,1995],{},"PublishedPart",[623,1997,1998],{},"PublishedLayout",[623,2000,2001],{},"PublishedTheme",") are ",[623,2004,715],{},"'s. It and every package's ",[623,2007,2008],{},"shadeFromEnv"," take the types ",[623,2011,1971],{}," writes as well (",[623,2014,2015],{},"shadeFromEnv\u003CShadeCollections>()",[884,2017,2018,2019,862,2021,712,2023,636,2026,2029,2030,712,2033,2035,2036,927,2038,2041,2042,2045,2046,2048,2049,2052,2053,2055,2056,697],{},"Also in ",[623,2020,1527],{},[623,2022,1545],{},[623,2024,2025],{},"fontFacesCss",[623,2027,2028],{},"@shadestack\u002Fstyles","' own), ",[623,2031,2032],{},"findPage",[623,2034,2008],{}," (a site client), ",[623,2037,1548],{},[623,2039,2040],{},"hasMainHeading(tree)"," (whether a page has its own ",[623,2043,2044],{},"h1"," anywhere it shows nodes; without one, give it its title as a visually hidden ",[623,2047,2044],{},"). The root entry has the content types. ",[623,2050,2051],{},"resolveImage"," (an image field's value against a page's ",[623,2054,1778],{},") is in ",[623,2057,2058],{},"@shadestack\u002Fcore\u002Fschema",[884,2060,2061,862,2063,2065,2066,697],{},[623,2062,1530],{},[623,2064,1934],{},", the site side of ",[628,2067,2069],{"href":2068},"\u002Fdevelopers\u002Fframeworks\u002Frender#the-website-editors-canvas","the website editor's canvas",[884,2071,2072,2075,2076,712,2079,712,2082,651,2085,697],{},[623,2073,2074],{},"@shadestack\u002Fclient\u002Fpreview",": what every framework's preview route builds on (below): ",[623,2077,2078],{},"readPreview(client, token)",[623,2080,2081],{},"previewHeaders()",[623,2083,2084],{},"previewPolicyFromEnv(env, { scripts, styles })",[623,2086,2087],{},"isPreviewPath",[884,2089,2090,862,2093,2096],{},[623,2091,2092],{},"@shadestack\u002Fclient\u002Frebuild",[623,2094,2095],{},"readRebuildRequest(request, token)",", what every framework's rebuild route builds on.",[884,2098,2099,2102,2103,712,2106,2109,2110,712,2113,712,2116,2119,2120,2122],{},[623,2100,2101],{},"@shadestack\u002Fclient\u002Fcontent-security",": the site's policy (",[623,2104,2105],{},"policyDirectives",[623,2107,2108],{},"policyText",") and the hashes of what a page wrote itself (",[623,2111,2112],{},"scriptHashes",[623,2114,2115],{},"styleHashes",[623,2117,2118],{},"headOf","), on the server only; ",[623,2121,706],{}," builds its policy on it too.",[884,2124,2125,2128,2129,697],{},[623,2126,2127],{},"callAccountRoute(plugin, path, options)",": a module's route on the account API, with the account's cookie for its account routes; see ",[628,2130,509],{"href":510},[884,2132,2133,2136,2137,2140,2141,2214,2217,2218,2221,2222,2225,2226,2229,2230,2233,2234,2237,2238,2241,2242,2245],{},[623,2134,2135],{},"reportErrors({ accountUrl, enabled?, maxPerPage?, release? })",": the site's browser errors to SHADE's error log, where they show on the Errors screen as ",[876,2138,2139],{},"Site",". Off until the site calls it, in the browser, once:",[1250,2142,2144],{"className":1557,"code":2143,"language":1559,"meta":1255,"style":1255},"import { reportErrors } from '@shadestack\u002Fclient'\nreportErrors({ accountUrl: 'https:\u002F\u002Fadmin.example.com', enabled: import.meta.env.PROD })\n",[623,2145,2146,2165],{"__ignoreMap":1255},[1259,2147,2148,2150,2152,2155,2157,2159,2161,2163],{"class":1261,"line":1262},[1259,2149,1567],{"class":1566},[1259,2151,1571],{"class":1570},[1259,2153,2154],{"class":1574}," reportErrors",[1259,2156,1584],{"class":1570},[1259,2158,1587],{"class":1566},[1259,2160,1590],{"class":1570},[1259,2162,666],{"class":1593},[1259,2164,1596],{"class":1570},[1259,2166,2167,2170,2172,2174,2177,2179,2181,2183,2185,2187,2190,2192,2195,2197,2200,2202,2204,2206,2209,2212],{"class":1261,"line":1268},[1259,2168,2169],{"class":1615},"reportErrors",[1259,2171,1618],{"class":1574},[1259,2173,1621],{"class":1570},[1259,2175,2176],{"class":1624}," accountUrl",[1259,2178,1628],{"class":1570},[1259,2180,1590],{"class":1570},[1259,2182,1633],{"class":1593},[1259,2184,1636],{"class":1570},[1259,2186,1578],{"class":1570},[1259,2188,2189],{"class":1624}," enabled",[1259,2191,1628],{"class":1570},[1259,2193,2194],{"class":1566}," import",[1259,2196,697],{"class":1570},[1259,2198,2199],{"class":1574},"meta",[1259,2201,697],{"class":1570},[1259,2203,1651],{"class":1574},[1259,2205,697],{"class":1570},[1259,2207,2208],{"class":1574},"PROD ",[1259,2210,2211],{"class":1570},"}",[1259,2213,1663],{"class":1574},[2215,2216],"br",{},"It sends uncaught errors and unhandled promise rejections to ",[623,2219,2220],{},"POST \u002Fapi\u002Fv1\u002Faccount\u002Ferrors",": the name, message and stack, the page's path without its query string or hash, and ",[623,2223,2224],{},"release"," when given (the site build the page came from: letters, digits and ",[623,2227,2228],{},"._@+-",", at most 100), so a forwarded error points at the build that caused it. It sends no cookies (",[623,2231,2232],{},"credentials: 'omit'","), and uses a ",[623,2235,2236],{},"text\u002Fplain"," body with ",[623,2239,2240],{},"keepalive",", so there is no preflight and a report still leaves while the page unloads. Each different error is sent once, at most ",[623,2243,2244],{},"maxPerPage"," (5) per page load; the call returns a function that stops. SHADE takes reports from the Site URL's origin only (other frontends are refused), at most 16 KB each and 30 per visitor address per ten minutes. Framework packages leave it to the site: call it from the site's own client-side script.",[657,2247,2249],{"id":2248},"preview-and-rebuild","Preview and rebuild",[619,2251,2252],{},"Every framework package gives a site the two routes SHADE calls, with the contract SHADE's own Astro site keeps.",[619,2254,2255,2258,2259,2261,2262,2265,2266,2268],{},[951,2256,2257],{},"The preview route."," The website module's ",[876,2260,896],{}," links to ",[623,2263,2264],{},"\u003CPreview address>\u002Fpreview?token=…"," (a signed token of ten minutes), and the admin shows it in a frame. The route reads the draft with the token (",[623,2267,2078],{},": SHADE checks the token) and renders it like any page:",[881,2270,2271,2282,2297],{},[884,2272,2273,2274,2277,2278,2281],{},"Without a token it answers 400 (",[876,2275,2276],{},"Missing preview token","). For a token SHADE refuses, or a page that is gone, it shows the expiry message (",[876,2279,2280],{},"This preview link has expired. Open the preview again from the editor.","). Any other failure is an error, never an expired link.",[884,2283,2284,2285,862,2287,712,2290,712,2293,2296],{},"It is never cached, indexed or sent on as a referrer (",[623,2286,2081],{},[623,2288,2289],{},"Cache-Control: no-store",[623,2291,2292],{},"X-Robots-Tag: noindex, nofollow",[623,2294,2295],{},"Referrer-Policy: no-referrer","), on the page and on any data the framework fetches for it.",[884,2298,2299,2300,2303,2304,2307,2308,2310,2311,2307,2314,2317,2318,927,2321,2324,2325,2327],{},"Outside development it has the site's Content-Security-Policy (",[623,2301,2302],{},"previewPolicyFromEnv","): the site's files, SHADE's account API (",[623,2305,2306],{},"SHADE_ACCOUNT_URL",", else ",[623,2309,914],{},") and media (",[623,2312,2313],{},"SHADE_MEDIA_BASE_URL",[623,2315,2316],{},"\u003CSHADE_API_URL>\u002Fuploads","), no ",[623,2319,2320],{},"unsafe-inline",[623,2322,2323],{},"frame-ancestors"," with only the admin (",[623,2326,914],{},"'s origin). The page's own inline scripts and styles are allowed the way its framework marks them (Next's nonce, the parts of the page Nuxt writes itself, SvelteKit's nonce and the head's hashes); a script or style in the rendered body never applies.",[619,2329,2330,2333,2334,2337,2338,2340,2341,636,2344,2347,2348,2351,2352,2355,2356,2359],{},[951,2331,2332],{},"The rebuild route."," After a publish SHADE calls a build hook: a POST with no body to the address in the website module's ",[876,2335,2336],{},"Build hook URL"," or a frontend's (",[876,2339,1012],{},"), the secret in the address, within 10 seconds, never following a redirect. The route takes only the site's ",[623,2342,2343],{},"SHADE_REBUILD_TOKEN",[623,2345,2346],{},"?token=…"," or ",[623,2349,2350],{},"Authorization: Bearer …",", compared in constant time, 401 otherwise and always while it is not set; never logged, never in the browser) and then does what its framework does for new content. A build hook says nothing of what changed, so the whole site is renewed. Set the hook to ",[623,2353,2354],{},"https:\u002F\u002F\u003Csite>\u002Fshade-rebuild?token=\u003CSHADE_REBUILD_TOKEN>",". The admin shows the build as ",[876,2357,2358],{},"Sent to the builder",": these routes send no build report (only SHADE's own site runner does).",[619,2361,2362,2365,2366,2368,2369,636,2372,2374,2375,2378,2379,979,2382,636,2384,2387,2388,2390],{},[951,2363,2364],{},"Previews of entries and releases"," (a release is the editorial module's). A site without the website module shows drafts too: list it under ",[876,2367,1012],{}," with its ",[951,2370,2371],{},"Preview address",[623,2373,899],{},"), and the admin's Preview button and share links of entries and releases go to ",[623,2376,2377],{},"\u003Csite>\u002Fpreview?token=…",". The route reads what the link shows with ",[623,2380,2381],{},"readContentPreview(client, token)",[623,2383,2074],{},[623,2385,2386],{},"client.contentPreview(token)",": an entry's version or a release, in the published shapes). It has the same contract as the page preview above: 400 without a token, the expiry message for a link SHADE refuses (expired, revoked, or its maker may no longer read it), and ",[623,2389,2081],{}," on the answer.",[619,2392,2393,2394,2397,2398,651,2400,2402],{},"A release that holds the website module's theme is shown in that theme: ",[623,2395,2396],{},"previewTheme(preview)"," gives the theme version's tokens and web font faces, or nothing when the preview has no theme (then the published theme stands). Write them with ",[623,2399,1545],{},[623,2401,2025],{},", as SHADE's own site does.",[619,2404,2405,2406,651,2409,2412,2413,1416],{},"The token is in the address: keep the page out of caches and search engines, send no referrer (the headers do; add ",[623,2407,2408],{},"\u003Cmeta name=\"robots\" content=\"noindex\">",[623,2410,2411],{},"\u003Cmeta name=\"referrer\" content=\"no-referrer\">"," too) and never log the address. The content-site starter does all of it (",[623,2414,2415],{},"starters\u002Fcontent-site\u002Fsrc\u002Fpages\u002Fpreview.astro",[619,2417,2418],{},"A page rendered per request already reads SHADE every time; the rebuild route is for what the framework keeps (Next.js's cache, Nuxt's cached routes). A prerendered or exported site, in any framework, needs a new build instead: point the build hook at the host's deploy hook (Vercel, Netlify and Cloudflare each give one).",[657,2420,2422],{"id":2421},"shadestackastro",[623,2423,706],{},[619,2425,2426],{},"SHADE's own site uses it; so can any Astro site.",[1250,2428,2432],{"className":2429,"code":2430,"language":2431,"meta":1255,"style":1255},"language-js shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F astro.config.mjs\nimport { shade } from '@shadestack\u002Fastro\u002Fintegration'\nexport default defineConfig({ integrations: [shade()] })\n","js",[623,2433,2434,2440,2459],{"__ignoreMap":1255},[1259,2435,2436],{"class":1261,"line":1262},[1259,2437,2439],{"class":2438},"sHwdD","\u002F\u002F astro.config.mjs\n",[1259,2441,2442,2444,2446,2448,2450,2452,2454,2457],{"class":1261,"line":1268},[1259,2443,1567],{"class":1566},[1259,2445,1571],{"class":1570},[1259,2447,1711],{"class":1574},[1259,2449,1584],{"class":1570},[1259,2451,1587],{"class":1566},[1259,2453,1590],{"class":1570},[1259,2455,2456],{"class":1593},"@shadestack\u002Fastro\u002Fintegration",[1259,2458,1596],{"class":1570},[1259,2460,2461,2464,2467,2470,2472,2474,2477,2479,2481,2483,2486,2488],{"class":1261,"line":1274},[1259,2462,2463],{"class":1566},"export",[1259,2465,2466],{"class":1566}," default",[1259,2468,2469],{"class":1615}," defineConfig",[1259,2471,1618],{"class":1574},[1259,2473,1621],{"class":1570},[1259,2475,2476],{"class":1624}," integrations",[1259,2478,1628],{"class":1570},[1259,2480,1670],{"class":1574},[1259,2482,696],{"class":1615},[1259,2484,2485],{"class":1574},"()] ",[1259,2487,2211],{"class":1570},[1259,2489,1663],{"class":1574},[881,2491,2492,2589,2702,2742,2749,2796,2815],{},[884,2493,2494,2497,2498,712,2500,651,2502,2504,2505,2508,2509,2512,2513],{},[623,2495,2496],{},"shade(options)"," declares ",[623,2499,914],{},[623,2501,917],{},[623,2503,2306],{}," (read with ",[623,2506,2507],{},"astro:env\u002Fserver",") and lets Vite compile SHADE's packages. Each of these parts can be switched off with ",[623,2510,2511],{},"false",":\n",[881,2514,2515,2544,2549,2555],{},[884,2516,2517,2520,2521,2524,2525,2528,2529,651,2532,2535,2536,1745,2538,2541,2542,697],{},[623,2518,2519],{},"plugins",": fetches the site parts (their ",[623,2522,2523],{},"head",") of the server packages installed on SHADE before the build. The site imports them from ",[623,2526,2527],{},"virtual:shade\u002Fmodule-sites"," and needs ",[623,2530,2531],{},"@shadestack\u002Fmodule-sdk",[623,2533,2534],{},"zod"," as dependencies, see ",[628,2537,317],{"href":437},[623,2539,2540],{},"devModules"," (module folders) adds their site parts in ",[623,2543,1103],{},[884,2545,2546,2548],{},[623,2547,1778],{},": copies the pages' images into the build.",[884,2550,2551,2554],{},[623,2552,2553],{},"search",": indexes the pages for the site's search with Pagefind.",[884,2556,2557,2560,2561,2563,2564,2567,2568,2571,2572,2575,2576,2579,2580,2347,2582,2585,2586,2588],{},[623,2558,2559],{},"contentSecurity",": puts a Content-Security-Policy in every page, by hash, with no ",[623,2562,2320],{},". It covers only what the page wrote itself, never what its content holds: the inline scripts and ",[623,2565,2566],{},"\u003Cstyle>"," blocks in the ",[623,2569,2570],{},"\u003Chead>",", Astro's own server island scripts in the body (held to the exact shape Astro writes), and an ",[623,2573,2574],{},"Image","'s focal point with ",[623,2577,2578],{},"unsafe-hashes",", only on a page that has one. The scripts Astro bundles from components are written as files, never into the page. A script, ",[623,2581,2566],{},[623,2583,2584],{},"style"," attribute anywhere else in the body is blocked, so a frontend's own inline code goes in the ",[623,2587,2570],{}," or in a file.",[884,2590,2591,2594,2595,2598,2599,2602,2603,2606,2607,2594,2610,651,2613,2616,2617,2620,2621,2624,2625,2628,2629,2632,2633,2636,2637,2640,2641,2643,2644],{},[623,2592,2593],{},"staticHost"," (default ",[623,2596,2597],{},"SHADE_STATIC_HOST","; off, a build for Caddy, when neither is set): ",[623,2600,2601],{},"'cloudflare'"," (Workers with static assets), ",[623,2604,2605],{},"'netlify'",", or for Netlify ",[623,2608,2609],{},"{ host, accountApiUrl, siteServerUrl }",[623,2611,2612],{},"ACCOUNT_API_URL",[623,2614,2615],{},"SITE_SERVER_URL","). It runs last in the build and writes into the uploaded folder ",[623,2618,2619],{},"_headers"," (the Caddyfile's security and cache headers, and the media library's SVG policy on ",[623,2622,2623],{},"\u002Fmedia\u002F*.svg","), ",[623,2626,2627],{},"_redirects"," (the site's redirects in the host's format; on Netlify also a not-found rule per language) and ",[623,2630,2631],{},"\u003Clanguage>\u002F404.html"," beside each ",[623,2634,2635],{},"\u003Clanguage>\u002F404\u002Findex.html","; it removes ",[623,2638,2639],{},"redirects*.caddy",". It is opt-in, because a build served by Caddy must not carry a worker or files Caddy would serve. See ",[628,2642,74],{"href":75},".\n",[881,2645,2646,2660,2672],{},[884,2647,2648,2649,2652,2653,2656,2657,697],{},"Cloudflare: the Worker is ",[623,2650,2651],{},"@shadestack\u002Fcloudflare","'s, set up in the site's ",[623,2654,2655],{},"wrangler.jsonc",", not in the build; the build warns without ",[623,2658,2659],{},"SHADE_ISLAND_SECRET",[884,2661,2662,2663,2666,2667,651,2669,697],{},"Netlify: the forwarding is an Edge Function written outside the uploaded folder, ",[623,2664,2665],{},".netlify\u002Fv1\u002Fedge-functions\u002Fshade-forward.js",", declared inline for ",[623,2668,1236],{},[623,2670,2671],{},"\u002F_server-islands\u002F*",[884,2673,2674,2675,2678,2679,2682,2683,712,2685,2688,2689,712,2692,2695,2696,651,2699,1416],{},"Both forward with one fetch handler, ",[623,2676,2677],{},"@shadestack\u002Fclient\u002Fforward",". Each reads ",[623,2680,2681],{},"SHADE_PROXY_SECRET"," from the host's runtime environment (the Worker's ",[623,2684,1651],{},[623,2686,2687],{},"Netlify.env",") and takes the visitor's address from the host (",[623,2690,2691],{},"CF-Connecting-IP",[623,2693,2694],{},"context.ip","), never from a header the visitor sent. It reads the pages and redirects from SHADE (the website module's ",[623,2697,2698],{},"\u002Fpages",[623,2700,2701],{},"\u002Fredirects",[884,2703,2704,2707,2708,712,2711,712,2714,712,2717,651,2720,2722,2723,2726,2727,2730,2731,651,2734,2737,2738,2741],{},[623,2705,2706],{},"@shadestack\u002Fastro\u002Fredirects",": the redirects in each format, with one filter for all (not a page's path, not the home page, not the paths the site's server answers itself: ",[623,2709,2710],{},"\u002Fapi\u002F",[623,2712,2713],{},"\u002F_server-islands\u002F",[623,2715,2716],{},"\u002Fshade-island",[623,2718,2719],{},"\u002F_astro\u002F",[623,2721,899],{},"): ",[623,2724,2725],{},"caddyRedirects"," (the site's ",[623,2728,2729],{},"redirects.caddy"," page), ",[623,2732,2733],{},"cloudflareRedirects",[623,2735,2736],{},"netlifyRedirects",". An old path with ",[623,2739,2740],{},"*"," is a pattern to each server, so it gets no rule (its meta-refresh page still works).",[884,2743,2744,2746,2747,697],{},[623,2745,706],{}," itself has no root entry; import the client's names from ",[623,2748,666],{},[884,2750,2751,2754,2755,2758,2759,2762,2763,2624,2766,2769,2770,2773,2774,2776,2777,2780,2781,2785,2786,712,2789,2792,2793,2795],{},[623,2752,2753],{},"@shadestack\u002Fastro\u002Fsite",": the consent banner (",[623,2756,2757],{},"ConsentBanner",", restyled by the site's ",[623,2760,2761],{},"--consent-*"," variables), its footer link (",[623,2764,2765],{},"ConsentSettingsLink",[623,2767,2768],{},"ConsentGate"," for a module's head part that waits for consent (see ",[628,2771,2772],{"href":997},"The consent banner",") and ",[623,2775,2574],{},". The skip link in your frame says ",[623,2778,2779],{},"site.words.skipLink"," (see ",[628,2782,2784],{"href":2783},"#the-sites-words","The site's words","). The header and footer are trees the website module gives with each page (",[623,2787,2788],{},"PublishedPage.header",[623,2790,2791],{},".footer","), rendered with ",[623,2794,1744],{}," like the page.",[884,2797,2798,862,2801,2804,2805,2807,2808,2810,2811,2814],{},[623,2799,2800],{},"@shadestack\u002Fastro\u002Fcontent-security",[623,2802,2803],{},"previewPolicy"," for a preview route's middleware: the site's policy (styles by hash too, no ",[623,2806,2320],{},") with ",[623,2809,2323],{}," for the admin. Give it to the route with and without a trailing slash (",[623,2812,2813],{},"\u002Fpreview\u002F"," renders the same page).",[884,2816,2817,862,2820,651,2822,2825,2826,2830,2831,2834,2835,2837,2838,2841,2842,2844],{},[623,2818,2819],{},"@shadestack\u002Fastro\u002Ftree",[623,2821,1744],{},[623,2823,2824],{},"ShadeHead"," for the new editor's pages (",[628,2827,2828],{"href":522},[623,2829,715],{},"), and ",[623,2832,2833],{},"applyCacheHeaders(Astro, result)",". Call the latter in the page's frontmatter, where ",[623,2836,1738],{}," runs, so a page that is the visitor's own is sent with ",[623,2839,2840],{},"Cache-Control: private, no-store",". Only the frontmatter is sure to run before Astro sends the headers: ",[623,2843,1744],{}," sets the header too, but only as a fallback, which is lost under streaming when it stands in a layout or component that awaits something first.",[1250,2846,2849],{"className":2847,"code":2848,"language":865,"meta":1255,"style":1255},"language-astro shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","---\n\u002F\u002F src\u002Fpages\u002F[...slug].astro\nimport { resolvePage } from '@shadestack\u002Frender'\nimport { applyCacheHeaders, ShadeTree } from '@shadestack\u002Fastro\u002Ftree'\nimport Layout from '..\u002Flayouts\u002FLayout.astro'\n\nconst result = resolvePage(input) \u002F\u002F the page's tree, components, data and language\napplyCacheHeaders(Astro, result)\n---\n\u003CLayout>\u003CShadeTree result={result} \u002F>\u003C\u002FLayout>\n",[623,2850,2851,2856,2861,2866,2871,2876,2880,2885,2890,2894],{"__ignoreMap":1255},[1259,2852,2853],{"class":1261,"line":1262},[1259,2854,2855],{},"---\n",[1259,2857,2858],{"class":1261,"line":1268},[1259,2859,2860],{},"\u002F\u002F src\u002Fpages\u002F[...slug].astro\n",[1259,2862,2863],{"class":1261,"line":1274},[1259,2864,2865],{},"import { resolvePage } from '@shadestack\u002Frender'\n",[1259,2867,2868],{"class":1261,"line":1280},[1259,2869,2870],{},"import { applyCacheHeaders, ShadeTree } from '@shadestack\u002Fastro\u002Ftree'\n",[1259,2872,2873],{"class":1261,"line":1287},[1259,2874,2875],{},"import Layout from '..\u002Flayouts\u002FLayout.astro'\n",[1259,2877,2878],{"class":1261,"line":1293},[1259,2879,1284],{"emptyLinePlaceholder":1283},[1259,2881,2882],{"class":1261,"line":1299},[1259,2883,2884],{},"const result = resolvePage(input) \u002F\u002F the page's tree, components, data and language\n",[1259,2886,2887],{"class":1261,"line":1305},[1259,2888,2889],{},"applyCacheHeaders(Astro, result)\n",[1259,2891,2892],{"class":1261,"line":1311},[1259,2893,2855],{},[1259,2895,2896],{"class":1261,"line":1317},[1259,2897,2898],{},"\u003CLayout>\u003CShadeTree result={result} \u002F>\u003C\u002FLayout>\n",[619,2900,2901,2904,2905,2907,2908,2910,2911,2914,2915,1745,2918,2920,2921,2924,2925,636,2928,2931,2932,2935,2936,2939,2940,2943,2944,2947,2948,2951,2952,2955,2956,2959,2960,1863,2962,697],{},[951,2902,2903],{},"Server islands on a static host."," With ",[623,2906,2659],{}," in the build's environment, a page's per-visitor parts are sealed (",[623,2909,1894],{}," of ",[623,2912,2913],{},"@shadestack\u002Fclient\u002Fislands",", as Next, Nuxt and SvelteKit do) instead of Astro's ",[623,2916,2917],{},"server:defer",[623,2919,1744],{}," writes their placeholders, and a page that has some loads ",[623,2922,2923],{},"@shadestack\u002Frender\u002Fserver-islands"," in its own chunk, which fills them from the island route. It asks the address in the head's ",[623,2926,2927],{},"\u003Cmeta name=\"shade-island-url\">",[623,2929,2930],{},"SHADE_ISLAND_URL",", the site's Node server on the instance, asked with ",[623,2933,2934],{},"credentials: 'include'","), else the page's own origin. The route is ",[623,2937,2938],{},"serverIslandRoute(env, { siteOrigin })",": with ",[623,2941,2942],{},"siteOrigin"," it also answers that origin from another address of the same site (",[623,2945,2946],{},"Sec-Fetch-Site: same-site"," and exactly that ",[623,2949,2950],{},"Origin","), with CORS and credentials. SHADE's site seals in ",[623,2953,2954],{},"src\u002Flib\u002Fpage.ts"," and serves the route in ",[623,2957,2958],{},"src\u002Fpages\u002Fshade-island.ts",", with Astro's ",[623,2961,1673],{},[623,2963,2942],{},[619,2965,2966,636,2969,2971,2972,2974,2975,2977,2978,2980,2981,712,2984,2987,2988,2991,2992,2995,2996,2998,2999,1863,3001,3004],{},[951,2967,2968],{},"The Cloudflare Worker",[623,2970,2651],{},") renders nothing personal: ",[623,2973,1236],{}," is forwarded to ",[623,2976,2612],{}," when it is set (404 otherwise), and everything else is the assets binding. Its answers get the site's security headers, which ",[623,2979,2619],{}," doesn't reach. The template (",[623,2982,2983],{},"template\u002Fwrangler.jsonc",[623,2985,2986],{},"template\u002Fworker.ts",") runs it first for that path only (",[623,2989,2990],{},"run_worker_first","). ",[623,2993,2994],{},"proxySecret"," is read from the Worker's ",[623,2997,1651],{}," per request and goes to the account API only, with ",[623,3000,2691],{},[623,3002,3003],{},"X-Shade-Client-Ip","; both headers are dropped when a visitor sends them.",[619,3006,3007,3008,3011,3012,1416],{},"Starter: ",[623,3009,3010],{},"starters\u002Fastro"," (a Node server, ",[623,3013,3014],{},"output: 'server'",[657,3016,2784],{"id":3017},"the-sites-words",[619,3019,3020,3021,3024,3025,3027],{},"The few words SHADE's own parts on a site say themselves come with the site data, in its language: ",[623,3022,3023],{},"site.words",". They are SHADE's language files' ",[623,3026,1673],{}," texts, so a language is one more file in SHADE. The packages show what they're given; none of them chooses a language.",[725,3029,3030,3040],{},[728,3031,3032],{},[731,3033,3034,3037],{},[734,3035,3036],{},"Word",[734,3038,3039],{},"Where it shows",[747,3041,3042,3056,3084,3094],{},[731,3043,3044,3049],{},[752,3045,3046],{},[623,3047,3048],{},"skipLink",[752,3050,3051,3052,3055],{},"your frame's skip link, and the ",[623,3053,3054],{},"shade:skip-link"," widget without a label",[731,3057,3058,3081],{},[752,3059,3060,712,3063,712,3066,712,3069,712,3072,712,3075,712,3078],{},[623,3061,3062],{},"close",[623,3064,3065],{},"navigation",[623,3067,3068],{},"menu",[623,3070,3071],{},"colourMode",[623,3073,3074],{},"light",[623,3076,3077],{},"dark",[623,3079,3080],{},"pauseMotion",[752,3082,3083],{},"the widgets' own words, where the editor gave none",[731,3085,3086,3091],{},[752,3087,3088],{},[623,3089,3090],{},"consent.*",[752,3092,3093],{},"the consent banner and its footer link",[731,3095,3096,3101],{},[752,3097,3098],{},[623,3099,3100],{},"embed.*",[752,3102,3103],{},"an embed's notice",[619,3105,3106,3107,3110,3111,3114,3115,3118],{},"Each word is the page's language's, else its primary language's (",[623,3108,3109],{},"de"," for ",[623,3112,3113],{},"de-AT","), the site's default language's or English's, word by word. ",[623,3116,3117],{},"renderInputFor"," gives the rendering core the words; a page rendered without them leaves out the widgets that would need a word, with an issue that says so.",[657,3120,2772],{"id":3121},"the-consent-banner",[619,3123,3124,3125,3128,3129,3132,3133,3136],{},"One banner for every framework: ",[623,3126,3127],{},"@shadestack\u002Fclient\u002Fconsent"," writes its markup and runs it in the browser, and each package gives a thin wrapper held to the same conformance fixture. Render it while ",[623,3130,3131],{},"site.consent"," has categories (it renders nothing otherwise), never on the preview page, and put the settings link in the footer: a page without the link shows a floating ",[876,3134,3135],{},"Privacy settings"," button once the visitor chose.",[725,3138,3139,3151],{},[728,3140,3141],{},[731,3142,3143,3145,3148],{},[734,3144,745],{},[734,3146,3147],{},"Banner and footer link",[734,3149,3150],{},"Stylesheet",[747,3152,3153,3169,3188,3209],{},[731,3154,3155,3158,3166],{},[752,3156,3157],{},"Astro",[752,3159,3160,712,3162,979,3164],{},[623,3161,2757],{},[623,3163,2765],{},[623,3165,2753],{},[752,3167,3168],{},"included",[731,3170,3171,3174,3182],{},[752,3172,3173],{},"Next",[752,3175,3176,712,3178,979,3180],{},[623,3177,2757],{},[623,3179,2765],{},[623,3181,756],{},[752,3183,3184,3187],{},[623,3185,3186],{},"import '@shadestack\u002Fclient\u002Fconsent.css'"," in the root layout",[731,3189,3190,3193,3206],{},[752,3191,3192],{},"Nuxt",[752,3194,3195,712,3198,3201,3202,3205],{},[623,3196,3197],{},"ShadeConsentBanner",[623,3199,3200],{},"ShadeConsentSettingsLink"," (the module registers them; props in kebab case, ",[623,3203,3204],{},":account-api-url",")",[752,3207,3208],{},"added by the module",[731,3210,3211,3214,3222],{},[752,3212,3213],{},"SvelteKit",[752,3215,3216,712,3218,979,3220],{},[623,3217,2757],{},[623,3219,2765],{},[623,3221,807],{},[752,3223,3224,3187],{},[623,3225,3186],{},[619,3227,3228,3229,712,3232,712,3235,651,3238,3241,3242,3245],{},"The banner takes ",[623,3230,3231],{},"categories={site.consent}",[623,3233,3234],{},"words={site.words.consent}",[623,3236,3237],{},"configuration={site.consentConfiguration}",[623,3239,3240],{},"accountApiUrl","; the link takes ",[623,3243,3244],{},"words",". For example in Astro:",[1250,3247,3249],{"className":2847,"code":3248,"language":865,"meta":1255,"style":1255},"\u003CConsentBanner categories={site.consent} words={site.words.consent} configuration={site.consentConfiguration} accountApiUrl={accountApiUrl} \u002F>\n\u003CConsentSettingsLink words={site.words.consent} \u002F>\n",[623,3250,3251,3256],{"__ignoreMap":1255},[1259,3252,3253],{"class":1261,"line":1262},[1259,3254,3255],{},"\u003CConsentBanner categories={site.consent} words={site.words.consent} configuration={site.consentConfiguration} accountApiUrl={accountApiUrl} \u002F>\n",[1259,3257,3258],{"class":1261,"line":1268},[1259,3259,3260],{},"\u003CConsentSettingsLink words={site.words.consent} \u002F>\n",[619,3262,3263,3264,1416],{},"Fetch the site data in the page's language so the words match (see ",[628,3265,2784],{"href":2783},[881,3267,3268,3271,3274,3293,3296,3309,3341],{},[884,3269,3270],{},"The three buttons look the same; each category shows why it is asked, where it loads from, its cookies and how long they live, and the outside party's privacy statement.",[884,3272,3273],{},"The choice is kept in the visitor's browser per category and version: a new or changed category asks again.",[884,3275,3276,3279,3280,2773,3283,3285,3286,3288,3289,3292],{},[623,3277,3278],{},"configuration"," (the site data's ",[623,3281,3282],{},"consentConfiguration",[623,3284,3240],{}," (the account API's address, ",[623,3287,2612],{},") let the banner send a receipt where a category needs proof, to ",[623,3290,3291],{},"\u003CaccountApiUrl>\u002Fapi\u002Fv1\u002Faccount\u002Fconsent-receipt"," with the visitor's session, and show its reference in the settings. Without them no receipt is sent.",[884,3294,3295],{},"Taking a category back expires its declared first-party cookies and reloads the page.",[884,3297,3298,3299,3302,3303,1412,3306,697],{},"Modules' scripts ask ",[623,3300,3301],{},"window.shadeConsent.has('\u003Cplugin>.\u003Ckey>')"," and hear ",[623,3304,3305],{},"shade:consent",[623,3307,3308],{},"document",[884,3310,3311,3314,3315,3318,3319,979,3322,3324,3325,3328,3329,3332,3333,3336,3337,3340],{},[951,3312,3313],{},"An outside video or map"," waits behind a notice until the visitor allows its category. The website editor's ",[623,3316,3317],{},"shade:embed"," widget does this on its own; a page written by hand uses ",[623,3320,3321],{},"consentEmbedHtml({ category, url, title, ratio }, site.consent, site.words.embed)",[623,3323,3127],{}," (empty when the address is not one of the category's hosts). ",[876,3326,3327],{},"Load this one"," makes that frame only; ",[876,3330,3331],{},"Always allow"," keeps the category in the visitor's choice (",[623,3334,3335],{},"window.shadeConsent.grant(key)","). The frame is lazy, named by the title, sandboxed and from a host the category names; the site's ",[623,3338,3339],{},"frame-src"," comes from the module's site sources.",[884,3342,3343,3346,3347,3350,3351,3354,3355,3358,3359,3362],{},[951,3344,3345],{},"A module's head part that waits for consent"," (Astro): a module with categories names the category that gates its head part (",[623,3348,3349],{},"consent.head",", published as the category's ",[623,3352,3353],{},"head: true","). Render that head part inside ",[623,3356,3357],{},"\u003CConsentGate category={key}>",": an inert ",[623,3360,3361],{},"\u003Ctemplate>"," the banner clones into the head once the visitor allows it. Its inline scripts are hashed with the rest of the head, so they run under the page's policy.",[657,3364,3366],{"id":3365},"shadestacknext",[623,3367,756],{},[619,3369,3370],{},"React, for Next.js (App Router).",[1250,3372,3374],{"className":1252,"code":3373,"language":1254,"meta":1255,"style":1255},"\u002F\u002F app\u002F[[...slug]]\u002Fpage.tsx\nimport { findPage, resolvePage, shadeFromEnv, ShadeTree } from '@shadestack\u002Fnext'\nimport { notFound } from 'next\u002Fnavigation'\n\nexport default async function Page({ params }: { params: Promise\u003C{ slug?: string[] }> }) {\n  const shade = shadeFromEnv()\n  const [site, page] = await Promise.all([shade.site(), findPage(shade, (await params).slug)])\n  if (!page) notFound()\n  const result = resolvePage(input) \u002F\u002F the page's tree, components, data and language, as above\n  return \u003Cmain>\u003CShadeTree result={result} interactions={page.interactions} \u002F>\u003C\u002Fmain>\n}\n",[623,3375,3376,3381,3386,3391,3395,3400,3405,3410,3415,3420,3425],{"__ignoreMap":1255},[1259,3377,3378],{"class":1261,"line":1262},[1259,3379,3380],{},"\u002F\u002F app\u002F[[...slug]]\u002Fpage.tsx\n",[1259,3382,3383],{"class":1261,"line":1268},[1259,3384,3385],{},"import { findPage, resolvePage, shadeFromEnv, ShadeTree } from '@shadestack\u002Fnext'\n",[1259,3387,3388],{"class":1261,"line":1274},[1259,3389,3390],{},"import { notFound } from 'next\u002Fnavigation'\n",[1259,3392,3393],{"class":1261,"line":1280},[1259,3394,1284],{"emptyLinePlaceholder":1283},[1259,3396,3397],{"class":1261,"line":1287},[1259,3398,3399],{},"export default async function Page({ params }: { params: Promise\u003C{ slug?: string[] }> }) {\n",[1259,3401,3402],{"class":1261,"line":1293},[1259,3403,3404],{},"  const shade = shadeFromEnv()\n",[1259,3406,3407],{"class":1261,"line":1299},[1259,3408,3409],{},"  const [site, page] = await Promise.all([shade.site(), findPage(shade, (await params).slug)])\n",[1259,3411,3412],{"class":1261,"line":1305},[1259,3413,3414],{},"  if (!page) notFound()\n",[1259,3416,3417],{"class":1261,"line":1311},[1259,3418,3419],{},"  const result = resolvePage(input) \u002F\u002F the page's tree, components, data and language, as above\n",[1259,3421,3422],{"class":1261,"line":1317},[1259,3423,3424],{},"  return \u003Cmain>\u003CShadeTree result={result} interactions={page.interactions} \u002F>\u003C\u002Fmain>\n",[1259,3426,3427],{"class":1261,"line":1323},[1259,3428,1398],{},[881,3430,3431,3451,3464,3496,3587,3802],{},[884,3432,3433,636,3436,712,3438,2773,3440,3443,3444,3447,3448,3450],{},[623,3434,3435],{},"shadeFromEnv()",[623,3437,914],{},[623,3439,917],{},[623,3441,3442],{},"findPage(client, segments)"," (null for a page that does not exist, and for a malformed segment such as a lone ",[623,3445,3446],{},"%",": answer 404, never 500). All three framework packages take them from ",[623,3449,1527],{}," and only adapt their route parameters.",[884,3452,3453,3454,3456,3457,3459,3460,3463],{},"With the website module, put ",[623,3455,1490],{}," in a ",[623,3458,2566],{}," of the root layout, and link ",[623,3461,3462],{},"@shadestack\u002Frender\u002Frender.css"," once.",[884,3465,3466,651,3468,2825,3471,2624,3475,3478,3479,3482,3483,3485,3486,3489,3490,712,3493,3495],{},[623,3467,1744],{},[623,3469,3470],{},"shadeMetadata",[628,3472,3473],{"href":522},[623,3474,715],{},[623,3476,3477],{},"ShadeJsonLd"," for their structured data, and ",[623,3480,3481],{},"await shadeNoStore(result)"," in a page that is the visitor's own (",[623,3484,1744],{}," warns once on the server when it renders such a result that ",[623,3487,3488],{},"shadeNoStore"," never saw). With ",[623,3491,3492],{},"interactions",[623,3494,1744],{}," starts the page's interactions in the browser once it is mounted, and again with the next page's.",[884,3497,3498,3499,3502,3503,3505,3506,3509,3510,3560,3562,3563,3565,3566,1211,3569,3572,3573,636,3575,3578,3579,3582,3583,3586],{},"A statically built page's server islands (",[628,3500,3501],{"href":1898},"deferred","): resolve with ",[623,3504,1884],{},", render ",[623,3507,3508],{},"await deferServerIslands(result)",", and add the island route:",[1250,3511,3513],{"className":1557,"code":3512,"language":1559,"meta":1255,"style":1255},"\u002F\u002F app\u002Fshade-island\u002Froute.ts\nimport { serverIslandRoute } from '@shadestack\u002Fnext'\n\nexport const GET = serverIslandRoute()\n",[623,3514,3515,3520,3539,3543],{"__ignoreMap":1255},[1259,3516,3517],{"class":1261,"line":1262},[1259,3518,3519],{"class":2438},"\u002F\u002F app\u002Fshade-island\u002Froute.ts\n",[1259,3521,3522,3524,3526,3529,3531,3533,3535,3537],{"class":1261,"line":1268},[1259,3523,1567],{"class":1566},[1259,3525,1571],{"class":1570},[1259,3527,3528],{"class":1574}," serverIslandRoute",[1259,3530,1584],{"class":1570},[1259,3532,1587],{"class":1566},[1259,3534,1590],{"class":1570},[1259,3536,756],{"class":1593},[1259,3538,1596],{"class":1570},[1259,3540,3541],{"class":1261,"line":1274},[1259,3542,1284],{"emptyLinePlaceholder":1283},[1259,3544,3545,3547,3550,3553,3555,3557],{"class":1261,"line":1280},[1259,3546,2463],{"class":1566},[1259,3548,3549],{"class":1605}," const",[1259,3551,3552],{"class":1574}," GET ",[1259,3554,1612],{"class":1570},[1259,3556,3528],{"class":1615},[1259,3558,3559],{"class":1574},"()\n",[2215,3561],{},"Set ",[623,3564,2659],{}," at build time and on the server. A site with a ",[623,3567,3568],{},"basePath",[623,3570,3571],{},"next.config"," passes it to ",[623,3574,1744],{},[623,3576,3577],{},"basePath=\"\u002Fdocs\"","), so the islands are asked for at ",[623,3580,3581],{},"\u002Fdocs\u002Fshade-island","; Next has no public way for a package to read it. A fully static export (",[623,3584,3585],{},"output: 'export'",") has no server for the route: its islands stay empty.",[884,3588,3589,3590,2722,3594,3597,3598,3601,3602,3605,3606,3608,3609,3612,3613,3616,3617,3713,3783,3785,3786,3788,3789,3791,3792,3794,3795,3798,3799,697],{},"The preview route (",[628,3591,3593],{"href":3592},"#preview-and-rebuild","preview and rebuild",[623,3595,3596],{},"shadePreviewProxy"," in the site's proxy answers 400 without a token and gives the request a fresh nonce in its Content-Security-Policy, which Next puts on its own scripts. The page reads the draft with ",[623,3599,3600],{},"readPreview",", and its layout puts the nonce (",[623,3603,3604],{},"shadePreviewNonce()",") on its own ",[623,3607,2566],{}," blocks. Next has no way for a page to answer 401, so an expired link is ",[623,3610,3611],{},"notFound()"," (404) with the route's own ",[623,3614,3615],{},"not-found.tsx",". Give the preview a root layout of its own (a route group per root layout), so reading the nonce doesn't make the site's other pages dynamic.",[1250,3618,3620],{"className":1557,"code":3619,"language":1559,"meta":1255,"style":1255},"\u002F\u002F proxy.ts (middleware.ts before Next.js 16)\nimport { shadePreviewProxy } from '@shadestack\u002Fnext'\n\nexport const proxy = (request: Request) => shadePreviewProxy(request)\nexport const config = { matcher: ['\u002Fpreview'] }\n",[623,3621,3622,3627,3646,3650,3682],{"__ignoreMap":1255},[1259,3623,3624],{"class":1261,"line":1262},[1259,3625,3626],{"class":2438},"\u002F\u002F proxy.ts (middleware.ts before Next.js 16)\n",[1259,3628,3629,3631,3633,3636,3638,3640,3642,3644],{"class":1261,"line":1268},[1259,3630,1567],{"class":1566},[1259,3632,1571],{"class":1570},[1259,3634,3635],{"class":1574}," shadePreviewProxy",[1259,3637,1584],{"class":1570},[1259,3639,1587],{"class":1566},[1259,3641,1590],{"class":1570},[1259,3643,756],{"class":1593},[1259,3645,1596],{"class":1570},[1259,3647,3648],{"class":1261,"line":1274},[1259,3649,1284],{"emptyLinePlaceholder":1283},[1259,3651,3652,3654,3656,3659,3661,3663,3667,3669,3672,3674,3677,3679],{"class":1261,"line":1280},[1259,3653,2463],{"class":1566},[1259,3655,3549],{"class":1605},[1259,3657,3658],{"class":1574}," proxy ",[1259,3660,1612],{"class":1570},[1259,3662,636],{"class":1570},[1259,3664,3666],{"class":3665},"sHdIc","request",[1259,3668,1628],{"class":1570},[1259,3670,3671],{"class":1690}," Request",[1259,3673,3205],{"class":1570},[1259,3675,3676],{"class":1605}," =>",[1259,3678,3635],{"class":1615},[1259,3680,3681],{"class":1574},"(request)\n",[1259,3683,3684,3686,3688,3691,3693,3695,3698,3700,3702,3704,3706,3708,3711],{"class":1261,"line":1287},[1259,3685,2463],{"class":1566},[1259,3687,3549],{"class":1605},[1259,3689,3690],{"class":1574}," config ",[1259,3692,1612],{"class":1570},[1259,3694,1571],{"class":1570},[1259,3696,3697],{"class":1624}," matcher",[1259,3699,1628],{"class":1570},[1259,3701,1670],{"class":1574},[1259,3703,1636],{"class":1570},[1259,3705,899],{"class":1593},[1259,3707,1636],{"class":1570},[1259,3709,3710],{"class":1574},"] ",[1259,3712,1398],{"class":1570},[1250,3714,3716],{"className":1252,"code":3715,"language":1254,"meta":1255,"style":1255},"\u002F\u002F app\u002F(preview)\u002Fpreview\u002Fpage.tsx\nimport { readPreview, ShadeTree, shadeFromEnv } from '@shadestack\u002Fnext'\nimport { renderPublishedPage } from '@shadestack\u002Fclient\u002Frender'\nimport { notFound } from 'next\u002Fnavigation'\n\nexport const metadata = { robots: { index: false, follow: false } }\n\nexport default async function Preview({ searchParams }: { searchParams: Promise\u003C{ token?: string }> }) {\n  const shade = shadeFromEnv()\n  const preview = await readPreview(shade, (await searchParams).token)\n  if (!('page' in preview)) notFound()\n  const { result } = await renderPublishedPage(preview.page, { client: shade })\n  return \u003Cmain>\u003CShadeTree result={result} interactions={preview.page.interactions} \u002F>\u003C\u002Fmain>\n}\n",[623,3717,3718,3723,3728,3733,3737,3741,3746,3750,3755,3759,3764,3769,3774,3779],{"__ignoreMap":1255},[1259,3719,3720],{"class":1261,"line":1262},[1259,3721,3722],{},"\u002F\u002F app\u002F(preview)\u002Fpreview\u002Fpage.tsx\n",[1259,3724,3725],{"class":1261,"line":1268},[1259,3726,3727],{},"import { readPreview, ShadeTree, shadeFromEnv } from '@shadestack\u002Fnext'\n",[1259,3729,3730],{"class":1261,"line":1274},[1259,3731,3732],{},"import { renderPublishedPage } from '@shadestack\u002Fclient\u002Frender'\n",[1259,3734,3735],{"class":1261,"line":1280},[1259,3736,3390],{},[1259,3738,3739],{"class":1261,"line":1287},[1259,3740,1284],{"emptyLinePlaceholder":1283},[1259,3742,3743],{"class":1261,"line":1293},[1259,3744,3745],{},"export const metadata = { robots: { index: false, follow: false } }\n",[1259,3747,3748],{"class":1261,"line":1299},[1259,3749,1284],{"emptyLinePlaceholder":1283},[1259,3751,3752],{"class":1261,"line":1305},[1259,3753,3754],{},"export default async function Preview({ searchParams }: { searchParams: Promise\u003C{ token?: string }> }) {\n",[1259,3756,3757],{"class":1261,"line":1311},[1259,3758,3404],{},[1259,3760,3761],{"class":1261,"line":1317},[1259,3762,3763],{},"  const preview = await readPreview(shade, (await searchParams).token)\n",[1259,3765,3766],{"class":1261,"line":1323},[1259,3767,3768],{},"  if (!('page' in preview)) notFound()\n",[1259,3770,3771],{"class":1261,"line":1329},[1259,3772,3773],{},"  const { result } = await renderPublishedPage(preview.page, { client: shade })\n",[1259,3775,3776],{"class":1261,"line":1335},[1259,3777,3778],{},"  return \u003Cmain>\u003CShadeTree result={result} interactions={preview.page.interactions} \u002F>\u003C\u002Fmain>\n",[1259,3780,3781],{"class":1261,"line":1341},[1259,3782,1398],{},[2215,3784],{},"An expired link is ",[623,3787,3611],{},": give the route a ",[623,3790,3615],{}," that says ",[876,3793,2280],{}," In ",[623,3796,3797],{},"app\u002F(preview)\u002Flayout.tsx",", write the theme as ",[623,3800,3801],{},"\u003Cstyle nonce={await shadePreviewNonce()}>",[884,3803,3804,3805,3808,3809,3811,3812,3815,3816,3864,3866,3867,3869],{},"The rebuild route: ",[623,3806,3807],{},"revalidateRoute()"," takes ",[623,3810,2343],{}," and revalidates every page (",[623,3813,3814],{},"revalidatePath('\u002F', 'layout')","), so the next visit renders each with the content SHADE gives now.",[1250,3817,3819],{"className":1557,"code":3818,"language":1559,"meta":1255,"style":1255},"\u002F\u002F app\u002Fshade-rebuild\u002Froute.ts\nimport { revalidateRoute } from '@shadestack\u002Fnext'\n\nexport const POST = revalidateRoute()\n",[623,3820,3821,3826,3845,3849],{"__ignoreMap":1255},[1259,3822,3823],{"class":1261,"line":1262},[1259,3824,3825],{"class":2438},"\u002F\u002F app\u002Fshade-rebuild\u002Froute.ts\n",[1259,3827,3828,3830,3832,3835,3837,3839,3841,3843],{"class":1261,"line":1268},[1259,3829,1567],{"class":1566},[1259,3831,1571],{"class":1570},[1259,3833,3834],{"class":1574}," revalidateRoute",[1259,3836,1584],{"class":1570},[1259,3838,1587],{"class":1566},[1259,3840,1590],{"class":1570},[1259,3842,756],{"class":1593},[1259,3844,1596],{"class":1570},[1259,3846,3847],{"class":1261,"line":1274},[1259,3848,1284],{"emptyLinePlaceholder":1283},[1259,3850,3851,3853,3855,3858,3860,3862],{"class":1261,"line":1280},[1259,3852,2463],{"class":1566},[1259,3854,3549],{"class":1605},[1259,3856,3857],{"class":1574}," POST ",[1259,3859,1612],{"class":1570},[1259,3861,3834],{"class":1615},[1259,3863,3559],{"class":1574},[2215,3865],{},"A static export (",[623,3868,3585],{},") has nothing to revalidate: point the build hook at the host's deploy hook.",[619,3871,3007,3872,3875,3876,979,3879,3881,3882,3885],{},[623,3873,3874],{},"starters\u002Fnext",". Its canvas render route writes the rendering core's HTML (",[623,3877,3878],{},"toHtml",[623,3880,715],{},"): Next keeps ",[623,3883,3884],{},"react-dom\u002Fserver"," out of route handlers.",[657,3887,3889],{"id":3888},"shadestacksveltekit",[623,3890,807],{},[619,3892,3893],{},"Svelte 5, for SvelteKit.",[1250,3895,3897],{"className":1557,"code":3896,"language":1559,"meta":1255,"style":1255},"\u002F\u002F src\u002Froutes\u002F[...slug]\u002F+page.server.ts\nimport { env } from '$env\u002Fdynamic\u002Fprivate'\nimport { error } from '@sveltejs\u002Fkit'\nimport { findPage, shadeFromEnv } from '@shadestack\u002Fsveltekit'\n\nexport async function load({ params }) {\n  const shade = shadeFromEnv(env)\n  const [site, page] = await Promise.all([shade.site(), findPage(shade, params.slug)])\n  if (!page) error(404)\n  return { site, page }\n}\n",[623,3898,3899,3904,3924,3944,3968,3972,3997,4014,4068,4093,4110],{"__ignoreMap":1255},[1259,3900,3901],{"class":1261,"line":1262},[1259,3902,3903],{"class":2438},"\u002F\u002F src\u002Froutes\u002F[...slug]\u002F+page.server.ts\n",[1259,3905,3906,3908,3910,3913,3915,3917,3919,3922],{"class":1261,"line":1268},[1259,3907,1567],{"class":1566},[1259,3909,1571],{"class":1570},[1259,3911,3912],{"class":1574}," env",[1259,3914,1584],{"class":1570},[1259,3916,1587],{"class":1566},[1259,3918,1590],{"class":1570},[1259,3920,3921],{"class":1593},"$env\u002Fdynamic\u002Fprivate",[1259,3923,1596],{"class":1570},[1259,3925,3926,3928,3930,3933,3935,3937,3939,3942],{"class":1261,"line":1274},[1259,3927,1567],{"class":1566},[1259,3929,1571],{"class":1570},[1259,3931,3932],{"class":1574}," error",[1259,3934,1584],{"class":1570},[1259,3936,1587],{"class":1566},[1259,3938,1590],{"class":1570},[1259,3940,3941],{"class":1593},"@sveltejs\u002Fkit",[1259,3943,1596],{"class":1570},[1259,3945,3946,3948,3950,3953,3955,3958,3960,3962,3964,3966],{"class":1261,"line":1280},[1259,3947,1567],{"class":1566},[1259,3949,1571],{"class":1570},[1259,3951,3952],{"class":1574}," findPage",[1259,3954,1578],{"class":1570},[1259,3956,3957],{"class":1574}," shadeFromEnv",[1259,3959,1584],{"class":1570},[1259,3961,1587],{"class":1566},[1259,3963,1590],{"class":1570},[1259,3965,807],{"class":1593},[1259,3967,1596],{"class":1570},[1259,3969,3970],{"class":1261,"line":1287},[1259,3971,1284],{"emptyLinePlaceholder":1283},[1259,3973,3974,3976,3979,3982,3985,3988,3991,3994],{"class":1261,"line":1293},[1259,3975,2463],{"class":1566},[1259,3977,3978],{"class":1605}," async",[1259,3980,3981],{"class":1605}," function",[1259,3983,3984],{"class":1615}," load",[1259,3986,3987],{"class":1570},"({",[1259,3989,3990],{"class":3665}," params",[1259,3992,3993],{"class":1570}," })",[1259,3995,3996],{"class":1570}," {\n",[1259,3998,3999,4002,4004,4006,4008,4010,4012],{"class":1261,"line":1299},[1259,4000,4001],{"class":1605},"  const",[1259,4003,1711],{"class":1574},[1259,4005,1684],{"class":1570},[1259,4007,3957],{"class":1615},[1259,4009,1618],{"class":1624},[1259,4011,1651],{"class":1574},[1259,4013,1663],{"class":1624},[1259,4015,4016,4018,4020,4022,4024,4026,4028,4030,4032,4034,4036,4038,4041,4043,4045,4047,4049,4051,4053,4055,4057,4059,4061,4063,4066],{"class":1261,"line":1305},[1259,4017,4001],{"class":1605},[1259,4019,1670],{"class":1570},[1259,4021,1673],{"class":1574},[1259,4023,1578],{"class":1570},[1259,4025,1678],{"class":1574},[1259,4027,1681],{"class":1570},[1259,4029,1684],{"class":1570},[1259,4031,1687],{"class":1566},[1259,4033,1691],{"class":1690},[1259,4035,697],{"class":1570},[1259,4037,1696],{"class":1615},[1259,4039,4040],{"class":1624},"([",[1259,4042,696],{"class":1574},[1259,4044,697],{"class":1570},[1259,4046,1673],{"class":1615},[1259,4048,1706],{"class":1624},[1259,4050,1578],{"class":1570},[1259,4052,3952],{"class":1615},[1259,4054,1618],{"class":1624},[1259,4056,696],{"class":1574},[1259,4058,1578],{"class":1570},[1259,4060,3990],{"class":1574},[1259,4062,697],{"class":1570},[1259,4064,4065],{"class":1574},"slug",[1259,4067,1728],{"class":1624},[1259,4069,4070,4073,4075,4077,4079,4082,4085,4087,4091],{"class":1261,"line":1311},[1259,4071,4072],{"class":1566},"  if",[1259,4074,636],{"class":1624},[1259,4076,1658],{"class":1570},[1259,4078,1716],{"class":1574},[1259,4080,4081],{"class":1624},") ",[1259,4083,4084],{"class":1615},"error",[1259,4086,1618],{"class":1624},[1259,4088,4090],{"class":4089},"sbssI","404",[1259,4092,1663],{"class":1624},[1259,4094,4095,4098,4100,4103,4105,4107],{"class":1261,"line":1317},[1259,4096,4097],{"class":1566},"  return",[1259,4099,1571],{"class":1570},[1259,4101,4102],{"class":1574}," site",[1259,4104,1578],{"class":1570},[1259,4106,1678],{"class":1574},[1259,4108,4109],{"class":1570}," }\n",[1259,4111,4112],{"class":1261,"line":1323},[1259,4113,1398],{"class":1570},[1250,4115,4119],{"className":4116,"code":4117,"language":4118,"meta":1255,"style":1255},"language-svelte shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u003C!-- src\u002Froutes\u002F[...slug]\u002F+page.svelte -->\n\u003Cscript>\n  import { ShadeTree } from '@shadestack\u002Fsveltekit'\n  let { data } = $props()\n\u003C\u002Fscript>\n\n\u003Cmain>\u003CShadeTree result={data.result} interactions={data.page.interactions} \u002F>\u003C\u002Fmain>\n","svelte",[623,4120,4121,4126,4131,4136,4141,4146,4150],{"__ignoreMap":1255},[1259,4122,4123],{"class":1261,"line":1262},[1259,4124,4125],{},"\u003C!-- src\u002Froutes\u002F[...slug]\u002F+page.svelte -->\n",[1259,4127,4128],{"class":1261,"line":1268},[1259,4129,4130],{},"\u003Cscript>\n",[1259,4132,4133],{"class":1261,"line":1274},[1259,4134,4135],{},"  import { ShadeTree } from '@shadestack\u002Fsveltekit'\n",[1259,4137,4138],{"class":1261,"line":1280},[1259,4139,4140],{},"  let { data } = $props()\n",[1259,4142,4143],{"class":1261,"line":1287},[1259,4144,4145],{},"\u003C\u002Fscript>\n",[1259,4147,4148],{"class":1261,"line":1293},[1259,4149,1284],{"emptyLinePlaceholder":1283},[1259,4151,4152],{"class":1261,"line":1299},[1259,4153,4154],{},"\u003Cmain>\u003CShadeTree result={data.result} interactions={data.page.interactions} \u002F>\u003C\u002Fmain>\n",[619,4156,4157,4158,979,4161,4163,4164,4167,4168,4170,4171,4173],{},"with ",[623,4159,4160],{},"result",[623,4162,1738],{}," in the ",[623,4165,4166],{},"load"," function. Import the theme's CSS (",[623,4169,1490],{},", with the website module) and ",[623,4172,3462],{}," in the root layout.",[881,4175,4176,4221,4253,4370,4530],{},[884,4177,4178,3808,4181,4183,4184,4187,4188,636,4191,4194,4195,4198,4199,4202,4203,4205,4206,4208,4209,1044,4212,651,4215,1044,4218,697],{},[623,4179,4180],{},"shadeFromEnv(env)",[623,4182,3921],{},"; ",[623,4185,4186],{},"findPage(client, params.slug)"," returns null for a page that does not exist. SvelteKit 3 declares a site's variables in ",[623,4189,4190],{},"src\u002Fenv.ts",[623,4192,4193],{},"defineEnvVars",") and gives them as ",[623,4196,4197],{},"$app\u002Fenv\u002Fprivate",": pass ",[623,4200,4201],{},"import * as env from '$app\u002Fenv\u002Fprivate'"," where these examples pass ",[623,4204,3921],{},"'s ",[623,4207,1651],{},", as the starter does. SvelteKit 3 also renamed ",[623,4210,4211],{},"$app\u002Fenvironment",[623,4213,4214],{},"$app\u002Fenv",[623,4216,4217],{},"$lib",[623,4219,4220],{},"#lib",[884,4222,4223,651,4225,2825,4227,4231,4232,4234,4235,4238,4239,911,4242,636,4244,3485,4246,3489,4248,712,4250,4252],{},[623,4224,1744],{},[623,4226,2824],{},[628,4228,4229],{"href":522},[623,4230,715],{},"). In the ",[623,4233,4166],{}," function, ",[623,4236,4237],{},"shadeNoStore(result, setHeaders)"," is for a page that is the visitor's own: it sends the page and its ",[623,4240,4241],{},"__data.json",[623,4243,2840],{},[623,4245,1744],{},[623,4247,3488],{},[623,4249,3492],{},[623,4251,1744],{}," starts the page's interactions in the browser once it is mounted, and again with the next page's: SvelteKit keeps the page's component between pages of the same route.",[884,4254,4255,4256,4258,4259,4261,4262,4264,4265,636,4268,4271,4272,4274,4275,4355,3562,4357,4359,4360,4362,4363,4366,4367,1416],{},"A prerendered page's server islands (",[628,4257,3501],{"href":1898},"): in its ",[623,4260,4166],{},", resolve with ",[623,4263,1884],{}," and return ",[623,4266,4267],{},"await deferServerIslands(result, env)",[623,4269,4270],{},"import * as env from '$env\u002Fstatic\u002Fprivate'",", since a prerendered ",[623,4273,4166],{}," can't read the dynamic environment), and add the island route:",[1250,4276,4278],{"className":1557,"code":4277,"language":1559,"meta":1255,"style":1255},"\u002F\u002F src\u002Froutes\u002Fshade-island\u002F+server.ts\nimport { env } from '$env\u002Fdynamic\u002Fprivate'\nimport { serverIslandRoute } from '@shadestack\u002Fsveltekit'\n\nexport const prerender = false\nexport const GET = serverIslandRoute(env)\n",[623,4279,4280,4285,4303,4321,4325,4340],{"__ignoreMap":1255},[1259,4281,4282],{"class":1261,"line":1262},[1259,4283,4284],{"class":2438},"\u002F\u002F src\u002Froutes\u002Fshade-island\u002F+server.ts\n",[1259,4286,4287,4289,4291,4293,4295,4297,4299,4301],{"class":1261,"line":1268},[1259,4288,1567],{"class":1566},[1259,4290,1571],{"class":1570},[1259,4292,3912],{"class":1574},[1259,4294,1584],{"class":1570},[1259,4296,1587],{"class":1566},[1259,4298,1590],{"class":1570},[1259,4300,3921],{"class":1593},[1259,4302,1596],{"class":1570},[1259,4304,4305,4307,4309,4311,4313,4315,4317,4319],{"class":1261,"line":1274},[1259,4306,1567],{"class":1566},[1259,4308,1571],{"class":1570},[1259,4310,3528],{"class":1574},[1259,4312,1584],{"class":1570},[1259,4314,1587],{"class":1566},[1259,4316,1590],{"class":1570},[1259,4318,807],{"class":1593},[1259,4320,1596],{"class":1570},[1259,4322,4323],{"class":1261,"line":1280},[1259,4324,1284],{"emptyLinePlaceholder":1283},[1259,4326,4327,4329,4331,4334,4336],{"class":1261,"line":1287},[1259,4328,2463],{"class":1566},[1259,4330,3549],{"class":1605},[1259,4332,4333],{"class":1574}," prerender ",[1259,4335,1612],{"class":1570},[1259,4337,4339],{"class":4338},"sfNiH"," false\n",[1259,4341,4342,4344,4346,4348,4350,4352],{"class":1261,"line":1293},[1259,4343,2463],{"class":1566},[1259,4345,3549],{"class":1605},[1259,4347,3552],{"class":1574},[1259,4349,1612],{"class":1570},[1259,4351,3528],{"class":1615},[1259,4353,4354],{"class":1574},"(env)\n",[2215,4356],{},[623,4358,2659],{}," at build time and on the server. ",[623,4361,1744],{}," asks for the route under the app's base path (",[623,4364,4365],{},"paths.base",", from ",[623,4368,4369],{},"$app\u002Fpaths",[884,4371,3589,4372,4374,4375,4377,4378,4380,4381,4384,4385,636,4388,4391,4392,4395,4396,4398,4399,4402,4403,4405,4406,4408,4409,697,4413,4504,4506,4507,4509,4510,712,4513,4516,4517,1799,4520,651,4523,4526,4527,697],{},[628,4373,3593],{"href":3592},"): its ",[623,4376,4166],{}," reads the draft with ",[623,4379,3600],{}," and answers SvelteKit's ",[623,4382,4383],{},"error(status, message)"," for a missing or expired token. ",[623,4386,4387],{},"shadePreviewHandle(env, dev)",[623,4389,4390],{},"@shadestack\u002Fsveltekit\u002Fpreview",", server only) in ",[623,4393,4394],{},"src\u002Fhooks.server.ts"," sends the route and its ",[623,4397,4241],{}," with the preview's headers, and the page with its policy. SvelteKit marks its own start script only when the site sets ",[623,4400,4401],{},"kit.csp",", so the preview needs it: the handle takes SvelteKit's nonce (or hash) from SvelteKit's policy and the ",[623,4404,2570],{},"'s hashes, and refuses to answer the preview without SvelteKit's (an error naming ",[623,4407,4401],{},"). How to set it: ",[628,4410,4412],{"href":4411},"#sveltekit-content-security-policy","SvelteKit's content security policy",[1250,4414,4416],{"className":1557,"code":4415,"language":1559,"meta":1255,"style":1255},"\u002F\u002F src\u002Fhooks.server.ts\nimport { dev } from '$app\u002Fenvironment'\nimport { env } from '$env\u002Fdynamic\u002Fprivate'\nimport { shadePreviewHandle } from '@shadestack\u002Fsveltekit\u002Fpreview'\n\nexport const handle = shadePreviewHandle(env, dev)\n",[623,4417,4418,4423,4442,4460,4479,4483],{"__ignoreMap":1255},[1259,4419,4420],{"class":1261,"line":1262},[1259,4421,4422],{"class":2438},"\u002F\u002F src\u002Fhooks.server.ts\n",[1259,4424,4425,4427,4429,4432,4434,4436,4438,4440],{"class":1261,"line":1268},[1259,4426,1567],{"class":1566},[1259,4428,1571],{"class":1570},[1259,4430,4431],{"class":1574}," dev",[1259,4433,1584],{"class":1570},[1259,4435,1587],{"class":1566},[1259,4437,1590],{"class":1570},[1259,4439,4211],{"class":1593},[1259,4441,1596],{"class":1570},[1259,4443,4444,4446,4448,4450,4452,4454,4456,4458],{"class":1261,"line":1274},[1259,4445,1567],{"class":1566},[1259,4447,1571],{"class":1570},[1259,4449,3912],{"class":1574},[1259,4451,1584],{"class":1570},[1259,4453,1587],{"class":1566},[1259,4455,1590],{"class":1570},[1259,4457,3921],{"class":1593},[1259,4459,1596],{"class":1570},[1259,4461,4462,4464,4466,4469,4471,4473,4475,4477],{"class":1261,"line":1280},[1259,4463,1567],{"class":1566},[1259,4465,1571],{"class":1570},[1259,4467,4468],{"class":1574}," shadePreviewHandle",[1259,4470,1584],{"class":1570},[1259,4472,1587],{"class":1566},[1259,4474,1590],{"class":1570},[1259,4476,4390],{"class":1593},[1259,4478,1596],{"class":1570},[1259,4480,4481],{"class":1261,"line":1287},[1259,4482,1284],{"emptyLinePlaceholder":1283},[1259,4484,4485,4487,4489,4492,4494,4496,4499,4501],{"class":1261,"line":1293},[1259,4486,2463],{"class":1566},[1259,4488,3549],{"class":1605},[1259,4490,4491],{"class":1574}," handle ",[1259,4493,1612],{"class":1570},[1259,4495,4468],{"class":1615},[1259,4497,4498],{"class":1574},"(env",[1259,4500,1578],{"class":1570},[1259,4502,4503],{"class":1574}," dev)\n",[2215,4505],{},"The route's ",[623,4508,4166],{}," is the same as the Next page: ",[623,4511,4512],{},"readPreview(shade, url.searchParams.get('token'))",[623,4514,4515],{},"error(preview.status, preview.message)"," unless ",[623,4518,4519],{},"'page' in preview",[623,4521,4522],{},"renderPublishedPage",[623,4524,4525],{},"return { page: preview.page, result }",", with ",[623,4528,4529],{},"export const prerender = false",[884,4531,4532],{},"Rebuilding: SvelteKit has no revalidation of its own. Its prerendered pages are files, so SHADE's build hook goes to the host's deploy hook, which builds the site again; pages rendered per request read SHADE every time and need nothing. (Vercel's ISR, for a site that uses it, is Vercel's own on-demand revalidation, outside SvelteKit.)",[619,4534,3007,4535,4538,4539,4542,4543,4545,4546,4548,4549,4552],{},[623,4536,4537],{},"starters\u002Fsveltekit"," (SvelteKit 3, ",[623,4540,4541],{},"@sveltejs\u002Fadapter-node","). Its ",[623,4544,4394],{}," allows the scripts of the page's ",[623,4547,2570],{}," (the theme's colour mode script) by their hash in SvelteKit's policy on every page, as ",[623,4550,4551],{},"shadePreviewHandle"," does for the preview.",[936,4554,4556],{"id":4555},"sveltekit-content-security-policy","SvelteKit content security policy",[619,4558,4559,4560,4562,4563,4565,4566,636,4569,4572,4573,636,4576,1416],{},"The preview needs ",[623,4561,4401],{},": SvelteKit puts a nonce or hash on the scripts it writes only when the site sets it, and the preview's policy allows no other inline script. ",[623,4564,4401],{}," holds for every page of the site, not only the preview. SvelteKit 3 takes its options in ",[623,4567,4568],{},"vite.config",[623,4570,4571],{},"sveltekit({ csp })","); SvelteKit 2 in ",[623,4574,4575],{},"svelte.config.js",[623,4577,4578],{},"kit: { csp }",[1250,4580,4582],{"className":2429,"code":4581,"language":2431,"meta":1255,"style":1255},"\u002F\u002F vite.config.js (SvelteKit 3)\nexport default defineConfig({\n  plugins: [sveltekit({\n    csp: { mode: 'auto', directives: { 'script-src': ['self'] } }\n  })]\n})\n",[623,4583,4584,4589,4602,4617,4671,4679],{"__ignoreMap":1255},[1259,4585,4586],{"class":1261,"line":1262},[1259,4587,4588],{"class":2438},"\u002F\u002F vite.config.js (SvelteKit 3)\n",[1259,4590,4591,4593,4595,4597,4599],{"class":1261,"line":1268},[1259,4592,2463],{"class":1566},[1259,4594,2466],{"class":1566},[1259,4596,2469],{"class":1615},[1259,4598,1618],{"class":1574},[1259,4600,4601],{"class":1570},"{\n",[1259,4603,4604,4607,4609,4611,4613,4615],{"class":1261,"line":1274},[1259,4605,4606],{"class":1624},"  plugins",[1259,4608,1628],{"class":1570},[1259,4610,1670],{"class":1574},[1259,4612,873],{"class":1615},[1259,4614,1618],{"class":1574},[1259,4616,4601],{"class":1570},[1259,4618,4619,4622,4624,4626,4629,4631,4633,4636,4638,4640,4643,4645,4647,4649,4652,4654,4656,4658,4660,4663,4665,4667,4669],{"class":1261,"line":1280},[1259,4620,4621],{"class":1624},"    csp",[1259,4623,1628],{"class":1570},[1259,4625,1571],{"class":1570},[1259,4627,4628],{"class":1624}," mode",[1259,4630,1628],{"class":1570},[1259,4632,1590],{"class":1570},[1259,4634,4635],{"class":1593},"auto",[1259,4637,1636],{"class":1570},[1259,4639,1578],{"class":1570},[1259,4641,4642],{"class":1624}," directives",[1259,4644,1628],{"class":1570},[1259,4646,1571],{"class":1570},[1259,4648,1590],{"class":1570},[1259,4650,4651],{"class":1624},"script-src",[1259,4653,1636],{"class":1570},[1259,4655,1628],{"class":1570},[1259,4657,1670],{"class":1574},[1259,4659,1636],{"class":1570},[1259,4661,4662],{"class":1593},"self",[1259,4664,1636],{"class":1570},[1259,4666,3710],{"class":1574},[1259,4668,2211],{"class":1570},[1259,4670,4109],{"class":1570},[1259,4672,4673,4676],{"class":1261,"line":1287},[1259,4674,4675],{"class":1570},"  }",[1259,4677,4678],{"class":1574},")]\n",[1259,4680,4681,4683],{"class":1261,"line":1293},[1259,4682,2211],{"class":1570},[1259,4684,1663],{"class":1574},[619,4686,4687,4688,4691,4692,4695],{},"With ",[623,4689,4690],{},"mode: 'auto'",", pages rendered per request get a nonce and prerendered pages a hash. A script of the site's own in ",[623,4693,4694],{},"\u003Csvelte:head>"," (a colour-mode script, say) is then blocked unless you allow it:",[881,4697,4698,4718],{},[884,4699,4700,4703,4704,636,4706,4709,4710,4713,4714,4717],{},[951,4701,4702],{},"By its hash",", in ",[623,4705,4651],{},[623,4707,4708],{},"csp: { mode: 'auto', directives: { 'script-src': ['self', 'sha256-…'] } }","). The hash is of the script's text exactly as written, so change it whenever the script changes. ",[623,4711,4712],{},"openssl dgst -sha256 -binary script.js | openssl base64"," gives the value after ",[623,4715,4716],{},"sha256-",". Prerendered pages need this way.",[884,4719,4720,4726,4727,4729,4730],{},[951,4721,1200,4722,4725],{},[623,4723,4724],{},"src\u002Fapp.html",", with SvelteKit's nonce",", instead of in ",[623,4728,4694],{},". A nonce is made per request, so this suits pages rendered per request:",[1250,4731,4735],{"className":4732,"code":4733,"language":4734,"meta":1255,"style":1255},"language-html shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u003Chead>\n  \u003Cscript nonce=\"%sveltekit.nonce%\">\n    document.documentElement.dataset.theme = localStorage.getItem('theme') ?? 'light'\n  \u003C\u002Fscript>\n  %sveltekit.head%\n\u003C\u002Fhead>\n","html",[623,4736,4737,4747,4770,4819,4828,4833],{"__ignoreMap":1255},[1259,4738,4739,4742,4744],{"class":1261,"line":1262},[1259,4740,4741],{"class":1570},"\u003C",[1259,4743,2523],{"class":1624},[1259,4745,4746],{"class":1570},">\n",[1259,4748,4749,4752,4755,4758,4760,4763,4766,4768],{"class":1261,"line":1268},[1259,4750,4751],{"class":1570},"  \u003C",[1259,4753,4754],{"class":1624},"script",[1259,4756,4757],{"class":1605}," nonce",[1259,4759,1612],{"class":1570},[1259,4761,4762],{"class":1570},"\"",[1259,4764,4765],{"class":1593},"%sveltekit.nonce%",[1259,4767,4762],{"class":1570},[1259,4769,4746],{"class":1570},[1259,4771,4772,4775,4777,4780,4782,4785,4787,4790,4792,4795,4797,4800,4802,4804,4806,4808,4810,4813,4815,4817],{"class":1261,"line":1274},[1259,4773,4774],{"class":1574},"    document",[1259,4776,697],{"class":1570},[1259,4778,4779],{"class":1574},"documentElement",[1259,4781,697],{"class":1570},[1259,4783,4784],{"class":1574},"dataset",[1259,4786,697],{"class":1570},[1259,4788,4789],{"class":1574},"theme ",[1259,4791,1612],{"class":1570},[1259,4793,4794],{"class":1574}," localStorage",[1259,4796,697],{"class":1570},[1259,4798,4799],{"class":1615},"getItem",[1259,4801,1618],{"class":1574},[1259,4803,1636],{"class":1570},[1259,4805,1498],{"class":1593},[1259,4807,1636],{"class":1570},[1259,4809,4081],{"class":1574},[1259,4811,4812],{"class":1570},"??",[1259,4814,1590],{"class":1570},[1259,4816,3074],{"class":1593},[1259,4818,1596],{"class":1570},[1259,4820,4821,4824,4826],{"class":1261,"line":1280},[1259,4822,4823],{"class":1570},"  \u003C\u002F",[1259,4825,4754],{"class":1624},[1259,4827,4746],{"class":1570},[1259,4829,4830],{"class":1261,"line":1287},[1259,4831,4832],{"class":1574},"  %sveltekit.head%\n",[1259,4834,4835,4838,4840],{"class":1261,"line":1293},[1259,4836,4837],{"class":1570},"\u003C\u002F",[1259,4839,2523],{"class":1624},[1259,4841,4746],{"class":1570},[619,4843,4844,4845,4848,4849,4851],{},"Styles work the same way under ",[623,4846,4847],{},"style-src",". Without ",[623,4850,4401],{}," the preview answers with an error that names it and links here.",[657,4853,4855],{"id":4854},"shadestacknuxt",[623,4856,780],{},[619,4858,4859],{},"Vue 3, for Nuxt.",[1250,4861,4863],{"className":1557,"code":4862,"language":1559,"meta":1255,"style":1255},"\u002F\u002F nuxt.config.ts\nexport default defineNuxtConfig({ modules: ['@shadestack\u002Fnuxt\u002Fmodule'] })\n",[623,4864,4865,4870],{"__ignoreMap":1255},[1259,4866,4867],{"class":1261,"line":1262},[1259,4868,4869],{"class":2438},"\u002F\u002F nuxt.config.ts\n",[1259,4871,4872,4874,4876,4879,4881,4883,4886,4888,4890,4892,4895,4897,4899,4901],{"class":1261,"line":1268},[1259,4873,2463],{"class":1566},[1259,4875,2466],{"class":1566},[1259,4877,4878],{"class":1615}," defineNuxtConfig",[1259,4880,1618],{"class":1574},[1259,4882,1621],{"class":1570},[1259,4884,4885],{"class":1624}," modules",[1259,4887,1628],{"class":1570},[1259,4889,1670],{"class":1574},[1259,4891,1636],{"class":1570},[1259,4893,4894],{"class":1593},"@shadestack\u002Fnuxt\u002Fmodule",[1259,4896,1636],{"class":1570},[1259,4898,3710],{"class":1574},[1259,4900,2211],{"class":1570},[1259,4902,1663],{"class":1574},[1250,4904,4908],{"className":4905,"code":4906,"language":4907,"meta":1255,"style":1255},"language-vue shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u003C!-- pages\u002F[...slug].vue -->\n\u003Cscript setup lang=\"ts\">\nconst route = useRoute()\n\u002F\u002F `useRequestFetch` passes the visitor's cookie on when Nuxt renders on the server, so a server island sees them.\nconst requestFetch = useRequestFetch()\nconst { data } = await useAsyncData(`page:${route.path}`, () => requestFetch('\u002Fapi\u002Fshade-page', { query: { path: route.path } }))\n\u003C\u002Fscript>\n\n\u003Ctemplate>\n  \u003Cmain>\u003CShadeTree v-if=\"data\" :result=\"data.result\" :interactions=\"data.page.interactions\" \u002F>\u003C\u002Fmain>\n\u003C\u002Ftemplate>\n","vue",[623,4909,4910,4915,4937,4951,4956,4970,5060,5068,5072,5081,5148],{"__ignoreMap":1255},[1259,4911,4912],{"class":1261,"line":1262},[1259,4913,4914],{"class":2438},"\u003C!-- pages\u002F[...slug].vue -->\n",[1259,4916,4917,4919,4921,4924,4927,4929,4931,4933,4935],{"class":1261,"line":1268},[1259,4918,4741],{"class":1570},[1259,4920,4754],{"class":1624},[1259,4922,4923],{"class":1605}," setup",[1259,4925,4926],{"class":1605}," lang",[1259,4928,1612],{"class":1570},[1259,4930,4762],{"class":1570},[1259,4932,1559],{"class":1593},[1259,4934,4762],{"class":1570},[1259,4936,4746],{"class":1570},[1259,4938,4939,4941,4944,4946,4949],{"class":1261,"line":1274},[1259,4940,1606],{"class":1605},[1259,4942,4943],{"class":1574}," route ",[1259,4945,1612],{"class":1570},[1259,4947,4948],{"class":1615}," useRoute",[1259,4950,3559],{"class":1574},[1259,4952,4953],{"class":1261,"line":1280},[1259,4954,4955],{"class":2438},"\u002F\u002F `useRequestFetch` passes the visitor's cookie on when Nuxt renders on the server, so a server island sees them.\n",[1259,4957,4958,4960,4963,4965,4968],{"class":1261,"line":1287},[1259,4959,1606],{"class":1605},[1259,4961,4962],{"class":1574}," requestFetch ",[1259,4964,1612],{"class":1570},[1259,4966,4967],{"class":1615}," useRequestFetch",[1259,4969,3559],{"class":1574},[1259,4971,4972,4974,4976,4979,4981,4983,4985,4988,4990,4993,4996,4999,5002,5004,5007,5010,5012,5015,5017,5020,5022,5024,5027,5029,5031,5033,5036,5038,5040,5043,5045,5048,5050,5053,5055,5057],{"class":1261,"line":1293},[1259,4973,1606],{"class":1605},[1259,4975,1571],{"class":1570},[1259,4977,4978],{"class":1574}," data ",[1259,4980,2211],{"class":1570},[1259,4982,1684],{"class":1570},[1259,4984,1687],{"class":1566},[1259,4986,4987],{"class":1615}," useAsyncData",[1259,4989,1618],{"class":1574},[1259,4991,4992],{"class":1570},"`",[1259,4994,4995],{"class":1593},"page:",[1259,4997,4998],{"class":1570},"${",[1259,5000,5001],{"class":1574},"route",[1259,5003,697],{"class":1570},[1259,5005,5006],{"class":1574},"path",[1259,5008,5009],{"class":1570},"}`",[1259,5011,1578],{"class":1570},[1259,5013,5014],{"class":1570}," ()",[1259,5016,3676],{"class":1605},[1259,5018,5019],{"class":1615}," requestFetch",[1259,5021,1618],{"class":1574},[1259,5023,1636],{"class":1570},[1259,5025,5026],{"class":1593},"\u002Fapi\u002Fshade-page",[1259,5028,1636],{"class":1570},[1259,5030,1578],{"class":1570},[1259,5032,1571],{"class":1570},[1259,5034,5035],{"class":1624}," query",[1259,5037,1628],{"class":1570},[1259,5039,1571],{"class":1570},[1259,5041,5042],{"class":1624}," path",[1259,5044,1628],{"class":1570},[1259,5046,5047],{"class":1574}," route",[1259,5049,697],{"class":1570},[1259,5051,5052],{"class":1574},"path ",[1259,5054,2211],{"class":1570},[1259,5056,1584],{"class":1570},[1259,5058,5059],{"class":1574},"))\n",[1259,5061,5062,5064,5066],{"class":1261,"line":1299},[1259,5063,4837],{"class":1570},[1259,5065,4754],{"class":1624},[1259,5067,4746],{"class":1570},[1259,5069,5070],{"class":1261,"line":1305},[1259,5071,1284],{"emptyLinePlaceholder":1283},[1259,5073,5074,5076,5079],{"class":1261,"line":1311},[1259,5075,4741],{"class":1570},[1259,5077,5078],{"class":1624},"template",[1259,5080,4746],{"class":1570},[1259,5082,5083,5085,5088,5091,5093,5096,5098,5100,5102,5104,5107,5109,5111,5113,5115,5117,5119,5121,5123,5125,5127,5129,5131,5133,5135,5137,5139,5141,5144,5146],{"class":1261,"line":1317},[1259,5084,4751],{"class":1570},[1259,5086,5087],{"class":1624},"main",[1259,5089,5090],{"class":1570},">\u003C",[1259,5092,1744],{"class":1624},[1259,5094,5095],{"class":1566}," v-if",[1259,5097,1612],{"class":1570},[1259,5099,4762],{"class":1570},[1259,5101,1071],{"class":1574},[1259,5103,4762],{"class":1570},[1259,5105,5106],{"class":1570}," :",[1259,5108,4160],{"class":1605},[1259,5110,1612],{"class":1570},[1259,5112,4762],{"class":1570},[1259,5114,1071],{"class":1574},[1259,5116,697],{"class":1570},[1259,5118,4160],{"class":1574},[1259,5120,4762],{"class":1570},[1259,5122,5106],{"class":1570},[1259,5124,3492],{"class":1605},[1259,5126,1612],{"class":1570},[1259,5128,4762],{"class":1570},[1259,5130,1071],{"class":1574},[1259,5132,697],{"class":1570},[1259,5134,1716],{"class":1574},[1259,5136,697],{"class":1570},[1259,5138,3492],{"class":1574},[1259,5140,4762],{"class":1570},[1259,5142,5143],{"class":1570}," \u002F>\u003C\u002F",[1259,5145,5087],{"class":1624},[1259,5147,4746],{"class":1570},[1259,5149,5150,5152,5154],{"class":1261,"line":1323},[1259,5151,4837],{"class":1570},[1259,5153,5078],{"class":1624},[1259,5155,4746],{"class":1570},[619,5157,5158],{},"with a server route that reads SHADE (the token stays on the server):",[1250,5160,5162],{"className":1557,"code":5161,"language":1559,"meta":1255,"style":1255},"\u002F\u002F server\u002Fapi\u002Fshade-page.get.ts\nimport { findPage, resolvePage, shadeFromEnv, shadeNoStore } from '@shadestack\u002Fnuxt'\n\nexport default defineEventHandler(async (event) => {\n  const shade = shadeFromEnv()\n  const path = String(getQuery(event).path ?? '')\n  const [site, page] = await Promise.all([shade.site(), findPage(shade, path.split('\u002F').filter(Boolean))])\n  if (!page) throw createError({ statusCode: 404 })\n  const result = resolvePage(input) \u002F\u002F the page's tree, components, data and language, as above\n  \u002F\u002F A page that is the visitor's own: its JSON with `Cache-Control: private, no-store`, kept out of shared caches.\n  return { site, page, result: shadeNoStore(event, result) }\n})\n",[623,5163,5164,5169,5201,5205,5230,5242,5276,5350,5384,5405,5410,5442],{"__ignoreMap":1255},[1259,5165,5166],{"class":1261,"line":1262},[1259,5167,5168],{"class":2438},"\u002F\u002F server\u002Fapi\u002Fshade-page.get.ts\n",[1259,5170,5171,5173,5175,5177,5179,5182,5184,5186,5188,5191,5193,5195,5197,5199],{"class":1261,"line":1268},[1259,5172,1567],{"class":1566},[1259,5174,1571],{"class":1570},[1259,5176,3952],{"class":1574},[1259,5178,1578],{"class":1570},[1259,5180,5181],{"class":1574}," resolvePage",[1259,5183,1578],{"class":1570},[1259,5185,3957],{"class":1574},[1259,5187,1578],{"class":1570},[1259,5189,5190],{"class":1574}," shadeNoStore",[1259,5192,1584],{"class":1570},[1259,5194,1587],{"class":1566},[1259,5196,1590],{"class":1570},[1259,5198,780],{"class":1593},[1259,5200,1596],{"class":1570},[1259,5202,5203],{"class":1261,"line":1274},[1259,5204,1284],{"emptyLinePlaceholder":1283},[1259,5206,5207,5209,5211,5214,5216,5219,5221,5224,5226,5228],{"class":1261,"line":1280},[1259,5208,2463],{"class":1566},[1259,5210,2466],{"class":1566},[1259,5212,5213],{"class":1615}," defineEventHandler",[1259,5215,1618],{"class":1574},[1259,5217,5218],{"class":1605},"async",[1259,5220,636],{"class":1570},[1259,5222,5223],{"class":3665},"event",[1259,5225,3205],{"class":1570},[1259,5227,3676],{"class":1605},[1259,5229,3996],{"class":1570},[1259,5231,5232,5234,5236,5238,5240],{"class":1261,"line":1287},[1259,5233,4001],{"class":1605},[1259,5235,1711],{"class":1574},[1259,5237,1684],{"class":1570},[1259,5239,3957],{"class":1615},[1259,5241,3559],{"class":1624},[1259,5243,5244,5246,5248,5250,5253,5255,5258,5260,5262,5264,5266,5268,5271,5274],{"class":1261,"line":1293},[1259,5245,4001],{"class":1605},[1259,5247,5042],{"class":1574},[1259,5249,1684],{"class":1570},[1259,5251,5252],{"class":1615}," String",[1259,5254,1618],{"class":1624},[1259,5256,5257],{"class":1615},"getQuery",[1259,5259,1618],{"class":1624},[1259,5261,5223],{"class":1574},[1259,5263,3205],{"class":1624},[1259,5265,697],{"class":1570},[1259,5267,5006],{"class":1574},[1259,5269,5270],{"class":1570}," ??",[1259,5272,5273],{"class":1570}," ''",[1259,5275,1663],{"class":1624},[1259,5277,5278,5280,5282,5284,5286,5288,5290,5292,5294,5296,5298,5300,5302,5304,5306,5308,5310,5312,5314,5316,5318,5320,5322,5324,5327,5329,5331,5333,5335,5337,5339,5342,5344,5347],{"class":1261,"line":1299},[1259,5279,4001],{"class":1605},[1259,5281,1670],{"class":1570},[1259,5283,1673],{"class":1574},[1259,5285,1578],{"class":1570},[1259,5287,1678],{"class":1574},[1259,5289,1681],{"class":1570},[1259,5291,1684],{"class":1570},[1259,5293,1687],{"class":1566},[1259,5295,1691],{"class":1690},[1259,5297,697],{"class":1570},[1259,5299,1696],{"class":1615},[1259,5301,4040],{"class":1624},[1259,5303,696],{"class":1574},[1259,5305,697],{"class":1570},[1259,5307,1673],{"class":1615},[1259,5309,1706],{"class":1624},[1259,5311,1578],{"class":1570},[1259,5313,3952],{"class":1615},[1259,5315,1618],{"class":1624},[1259,5317,696],{"class":1574},[1259,5319,1578],{"class":1570},[1259,5321,5042],{"class":1574},[1259,5323,697],{"class":1570},[1259,5325,5326],{"class":1615},"split",[1259,5328,1618],{"class":1624},[1259,5330,1636],{"class":1570},[1259,5332,1169],{"class":1593},[1259,5334,1636],{"class":1570},[1259,5336,3205],{"class":1624},[1259,5338,697],{"class":1570},[1259,5340,5341],{"class":1615},"filter",[1259,5343,1618],{"class":1624},[1259,5345,5346],{"class":1574},"Boolean",[1259,5348,5349],{"class":1624},"))])\n",[1259,5351,5352,5354,5356,5358,5360,5362,5365,5368,5370,5372,5375,5377,5380,5382],{"class":1261,"line":1305},[1259,5353,4072],{"class":1566},[1259,5355,636],{"class":1624},[1259,5357,1658],{"class":1570},[1259,5359,1716],{"class":1574},[1259,5361,4081],{"class":1624},[1259,5363,5364],{"class":1566},"throw",[1259,5366,5367],{"class":1615}," createError",[1259,5369,1618],{"class":1624},[1259,5371,1621],{"class":1570},[1259,5373,5374],{"class":1624}," statusCode",[1259,5376,1628],{"class":1570},[1259,5378,5379],{"class":4089}," 404",[1259,5381,1584],{"class":1570},[1259,5383,1663],{"class":1624},[1259,5385,5386,5388,5391,5393,5395,5397,5400,5402],{"class":1261,"line":1311},[1259,5387,4001],{"class":1605},[1259,5389,5390],{"class":1574}," result",[1259,5392,1684],{"class":1570},[1259,5394,5181],{"class":1615},[1259,5396,1618],{"class":1624},[1259,5398,5399],{"class":1574},"input",[1259,5401,4081],{"class":1624},[1259,5403,5404],{"class":2438},"\u002F\u002F the page's tree, components, data and language, as above\n",[1259,5406,5407],{"class":1261,"line":1317},[1259,5408,5409],{"class":2438},"  \u002F\u002F A page that is the visitor's own: its JSON with `Cache-Control: private, no-store`, kept out of shared caches.\n",[1259,5411,5412,5414,5416,5418,5420,5422,5424,5426,5428,5430,5432,5434,5436,5438,5440],{"class":1261,"line":1323},[1259,5413,4097],{"class":1566},[1259,5415,1571],{"class":1570},[1259,5417,4102],{"class":1574},[1259,5419,1578],{"class":1570},[1259,5421,1678],{"class":1574},[1259,5423,1578],{"class":1570},[1259,5425,5390],{"class":1624},[1259,5427,1628],{"class":1570},[1259,5429,5190],{"class":1615},[1259,5431,1618],{"class":1624},[1259,5433,5223],{"class":1574},[1259,5435,1578],{"class":1570},[1259,5437,5390],{"class":1574},[1259,5439,4081],{"class":1624},[1259,5441,1398],{"class":1570},[1259,5443,5444,5446],{"class":1261,"line":1329},[1259,5445,2211],{"class":1570},[1259,5447,1663],{"class":1574},[881,5449,5450,5498,5528,5553,5869],{},[884,5451,5452,5453,5456,5457,5459,5460,5463,5464,862,5467,4205,5469,712,5472,712,5475,712,5478,5481,5482,5485,5486,5489,5490,5493,5494,5497],{},"The module registers ",[623,5454,5455],{},"\u003CShadeTree>"," everywhere, adds ",[623,5458,3462],{}," (off with ",[623,5461,5462],{},"shade: { css: false }","), and lets Nuxt compile SHADE's packages. It also tells Vue that SHADE's wrappers and widgets are custom elements (",[623,5465,5466],{},"SHADE_ELEMENTS",[623,5468,715],{},[623,5470,5471],{},"SHADE_ELEMENT_TAGS",[623,5473,5474],{},"shade-island",[623,5476,5477],{},"shade-code",[623,5479,5480],{},"shade-icon"," and the widgets of ",[623,5483,5484],{},"WIDGET_TAGS",", and no other ",[623,5487,5488],{},"shade-"," tag, so ",[623,5491,5492],{},"\u003Cshade-tree>"," and a site's own ",[623,5495,5496],{},"Shade…"," components stay components).",[884,5499,5500,651,5502,2825,5505,5509,5510,5512,5513,927,5515,5518,5519,5522,5523,712,5526,3495],{},[623,5501,1744],{},[623,5503,5504],{},"shadeHead",[628,5506,5507],{"href":522},[623,5508,715],{},"); resolve the page in the server route. ",[623,5511,1744],{}," sends a page that is the visitor's own with ",[623,5514,2840],{},[623,5516,5517],{},"shadeNoStore(event, result)"," sends the server route's JSON so, which the browser fetches on a client-side navigation. Fetch it with ",[623,5520,5521],{},"useRequestFetch()",", so the visitor's cookie reaches the route during server rendering. With ",[623,5524,5525],{},":interactions",[623,5527,1744],{},[884,5529,4255,5530,5532,5533,4264,5535,5538,5539,5542,5543,5546,5547,5549,5550,5552],{},[628,5531,3501],{"href":1898},"): in the server route, resolve with ",[623,5534,1884],{},[623,5536,5537],{},"result: await deferServerIslands(result)",". The module adds the island route itself (",[623,5540,5541],{},"GET \u002Fshade-island",", under ",[623,5544,5545],{},"app.baseURL",") and tells ",[623,5548,1744],{}," the base path; set ",[623,5551,2659],{}," at build time and on the server.",[884,5554,3589,5555,5557,5558,5560,5561,5563,5564,5567,5568,5571,5572,5575,5576,5846,5848,5851,5852,651,5854,5857,5858,5861,5862,5865,5866,5868],{},[628,5556,3593],{"href":3592},"): the module's server module gives the page at ",[623,5559,899],{}," (under ",[623,5562,5545],{},") its headers and, outside development, its policy, from what Nuxt wrote itself: the head and what Nuxt appends to the body (its payload and config), never the rendered body. The preview is rendered as one answer: a preview with ",[623,5565,5566],{},"streaming"," on in ",[623,5569,5570],{},"routeRules"," is refused. The page reads the draft from a server route that sends its JSON with the preview's headers (",[623,5573,5574],{},"shadePreviewHeaders(event)","):",[1250,5577,5579],{"className":1557,"code":5578,"language":1559,"meta":1255,"style":1255},"\u002F\u002F server\u002Fapi\u002Fshade-preview.get.ts\nimport { readPreview, shadeFromEnv, shadePreviewHeaders } from '@shadestack\u002Fnuxt'\nimport { renderPublishedPage } from '@shadestack\u002Fclient\u002Frender'\n\nexport default defineEventHandler(async (event) => {\n  shadePreviewHeaders(event)\n  const shade = shadeFromEnv()\n  const preview = await readPreview(shade, getQuery(event).token)\n  if (!('page' in preview)) throw createError({ statusCode: preview.status, statusMessage: preview.message })\n  const { result } = await renderPublishedPage(preview.page, { client: shade })\n  return { page: preview.page, result }\n})\n",[623,5580,5581,5586,5614,5633,5637,5659,5670,5682,5717,5778,5818,5840],{"__ignoreMap":1255},[1259,5582,5583],{"class":1261,"line":1262},[1259,5584,5585],{"class":2438},"\u002F\u002F server\u002Fapi\u002Fshade-preview.get.ts\n",[1259,5587,5588,5590,5592,5595,5597,5599,5601,5604,5606,5608,5610,5612],{"class":1261,"line":1268},[1259,5589,1567],{"class":1566},[1259,5591,1571],{"class":1570},[1259,5593,5594],{"class":1574}," readPreview",[1259,5596,1578],{"class":1570},[1259,5598,3957],{"class":1574},[1259,5600,1578],{"class":1570},[1259,5602,5603],{"class":1574}," shadePreviewHeaders",[1259,5605,1584],{"class":1570},[1259,5607,1587],{"class":1566},[1259,5609,1590],{"class":1570},[1259,5611,780],{"class":1593},[1259,5613,1596],{"class":1570},[1259,5615,5616,5618,5620,5623,5625,5627,5629,5631],{"class":1261,"line":1274},[1259,5617,1567],{"class":1566},[1259,5619,1571],{"class":1570},[1259,5621,5622],{"class":1574}," renderPublishedPage",[1259,5624,1584],{"class":1570},[1259,5626,1587],{"class":1566},[1259,5628,1590],{"class":1570},[1259,5630,1527],{"class":1593},[1259,5632,1596],{"class":1570},[1259,5634,5635],{"class":1261,"line":1280},[1259,5636,1284],{"emptyLinePlaceholder":1283},[1259,5638,5639,5641,5643,5645,5647,5649,5651,5653,5655,5657],{"class":1261,"line":1287},[1259,5640,2463],{"class":1566},[1259,5642,2466],{"class":1566},[1259,5644,5213],{"class":1615},[1259,5646,1618],{"class":1574},[1259,5648,5218],{"class":1605},[1259,5650,636],{"class":1570},[1259,5652,5223],{"class":3665},[1259,5654,3205],{"class":1570},[1259,5656,3676],{"class":1605},[1259,5658,3996],{"class":1570},[1259,5660,5661,5664,5666,5668],{"class":1261,"line":1293},[1259,5662,5663],{"class":1615},"  shadePreviewHeaders",[1259,5665,1618],{"class":1624},[1259,5667,5223],{"class":1574},[1259,5669,1663],{"class":1624},[1259,5671,5672,5674,5676,5678,5680],{"class":1261,"line":1299},[1259,5673,4001],{"class":1605},[1259,5675,1711],{"class":1574},[1259,5677,1684],{"class":1570},[1259,5679,3957],{"class":1615},[1259,5681,3559],{"class":1624},[1259,5683,5684,5686,5689,5691,5693,5695,5697,5699,5701,5704,5706,5708,5710,5712,5715],{"class":1261,"line":1305},[1259,5685,4001],{"class":1605},[1259,5687,5688],{"class":1574}," preview",[1259,5690,1684],{"class":1570},[1259,5692,1687],{"class":1566},[1259,5694,5594],{"class":1615},[1259,5696,1618],{"class":1624},[1259,5698,696],{"class":1574},[1259,5700,1578],{"class":1570},[1259,5702,5703],{"class":1615}," getQuery",[1259,5705,1618],{"class":1624},[1259,5707,5223],{"class":1574},[1259,5709,3205],{"class":1624},[1259,5711,697],{"class":1570},[1259,5713,5714],{"class":1574},"token",[1259,5716,1663],{"class":1624},[1259,5718,5719,5721,5723,5725,5727,5729,5731,5733,5736,5738,5741,5743,5745,5747,5749,5751,5753,5755,5757,5760,5762,5765,5767,5769,5771,5774,5776],{"class":1261,"line":1311},[1259,5720,4072],{"class":1566},[1259,5722,636],{"class":1624},[1259,5724,1658],{"class":1570},[1259,5726,1618],{"class":1624},[1259,5728,1636],{"class":1570},[1259,5730,1716],{"class":1593},[1259,5732,1636],{"class":1570},[1259,5734,5735],{"class":1570}," in",[1259,5737,5688],{"class":1574},[1259,5739,5740],{"class":1624},")) ",[1259,5742,5364],{"class":1566},[1259,5744,5367],{"class":1615},[1259,5746,1618],{"class":1624},[1259,5748,1621],{"class":1570},[1259,5750,5374],{"class":1624},[1259,5752,1628],{"class":1570},[1259,5754,5688],{"class":1574},[1259,5756,697],{"class":1570},[1259,5758,5759],{"class":1574},"status",[1259,5761,1578],{"class":1570},[1259,5763,5764],{"class":1624}," statusMessage",[1259,5766,1628],{"class":1570},[1259,5768,5688],{"class":1574},[1259,5770,697],{"class":1570},[1259,5772,5773],{"class":1574},"message",[1259,5775,1584],{"class":1570},[1259,5777,1663],{"class":1624},[1259,5779,5780,5782,5784,5786,5788,5790,5792,5794,5796,5799,5801,5803,5805,5807,5810,5812,5814,5816],{"class":1261,"line":1317},[1259,5781,4001],{"class":1605},[1259,5783,1571],{"class":1570},[1259,5785,5390],{"class":1574},[1259,5787,1584],{"class":1570},[1259,5789,1684],{"class":1570},[1259,5791,1687],{"class":1566},[1259,5793,5622],{"class":1615},[1259,5795,1618],{"class":1624},[1259,5797,5798],{"class":1574},"preview",[1259,5800,697],{"class":1570},[1259,5802,1716],{"class":1574},[1259,5804,1578],{"class":1570},[1259,5806,1571],{"class":1570},[1259,5808,5809],{"class":1624}," client",[1259,5811,1628],{"class":1570},[1259,5813,1711],{"class":1574},[1259,5815,1584],{"class":1570},[1259,5817,1663],{"class":1624},[1259,5819,5820,5822,5824,5826,5828,5830,5832,5834,5836,5838],{"class":1261,"line":1323},[1259,5821,4097],{"class":1566},[1259,5823,1571],{"class":1570},[1259,5825,1678],{"class":1624},[1259,5827,1628],{"class":1570},[1259,5829,5688],{"class":1574},[1259,5831,697],{"class":1570},[1259,5833,1716],{"class":1574},[1259,5835,1578],{"class":1570},[1259,5837,5390],{"class":1574},[1259,5839,4109],{"class":1570},[1259,5841,5842,5844],{"class":1261,"line":1329},[1259,5843,2211],{"class":1570},[1259,5845,1663],{"class":1574},[2215,5847],{},[623,5849,5850],{},"pages\u002Fpreview.vue"," fetches it with ",[623,5853,5521],{},[623,5855,5856],{},"useAsyncData",", passing ",[623,5859,5860],{},"route.query.token",", throws ",[623,5863,5864],{},"createError({ …, fatal: true })"," on an error, and renders ",[623,5867,1744],{}," like the page above.",[884,5870,5871,5872,5875,5876,5878,5879,712,5882,712,5885,5888,5889,5892,5893,5895,5896,5899],{},"The rebuild route: the module adds ",[623,5873,5874],{},"POST \u002Fshade-rebuild",", which takes ",[623,5877,2343],{}," and clears what Nitro cached of the site's pages: the route rules' cached answers (",[623,5880,5881],{},"cache",[623,5883,5884],{},"swr",[623,5886,5887],{},"isr"," on Nitro's own storage) and the cached handlers (",[623,5890,5891],{},"defineCachedEventHandler",", such as a cached ",[623,5894,5026],{},"). The next visit reads SHADE again. Other cached functions stay. A prerendered site (",[623,5897,5898],{},"nuxt generate",") and a host's own ISR cache need the host's deploy hook instead.",[619,5901,3007,5902,5905,5906,5909],{},[623,5903,5904],{},"starters\u002Fnuxt",". It reads SHADE through server routes of its own (",[623,5907,5908],{},"server\u002Fapi\u002F","), so the token stays on the server.",[2584,5911,5912],{},"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 .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 .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}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 .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}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 .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}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}",{"title":1255,"searchDepth":1268,"depth":1268,"links":5914},[5915,5916,5917,5921,5922,5923,5924,5925,5926,5927,5930],{"id":659,"depth":1268,"text":660},{"id":700,"depth":1268,"text":701},{"id":851,"depth":1268,"text":852,"children":5918},[5919,5920],{"id":938,"depth":1274,"text":939},{"id":1221,"depth":1274,"text":1222},{"id":1512,"depth":1268,"text":666},{"id":2248,"depth":1268,"text":2249},{"id":2421,"depth":1268,"text":706},{"id":3017,"depth":1268,"text":2784},{"id":3121,"depth":1268,"text":2772},{"id":3365,"depth":1268,"text":756},{"id":3888,"depth":1268,"text":807,"children":5928},[5929],{"id":4555,"depth":1274,"text":4556},{"id":4854,"depth":1268,"text":780},"md",null,{},{"title":502,"description":1255},"XLvYe3oK0A_DfFDRWihF8pepf68lUE20WyosmdAUxdE",[5937,5938],{"title":498,"path":499,"stem":500,"description":1255,"children":-1},{"title":509,"path":510,"stem":511,"description":1255,"children":-1},1796500156579]