[{"data":1,"prerenderedAt":484},["ShallowReactive",2],{"navigation_docs":3,"-docs-templates-publish":145,"-docs-templates-publish-surround":479},[4,8,12,16,51,81,103],{"title":5,"path":6,"stem":7},"Introduction","\u002Fdocs\u002Fintroduction","docs\u002F1.introduction",{"title":9,"path":10,"stem":11},"Getting started","\u002Fdocs\u002Fgetting-started","docs\u002F2.getting-started",{"title":13,"path":14,"stem":15},"Environment variables","\u002Fdocs\u002Fenvironment-variables","docs\u002F3.environment-variables",{"title":17,"icon":18,"path":19,"stem":20,"children":21,"page":50},"Guide","i-lucide-book-open","\u002Fdocs\u002Fguide","docs\u002F4.guide",[22,26,30,34,38,42,46],{"title":23,"path":24,"stem":25},"Scaffold a project","\u002Fdocs\u002Fguide\u002Fscaffold","docs\u002F4.guide\u002F1.scaffold",{"title":27,"path":28,"stem":29},"Pin and manage templates","\u002Fdocs\u002Fguide\u002Fpin","docs\u002F4.guide\u002F2.pin",{"title":31,"path":32,"stem":33},"Update pinned templates","\u002Fdocs\u002Fguide\u002Fupdating","docs\u002F4.guide\u002F3.updating",{"title":35,"path":36,"stem":37},"Find templates","\u002Fdocs\u002Fguide\u002Fsearch","docs\u002F4.guide\u002F4.search",{"title":39,"path":40,"stem":41},"Manage registries","\u002Fdocs\u002Fguide\u002Fregistry","docs\u002F4.guide\u002F5.registry",{"title":43,"path":44,"stem":45},"Troubleshooting","\u002Fdocs\u002Fguide\u002Ftroubleshooting","docs\u002F4.guide\u002F6.troubleshooting",{"title":47,"path":48,"stem":49},"Build your first template","\u002Fdocs\u002Fguide\u002Fcreate-template","docs\u002F4.guide\u002F7.create-template",false,{"title":52,"icon":53,"path":54,"stem":55,"children":56,"page":50},"Templates","i-lucide-layout-template","\u002Fdocs\u002Ftemplates","docs\u002F5.templates",[57,61,65,69,73,77],{"title":58,"path":59,"stem":60},"Template anatomy","\u002Fdocs\u002Ftemplates\u002Fanatomy","docs\u002F5.templates\u002F1.anatomy",{"title":62,"path":63,"stem":64},"Template params","\u002Fdocs\u002Ftemplates\u002Fparams","docs\u002F5.templates\u002F2.params",{"title":66,"path":67,"stem":68},"Template rendering","\u002Fdocs\u002Ftemplates\u002Ftemplate-rendering","docs\u002F5.templates\u002F3.template-rendering",{"title":70,"path":71,"stem":72},"Hooks","\u002Fdocs\u002Ftemplates\u002Fhooks","docs\u002F5.templates\u002F4.hooks",{"title":74,"path":75,"stem":76},"Publish a template","\u002Fdocs\u002Ftemplates\u002Fpublish","docs\u002F5.templates\u002F5.publish",{"title":78,"path":79,"stem":80},"spin.toml","\u002Fdocs\u002Ftemplates\u002Fspin-toml","docs\u002F5.templates\u002F6.spin-toml",{"title":82,"icon":83,"path":84,"stem":85,"children":86,"page":50},"Registries","i-lucide-database","\u002Fdocs\u002Fregistries","docs\u002F6.registries",[87,91,95,99],{"title":88,"path":89,"stem":90},"Registry anatomy","\u002Fdocs\u002Fregistries\u002Fanatomy","docs\u002F6.registries\u002F1.anatomy",{"title":92,"path":93,"stem":94},"Template metadata file","\u002Fdocs\u002Fregistries\u002Ftemplate-metadata","docs\u002F6.registries\u002F2.template-metadata",{"title":96,"path":97,"stem":98},"Run a registry","\u002Fdocs\u002Fregistries\u002Frun","docs\u002F6.registries\u002F3.run",{"title":100,"path":101,"stem":102},"registry.toml","\u002Fdocs\u002Fregistries\u002Fregistry-toml","docs\u002F6.registries\u002F4.registry-toml",{"title":104,"icon":105,"path":106,"stem":107,"children":108,"page":50},"Commands","i-lucide-terminal","\u002Fdocs\u002Fcommands","docs\u002F7.commands",[109,113,117,121,125,129,133,137,141],{"title":110,"path":111,"stem":112},"spin new","\u002Fdocs\u002Fcommands\u002Fnew","docs\u002F7.commands\u002F1.new",{"title":114,"path":115,"stem":116},"spin add","\u002Fdocs\u002Fcommands\u002Fadd","docs\u002F7.commands\u002F2.add",{"title":118,"path":119,"stem":120},"spin list","\u002Fdocs\u002Fcommands\u002Flist","docs\u002F7.commands\u002F3.list",{"title":122,"path":123,"stem":124},"spin update","\u002Fdocs\u002Fcommands\u002Fupdate","docs\u002F7.commands\u002F4.update",{"title":126,"path":127,"stem":128},"spin remove","\u002Fdocs\u002Fcommands\u002Fremove","docs\u002F7.commands\u002F5.remove",{"title":130,"path":131,"stem":132},"spin search","\u002Fdocs\u002Fcommands\u002Fsearch","docs\u002F7.commands\u002F6.search",{"title":134,"path":135,"stem":136},"spin registry","\u002Fdocs\u002Fcommands\u002Fregistry","docs\u002F7.commands\u002F7.registry",{"title":138,"path":139,"stem":140},"spin init","\u002Fdocs\u002Fcommands\u002Finit","docs\u002F7.commands\u002F8.init",{"title":142,"path":143,"stem":144},"spin version","\u002Fdocs\u002Fcommands\u002Fversion","docs\u002F7.commands\u002F9.version",{"id":146,"title":74,"body":147,"description":472,"extension":473,"links":474,"meta":475,"navigation":476,"path":75,"seo":477,"stem":76,"__hash__":478},"docs\u002Fdocs\u002F5.templates\u002F5.publish.md",{"type":148,"value":149,"toc":459},"minimark",[150,155,175,179,195,224,233,250,254,257,265,269,272,283,286,296,300,351,355,360,379,383,401,405,408,455],[151,152,154],"h2",{"id":153},"requirements","Requirements",[156,157,158,166,172],"ul",{},[159,160,161,162,165],"li",{},"A ",[163,164,78],"code",{}," file at the repository root.",[159,167,161,168,171],{},[163,169,170],{},"_base\u002F"," directory containing at least one file.",[159,173,174],{},"The template must render successfully using its default parameter values.",[151,176,178],{"id":177},"authoring-tips","Authoring tips",[180,181,182,186,187,190,191,194],"p",{},[183,184,185],"strong",{},"Param prompts."," Write prompts as questions the user can answer without reading the template source. Bad: ",[163,188,189],{},"name",". Good: ",[163,192,193],{},"What is your project name?",".",[180,196,197,200,201,204,205,208,209,212,213,216,217,220,221,194],{},[183,198,199],{},"Script naming."," Files in ",[163,202,203],{},"_pre\u002F"," and ",[163,206,207],{},"_post\u002F"," run sorted alphabetically after ",[163,210,211],{},"[[pre]]","\u002F",[163,214,215],{},"[[post]]"," inline steps. Prefix with numbers to control order: ",[163,218,219],{},"01-setup.sh",", ",[163,222,223],{},"02-init.sh",[180,225,226,229,230,232],{},[183,227,228],{},"Permissions."," Files keep their mode from ",[163,231,170],{},". Executable files stay executable. Set the permission bits before publishing.",[180,234,235,238,239,204,242,245,246,249],{},[183,236,237],{},"Test every param combination."," Run ",[163,240,241],{},"spin new --dry-run",[163,243,244],{},"--print-params"," with each ",[163,247,248],{},"--param"," variant to verify the template renders correctly before publishing.",[151,251,253],{"id":252},"versioning","Versioning",[180,255,256],{},"Use Git branches or tags to version your template.",[180,258,259,260,204,262,264],{},"By default, ",[163,261,110],{},[163,263,114],{}," shallow-clone the repository's default branch. If you want users to pin a specific version, publish stable branches or tags and reference them in the repository URL.",[151,266,268],{"id":267},"readme-conventions","README conventions",[180,270,271],{},"A template README should include:",[156,273,274,277,280],{},[159,275,276],{},"A short description.",[159,278,279],{},"A usage example.",[159,281,282],{},"The parameters users will be prompted for.",[180,284,285],{},"Example:",[287,288,294],"pre",{"className":289,"code":291,"language":292,"meta":293},[290],"language-text","# go-cli-template\n\nA minimal Go CLI starter for Spin.\n\n## Usage\n\nspin new myapp https:\u002F\u002Fgithub.com\u002Fexample\u002Fgo-cli-template.git\n\n## Parameters\n\n- project_name (default: myproject)\n- license (MIT, Apache-2.0, BSD-3-Clause, Proprietary)\n","text","",[163,295,291],{"__ignoreMap":293},[151,297,299],{"id":298},"testing-a-template-locally","Testing a template locally",[287,301,305],{"className":302,"code":303,"language":304,"meta":293,"style":293},"language-sh shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","spin new test-output --template .\u002Fmy-template --dry-run\nspin new test-output --template .\u002Fmy-template --param project_name=test\n","sh",[163,306,307,332],{"__ignoreMap":293},[308,309,312,316,320,323,326,329],"span",{"class":310,"line":311},"line",1,[308,313,315],{"class":314},"sBMFI","spin",[308,317,319],{"class":318},"sfazB"," new",[308,321,322],{"class":318}," test-output",[308,324,325],{"class":318}," --template",[308,327,328],{"class":318}," .\u002Fmy-template",[308,330,331],{"class":318}," --dry-run\n",[308,333,335,337,339,341,343,345,348],{"class":310,"line":334},2,[308,336,315],{"class":314},[308,338,319],{"class":318},[308,340,322],{"class":318},[308,342,325],{"class":318},[308,344,328],{"class":318},[308,346,347],{"class":318}," --param",[308,349,350],{"class":318}," project_name=test\n",[151,352,354],{"id":353},"distribution-options","Distribution options",[356,357,359],"h3",{"id":358},"git-repository","Git repository",[287,361,363],{"className":302,"code":362,"language":304,"meta":293,"style":293},"spin new myapp --template https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo.git\n",[163,364,365],{"__ignoreMap":293},[308,366,367,369,371,374,376],{"class":310,"line":311},[308,368,315],{"class":314},[308,370,319],{"class":318},[308,372,373],{"class":318}," myapp",[308,375,325],{"class":318},[308,377,378],{"class":318}," https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo.git\n",[356,380,382],{"id":381},"local-path","Local path",[287,384,386],{"className":302,"code":385,"language":304,"meta":293,"style":293},"spin new myapp --template ~\u002Ftemplates\u002Fmy-template\n",[163,387,388],{"__ignoreMap":293},[308,389,390,392,394,396,398],{"class":310,"line":311},[308,391,315],{"class":314},[308,393,319],{"class":318},[308,395,373],{"class":318},[308,397,325],{"class":318},[308,399,400],{"class":318}," ~\u002Ftemplates\u002Fmy-template\n",[356,402,404],{"id":403},"registry","Registry",[180,406,407],{},"Publish the template in a Spin registry so users can discover it with:",[287,409,411],{"className":302,"code":410,"language":304,"meta":293,"style":293},"spin search\nspin add \u003Cregistry>\u002F\u003Ctemplate>\n",[163,412,413,420],{"__ignoreMap":293},[308,414,415,417],{"class":310,"line":311},[308,416,315],{"class":314},[308,418,419],{"class":318}," search\n",[308,421,422,424,427,431,434,438,441,443,446,449,452],{"class":310,"line":334},[308,423,315],{"class":314},[308,425,426],{"class":318}," add",[308,428,430],{"class":429},"sMK4o"," \u003C",[308,432,433],{"class":318},"registr",[308,435,437],{"class":436},"sTEyZ","y",[308,439,440],{"class":429},">",[308,442,212],{"class":318},[308,444,445],{"class":429},"\u003C",[308,447,448],{"class":318},"templat",[308,450,451],{"class":436},"e",[308,453,454],{"class":429},">\n",[456,457,458],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}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 .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}",{"title":293,"searchDepth":334,"depth":334,"links":460},[461,462,463,464,465,466],{"id":153,"depth":334,"text":154},{"id":177,"depth":334,"text":178},{"id":252,"depth":334,"text":253},{"id":267,"depth":334,"text":268},{"id":298,"depth":334,"text":299},{"id":353,"depth":334,"text":354,"children":467},[468,470,471],{"id":358,"depth":469,"text":359},3,{"id":381,"depth":469,"text":382},{"id":403,"depth":469,"text":404},"A template is a normal directory or Git repository. Publish it by making it available at a URL or local path that others can pass to spin new or spin add.","md",null,{},true,{"title":74,"description":472},"JeNSV3HZFlxARjfooJ3wKn-54y3uFMHoqq9sdR6fjOU",[480,482],{"title":70,"path":71,"stem":72,"description":481,"children":-1},"Hooks are shell commands declared in spin.toml. They are rendered through text\u002Ftemplate with the resolved param values and run via sh -c in the generated pro...",{"title":78,"path":79,"stem":80,"description":483,"children":-1},"spin.toml lives at the root of every template. It describes the template and tells spin new what questions to ask and what files to render.",1787755180240]