[{"data":1,"prerenderedAt":3187},["Reactive",2],{"navigation":3,"docs-/recipes/transformers":164,"docs-/recipes/transformers-surround":1457},[4,20,45,67,92,102,115],{"title":5,"_path":6,"children":7},"Get Started","/get-started",[8,11,14,17],{"title":9,"_path":10},"Installation","/get-started/installation",{"title":12,"_path":13},"Configuration","/get-started/configuration",{"title":15,"_path":16},"Edge Channel","/get-started/edge-channel",{"title":18,"_path":19},"Migration","/get-started/from-v1",{"title":21,"_path":22,"children":23},"Usage","/usage",[24,27,30,33,36,39,42],{"title":25,"_path":26},"Content Directory","/usage/content-directory",{"title":28,"_path":29},"Markdown","/usage/markdown",{"title":31,"_path":32},"JSON, YAML, CSV","/usage/files",{"title":34,"_path":35},"Render Content","/usage/render",{"title":37,"_path":38},"Search","/usage/search",{"title":40,"_path":41},"Fetch Navigation","/usage/navigation",{"title":43,"_path":44},"TypeScript Support","/usage/typescript",{"title":46,"_path":47,"children":48},"Composables","/composables",[49,52,55,58,61,64],{"title":50,"_path":51},"queryContent()","/composables/query-content",{"title":53,"_path":54},"fetchContentNavigation()","/composables/fetch-content-navigation",{"title":56,"_path":57},"useContentHead()","/composables/use-content-head",{"title":59,"_path":60},"useContentHelpers()","/composables/use-content-helpers",{"title":62,"_path":63},"useUnwrap()","/composables/use-unwrap",{"title":65,"_path":66},"searchContent()","/composables/search-content",{"title":68,"_path":69,"children":70},"Components","/components",[71,74,77,80,83,86,89],{"title":72,"_path":73},"\u003CContentDoc>","/components/content-doc",{"title":75,"_path":76},"\u003CContentRenderer>","/components/content-renderer",{"title":78,"_path":79},"\u003CContentList>","/components/content-list",{"title":81,"_path":82},"\u003CContentNavigation>","/components/content-navigation",{"title":84,"_path":85},"\u003CContentQuery>","/components/content-query",{"title":87,"_path":88},"\u003CContentSlot>","/components/content-slot",{"title":90,"_path":91},"Prose Components","/components/prose",{"title":93,"_path":94,"children":95},"Document Driven","/document-driven",[96,99],{"title":97,"_path":98},"Introduction","/document-driven/introduction",{"title":100,"_path":101},"useContent()","/document-driven/use-content",{"title":103,"_path":104,"children":105},"Recipes","/recipes",[106,109,112],{"title":107,"_path":108},"Hooks","/recipes/hooks",{"title":110,"_path":111},"Transformers","/recipes/transformers",{"title":113,"_path":114},"Sitemap","/recipes/sitemap",{"title":116,"_path":117,"children":118},"V1","/v1",[119,141,154],{"title":120,"_path":121,"children":122},"Getting Started","/v1/getting-started",[123,125,127,130,133,136,138],{"title":97,"_path":124},"/v1/getting-started/introduction",{"title":9,"_path":126},"/v1/getting-started/installation",{"title":128,"_path":129},"Writing content","/v1/getting-started/writing",{"title":131,"_path":132},"Fetching content","/v1/getting-started/fetching",{"title":134,"_path":135},"Displaying content","/v1/getting-started/displaying",{"title":12,"_path":137},"/v1/getting-started/configuration",{"title":139,"_path":140},"Advanced","/v1/getting-started/advanced",{"title":142,"_path":143,"children":144},"Examples","/v1/examples",[145,148,151],{"title":146,"_path":147},"Basic Usage","/v1/examples/basic",{"title":149,"_path":150},"TailwindCSS","/v1/examples/tailwindcss-typography",{"title":152,"_path":153},"Docs Theme","/v1/examples/docs-theme",{"title":155,"_path":156,"children":157},"Community","/v1/community",[158,161],{"title":159,"_path":160},"Snippets","/v1/community/snippets",{"title":162,"_path":163},"Integrations","/v1/community/integrations",{"_path":111,"_dir":165,"_draft":166,"_partial":166,"_locale":167,"title":110,"description":168,"body":169,"_type":1452,"_id":1453,"_source":1454,"_file":1455,"_extension":1456},"recipes",false,"","Transformers are responsible for parsing and manipulating contents in Nuxt Content.",{"type":170,"children":171,"toc":1450},"root",[172,180,185,240,639,647,1199,1207,1433,1444],{"type":173,"tag":174,"props":175,"children":176},"element","p",{},[177],{"type":178,"value":179},"text","Nuxt Content has specific transformers for each content type to parse the raw content and prepare it for querying and rendering.",{"type":173,"tag":174,"props":181,"children":182},{},[183],{"type":178,"value":184},"You can create custom transformers to support new content types or improve functionalities of supported content types.",{"type":173,"tag":186,"props":187,"children":188},"ol",{},[189],{"type":173,"tag":190,"props":191,"children":192},"li",{},[193,195],{"type":178,"value":194},"Create your transformer. A transformer consists of 4 parts:\n",{"type":173,"tag":196,"props":197,"children":198},"ul",{},[199,210,220,230],{"type":173,"tag":190,"props":200,"children":201},{},[202,208],{"type":173,"tag":203,"props":204,"children":205},"code",{"className":167},[206],{"type":178,"value":207},"name",{"type":178,"value":209},": Transformer name.",{"type":173,"tag":190,"props":211,"children":212},{},[213,218],{"type":173,"tag":203,"props":214,"children":215},{"className":167},[216],{"type":178,"value":217},"extensions",{"type":178,"value":219},": List of valid file extensions.",{"type":173,"tag":190,"props":221,"children":222},{},[223,228],{"type":173,"tag":203,"props":224,"children":225},{"className":167},[226],{"type":178,"value":227},"parse",{"type":178,"value":229},": If provided, this function will be used to parse the raw content.",{"type":173,"tag":190,"props":231,"children":232},{},[233,238],{"type":173,"tag":203,"props":234,"children":235},{"className":167},[236],{"type":178,"value":237},"transform",{"type":178,"value":239},": Receives that parsed content and manipulates it.",{"type":173,"tag":241,"props":242,"children":247},"pre",{"className":243,"code":244,"filename":245,"language":246,"meta":167,"style":167},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","// filename: my-transformer.ts\nimport { defineTransformer } from '@nuxt/content/transformers'\n\nexport default defineTransformer({\n  name: 'my-transformer',\n  extensions: ['.names'],\n  parse (_id, rawContent) {\n    return {\n      _id,\n      body: rawContent.trim().split('\\n').map(line => line.trim()).sort()\n    }\n  }\n})\n\n","my-transformer.ts","ts",[248],{"type":173,"tag":203,"props":249,"children":250},{"__ignoreMap":167},[251,263,311,321,350,384,424,464,477,490,607,616,625],{"type":173,"tag":252,"props":253,"children":256},"span",{"class":254,"line":255},"line",1,[257],{"type":173,"tag":252,"props":258,"children":260},{"style":259},"--shiki-light:#90A4AE;--shiki-default:#546E7A;--shiki-dark:#676E95;--shiki-light-font-style:italic;--shiki-default-font-style:italic;--shiki-dark-font-style:italic",[261],{"type":178,"value":262},"// filename: my-transformer.ts\n",{"type":173,"tag":252,"props":264,"children":266},{"class":254,"line":265},2,[267,273,279,285,290,295,300,306],{"type":173,"tag":252,"props":268,"children":270},{"style":269},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF;--shiki-light-font-style:italic;--shiki-default-font-style:italic;--shiki-dark-font-style:italic",[271],{"type":178,"value":272},"import",{"type":173,"tag":252,"props":274,"children":276},{"style":275},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[277],{"type":178,"value":278}," {",{"type":173,"tag":252,"props":280,"children":282},{"style":281},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[283],{"type":178,"value":284}," defineTransformer",{"type":173,"tag":252,"props":286,"children":287},{"style":275},[288],{"type":178,"value":289}," }",{"type":173,"tag":252,"props":291,"children":292},{"style":269},[293],{"type":178,"value":294}," from",{"type":173,"tag":252,"props":296,"children":297},{"style":275},[298],{"type":178,"value":299}," '",{"type":173,"tag":252,"props":301,"children":303},{"style":302},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[304],{"type":178,"value":305},"@nuxt/content/transformers",{"type":173,"tag":252,"props":307,"children":308},{"style":275},[309],{"type":178,"value":310},"'\n",{"type":173,"tag":252,"props":312,"children":314},{"class":254,"line":313},3,[315],{"type":173,"tag":252,"props":316,"children":318},{"emptyLinePlaceholder":317},true,[319],{"type":178,"value":320},"\n",{"type":173,"tag":252,"props":322,"children":324},{"class":254,"line":323},4,[325,330,335,340,345],{"type":173,"tag":252,"props":326,"children":327},{"style":269},[328],{"type":178,"value":329},"export",{"type":173,"tag":252,"props":331,"children":332},{"style":269},[333],{"type":178,"value":334}," default",{"type":173,"tag":252,"props":336,"children":338},{"style":337},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[339],{"type":178,"value":284},{"type":173,"tag":252,"props":341,"children":342},{"style":281},[343],{"type":178,"value":344},"(",{"type":173,"tag":252,"props":346,"children":347},{"style":275},[348],{"type":178,"value":349},"{\n",{"type":173,"tag":252,"props":351,"children":353},{"class":254,"line":352},5,[354,360,365,369,374,379],{"type":173,"tag":252,"props":355,"children":357},{"style":356},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[358],{"type":178,"value":359},"  name",{"type":173,"tag":252,"props":361,"children":362},{"style":275},[363],{"type":178,"value":364},":",{"type":173,"tag":252,"props":366,"children":367},{"style":275},[368],{"type":178,"value":299},{"type":173,"tag":252,"props":370,"children":371},{"style":302},[372],{"type":178,"value":373},"my-transformer",{"type":173,"tag":252,"props":375,"children":376},{"style":275},[377],{"type":178,"value":378},"'",{"type":173,"tag":252,"props":380,"children":381},{"style":275},[382],{"type":178,"value":383},",\n",{"type":173,"tag":252,"props":385,"children":387},{"class":254,"line":386},6,[388,393,397,402,406,411,415,420],{"type":173,"tag":252,"props":389,"children":390},{"style":356},[391],{"type":178,"value":392},"  extensions",{"type":173,"tag":252,"props":394,"children":395},{"style":275},[396],{"type":178,"value":364},{"type":173,"tag":252,"props":398,"children":399},{"style":281},[400],{"type":178,"value":401}," [",{"type":173,"tag":252,"props":403,"children":404},{"style":275},[405],{"type":178,"value":378},{"type":173,"tag":252,"props":407,"children":408},{"style":302},[409],{"type":178,"value":410},".names",{"type":173,"tag":252,"props":412,"children":413},{"style":275},[414],{"type":178,"value":378},{"type":173,"tag":252,"props":416,"children":417},{"style":281},[418],{"type":178,"value":419},"]",{"type":173,"tag":252,"props":421,"children":422},{"style":275},[423],{"type":178,"value":383},{"type":173,"tag":252,"props":425,"children":427},{"class":254,"line":426},7,[428,433,438,444,449,454,459],{"type":173,"tag":252,"props":429,"children":430},{"style":356},[431],{"type":178,"value":432},"  parse",{"type":173,"tag":252,"props":434,"children":435},{"style":275},[436],{"type":178,"value":437}," (",{"type":173,"tag":252,"props":439,"children":441},{"style":440},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8;--shiki-light-font-style:italic;--shiki-default-font-style:italic;--shiki-dark-font-style:italic",[442],{"type":178,"value":443},"_id",{"type":173,"tag":252,"props":445,"children":446},{"style":275},[447],{"type":178,"value":448},",",{"type":173,"tag":252,"props":450,"children":451},{"style":440},[452],{"type":178,"value":453}," rawContent",{"type":173,"tag":252,"props":455,"children":456},{"style":275},[457],{"type":178,"value":458},")",{"type":173,"tag":252,"props":460,"children":461},{"style":275},[462],{"type":178,"value":463}," {\n",{"type":173,"tag":252,"props":465,"children":467},{"class":254,"line":466},8,[468,473],{"type":173,"tag":252,"props":469,"children":470},{"style":269},[471],{"type":178,"value":472},"    return",{"type":173,"tag":252,"props":474,"children":475},{"style":275},[476],{"type":178,"value":463},{"type":173,"tag":252,"props":478,"children":480},{"class":254,"line":479},9,[481,486],{"type":173,"tag":252,"props":482,"children":483},{"style":281},[484],{"type":178,"value":485},"      _id",{"type":173,"tag":252,"props":487,"children":488},{"style":275},[489],{"type":178,"value":383},{"type":173,"tag":252,"props":491,"children":493},{"class":254,"line":492},10,[494,499,503,507,512,517,522,526,531,535,539,544,548,552,556,561,565,569,575,580,584,588,593,597,602],{"type":173,"tag":252,"props":495,"children":496},{"style":356},[497],{"type":178,"value":498},"      body",{"type":173,"tag":252,"props":500,"children":501},{"style":275},[502],{"type":178,"value":364},{"type":173,"tag":252,"props":504,"children":505},{"style":281},[506],{"type":178,"value":453},{"type":173,"tag":252,"props":508,"children":509},{"style":275},[510],{"type":178,"value":511},".",{"type":173,"tag":252,"props":513,"children":514},{"style":337},[515],{"type":178,"value":516},"trim",{"type":173,"tag":252,"props":518,"children":519},{"style":356},[520],{"type":178,"value":521},"()",{"type":173,"tag":252,"props":523,"children":524},{"style":275},[525],{"type":178,"value":511},{"type":173,"tag":252,"props":527,"children":528},{"style":337},[529],{"type":178,"value":530},"split",{"type":173,"tag":252,"props":532,"children":533},{"style":356},[534],{"type":178,"value":344},{"type":173,"tag":252,"props":536,"children":537},{"style":275},[538],{"type":178,"value":378},{"type":173,"tag":252,"props":540,"children":541},{"style":281},[542],{"type":178,"value":543},"\\n",{"type":173,"tag":252,"props":545,"children":546},{"style":275},[547],{"type":178,"value":378},{"type":173,"tag":252,"props":549,"children":550},{"style":356},[551],{"type":178,"value":458},{"type":173,"tag":252,"props":553,"children":554},{"style":275},[555],{"type":178,"value":511},{"type":173,"tag":252,"props":557,"children":558},{"style":337},[559],{"type":178,"value":560},"map",{"type":173,"tag":252,"props":562,"children":563},{"style":356},[564],{"type":178,"value":344},{"type":173,"tag":252,"props":566,"children":567},{"style":440},[568],{"type":178,"value":254},{"type":173,"tag":252,"props":570,"children":572},{"style":571},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[573],{"type":178,"value":574}," =>",{"type":173,"tag":252,"props":576,"children":577},{"style":281},[578],{"type":178,"value":579}," line",{"type":173,"tag":252,"props":581,"children":582},{"style":275},[583],{"type":178,"value":511},{"type":173,"tag":252,"props":585,"children":586},{"style":337},[587],{"type":178,"value":516},{"type":173,"tag":252,"props":589,"children":590},{"style":356},[591],{"type":178,"value":592},"())",{"type":173,"tag":252,"props":594,"children":595},{"style":275},[596],{"type":178,"value":511},{"type":173,"tag":252,"props":598,"children":599},{"style":337},[600],{"type":178,"value":601},"sort",{"type":173,"tag":252,"props":603,"children":604},{"style":356},[605],{"type":178,"value":606},"()\n",{"type":173,"tag":252,"props":608,"children":610},{"class":254,"line":609},11,[611],{"type":173,"tag":252,"props":612,"children":613},{"style":275},[614],{"type":178,"value":615},"    }\n",{"type":173,"tag":252,"props":617,"children":619},{"class":254,"line":618},12,[620],{"type":173,"tag":252,"props":621,"children":622},{"style":275},[623],{"type":178,"value":624},"  }\n",{"type":173,"tag":252,"props":626,"children":628},{"class":254,"line":627},13,[629,634],{"type":173,"tag":252,"props":630,"children":631},{"style":275},[632],{"type":178,"value":633},"}",{"type":173,"tag":252,"props":635,"children":636},{"style":281},[637],{"type":178,"value":638},")\n",{"type":173,"tag":186,"props":640,"children":641},{"start":265},[642],{"type":173,"tag":190,"props":643,"children":644},{},[645],{"type":178,"value":646},"Define simple module to register transformer",{"type":173,"tag":241,"props":648,"children":651},{"className":243,"code":649,"filename":650,"language":246,"meta":167,"style":167},"// filename: my-module.mjs\nimport { resolve } from 'path'\nimport { defineNuxtModule } from '@nuxt/kit'\n\nexport default defineNuxtModule({\n  setup (_options, nuxt) {\n    nuxt.options.nitro.externals = nuxt.options.nitro.externals || {}\n    nuxt.options.nitro.externals.inline = nuxt.options.nitro.externals.inline || []\n    nuxt.options.nitro.externals.inline.push(resolve('./my-module'))\n    // @ts-ignore\n    nuxt.hook('content:context', (contentContext) => {\n      contentContext.transformers.push(resolve('./my-module/my-transformer.ts'))\n    })\n  }\n})\n\n","my-module.mjs",[652],{"type":173,"tag":203,"props":653,"children":654},{"__ignoreMap":167},[655,663,700,737,744,767,801,879,968,1047,1055,1113,1167,1179,1187],{"type":173,"tag":252,"props":656,"children":657},{"class":254,"line":255},[658],{"type":173,"tag":252,"props":659,"children":660},{"style":259},[661],{"type":178,"value":662},"// filename: my-module.mjs\n",{"type":173,"tag":252,"props":664,"children":665},{"class":254,"line":265},[666,670,674,679,683,687,691,696],{"type":173,"tag":252,"props":667,"children":668},{"style":269},[669],{"type":178,"value":272},{"type":173,"tag":252,"props":671,"children":672},{"style":275},[673],{"type":178,"value":278},{"type":173,"tag":252,"props":675,"children":676},{"style":281},[677],{"type":178,"value":678}," resolve",{"type":173,"tag":252,"props":680,"children":681},{"style":275},[682],{"type":178,"value":289},{"type":173,"tag":252,"props":684,"children":685},{"style":269},[686],{"type":178,"value":294},{"type":173,"tag":252,"props":688,"children":689},{"style":275},[690],{"type":178,"value":299},{"type":173,"tag":252,"props":692,"children":693},{"style":302},[694],{"type":178,"value":695},"path",{"type":173,"tag":252,"props":697,"children":698},{"style":275},[699],{"type":178,"value":310},{"type":173,"tag":252,"props":701,"children":702},{"class":254,"line":313},[703,707,711,716,720,724,728,733],{"type":173,"tag":252,"props":704,"children":705},{"style":269},[706],{"type":178,"value":272},{"type":173,"tag":252,"props":708,"children":709},{"style":275},[710],{"type":178,"value":278},{"type":173,"tag":252,"props":712,"children":713},{"style":281},[714],{"type":178,"value":715}," defineNuxtModule",{"type":173,"tag":252,"props":717,"children":718},{"style":275},[719],{"type":178,"value":289},{"type":173,"tag":252,"props":721,"children":722},{"style":269},[723],{"type":178,"value":294},{"type":173,"tag":252,"props":725,"children":726},{"style":275},[727],{"type":178,"value":299},{"type":173,"tag":252,"props":729,"children":730},{"style":302},[731],{"type":178,"value":732},"@nuxt/kit",{"type":173,"tag":252,"props":734,"children":735},{"style":275},[736],{"type":178,"value":310},{"type":173,"tag":252,"props":738,"children":739},{"class":254,"line":323},[740],{"type":173,"tag":252,"props":741,"children":742},{"emptyLinePlaceholder":317},[743],{"type":178,"value":320},{"type":173,"tag":252,"props":745,"children":746},{"class":254,"line":352},[747,751,755,759,763],{"type":173,"tag":252,"props":748,"children":749},{"style":269},[750],{"type":178,"value":329},{"type":173,"tag":252,"props":752,"children":753},{"style":269},[754],{"type":178,"value":334},{"type":173,"tag":252,"props":756,"children":757},{"style":337},[758],{"type":178,"value":715},{"type":173,"tag":252,"props":760,"children":761},{"style":281},[762],{"type":178,"value":344},{"type":173,"tag":252,"props":764,"children":765},{"style":275},[766],{"type":178,"value":349},{"type":173,"tag":252,"props":768,"children":769},{"class":254,"line":386},[770,775,779,784,788,793,797],{"type":173,"tag":252,"props":771,"children":772},{"style":356},[773],{"type":178,"value":774},"  setup",{"type":173,"tag":252,"props":776,"children":777},{"style":275},[778],{"type":178,"value":437},{"type":173,"tag":252,"props":780,"children":781},{"style":440},[782],{"type":178,"value":783},"_options",{"type":173,"tag":252,"props":785,"children":786},{"style":275},[787],{"type":178,"value":448},{"type":173,"tag":252,"props":789,"children":790},{"style":440},[791],{"type":178,"value":792}," nuxt",{"type":173,"tag":252,"props":794,"children":795},{"style":275},[796],{"type":178,"value":458},{"type":173,"tag":252,"props":798,"children":799},{"style":275},[800],{"type":178,"value":463},{"type":173,"tag":252,"props":802,"children":803},{"class":254,"line":426},[804,809,813,818,822,827,831,836,841,845,849,853,857,861,865,869,874],{"type":173,"tag":252,"props":805,"children":806},{"style":281},[807],{"type":178,"value":808},"    nuxt",{"type":173,"tag":252,"props":810,"children":811},{"style":275},[812],{"type":178,"value":511},{"type":173,"tag":252,"props":814,"children":815},{"style":281},[816],{"type":178,"value":817},"options",{"type":173,"tag":252,"props":819,"children":820},{"style":275},[821],{"type":178,"value":511},{"type":173,"tag":252,"props":823,"children":824},{"style":281},[825],{"type":178,"value":826},"nitro",{"type":173,"tag":252,"props":828,"children":829},{"style":275},[830],{"type":178,"value":511},{"type":173,"tag":252,"props":832,"children":833},{"style":281},[834],{"type":178,"value":835},"externals",{"type":173,"tag":252,"props":837,"children":838},{"style":275},[839],{"type":178,"value":840}," =",{"type":173,"tag":252,"props":842,"children":843},{"style":281},[844],{"type":178,"value":792},{"type":173,"tag":252,"props":846,"children":847},{"style":275},[848],{"type":178,"value":511},{"type":173,"tag":252,"props":850,"children":851},{"style":281},[852],{"type":178,"value":817},{"type":173,"tag":252,"props":854,"children":855},{"style":275},[856],{"type":178,"value":511},{"type":173,"tag":252,"props":858,"children":859},{"style":281},[860],{"type":178,"value":826},{"type":173,"tag":252,"props":862,"children":863},{"style":275},[864],{"type":178,"value":511},{"type":173,"tag":252,"props":866,"children":867},{"style":281},[868],{"type":178,"value":835},{"type":173,"tag":252,"props":870,"children":871},{"style":275},[872],{"type":178,"value":873}," ||",{"type":173,"tag":252,"props":875,"children":876},{"style":275},[877],{"type":178,"value":878}," {}\n",{"type":173,"tag":252,"props":880,"children":881},{"class":254,"line":466},[882,886,890,894,898,902,906,910,914,919,923,927,931,935,939,943,947,951,955,959,963],{"type":173,"tag":252,"props":883,"children":884},{"style":281},[885],{"type":178,"value":808},{"type":173,"tag":252,"props":887,"children":888},{"style":275},[889],{"type":178,"value":511},{"type":173,"tag":252,"props":891,"children":892},{"style":281},[893],{"type":178,"value":817},{"type":173,"tag":252,"props":895,"children":896},{"style":275},[897],{"type":178,"value":511},{"type":173,"tag":252,"props":899,"children":900},{"style":281},[901],{"type":178,"value":826},{"type":173,"tag":252,"props":903,"children":904},{"style":275},[905],{"type":178,"value":511},{"type":173,"tag":252,"props":907,"children":908},{"style":281},[909],{"type":178,"value":835},{"type":173,"tag":252,"props":911,"children":912},{"style":275},[913],{"type":178,"value":511},{"type":173,"tag":252,"props":915,"children":916},{"style":281},[917],{"type":178,"value":918},"inline",{"type":173,"tag":252,"props":920,"children":921},{"style":275},[922],{"type":178,"value":840},{"type":173,"tag":252,"props":924,"children":925},{"style":281},[926],{"type":178,"value":792},{"type":173,"tag":252,"props":928,"children":929},{"style":275},[930],{"type":178,"value":511},{"type":173,"tag":252,"props":932,"children":933},{"style":281},[934],{"type":178,"value":817},{"type":173,"tag":252,"props":936,"children":937},{"style":275},[938],{"type":178,"value":511},{"type":173,"tag":252,"props":940,"children":941},{"style":281},[942],{"type":178,"value":826},{"type":173,"tag":252,"props":944,"children":945},{"style":275},[946],{"type":178,"value":511},{"type":173,"tag":252,"props":948,"children":949},{"style":281},[950],{"type":178,"value":835},{"type":173,"tag":252,"props":952,"children":953},{"style":275},[954],{"type":178,"value":511},{"type":173,"tag":252,"props":956,"children":957},{"style":281},[958],{"type":178,"value":918},{"type":173,"tag":252,"props":960,"children":961},{"style":275},[962],{"type":178,"value":873},{"type":173,"tag":252,"props":964,"children":965},{"style":356},[966],{"type":178,"value":967}," []\n",{"type":173,"tag":252,"props":969,"children":970},{"class":254,"line":479},[971,975,979,983,987,991,995,999,1003,1007,1011,1016,1020,1025,1029,1033,1038,1042],{"type":173,"tag":252,"props":972,"children":973},{"style":281},[974],{"type":178,"value":808},{"type":173,"tag":252,"props":976,"children":977},{"style":275},[978],{"type":178,"value":511},{"type":173,"tag":252,"props":980,"children":981},{"style":281},[982],{"type":178,"value":817},{"type":173,"tag":252,"props":984,"children":985},{"style":275},[986],{"type":178,"value":511},{"type":173,"tag":252,"props":988,"children":989},{"style":281},[990],{"type":178,"value":826},{"type":173,"tag":252,"props":992,"children":993},{"style":275},[994],{"type":178,"value":511},{"type":173,"tag":252,"props":996,"children":997},{"style":281},[998],{"type":178,"value":835},{"type":173,"tag":252,"props":1000,"children":1001},{"style":275},[1002],{"type":178,"value":511},{"type":173,"tag":252,"props":1004,"children":1005},{"style":281},[1006],{"type":178,"value":918},{"type":173,"tag":252,"props":1008,"children":1009},{"style":275},[1010],{"type":178,"value":511},{"type":173,"tag":252,"props":1012,"children":1013},{"style":337},[1014],{"type":178,"value":1015},"push",{"type":173,"tag":252,"props":1017,"children":1018},{"style":356},[1019],{"type":178,"value":344},{"type":173,"tag":252,"props":1021,"children":1022},{"style":337},[1023],{"type":178,"value":1024},"resolve",{"type":173,"tag":252,"props":1026,"children":1027},{"style":356},[1028],{"type":178,"value":344},{"type":173,"tag":252,"props":1030,"children":1031},{"style":275},[1032],{"type":178,"value":378},{"type":173,"tag":252,"props":1034,"children":1035},{"style":302},[1036],{"type":178,"value":1037},"./my-module",{"type":173,"tag":252,"props":1039,"children":1040},{"style":275},[1041],{"type":178,"value":378},{"type":173,"tag":252,"props":1043,"children":1044},{"style":356},[1045],{"type":178,"value":1046},"))\n",{"type":173,"tag":252,"props":1048,"children":1049},{"class":254,"line":492},[1050],{"type":173,"tag":252,"props":1051,"children":1052},{"style":259},[1053],{"type":178,"value":1054},"    // @ts-ignore\n",{"type":173,"tag":252,"props":1056,"children":1057},{"class":254,"line":609},[1058,1062,1066,1071,1075,1079,1084,1088,1092,1096,1101,1105,1109],{"type":173,"tag":252,"props":1059,"children":1060},{"style":281},[1061],{"type":178,"value":808},{"type":173,"tag":252,"props":1063,"children":1064},{"style":275},[1065],{"type":178,"value":511},{"type":173,"tag":252,"props":1067,"children":1068},{"style":337},[1069],{"type":178,"value":1070},"hook",{"type":173,"tag":252,"props":1072,"children":1073},{"style":356},[1074],{"type":178,"value":344},{"type":173,"tag":252,"props":1076,"children":1077},{"style":275},[1078],{"type":178,"value":378},{"type":173,"tag":252,"props":1080,"children":1081},{"style":302},[1082],{"type":178,"value":1083},"content:context",{"type":173,"tag":252,"props":1085,"children":1086},{"style":275},[1087],{"type":178,"value":378},{"type":173,"tag":252,"props":1089,"children":1090},{"style":275},[1091],{"type":178,"value":448},{"type":173,"tag":252,"props":1093,"children":1094},{"style":275},[1095],{"type":178,"value":437},{"type":173,"tag":252,"props":1097,"children":1098},{"style":440},[1099],{"type":178,"value":1100},"contentContext",{"type":173,"tag":252,"props":1102,"children":1103},{"style":275},[1104],{"type":178,"value":458},{"type":173,"tag":252,"props":1106,"children":1107},{"style":571},[1108],{"type":178,"value":574},{"type":173,"tag":252,"props":1110,"children":1111},{"style":275},[1112],{"type":178,"value":463},{"type":173,"tag":252,"props":1114,"children":1115},{"class":254,"line":618},[1116,1121,1125,1130,1134,1138,1142,1146,1150,1154,1159,1163],{"type":173,"tag":252,"props":1117,"children":1118},{"style":281},[1119],{"type":178,"value":1120},"      contentContext",{"type":173,"tag":252,"props":1122,"children":1123},{"style":275},[1124],{"type":178,"value":511},{"type":173,"tag":252,"props":1126,"children":1127},{"style":281},[1128],{"type":178,"value":1129},"transformers",{"type":173,"tag":252,"props":1131,"children":1132},{"style":275},[1133],{"type":178,"value":511},{"type":173,"tag":252,"props":1135,"children":1136},{"style":337},[1137],{"type":178,"value":1015},{"type":173,"tag":252,"props":1139,"children":1140},{"style":356},[1141],{"type":178,"value":344},{"type":173,"tag":252,"props":1143,"children":1144},{"style":337},[1145],{"type":178,"value":1024},{"type":173,"tag":252,"props":1147,"children":1148},{"style":356},[1149],{"type":178,"value":344},{"type":173,"tag":252,"props":1151,"children":1152},{"style":275},[1153],{"type":178,"value":378},{"type":173,"tag":252,"props":1155,"children":1156},{"style":302},[1157],{"type":178,"value":1158},"./my-module/my-transformer.ts",{"type":173,"tag":252,"props":1160,"children":1161},{"style":275},[1162],{"type":178,"value":378},{"type":173,"tag":252,"props":1164,"children":1165},{"style":356},[1166],{"type":178,"value":1046},{"type":173,"tag":252,"props":1168,"children":1169},{"class":254,"line":627},[1170,1175],{"type":173,"tag":252,"props":1171,"children":1172},{"style":275},[1173],{"type":178,"value":1174},"    }",{"type":173,"tag":252,"props":1176,"children":1177},{"style":356},[1178],{"type":178,"value":638},{"type":173,"tag":252,"props":1180,"children":1182},{"class":254,"line":1181},14,[1183],{"type":173,"tag":252,"props":1184,"children":1185},{"style":275},[1186],{"type":178,"value":624},{"type":173,"tag":252,"props":1188,"children":1190},{"class":254,"line":1189},15,[1191,1195],{"type":173,"tag":252,"props":1192,"children":1193},{"style":275},[1194],{"type":178,"value":633},{"type":173,"tag":252,"props":1196,"children":1197},{"style":281},[1198],{"type":178,"value":638},{"type":173,"tag":186,"props":1200,"children":1201},{"start":313},[1202],{"type":173,"tag":190,"props":1203,"children":1204},{},[1205],{"type":178,"value":1206},"Register your module",{"type":173,"tag":241,"props":1208,"children":1211},{"className":243,"code":1209,"filename":1210,"language":246,"meta":167,"style":167},"// filename: my-module.mjs\nimport { resolve } from 'path'\nimport { defineNuxtConfig } from '@nuxt/kit'\nimport MyModule from './my-module'\n\nexport default defineNuxtConfig({\n  modules: [\n    // always put it before @nuxt/content because the transformers \n    // needs to be loaded before transformation occurs\n    MyModule,\n    '@nuxt/content'\n  ]\n})\n","nuxt.config.ts",[1212],{"type":173,"tag":203,"props":1213,"children":1214},{"__ignoreMap":167},[1215,1222,1257,1293,1322,1329,1352,1369,1377,1385,1397,1414,1422],{"type":173,"tag":252,"props":1216,"children":1217},{"class":254,"line":255},[1218],{"type":173,"tag":252,"props":1219,"children":1220},{"style":259},[1221],{"type":178,"value":662},{"type":173,"tag":252,"props":1223,"children":1224},{"class":254,"line":265},[1225,1229,1233,1237,1241,1245,1249,1253],{"type":173,"tag":252,"props":1226,"children":1227},{"style":269},[1228],{"type":178,"value":272},{"type":173,"tag":252,"props":1230,"children":1231},{"style":275},[1232],{"type":178,"value":278},{"type":173,"tag":252,"props":1234,"children":1235},{"style":281},[1236],{"type":178,"value":678},{"type":173,"tag":252,"props":1238,"children":1239},{"style":275},[1240],{"type":178,"value":289},{"type":173,"tag":252,"props":1242,"children":1243},{"style":269},[1244],{"type":178,"value":294},{"type":173,"tag":252,"props":1246,"children":1247},{"style":275},[1248],{"type":178,"value":299},{"type":173,"tag":252,"props":1250,"children":1251},{"style":302},[1252],{"type":178,"value":695},{"type":173,"tag":252,"props":1254,"children":1255},{"style":275},[1256],{"type":178,"value":310},{"type":173,"tag":252,"props":1258,"children":1259},{"class":254,"line":313},[1260,1264,1268,1273,1277,1281,1285,1289],{"type":173,"tag":252,"props":1261,"children":1262},{"style":269},[1263],{"type":178,"value":272},{"type":173,"tag":252,"props":1265,"children":1266},{"style":275},[1267],{"type":178,"value":278},{"type":173,"tag":252,"props":1269,"children":1270},{"style":281},[1271],{"type":178,"value":1272}," defineNuxtConfig",{"type":173,"tag":252,"props":1274,"children":1275},{"style":275},[1276],{"type":178,"value":289},{"type":173,"tag":252,"props":1278,"children":1279},{"style":269},[1280],{"type":178,"value":294},{"type":173,"tag":252,"props":1282,"children":1283},{"style":275},[1284],{"type":178,"value":299},{"type":173,"tag":252,"props":1286,"children":1287},{"style":302},[1288],{"type":178,"value":732},{"type":173,"tag":252,"props":1290,"children":1291},{"style":275},[1292],{"type":178,"value":310},{"type":173,"tag":252,"props":1294,"children":1295},{"class":254,"line":323},[1296,1300,1305,1310,1314,1318],{"type":173,"tag":252,"props":1297,"children":1298},{"style":269},[1299],{"type":178,"value":272},{"type":173,"tag":252,"props":1301,"children":1302},{"style":281},[1303],{"type":178,"value":1304}," MyModule ",{"type":173,"tag":252,"props":1306,"children":1307},{"style":269},[1308],{"type":178,"value":1309},"from",{"type":173,"tag":252,"props":1311,"children":1312},{"style":275},[1313],{"type":178,"value":299},{"type":173,"tag":252,"props":1315,"children":1316},{"style":302},[1317],{"type":178,"value":1037},{"type":173,"tag":252,"props":1319,"children":1320},{"style":275},[1321],{"type":178,"value":310},{"type":173,"tag":252,"props":1323,"children":1324},{"class":254,"line":352},[1325],{"type":173,"tag":252,"props":1326,"children":1327},{"emptyLinePlaceholder":317},[1328],{"type":178,"value":320},{"type":173,"tag":252,"props":1330,"children":1331},{"class":254,"line":386},[1332,1336,1340,1344,1348],{"type":173,"tag":252,"props":1333,"children":1334},{"style":269},[1335],{"type":178,"value":329},{"type":173,"tag":252,"props":1337,"children":1338},{"style":269},[1339],{"type":178,"value":334},{"type":173,"tag":252,"props":1341,"children":1342},{"style":337},[1343],{"type":178,"value":1272},{"type":173,"tag":252,"props":1345,"children":1346},{"style":281},[1347],{"type":178,"value":344},{"type":173,"tag":252,"props":1349,"children":1350},{"style":275},[1351],{"type":178,"value":349},{"type":173,"tag":252,"props":1353,"children":1354},{"class":254,"line":426},[1355,1360,1364],{"type":173,"tag":252,"props":1356,"children":1357},{"style":356},[1358],{"type":178,"value":1359},"  modules",{"type":173,"tag":252,"props":1361,"children":1362},{"style":275},[1363],{"type":178,"value":364},{"type":173,"tag":252,"props":1365,"children":1366},{"style":281},[1367],{"type":178,"value":1368}," [\n",{"type":173,"tag":252,"props":1370,"children":1371},{"class":254,"line":466},[1372],{"type":173,"tag":252,"props":1373,"children":1374},{"style":259},[1375],{"type":178,"value":1376},"    // always put it before @nuxt/content because the transformers \n",{"type":173,"tag":252,"props":1378,"children":1379},{"class":254,"line":479},[1380],{"type":173,"tag":252,"props":1381,"children":1382},{"style":259},[1383],{"type":178,"value":1384},"    // needs to be loaded before transformation occurs\n",{"type":173,"tag":252,"props":1386,"children":1387},{"class":254,"line":492},[1388,1393],{"type":173,"tag":252,"props":1389,"children":1390},{"style":281},[1391],{"type":178,"value":1392},"    MyModule",{"type":173,"tag":252,"props":1394,"children":1395},{"style":275},[1396],{"type":178,"value":383},{"type":173,"tag":252,"props":1398,"children":1399},{"class":254,"line":609},[1400,1405,1410],{"type":173,"tag":252,"props":1401,"children":1402},{"style":275},[1403],{"type":178,"value":1404},"    '",{"type":173,"tag":252,"props":1406,"children":1407},{"style":302},[1408],{"type":178,"value":1409},"@nuxt/content",{"type":173,"tag":252,"props":1411,"children":1412},{"style":275},[1413],{"type":178,"value":310},{"type":173,"tag":252,"props":1415,"children":1416},{"class":254,"line":618},[1417],{"type":173,"tag":252,"props":1418,"children":1419},{"style":281},[1420],{"type":178,"value":1421},"  ]\n",{"type":173,"tag":252,"props":1423,"children":1424},{"class":254,"line":627},[1425,1429],{"type":173,"tag":252,"props":1426,"children":1427},{"style":275},[1428],{"type":178,"value":633},{"type":173,"tag":252,"props":1430,"children":1431},{"style":281},[1432],{"type":178,"value":638},{"type":173,"tag":174,"props":1434,"children":1435},{},[1436,1438,1442],{"type":178,"value":1437},"That's it. You can create ",{"type":173,"tag":203,"props":1439,"children":1440},{"className":167},[1441],{"type":178,"value":410},{"type":178,"value":1443}," files in content directory. Checkout transformer example.",{"type":173,"tag":1445,"props":1446,"children":1447},"style",{},[1448],{"type":178,"value":1449},"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 .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.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 .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);}",{"title":167,"searchDepth":265,"depth":265,"links":1451},[],"markdown","content:6.recipes:2.transformers.md","content","6.recipes/2.transformers.md","md",[1458,2368],{"_path":108,"_dir":165,"_draft":166,"_partial":166,"_locale":167,"title":107,"description":1459,"body":1460,"_type":1452,"_id":2366,"_source":1454,"_file":2367,"_extension":1456},"Nuxt Content exposes hooks to allow you to modify the content before it is parsed and after it is parsed.",{"type":170,"children":1461,"toc":2362},[1462,1467,1487,1499,1567,1577,1582,1591,1604,1612,1617,1906,1915,1920,1929,1941,1948,1953,2358],{"type":173,"tag":174,"props":1463,"children":1464},{},[1465],{"type":178,"value":1466},"The module adds some hooks you can use:",{"type":173,"tag":174,"props":1468,"children":1469},{},[1470,1475,1477,1486],{"type":173,"tag":203,"props":1471,"children":1472},{"className":167},[1473],{"type":178,"value":1474},"content:file:*",{"type":178,"value":1476}," hooks are available in nitro runtime, in order to use them you need to create a custom ",{"type":173,"tag":1478,"props":1479,"children":1483},"a",{"href":1480,"rel":1481},"https://nitro.unjs.io/guide/plugins",[1482],"nofollow",[1484],{"type":178,"value":1485},"nitro plugin",{"type":178,"value":511},{"type":173,"tag":174,"props":1488,"children":1489},{},[1490,1492,1497],{"type":178,"value":1491},"Create a plugin in the ",{"type":173,"tag":203,"props":1493,"children":1494},{"className":167},[1495],{"type":178,"value":1496},"server/plugins/",{"type":178,"value":1498}," directory",{"type":173,"tag":241,"props":1500,"children":1503},{"className":243,"code":1501,"filename":1502,"language":246,"meta":167,"style":167},"export default defineNitroPlugin((nitroApp) => {\n  // ...\n})\n","server/plugins/content.ts",[1504],{"type":173,"tag":203,"props":1505,"children":1506},{"__ignoreMap":167},[1507,1548,1556],{"type":173,"tag":252,"props":1508,"children":1509},{"class":254,"line":255},[1510,1514,1518,1523,1527,1531,1536,1540,1544],{"type":173,"tag":252,"props":1511,"children":1512},{"style":269},[1513],{"type":178,"value":329},{"type":173,"tag":252,"props":1515,"children":1516},{"style":269},[1517],{"type":178,"value":334},{"type":173,"tag":252,"props":1519,"children":1520},{"style":337},[1521],{"type":178,"value":1522}," defineNitroPlugin",{"type":173,"tag":252,"props":1524,"children":1525},{"style":281},[1526],{"type":178,"value":344},{"type":173,"tag":252,"props":1528,"children":1529},{"style":275},[1530],{"type":178,"value":344},{"type":173,"tag":252,"props":1532,"children":1533},{"style":440},[1534],{"type":178,"value":1535},"nitroApp",{"type":173,"tag":252,"props":1537,"children":1538},{"style":275},[1539],{"type":178,"value":458},{"type":173,"tag":252,"props":1541,"children":1542},{"style":571},[1543],{"type":178,"value":574},{"type":173,"tag":252,"props":1545,"children":1546},{"style":275},[1547],{"type":178,"value":463},{"type":173,"tag":252,"props":1549,"children":1550},{"class":254,"line":265},[1551],{"type":173,"tag":252,"props":1552,"children":1553},{"style":259},[1554],{"type":178,"value":1555},"  // ...\n",{"type":173,"tag":252,"props":1557,"children":1558},{"class":254,"line":313},[1559,1563],{"type":173,"tag":252,"props":1560,"children":1561},{"style":275},[1562],{"type":178,"value":633},{"type":173,"tag":252,"props":1564,"children":1565},{"style":281},[1566],{"type":178,"value":638},{"type":173,"tag":1568,"props":1569,"children":1571},"h2",{"id":1570},"contentfilebeforeparse",[1572],{"type":173,"tag":203,"props":1573,"children":1574},{"className":167},[1575],{"type":178,"value":1576},"content:file:beforeParse",{"type":173,"tag":174,"props":1578,"children":1579},{},[1580],{"type":178,"value":1581},"Allows you to modify the contents of a file before it is handled by the parsers.",{"type":173,"tag":174,"props":1583,"children":1584},{},[1585],{"type":173,"tag":1586,"props":1587,"children":1588},"strong",{},[1589],{"type":178,"value":1590},"Arguments:",{"type":173,"tag":196,"props":1592,"children":1593},{},[1594],{"type":173,"tag":190,"props":1595,"children":1596},{},[1597,1599],{"type":178,"value":1598},"file: ",{"type":173,"tag":203,"props":1600,"children":1601},{"className":167},[1602],{"type":178,"value":1603},"{ _id: string, body: string }",{"type":173,"tag":174,"props":1605,"children":1606},{},[1607],{"type":173,"tag":1586,"props":1608,"children":1609},{},[1610],{"type":178,"value":1611},"Example:",{"type":173,"tag":174,"props":1613,"children":1614},{},[1615],{"type":178,"value":1616},"Changing all occurrences of React to Vue in all Markdown files:",{"type":173,"tag":241,"props":1618,"children":1620},{"className":243,"code":1619,"filename":1502,"language":246,"meta":167,"style":167},"export default defineNitroPlugin((nitroApp) => {\n  nitroApp.hooks.hook('content:file:beforeParse', (file) => {\n    if (file._id.endsWith('.md')) {\n      file.body = file.body.replace(/react/g, 'vue')\n    }\n  })\n})\n",[1621],{"type":173,"tag":203,"props":1622,"children":1623},{"__ignoreMap":167},[1624,1663,1729,1788,1876,1883,1895],{"type":173,"tag":252,"props":1625,"children":1626},{"class":254,"line":255},[1627,1631,1635,1639,1643,1647,1651,1655,1659],{"type":173,"tag":252,"props":1628,"children":1629},{"style":269},[1630],{"type":178,"value":329},{"type":173,"tag":252,"props":1632,"children":1633},{"style":269},[1634],{"type":178,"value":334},{"type":173,"tag":252,"props":1636,"children":1637},{"style":337},[1638],{"type":178,"value":1522},{"type":173,"tag":252,"props":1640,"children":1641},{"style":281},[1642],{"type":178,"value":344},{"type":173,"tag":252,"props":1644,"children":1645},{"style":275},[1646],{"type":178,"value":344},{"type":173,"tag":252,"props":1648,"children":1649},{"style":440},[1650],{"type":178,"value":1535},{"type":173,"tag":252,"props":1652,"children":1653},{"style":275},[1654],{"type":178,"value":458},{"type":173,"tag":252,"props":1656,"children":1657},{"style":571},[1658],{"type":178,"value":574},{"type":173,"tag":252,"props":1660,"children":1661},{"style":275},[1662],{"type":178,"value":463},{"type":173,"tag":252,"props":1664,"children":1665},{"class":254,"line":265},[1666,1671,1675,1680,1684,1688,1692,1696,1700,1704,1708,1712,1717,1721,1725],{"type":173,"tag":252,"props":1667,"children":1668},{"style":281},[1669],{"type":178,"value":1670},"  nitroApp",{"type":173,"tag":252,"props":1672,"children":1673},{"style":275},[1674],{"type":178,"value":511},{"type":173,"tag":252,"props":1676,"children":1677},{"style":281},[1678],{"type":178,"value":1679},"hooks",{"type":173,"tag":252,"props":1681,"children":1682},{"style":275},[1683],{"type":178,"value":511},{"type":173,"tag":252,"props":1685,"children":1686},{"style":337},[1687],{"type":178,"value":1070},{"type":173,"tag":252,"props":1689,"children":1690},{"style":356},[1691],{"type":178,"value":344},{"type":173,"tag":252,"props":1693,"children":1694},{"style":275},[1695],{"type":178,"value":378},{"type":173,"tag":252,"props":1697,"children":1698},{"style":302},[1699],{"type":178,"value":1576},{"type":173,"tag":252,"props":1701,"children":1702},{"style":275},[1703],{"type":178,"value":378},{"type":173,"tag":252,"props":1705,"children":1706},{"style":275},[1707],{"type":178,"value":448},{"type":173,"tag":252,"props":1709,"children":1710},{"style":275},[1711],{"type":178,"value":437},{"type":173,"tag":252,"props":1713,"children":1714},{"style":440},[1715],{"type":178,"value":1716},"file",{"type":173,"tag":252,"props":1718,"children":1719},{"style":275},[1720],{"type":178,"value":458},{"type":173,"tag":252,"props":1722,"children":1723},{"style":571},[1724],{"type":178,"value":574},{"type":173,"tag":252,"props":1726,"children":1727},{"style":275},[1728],{"type":178,"value":463},{"type":173,"tag":252,"props":1730,"children":1731},{"class":254,"line":313},[1732,1737,1741,1745,1749,1753,1757,1762,1766,1770,1775,1779,1784],{"type":173,"tag":252,"props":1733,"children":1734},{"style":269},[1735],{"type":178,"value":1736},"    if",{"type":173,"tag":252,"props":1738,"children":1739},{"style":356},[1740],{"type":178,"value":437},{"type":173,"tag":252,"props":1742,"children":1743},{"style":281},[1744],{"type":178,"value":1716},{"type":173,"tag":252,"props":1746,"children":1747},{"style":275},[1748],{"type":178,"value":511},{"type":173,"tag":252,"props":1750,"children":1751},{"style":281},[1752],{"type":178,"value":443},{"type":173,"tag":252,"props":1754,"children":1755},{"style":275},[1756],{"type":178,"value":511},{"type":173,"tag":252,"props":1758,"children":1759},{"style":337},[1760],{"type":178,"value":1761},"endsWith",{"type":173,"tag":252,"props":1763,"children":1764},{"style":356},[1765],{"type":178,"value":344},{"type":173,"tag":252,"props":1767,"children":1768},{"style":275},[1769],{"type":178,"value":378},{"type":173,"tag":252,"props":1771,"children":1772},{"style":302},[1773],{"type":178,"value":1774},".md",{"type":173,"tag":252,"props":1776,"children":1777},{"style":275},[1778],{"type":178,"value":378},{"type":173,"tag":252,"props":1780,"children":1781},{"style":356},[1782],{"type":178,"value":1783},")) ",{"type":173,"tag":252,"props":1785,"children":1786},{"style":275},[1787],{"type":178,"value":349},{"type":173,"tag":252,"props":1789,"children":1790},{"class":254,"line":323},[1791,1796,1800,1805,1809,1814,1818,1822,1826,1831,1835,1840,1845,1849,1855,1859,1863,1868,1872],{"type":173,"tag":252,"props":1792,"children":1793},{"style":281},[1794],{"type":178,"value":1795},"      file",{"type":173,"tag":252,"props":1797,"children":1798},{"style":275},[1799],{"type":178,"value":511},{"type":173,"tag":252,"props":1801,"children":1802},{"style":281},[1803],{"type":178,"value":1804},"body",{"type":173,"tag":252,"props":1806,"children":1807},{"style":275},[1808],{"type":178,"value":840},{"type":173,"tag":252,"props":1810,"children":1811},{"style":281},[1812],{"type":178,"value":1813}," file",{"type":173,"tag":252,"props":1815,"children":1816},{"style":275},[1817],{"type":178,"value":511},{"type":173,"tag":252,"props":1819,"children":1820},{"style":281},[1821],{"type":178,"value":1804},{"type":173,"tag":252,"props":1823,"children":1824},{"style":275},[1825],{"type":178,"value":511},{"type":173,"tag":252,"props":1827,"children":1828},{"style":337},[1829],{"type":178,"value":1830},"replace",{"type":173,"tag":252,"props":1832,"children":1833},{"style":356},[1834],{"type":178,"value":344},{"type":173,"tag":252,"props":1836,"children":1837},{"style":275},[1838],{"type":178,"value":1839},"/",{"type":173,"tag":252,"props":1841,"children":1842},{"style":302},[1843],{"type":178,"value":1844},"react",{"type":173,"tag":252,"props":1846,"children":1847},{"style":275},[1848],{"type":178,"value":1839},{"type":173,"tag":252,"props":1850,"children":1852},{"style":1851},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[1853],{"type":178,"value":1854},"g",{"type":173,"tag":252,"props":1856,"children":1857},{"style":275},[1858],{"type":178,"value":448},{"type":173,"tag":252,"props":1860,"children":1861},{"style":275},[1862],{"type":178,"value":299},{"type":173,"tag":252,"props":1864,"children":1865},{"style":302},[1866],{"type":178,"value":1867},"vue",{"type":173,"tag":252,"props":1869,"children":1870},{"style":275},[1871],{"type":178,"value":378},{"type":173,"tag":252,"props":1873,"children":1874},{"style":356},[1875],{"type":178,"value":638},{"type":173,"tag":252,"props":1877,"children":1878},{"class":254,"line":352},[1879],{"type":173,"tag":252,"props":1880,"children":1881},{"style":275},[1882],{"type":178,"value":615},{"type":173,"tag":252,"props":1884,"children":1885},{"class":254,"line":386},[1886,1891],{"type":173,"tag":252,"props":1887,"children":1888},{"style":275},[1889],{"type":178,"value":1890},"  }",{"type":173,"tag":252,"props":1892,"children":1893},{"style":356},[1894],{"type":178,"value":638},{"type":173,"tag":252,"props":1896,"children":1897},{"class":254,"line":426},[1898,1902],{"type":173,"tag":252,"props":1899,"children":1900},{"style":275},[1901],{"type":178,"value":633},{"type":173,"tag":252,"props":1903,"children":1904},{"style":281},[1905],{"type":178,"value":638},{"type":173,"tag":1568,"props":1907,"children":1909},{"id":1908},"contentfileafterparse",[1910],{"type":173,"tag":203,"props":1911,"children":1912},{"className":167},[1913],{"type":178,"value":1914},"content:file:afterParse",{"type":173,"tag":174,"props":1916,"children":1917},{},[1918],{"type":178,"value":1919},"Allows you to modify a document after being parsed by parsers.",{"type":173,"tag":174,"props":1921,"children":1922},{},[1923,1928],{"type":173,"tag":1586,"props":1924,"children":1925},{},[1926],{"type":178,"value":1927},"Arguments",{"type":178,"value":364},{"type":173,"tag":196,"props":1930,"children":1931},{},[1932],{"type":173,"tag":190,"props":1933,"children":1934},{},[1935,1936],{"type":178,"value":1598},{"type":173,"tag":203,"props":1937,"children":1938},{"className":167},[1939],{"type":178,"value":1940},"{ _id: string, body: any }",{"type":173,"tag":174,"props":1942,"children":1943},{},[1944],{"type":173,"tag":1586,"props":1945,"children":1946},{},[1947],{"type":178,"value":1611},{"type":173,"tag":174,"props":1949,"children":1950},{},[1951],{"type":178,"value":1952},"Using content's first picture as cover image.",{"type":173,"tag":241,"props":1954,"children":1956},{"className":243,"code":1955,"filename":1502,"language":246,"meta":167,"style":167},"import { visit } from 'unist-util-visit'\n\nexport default defineNitroPlugin((nitroApp) => {\n  nitroApp.hooks.hook('content:file:afterParse', (file) => {\n    if (file._id.endsWith('.md')) {\n      visit(file.body, (n: any) => n.tag === 'img', (node) => {\n        file.coverImage = node.props.src\n      })\n    }\n  })\n})\n\n",[1957],{"type":173,"tag":203,"props":1958,"children":1959},{"__ignoreMap":167},[1960,1997,2004,2043,2106,2161,2273,2317,2329,2336,2347],{"type":173,"tag":252,"props":1961,"children":1962},{"class":254,"line":255},[1963,1967,1971,1976,1980,1984,1988,1993],{"type":173,"tag":252,"props":1964,"children":1965},{"style":269},[1966],{"type":178,"value":272},{"type":173,"tag":252,"props":1968,"children":1969},{"style":275},[1970],{"type":178,"value":278},{"type":173,"tag":252,"props":1972,"children":1973},{"style":281},[1974],{"type":178,"value":1975}," visit",{"type":173,"tag":252,"props":1977,"children":1978},{"style":275},[1979],{"type":178,"value":289},{"type":173,"tag":252,"props":1981,"children":1982},{"style":269},[1983],{"type":178,"value":294},{"type":173,"tag":252,"props":1985,"children":1986},{"style":275},[1987],{"type":178,"value":299},{"type":173,"tag":252,"props":1989,"children":1990},{"style":302},[1991],{"type":178,"value":1992},"unist-util-visit",{"type":173,"tag":252,"props":1994,"children":1995},{"style":275},[1996],{"type":178,"value":310},{"type":173,"tag":252,"props":1998,"children":1999},{"class":254,"line":265},[2000],{"type":173,"tag":252,"props":2001,"children":2002},{"emptyLinePlaceholder":317},[2003],{"type":178,"value":320},{"type":173,"tag":252,"props":2005,"children":2006},{"class":254,"line":313},[2007,2011,2015,2019,2023,2027,2031,2035,2039],{"type":173,"tag":252,"props":2008,"children":2009},{"style":269},[2010],{"type":178,"value":329},{"type":173,"tag":252,"props":2012,"children":2013},{"style":269},[2014],{"type":178,"value":334},{"type":173,"tag":252,"props":2016,"children":2017},{"style":337},[2018],{"type":178,"value":1522},{"type":173,"tag":252,"props":2020,"children":2021},{"style":281},[2022],{"type":178,"value":344},{"type":173,"tag":252,"props":2024,"children":2025},{"style":275},[2026],{"type":178,"value":344},{"type":173,"tag":252,"props":2028,"children":2029},{"style":440},[2030],{"type":178,"value":1535},{"type":173,"tag":252,"props":2032,"children":2033},{"style":275},[2034],{"type":178,"value":458},{"type":173,"tag":252,"props":2036,"children":2037},{"style":571},[2038],{"type":178,"value":574},{"type":173,"tag":252,"props":2040,"children":2041},{"style":275},[2042],{"type":178,"value":463},{"type":173,"tag":252,"props":2044,"children":2045},{"class":254,"line":323},[2046,2050,2054,2058,2062,2066,2070,2074,2078,2082,2086,2090,2094,2098,2102],{"type":173,"tag":252,"props":2047,"children":2048},{"style":281},[2049],{"type":178,"value":1670},{"type":173,"tag":252,"props":2051,"children":2052},{"style":275},[2053],{"type":178,"value":511},{"type":173,"tag":252,"props":2055,"children":2056},{"style":281},[2057],{"type":178,"value":1679},{"type":173,"tag":252,"props":2059,"children":2060},{"style":275},[2061],{"type":178,"value":511},{"type":173,"tag":252,"props":2063,"children":2064},{"style":337},[2065],{"type":178,"value":1070},{"type":173,"tag":252,"props":2067,"children":2068},{"style":356},[2069],{"type":178,"value":344},{"type":173,"tag":252,"props":2071,"children":2072},{"style":275},[2073],{"type":178,"value":378},{"type":173,"tag":252,"props":2075,"children":2076},{"style":302},[2077],{"type":178,"value":1914},{"type":173,"tag":252,"props":2079,"children":2080},{"style":275},[2081],{"type":178,"value":378},{"type":173,"tag":252,"props":2083,"children":2084},{"style":275},[2085],{"type":178,"value":448},{"type":173,"tag":252,"props":2087,"children":2088},{"style":275},[2089],{"type":178,"value":437},{"type":173,"tag":252,"props":2091,"children":2092},{"style":440},[2093],{"type":178,"value":1716},{"type":173,"tag":252,"props":2095,"children":2096},{"style":275},[2097],{"type":178,"value":458},{"type":173,"tag":252,"props":2099,"children":2100},{"style":571},[2101],{"type":178,"value":574},{"type":173,"tag":252,"props":2103,"children":2104},{"style":275},[2105],{"type":178,"value":463},{"type":173,"tag":252,"props":2107,"children":2108},{"class":254,"line":352},[2109,2113,2117,2121,2125,2129,2133,2137,2141,2145,2149,2153,2157],{"type":173,"tag":252,"props":2110,"children":2111},{"style":269},[2112],{"type":178,"value":1736},{"type":173,"tag":252,"props":2114,"children":2115},{"style":356},[2116],{"type":178,"value":437},{"type":173,"tag":252,"props":2118,"children":2119},{"style":281},[2120],{"type":178,"value":1716},{"type":173,"tag":252,"props":2122,"children":2123},{"style":275},[2124],{"type":178,"value":511},{"type":173,"tag":252,"props":2126,"children":2127},{"style":281},[2128],{"type":178,"value":443},{"type":173,"tag":252,"props":2130,"children":2131},{"style":275},[2132],{"type":178,"value":511},{"type":173,"tag":252,"props":2134,"children":2135},{"style":337},[2136],{"type":178,"value":1761},{"type":173,"tag":252,"props":2138,"children":2139},{"style":356},[2140],{"type":178,"value":344},{"type":173,"tag":252,"props":2142,"children":2143},{"style":275},[2144],{"type":178,"value":378},{"type":173,"tag":252,"props":2146,"children":2147},{"style":302},[2148],{"type":178,"value":1774},{"type":173,"tag":252,"props":2150,"children":2151},{"style":275},[2152],{"type":178,"value":378},{"type":173,"tag":252,"props":2154,"children":2155},{"style":356},[2156],{"type":178,"value":1783},{"type":173,"tag":252,"props":2158,"children":2159},{"style":275},[2160],{"type":178,"value":349},{"type":173,"tag":252,"props":2162,"children":2163},{"class":254,"line":386},[2164,2169,2173,2177,2181,2185,2189,2193,2198,2202,2208,2212,2216,2221,2225,2230,2235,2239,2244,2248,2252,2256,2261,2265,2269],{"type":173,"tag":252,"props":2165,"children":2166},{"style":337},[2167],{"type":178,"value":2168},"      visit",{"type":173,"tag":252,"props":2170,"children":2171},{"style":356},[2172],{"type":178,"value":344},{"type":173,"tag":252,"props":2174,"children":2175},{"style":281},[2176],{"type":178,"value":1716},{"type":173,"tag":252,"props":2178,"children":2179},{"style":275},[2180],{"type":178,"value":511},{"type":173,"tag":252,"props":2182,"children":2183},{"style":281},[2184],{"type":178,"value":1804},{"type":173,"tag":252,"props":2186,"children":2187},{"style":275},[2188],{"type":178,"value":448},{"type":173,"tag":252,"props":2190,"children":2191},{"style":275},[2192],{"type":178,"value":437},{"type":173,"tag":252,"props":2194,"children":2195},{"style":440},[2196],{"type":178,"value":2197},"n",{"type":173,"tag":252,"props":2199,"children":2200},{"style":275},[2201],{"type":178,"value":364},{"type":173,"tag":252,"props":2203,"children":2205},{"style":2204},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[2206],{"type":178,"value":2207}," any",{"type":173,"tag":252,"props":2209,"children":2210},{"style":275},[2211],{"type":178,"value":458},{"type":173,"tag":252,"props":2213,"children":2214},{"style":571},[2215],{"type":178,"value":574},{"type":173,"tag":252,"props":2217,"children":2218},{"style":281},[2219],{"type":178,"value":2220}," n",{"type":173,"tag":252,"props":2222,"children":2223},{"style":275},[2224],{"type":178,"value":511},{"type":173,"tag":252,"props":2226,"children":2227},{"style":281},[2228],{"type":178,"value":2229},"tag",{"type":173,"tag":252,"props":2231,"children":2232},{"style":275},[2233],{"type":178,"value":2234}," ===",{"type":173,"tag":252,"props":2236,"children":2237},{"style":275},[2238],{"type":178,"value":299},{"type":173,"tag":252,"props":2240,"children":2241},{"style":302},[2242],{"type":178,"value":2243},"img",{"type":173,"tag":252,"props":2245,"children":2246},{"style":275},[2247],{"type":178,"value":378},{"type":173,"tag":252,"props":2249,"children":2250},{"style":275},[2251],{"type":178,"value":448},{"type":173,"tag":252,"props":2253,"children":2254},{"style":275},[2255],{"type":178,"value":437},{"type":173,"tag":252,"props":2257,"children":2258},{"style":440},[2259],{"type":178,"value":2260},"node",{"type":173,"tag":252,"props":2262,"children":2263},{"style":275},[2264],{"type":178,"value":458},{"type":173,"tag":252,"props":2266,"children":2267},{"style":571},[2268],{"type":178,"value":574},{"type":173,"tag":252,"props":2270,"children":2271},{"style":275},[2272],{"type":178,"value":463},{"type":173,"tag":252,"props":2274,"children":2275},{"class":254,"line":426},[2276,2281,2285,2290,2294,2299,2303,2308,2312],{"type":173,"tag":252,"props":2277,"children":2278},{"style":281},[2279],{"type":178,"value":2280},"        file",{"type":173,"tag":252,"props":2282,"children":2283},{"style":275},[2284],{"type":178,"value":511},{"type":173,"tag":252,"props":2286,"children":2287},{"style":281},[2288],{"type":178,"value":2289},"coverImage",{"type":173,"tag":252,"props":2291,"children":2292},{"style":275},[2293],{"type":178,"value":840},{"type":173,"tag":252,"props":2295,"children":2296},{"style":281},[2297],{"type":178,"value":2298}," node",{"type":173,"tag":252,"props":2300,"children":2301},{"style":275},[2302],{"type":178,"value":511},{"type":173,"tag":252,"props":2304,"children":2305},{"style":281},[2306],{"type":178,"value":2307},"props",{"type":173,"tag":252,"props":2309,"children":2310},{"style":275},[2311],{"type":178,"value":511},{"type":173,"tag":252,"props":2313,"children":2314},{"style":281},[2315],{"type":178,"value":2316},"src\n",{"type":173,"tag":252,"props":2318,"children":2319},{"class":254,"line":466},[2320,2325],{"type":173,"tag":252,"props":2321,"children":2322},{"style":275},[2323],{"type":178,"value":2324},"      }",{"type":173,"tag":252,"props":2326,"children":2327},{"style":356},[2328],{"type":178,"value":638},{"type":173,"tag":252,"props":2330,"children":2331},{"class":254,"line":479},[2332],{"type":173,"tag":252,"props":2333,"children":2334},{"style":275},[2335],{"type":178,"value":615},{"type":173,"tag":252,"props":2337,"children":2338},{"class":254,"line":492},[2339,2343],{"type":173,"tag":252,"props":2340,"children":2341},{"style":275},[2342],{"type":178,"value":1890},{"type":173,"tag":252,"props":2344,"children":2345},{"style":356},[2346],{"type":178,"value":638},{"type":173,"tag":252,"props":2348,"children":2349},{"class":254,"line":609},[2350,2354],{"type":173,"tag":252,"props":2351,"children":2352},{"style":275},[2353],{"type":178,"value":633},{"type":173,"tag":252,"props":2355,"children":2356},{"style":281},[2357],{"type":178,"value":638},{"type":173,"tag":1445,"props":2359,"children":2360},{},[2361],{"type":178,"value":1449},{"title":167,"searchDepth":265,"depth":265,"links":2363},[2364,2365],{"id":1570,"depth":265,"text":1576},{"id":1908,"depth":265,"text":1914},"content:6.recipes:1.hooks.md","6.recipes/1.hooks.md",{"_path":114,"_dir":165,"_draft":166,"_partial":166,"_locale":167,"title":113,"description":2369,"body":2370,"_type":1452,"_id":3185,"_source":1454,"_file":3186,"_extension":1456},"A sitemap file is useful for helping Google to better index your website, ensuring that the content you write can be visible in search results.",{"type":170,"children":2371,"toc":3182},[2372,2379,2391,2469,2475,2496,2521,2526,3009,3021,3033,3051,3178],{"type":173,"tag":2373,"props":2374,"children":2376},"h1",{"id":2375},"library",[2377],{"type":178,"value":2378},"Library",{"type":173,"tag":174,"props":2380,"children":2381},{},[2382,2384,2389],{"type":178,"value":2383},"This can be created by utilising the ",{"type":173,"tag":203,"props":2385,"children":2386},{"className":167},[2387],{"type":178,"value":2388},"sitemap",{"type":178,"value":2390}," library, which can be installed as follows:",{"type":173,"tag":2392,"props":2393,"children":2394},"code-group",{},[2395,2422,2445],{"type":173,"tag":241,"props":2396,"children":2401},{"className":2397,"code":2398,"filename":2399,"language":2400,"meta":167,"style":167},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pnpm add sitemap\n","pnpm","bash",[2402],{"type":173,"tag":203,"props":2403,"children":2404},{"__ignoreMap":167},[2405],{"type":173,"tag":252,"props":2406,"children":2407},{"class":254,"line":255},[2408,2412,2417],{"type":173,"tag":252,"props":2409,"children":2410},{"style":2204},[2411],{"type":178,"value":2399},{"type":173,"tag":252,"props":2413,"children":2414},{"style":302},[2415],{"type":178,"value":2416}," add",{"type":173,"tag":252,"props":2418,"children":2419},{"style":302},[2420],{"type":178,"value":2421}," sitemap\n",{"type":173,"tag":241,"props":2423,"children":2426},{"className":2397,"code":2424,"filename":2425,"language":2400,"meta":167,"style":167},"yarn add sitemap\n","yarn",[2427],{"type":173,"tag":203,"props":2428,"children":2429},{"__ignoreMap":167},[2430],{"type":173,"tag":252,"props":2431,"children":2432},{"class":254,"line":255},[2433,2437,2441],{"type":173,"tag":252,"props":2434,"children":2435},{"style":2204},[2436],{"type":178,"value":2425},{"type":173,"tag":252,"props":2438,"children":2439},{"style":302},[2440],{"type":178,"value":2416},{"type":173,"tag":252,"props":2442,"children":2443},{"style":302},[2444],{"type":178,"value":2421},{"type":173,"tag":241,"props":2446,"children":2449},{"className":2397,"code":2447,"filename":2448,"language":2400,"meta":167,"style":167},"npm install sitemap\n","npm",[2450],{"type":173,"tag":203,"props":2451,"children":2452},{"__ignoreMap":167},[2453],{"type":173,"tag":252,"props":2454,"children":2455},{"class":254,"line":255},[2456,2460,2465],{"type":173,"tag":252,"props":2457,"children":2458},{"style":2204},[2459],{"type":178,"value":2448},{"type":173,"tag":252,"props":2461,"children":2462},{"style":302},[2463],{"type":178,"value":2464}," install",{"type":173,"tag":252,"props":2466,"children":2467},{"style":302},[2468],{"type":178,"value":2421},{"type":173,"tag":1568,"props":2470,"children":2472},{"id":2471},"server-route",[2473],{"type":178,"value":2474},"Server Route",{"type":173,"tag":174,"props":2476,"children":2477},{},[2478,2480,2487,2489,2494],{"type":178,"value":2479},"We will be utilising the ",{"type":173,"tag":1478,"props":2481,"children":2484},{"href":2482,"rel":2483},"https://nuxt.com/docs/guide/directory-structure/server#server-routes",[1482],[2485],{"type":178,"value":2486},"server routes",{"type":178,"value":2488}," available within Nuxt, and to do so you'll need to create the ",{"type":173,"tag":203,"props":2490,"children":2491},{"className":167},[2492],{"type":178,"value":2493},"server/",{"type":178,"value":2495}," directory within your website's root directly.",{"type":173,"tag":174,"props":2497,"children":2498},{},[2499,2501,2506,2508,2513,2515,2520],{"type":178,"value":2500},"Once this is done, create a ",{"type":173,"tag":203,"props":2502,"children":2503},{"className":167},[2504],{"type":178,"value":2505},"routes/",{"type":178,"value":2507}," directory inside this, and add a ",{"type":173,"tag":203,"props":2509,"children":2510},{"className":167},[2511],{"type":178,"value":2512},"sitemap.xml.ts",{"type":178,"value":2514}," file, this will translate to ",{"type":173,"tag":203,"props":2516,"children":2517},{"className":167},[2518],{"type":178,"value":2519},"/sitemap.xml",{"type":178,"value":511},{"type":173,"tag":174,"props":2522,"children":2523},{},[2524],{"type":178,"value":2525},"You'll need to add the following:",{"type":173,"tag":241,"props":2527,"children":2530},{"className":243,"code":2528,"filename":2529,"language":246,"meta":167,"style":167},"import { serverQueryContent } from '#content/server'\nimport { SitemapStream, streamToPromise } from 'sitemap'\n\nexport default defineEventHandler(async (event) => {\n  // Fetch all documents\n  const docs = await serverQueryContent(event).find()\n  const sitemap = new SitemapStream({\n    hostname: 'https://example.com'\n  })\n\n  for (const doc of docs) {\n    sitemap.write({\n      url: doc._path,\n      changefreq: 'monthly'\n    })\n  }\n  sitemap.end()\n\n  return streamToPromise(sitemap)\n})\n","server/routes/sitemap.xml.ts",[2531],{"type":173,"tag":203,"props":2532,"children":2533},{"__ignoreMap":167},[2534,2571,2616,2623,2669,2677,2728,2761,2786,2797,2804,2844,2869,2898,2923,2934,2942,2964,2972,2997],{"type":173,"tag":252,"props":2535,"children":2536},{"class":254,"line":255},[2537,2541,2545,2550,2554,2558,2562,2567],{"type":173,"tag":252,"props":2538,"children":2539},{"style":269},[2540],{"type":178,"value":272},{"type":173,"tag":252,"props":2542,"children":2543},{"style":275},[2544],{"type":178,"value":278},{"type":173,"tag":252,"props":2546,"children":2547},{"style":281},[2548],{"type":178,"value":2549}," serverQueryContent",{"type":173,"tag":252,"props":2551,"children":2552},{"style":275},[2553],{"type":178,"value":289},{"type":173,"tag":252,"props":2555,"children":2556},{"style":269},[2557],{"type":178,"value":294},{"type":173,"tag":252,"props":2559,"children":2560},{"style":275},[2561],{"type":178,"value":299},{"type":173,"tag":252,"props":2563,"children":2564},{"style":302},[2565],{"type":178,"value":2566},"#content/server",{"type":173,"tag":252,"props":2568,"children":2569},{"style":275},[2570],{"type":178,"value":310},{"type":173,"tag":252,"props":2572,"children":2573},{"class":254,"line":265},[2574,2578,2582,2587,2591,2596,2600,2604,2608,2612],{"type":173,"tag":252,"props":2575,"children":2576},{"style":269},[2577],{"type":178,"value":272},{"type":173,"tag":252,"props":2579,"children":2580},{"style":275},[2581],{"type":178,"value":278},{"type":173,"tag":252,"props":2583,"children":2584},{"style":281},[2585],{"type":178,"value":2586}," SitemapStream",{"type":173,"tag":252,"props":2588,"children":2589},{"style":275},[2590],{"type":178,"value":448},{"type":173,"tag":252,"props":2592,"children":2593},{"style":281},[2594],{"type":178,"value":2595}," streamToPromise",{"type":173,"tag":252,"props":2597,"children":2598},{"style":275},[2599],{"type":178,"value":289},{"type":173,"tag":252,"props":2601,"children":2602},{"style":269},[2603],{"type":178,"value":294},{"type":173,"tag":252,"props":2605,"children":2606},{"style":275},[2607],{"type":178,"value":299},{"type":173,"tag":252,"props":2609,"children":2610},{"style":302},[2611],{"type":178,"value":2388},{"type":173,"tag":252,"props":2613,"children":2614},{"style":275},[2615],{"type":178,"value":310},{"type":173,"tag":252,"props":2617,"children":2618},{"class":254,"line":313},[2619],{"type":173,"tag":252,"props":2620,"children":2621},{"emptyLinePlaceholder":317},[2622],{"type":178,"value":320},{"type":173,"tag":252,"props":2624,"children":2625},{"class":254,"line":323},[2626,2630,2634,2639,2643,2648,2652,2657,2661,2665],{"type":173,"tag":252,"props":2627,"children":2628},{"style":269},[2629],{"type":178,"value":329},{"type":173,"tag":252,"props":2631,"children":2632},{"style":269},[2633],{"type":178,"value":334},{"type":173,"tag":252,"props":2635,"children":2636},{"style":337},[2637],{"type":178,"value":2638}," defineEventHandler",{"type":173,"tag":252,"props":2640,"children":2641},{"style":281},[2642],{"type":178,"value":344},{"type":173,"tag":252,"props":2644,"children":2645},{"style":571},[2646],{"type":178,"value":2647},"async",{"type":173,"tag":252,"props":2649,"children":2650},{"style":275},[2651],{"type":178,"value":437},{"type":173,"tag":252,"props":2653,"children":2654},{"style":440},[2655],{"type":178,"value":2656},"event",{"type":173,"tag":252,"props":2658,"children":2659},{"style":275},[2660],{"type":178,"value":458},{"type":173,"tag":252,"props":2662,"children":2663},{"style":571},[2664],{"type":178,"value":574},{"type":173,"tag":252,"props":2666,"children":2667},{"style":275},[2668],{"type":178,"value":463},{"type":173,"tag":252,"props":2670,"children":2671},{"class":254,"line":352},[2672],{"type":173,"tag":252,"props":2673,"children":2674},{"style":259},[2675],{"type":178,"value":2676},"  // Fetch all documents\n",{"type":173,"tag":252,"props":2678,"children":2679},{"class":254,"line":386},[2680,2685,2690,2694,2699,2703,2707,2711,2715,2719,2724],{"type":173,"tag":252,"props":2681,"children":2682},{"style":571},[2683],{"type":178,"value":2684},"  const",{"type":173,"tag":252,"props":2686,"children":2687},{"style":281},[2688],{"type":178,"value":2689}," docs",{"type":173,"tag":252,"props":2691,"children":2692},{"style":275},[2693],{"type":178,"value":840},{"type":173,"tag":252,"props":2695,"children":2696},{"style":269},[2697],{"type":178,"value":2698}," await",{"type":173,"tag":252,"props":2700,"children":2701},{"style":337},[2702],{"type":178,"value":2549},{"type":173,"tag":252,"props":2704,"children":2705},{"style":356},[2706],{"type":178,"value":344},{"type":173,"tag":252,"props":2708,"children":2709},{"style":281},[2710],{"type":178,"value":2656},{"type":173,"tag":252,"props":2712,"children":2713},{"style":356},[2714],{"type":178,"value":458},{"type":173,"tag":252,"props":2716,"children":2717},{"style":275},[2718],{"type":178,"value":511},{"type":173,"tag":252,"props":2720,"children":2721},{"style":337},[2722],{"type":178,"value":2723},"find",{"type":173,"tag":252,"props":2725,"children":2726},{"style":356},[2727],{"type":178,"value":606},{"type":173,"tag":252,"props":2729,"children":2730},{"class":254,"line":426},[2731,2735,2740,2744,2749,2753,2757],{"type":173,"tag":252,"props":2732,"children":2733},{"style":571},[2734],{"type":178,"value":2684},{"type":173,"tag":252,"props":2736,"children":2737},{"style":281},[2738],{"type":178,"value":2739}," sitemap",{"type":173,"tag":252,"props":2741,"children":2742},{"style":275},[2743],{"type":178,"value":840},{"type":173,"tag":252,"props":2745,"children":2746},{"style":275},[2747],{"type":178,"value":2748}," new",{"type":173,"tag":252,"props":2750,"children":2751},{"style":337},[2752],{"type":178,"value":2586},{"type":173,"tag":252,"props":2754,"children":2755},{"style":356},[2756],{"type":178,"value":344},{"type":173,"tag":252,"props":2758,"children":2759},{"style":275},[2760],{"type":178,"value":349},{"type":173,"tag":252,"props":2762,"children":2763},{"class":254,"line":466},[2764,2769,2773,2777,2782],{"type":173,"tag":252,"props":2765,"children":2766},{"style":356},[2767],{"type":178,"value":2768},"    hostname",{"type":173,"tag":252,"props":2770,"children":2771},{"style":275},[2772],{"type":178,"value":364},{"type":173,"tag":252,"props":2774,"children":2775},{"style":275},[2776],{"type":178,"value":299},{"type":173,"tag":252,"props":2778,"children":2779},{"style":302},[2780],{"type":178,"value":2781},"https://example.com",{"type":173,"tag":252,"props":2783,"children":2784},{"style":275},[2785],{"type":178,"value":310},{"type":173,"tag":252,"props":2787,"children":2788},{"class":254,"line":479},[2789,2793],{"type":173,"tag":252,"props":2790,"children":2791},{"style":275},[2792],{"type":178,"value":1890},{"type":173,"tag":252,"props":2794,"children":2795},{"style":356},[2796],{"type":178,"value":638},{"type":173,"tag":252,"props":2798,"children":2799},{"class":254,"line":492},[2800],{"type":173,"tag":252,"props":2801,"children":2802},{"emptyLinePlaceholder":317},[2803],{"type":178,"value":320},{"type":173,"tag":252,"props":2805,"children":2806},{"class":254,"line":609},[2807,2812,2816,2821,2826,2831,2835,2840],{"type":173,"tag":252,"props":2808,"children":2809},{"style":269},[2810],{"type":178,"value":2811},"  for",{"type":173,"tag":252,"props":2813,"children":2814},{"style":356},[2815],{"type":178,"value":437},{"type":173,"tag":252,"props":2817,"children":2818},{"style":571},[2819],{"type":178,"value":2820},"const",{"type":173,"tag":252,"props":2822,"children":2823},{"style":281},[2824],{"type":178,"value":2825}," doc",{"type":173,"tag":252,"props":2827,"children":2828},{"style":275},[2829],{"type":178,"value":2830}," of",{"type":173,"tag":252,"props":2832,"children":2833},{"style":281},[2834],{"type":178,"value":2689},{"type":173,"tag":252,"props":2836,"children":2837},{"style":356},[2838],{"type":178,"value":2839},") ",{"type":173,"tag":252,"props":2841,"children":2842},{"style":275},[2843],{"type":178,"value":349},{"type":173,"tag":252,"props":2845,"children":2846},{"class":254,"line":618},[2847,2852,2856,2861,2865],{"type":173,"tag":252,"props":2848,"children":2849},{"style":281},[2850],{"type":178,"value":2851},"    sitemap",{"type":173,"tag":252,"props":2853,"children":2854},{"style":275},[2855],{"type":178,"value":511},{"type":173,"tag":252,"props":2857,"children":2858},{"style":337},[2859],{"type":178,"value":2860},"write",{"type":173,"tag":252,"props":2862,"children":2863},{"style":356},[2864],{"type":178,"value":344},{"type":173,"tag":252,"props":2866,"children":2867},{"style":275},[2868],{"type":178,"value":349},{"type":173,"tag":252,"props":2870,"children":2871},{"class":254,"line":627},[2872,2877,2881,2885,2889,2894],{"type":173,"tag":252,"props":2873,"children":2874},{"style":356},[2875],{"type":178,"value":2876},"      url",{"type":173,"tag":252,"props":2878,"children":2879},{"style":275},[2880],{"type":178,"value":364},{"type":173,"tag":252,"props":2882,"children":2883},{"style":281},[2884],{"type":178,"value":2825},{"type":173,"tag":252,"props":2886,"children":2887},{"style":275},[2888],{"type":178,"value":511},{"type":173,"tag":252,"props":2890,"children":2891},{"style":281},[2892],{"type":178,"value":2893},"_path",{"type":173,"tag":252,"props":2895,"children":2896},{"style":275},[2897],{"type":178,"value":383},{"type":173,"tag":252,"props":2899,"children":2900},{"class":254,"line":1181},[2901,2906,2910,2914,2919],{"type":173,"tag":252,"props":2902,"children":2903},{"style":356},[2904],{"type":178,"value":2905},"      changefreq",{"type":173,"tag":252,"props":2907,"children":2908},{"style":275},[2909],{"type":178,"value":364},{"type":173,"tag":252,"props":2911,"children":2912},{"style":275},[2913],{"type":178,"value":299},{"type":173,"tag":252,"props":2915,"children":2916},{"style":302},[2917],{"type":178,"value":2918},"monthly",{"type":173,"tag":252,"props":2920,"children":2921},{"style":275},[2922],{"type":178,"value":310},{"type":173,"tag":252,"props":2924,"children":2925},{"class":254,"line":1189},[2926,2930],{"type":173,"tag":252,"props":2927,"children":2928},{"style":275},[2929],{"type":178,"value":1174},{"type":173,"tag":252,"props":2931,"children":2932},{"style":356},[2933],{"type":178,"value":638},{"type":173,"tag":252,"props":2935,"children":2937},{"class":254,"line":2936},16,[2938],{"type":173,"tag":252,"props":2939,"children":2940},{"style":275},[2941],{"type":178,"value":624},{"type":173,"tag":252,"props":2943,"children":2945},{"class":254,"line":2944},17,[2946,2951,2955,2960],{"type":173,"tag":252,"props":2947,"children":2948},{"style":281},[2949],{"type":178,"value":2950},"  sitemap",{"type":173,"tag":252,"props":2952,"children":2953},{"style":275},[2954],{"type":178,"value":511},{"type":173,"tag":252,"props":2956,"children":2957},{"style":337},[2958],{"type":178,"value":2959},"end",{"type":173,"tag":252,"props":2961,"children":2962},{"style":356},[2963],{"type":178,"value":606},{"type":173,"tag":252,"props":2965,"children":2967},{"class":254,"line":2966},18,[2968],{"type":173,"tag":252,"props":2969,"children":2970},{"emptyLinePlaceholder":317},[2971],{"type":178,"value":320},{"type":173,"tag":252,"props":2973,"children":2975},{"class":254,"line":2974},19,[2976,2981,2985,2989,2993],{"type":173,"tag":252,"props":2977,"children":2978},{"style":269},[2979],{"type":178,"value":2980},"  return",{"type":173,"tag":252,"props":2982,"children":2983},{"style":337},[2984],{"type":178,"value":2595},{"type":173,"tag":252,"props":2986,"children":2987},{"style":356},[2988],{"type":178,"value":344},{"type":173,"tag":252,"props":2990,"children":2991},{"style":281},[2992],{"type":178,"value":2388},{"type":173,"tag":252,"props":2994,"children":2995},{"style":356},[2996],{"type":178,"value":638},{"type":173,"tag":252,"props":2998,"children":3000},{"class":254,"line":2999},20,[3001,3005],{"type":173,"tag":252,"props":3002,"children":3003},{"style":275},[3004],{"type":178,"value":633},{"type":173,"tag":252,"props":3006,"children":3007},{"style":281},[3008],{"type":178,"value":638},{"type":173,"tag":174,"props":3010,"children":3011},{},[3012,3014,3019],{"type":178,"value":3013},"Now, once users go to ",{"type":173,"tag":203,"props":3015,"children":3016},{"className":167},[3017],{"type":178,"value":3018},"https://example.com/sitemap.xml",{"type":178,"value":3020},", you'll find the generated XML file with all your pages.",{"type":173,"tag":174,"props":3022,"children":3023},{},[3024,3026,3031],{"type":178,"value":3025},"When using ",{"type":173,"tag":203,"props":3027,"children":3028},{"className":167},[3029],{"type":178,"value":3030},"nuxt generate",{"type":178,"value":3032},", you may want to pre-render the sitemap since the server route won't be able to run on a static hosting.",{"type":173,"tag":174,"props":3034,"children":3035},{},[3036,3038,3043,3045,3050],{"type":178,"value":3037},"You can do this using the ",{"type":173,"tag":203,"props":3039,"children":3040},{"className":167},[3041],{"type":178,"value":3042},"nitro.prerender",{"type":178,"value":3044}," option in your ",{"type":173,"tag":203,"props":3046,"children":3047},{"className":167},[3048],{"type":178,"value":3049},"nuxt.config",{"type":178,"value":364},{"type":173,"tag":241,"props":3052,"children":3054},{"className":243,"code":3053,"filename":1210,"language":246,"meta":167,"style":167},"export default defineNuxtConfig({\n  // ...\n  nitro: {\n    prerender: {\n      routes: ['/sitemap.xml']\n    }\n  }\n})\n",[3055],{"type":173,"tag":203,"props":3056,"children":3057},{"__ignoreMap":167},[3058,3081,3088,3104,3120,3153,3160,3167],{"type":173,"tag":252,"props":3059,"children":3060},{"class":254,"line":255},[3061,3065,3069,3073,3077],{"type":173,"tag":252,"props":3062,"children":3063},{"style":269},[3064],{"type":178,"value":329},{"type":173,"tag":252,"props":3066,"children":3067},{"style":269},[3068],{"type":178,"value":334},{"type":173,"tag":252,"props":3070,"children":3071},{"style":337},[3072],{"type":178,"value":1272},{"type":173,"tag":252,"props":3074,"children":3075},{"style":281},[3076],{"type":178,"value":344},{"type":173,"tag":252,"props":3078,"children":3079},{"style":275},[3080],{"type":178,"value":349},{"type":173,"tag":252,"props":3082,"children":3083},{"class":254,"line":265},[3084],{"type":173,"tag":252,"props":3085,"children":3086},{"style":259},[3087],{"type":178,"value":1555},{"type":173,"tag":252,"props":3089,"children":3090},{"class":254,"line":313},[3091,3096,3100],{"type":173,"tag":252,"props":3092,"children":3093},{"style":356},[3094],{"type":178,"value":3095},"  nitro",{"type":173,"tag":252,"props":3097,"children":3098},{"style":275},[3099],{"type":178,"value":364},{"type":173,"tag":252,"props":3101,"children":3102},{"style":275},[3103],{"type":178,"value":463},{"type":173,"tag":252,"props":3105,"children":3106},{"class":254,"line":323},[3107,3112,3116],{"type":173,"tag":252,"props":3108,"children":3109},{"style":356},[3110],{"type":178,"value":3111},"    prerender",{"type":173,"tag":252,"props":3113,"children":3114},{"style":275},[3115],{"type":178,"value":364},{"type":173,"tag":252,"props":3117,"children":3118},{"style":275},[3119],{"type":178,"value":463},{"type":173,"tag":252,"props":3121,"children":3122},{"class":254,"line":352},[3123,3128,3132,3136,3140,3144,3148],{"type":173,"tag":252,"props":3124,"children":3125},{"style":356},[3126],{"type":178,"value":3127},"      routes",{"type":173,"tag":252,"props":3129,"children":3130},{"style":275},[3131],{"type":178,"value":364},{"type":173,"tag":252,"props":3133,"children":3134},{"style":281},[3135],{"type":178,"value":401},{"type":173,"tag":252,"props":3137,"children":3138},{"style":275},[3139],{"type":178,"value":378},{"type":173,"tag":252,"props":3141,"children":3142},{"style":302},[3143],{"type":178,"value":2519},{"type":173,"tag":252,"props":3145,"children":3146},{"style":275},[3147],{"type":178,"value":378},{"type":173,"tag":252,"props":3149,"children":3150},{"style":281},[3151],{"type":178,"value":3152},"]\n",{"type":173,"tag":252,"props":3154,"children":3155},{"class":254,"line":386},[3156],{"type":173,"tag":252,"props":3157,"children":3158},{"style":275},[3159],{"type":178,"value":615},{"type":173,"tag":252,"props":3161,"children":3162},{"class":254,"line":426},[3163],{"type":173,"tag":252,"props":3164,"children":3165},{"style":275},[3166],{"type":178,"value":624},{"type":173,"tag":252,"props":3168,"children":3169},{"class":254,"line":466},[3170,3174],{"type":173,"tag":252,"props":3171,"children":3172},{"style":275},[3173],{"type":178,"value":633},{"type":173,"tag":252,"props":3175,"children":3176},{"style":281},[3177],{"type":178,"value":638},{"type":173,"tag":1445,"props":3179,"children":3180},{},[3181],{"type":178,"value":1449},{"title":167,"searchDepth":265,"depth":265,"links":3183},[3184],{"id":2471,"depth":265,"text":2474},"content:6.recipes:3.sitemap.md","6.recipes/3.sitemap.md",1699441215041]