[{"data":1,"prerenderedAt":8381},["ShallowReactive",2],{"blogsSurround:/blogs/frontend/nuxt-content-for-blog":3,"content-query-i8rjbrH0JX":25,"content-navigation-8C37fagqQL":8363},[4,24],{"_path":5,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":9,"description":10,"tags":11,"publishedAt":16,"publishedTo":17,"_type":18,"_id":19,"_source":20,"_file":21,"_stem":22,"_extension":23},"/blogs/utils/gpg-intro","utils",false,"","GPG 入门","一直没用过 gpg，刻板印象是接口非常不友好很难用，但仔细试了一下意外很好用啊。。我直接一个黑转粉（）",[12,13,14,15],"explore","#linux","#mac","#tool","2025-06-25","murchinroom-web","markdown","blogs:blogs:utils:gpg-intro:index.md","blogs","blogs/utils/gpg-intro/index.md","blogs/utils/gpg-intro/index","md",null,{"_path":26,"_dir":27,"_draft":7,"_partial":7,"_locale":8,"title":28,"description":29,"publishedAt":30,"body":31,"_type":18,"_id":8360,"_source":20,"_file":8361,"_stem":8362,"_extension":23},"/blogs/frontend/nuxt-content-for-blog","frontend","用 Nuxt Content 搭建 Blog 系统","为 Nuxt 站点增添由 Markdown 撰写的内容页面。","2024-12-20",{"type":32,"children":33,"toc":8340},"root",[34,42,47,54,70,84,107,130,144,163,168,174,215,227,232,245,294,307,315,320,326,331,345,350,393,414,477,483,496,508,879,884,890,901,1029,1042,1062,1098,1179,1200,1212,1234,1246,1261,1274,1279,1284,1460,1474,1496,1523,1528,1674,1679,1717,1832,1846,1868,1903,1958,2175,2180,2263,2268,2308,2337,2350,2356,2369,2472,2485,2499,2504,2517,2530,2568,2595,3479,3484,3490,3495,3500,3513,3526,3545,3559,3568,3663,3680,3728,3733,3738,3746,3751,3764,3772,3777,3782,3795,3988,4016,4344,4356,4418,4429,4448,4453,5099,5104,5112,5117,5125,5146,5498,5503,5508,5537,5703,5708,5721,6313,6326,6346,6371,6380,6962,6967,6985,7731,7736,7744,7749,7754,7782,7787,7792,7799,7804,7809,7878,7884,7892,7897,7911,7923,7931,7944,7965,7978,8029,8042,8075,8081,8086,8099,8112,8188,8193,8201,8278,8283,8289,8294,8315,8329,8334],{"type":35,"tag":36,"props":37,"children":39},"element","h1",{"id":38},"用-nuxt-content-搭建-blog-系统",[40],{"type":41,"value":28},"text",{"type":35,"tag":43,"props":44,"children":45},"p",{},[46],{"type":41,"value":29},{"type":35,"tag":48,"props":49,"children":51},"h2",{"id":50},"故事背景和-nuxt",[52],{"type":41,"value":53},"故事背景和 Nuxt",{"type":35,"tag":43,"props":55,"children":56},{},[57,59,68],{"type":41,"value":58},"之前有一段时期，我特别痴迷于 ",{"type":35,"tag":60,"props":61,"children":65},"a",{"href":62,"rel":63},"https://nuxt.com",[64],"nofollow",[66],{"type":41,"value":67},"Nuxt",{"type":41,"value":69},"，把各种个人和工作的新项目，都推向了使用 Nuxt 的深渊。",{"type":35,"tag":43,"props":71,"children":72},{},[73,75,82],{"type":41,"value":74},"Nuxt 在官网给自己贴的标签是 「The Intuitive Vue Framework」。实际用起来也确实是个非常直接、简单的框架呢，对得起这个名号。在符合直觉的用途下，该框架的行为和方式都很符合直觉。如果项目的架构可控，可以完全按照 Nuxt 的方式来玩，熟悉起来之后还是能节省一点点心智负担的（用起来有种 ",{"type":35,"tag":60,"props":76,"children":79},{"href":77,"rel":78},"https://fastapi.tiangolo.com",[64],[80],{"type":41,"value":81},"FastAPI",{"type":41,"value":83}," 的美感）。",{"type":35,"tag":43,"props":85,"children":86},{},[87,89,96,98,105],{"type":41,"value":88},"不过组件库缺失还是有点烦，还得上另一家的组件库，总之就是非常 NTR。等一下，我是不是忽略了 ",{"type":35,"tag":60,"props":90,"children":93},{"href":91,"rel":92},"https://ui.nuxt.com",[64],[94],{"type":41,"value":95},"Nuxt UI",{"type":41,"value":97},"？这东西，你用一次就知道了，Nuxt UI 基础版还是有很多功能缺失的——所以说真用来工作还是不如老当益壮的 ",{"type":35,"tag":60,"props":99,"children":102},{"href":100,"rel":101},"https://quasar.dev",[64],[103],{"type":41,"value":104},"Quasar",{"type":41,"value":106}," 全家桶有安全感捏。（但话说我是真的馋 Nuxt UI Pro，看文档嘎嘎香，之后还是得想办法搞一个来玩玩。）",{"type":35,"tag":43,"props":108,"children":109},{},[110,112,119,121,128],{"type":41,"value":111},"当然我也尝试了不用组件库，",{"type":35,"tag":60,"props":113,"children":116},{"href":114,"rel":115},"https://tailwindcss.com",[64],[117],{"type":41,"value":118},"Tailwind CSS",{"type":41,"value":120}," 硬上，把丢掉的手艺活全捡回来。。体验嘛，对我这种偶尔写点老气中后台、内部临时小 demo 和个人破玩具的全栈开发来说，只能说是自讨苦吃。（昨天我发现了 ",{"type":35,"tag":60,"props":122,"children":125},{"href":123,"rel":124},"https://daisyui.com",[64],[126],{"type":41,"value":127},"daisyUI",{"type":41,"value":129}," 也感觉比较有意思，直击手搓 Tailwind 的痛点，之后试试。）",{"type":35,"tag":43,"props":131,"children":132},{},[133,135,142],{"type":41,"value":134},"目前新的 ",{"type":35,"tag":60,"props":136,"children":139},{"href":137,"rel":138},"https://www.murchinroom.fun",[64],[140],{"type":41,"value":141},"murchinroom 主页",{"type":41,"value":143},"就是徒手 Tailwind 的一个例子（也不能说完全徒手叭，还是上了模版的）。",{"type":35,"tag":43,"props":145,"children":146},{},[147,153,155,161],{"type":35,"tag":148,"props":149,"children":152},"img",{"alt":150,"src":151},"murchinroom 主页截图","attachments/murchinroom-web-homepage.png",[],{"type":41,"value":154},"\n但前面说的这些都",{"type":35,"tag":156,"props":157,"children":158},"strong",{},[159],{"type":41,"value":160},"不是",{"type":41,"value":162},"重点。只是好长时间没写过东西了，单纯想唠叨一下，诶嘿。",{"type":35,"tag":43,"props":164,"children":165},{},[166],{"type":41,"value":167},"总之，这篇文章要讲的故事是，为了给这个新的 murchinroom 主页增加博客功能，我研究了一下 Nuxt Content。",{"type":35,"tag":48,"props":169,"children":171},{"id":170},"nuxt-content",[172],{"type":41,"value":173},"Nuxt Content",{"type":35,"tag":43,"props":175,"children":176},{},[177,179,186,188,195,197,204,206,213],{"type":41,"value":178},"我们都知道，如果要从头写一个纯内容的站点，例如文档或者博客站，动态的 ",{"type":35,"tag":60,"props":180,"children":183},{"href":181,"rel":182},"https://wordpress.com",[64],[184],{"type":41,"value":185},"WordPress",{"type":41,"value":187},"，或者静态的 ",{"type":35,"tag":60,"props":189,"children":192},{"href":190,"rel":191},"https://gohugo.io",[64],[193],{"type":41,"value":194},"Hugo",{"type":41,"value":196}," 才是久经考验的最佳时间。而如果你希望更现代一些",{"type":35,"tag":60,"props":198,"children":201},{"href":199,"rel":200},"https://vitepress.dev",[64],[202],{"type":41,"value":203},"VitePress",{"type":41,"value":205},"， 或者让我们更激进一些 ",{"type":35,"tag":60,"props":207,"children":210},{"href":208,"rel":209},"https://astro.build",[64],[211],{"type":41,"value":212},"Astro",{"type":41,"value":214}," 才是更好的选择。",{"type":35,"tag":43,"props":216,"children":217},{},[218,220,225],{"type":41,"value":219},"但有时候我们也得给已有的站点加入动态内容模块。例如给基于 Nuxt 的 ",{"type":35,"tag":60,"props":221,"children":223},{"href":137,"rel":222},[64],[224],{"type":41,"value":141},{"type":41,"value":226}," 增加博客模块。这个时候如果还选择上述的完整站点解决方案，就不得不掏出祖传秘方——iframe 或者直接跨站点链接跳转了，总之实现上不太优雅，你维护起来更加“救命呀！”",{"type":35,"tag":43,"props":228,"children":229},{},[230],{"type":41,"value":231},"我还是希望能在一个站点中，既有原来 Vue 写的静态或动态内容，又有一部分解析来自同一个源码目录树下的 Markdown 文档，形成博客内容。",{"type":35,"tag":43,"props":233,"children":234},{},[235,237,243],{"type":41,"value":236},"这就是 ",{"type":35,"tag":60,"props":238,"children":241},{"href":239,"rel":240},"https://content.nuxt.com",[64],[242],{"type":41,"value":173},{"type":41,"value":244}," 的用武之地。",{"type":35,"tag":246,"props":247,"children":248},"blockquote",{},[249],{"type":35,"tag":43,"props":250,"children":251},{},[252,254,261,263,269,271,277,278,284,286,292],{"type":41,"value":253},"Nuxt Content 会读取你项目中的 ",{"type":35,"tag":255,"props":256,"children":258},"code",{"className":257},[],[259],{"type":41,"value":260},"content/",{"type":41,"value":262}," 目录，解析 ",{"type":35,"tag":255,"props":264,"children":266},{"className":265},[],[267],{"type":41,"value":268},".md",{"type":41,"value":270},"、",{"type":35,"tag":255,"props":272,"children":274},{"className":273},[],[275],{"type":41,"value":276},".yml",{"type":41,"value":270},{"type":35,"tag":255,"props":279,"children":281},{"className":280},[],[282],{"type":41,"value":283},".csv",{"type":41,"value":285}," 和 ",{"type":35,"tag":255,"props":287,"children":289},{"className":288},[],[290],{"type":41,"value":291},".json",{"type":41,"value":293}," 文件，为你的应用创建一个强大的数据层。你还可以使用 MDC 语法在 Markdown 中使用 Vue 组件。\n—— Nuxt Content 官网机翻",{"type":35,"tag":43,"props":295,"children":296},{},[297,299,305],{"type":41,"value":298},"总之就是说，这东西能从你 src 里读 Markdown 文档，和一些数据文件，形成渲染好的页面，提供查询和展示功能。具体来说，对于我们的博客建设需求，就可以把博客内容的 Markdown 文档，放到站点源码的 ",{"type":35,"tag":255,"props":300,"children":302},{"className":301},[],[303],{"type":41,"value":304},"blogs/",{"type":41,"value":306}," 目录里，编译时，Nuxt Content 会把这些 markdown 一并渲染好，成为站点的博客内容页面。整个过程相当静态，有一种编译 Go 语言程序，在其中 embed 一些 static 内容的美感。",{"type":35,"tag":43,"props":308,"children":309},{},[310],{"type":35,"tag":148,"props":311,"children":314},{"alt":312,"src":313},"Nuxt Content 工作流程示意图，总之就是前一段文本的内容画成了一个丑陋的示意图，不重要。","attachments/NuxtContent.png",[],{"type":35,"tag":43,"props":316,"children":317},{},[318],{"type":41,"value":319},"由于官方的文档有一点点草率，例子和脚手架参考价值都有限。所以还是自己写一篇介绍一下我的实践。",{"type":35,"tag":48,"props":321,"children":323},{"id":322},"content-安装",[324],{"type":41,"value":325},"Content 安装",{"type":35,"tag":43,"props":327,"children":328},{},[329],{"type":41,"value":330},"此处仅介绍在现有 Nuxt 项目中添加 Content 模块，官方也有提供新建项目的脚手架，需要的读者可以参考文档。",{"type":35,"tag":246,"props":332,"children":333},{},[334],{"type":35,"tag":43,"props":335,"children":336},{},[337,339],{"type":41,"value":338},"文档：",{"type":35,"tag":60,"props":340,"children":343},{"href":341,"rel":342},"https://content.nuxt.com/get-started/installation",[64],[344],{"type":41,"value":341},{"type":35,"tag":43,"props":346,"children":347},{},[348],{"type":41,"value":349},"添加包：",{"type":35,"tag":351,"props":352,"children":356},"pre",{"code":353,"language":354,"meta":8,"className":355,"style":8},"pnpx nuxi module add content\n","sh","language-sh shiki shiki-themes github-light github-dark monokai",[357],{"type":35,"tag":255,"props":358,"children":359},{"__ignoreMap":8},[360],{"type":35,"tag":361,"props":362,"children":365},"span",{"class":363,"line":364},"line",1,[366,372,378,383,388],{"type":35,"tag":361,"props":367,"children":369},{"style":368},"--shiki-default:#6F42C1;--shiki-dark:#B392F0;--shiki-sepia:#A6E22E",[370],{"type":41,"value":371},"pnpx",{"type":35,"tag":361,"props":373,"children":375},{"style":374},"--shiki-default:#032F62;--shiki-dark:#9ECBFF;--shiki-sepia:#E6DB74",[376],{"type":41,"value":377}," nuxi",{"type":35,"tag":361,"props":379,"children":380},{"style":374},[381],{"type":41,"value":382}," module",{"type":35,"tag":361,"props":384,"children":385},{"style":374},[386],{"type":41,"value":387}," add",{"type":35,"tag":361,"props":389,"children":390},{"style":374},[391],{"type":41,"value":392}," content\n",{"type":35,"tag":43,"props":394,"children":395},{},[396,398,404,406,412],{"type":41,"value":397},"修改项目配置：",{"type":35,"tag":255,"props":399,"children":401},{"className":400},[],[402],{"type":41,"value":403},"nuxt.config.ts",{"type":41,"value":405},"，在 ",{"type":35,"tag":255,"props":407,"children":409},{"className":408},[],[410],{"type":41,"value":411},"modules",{"type":41,"value":413}," 里面增加 content：",{"type":35,"tag":351,"props":415,"children":417},{"code":416,"language":354,"meta":8,"className":355,"style":8},"export default defineNuxtConfig({\n  modules: [\n    '@nuxt/content'\n  ],\n})\n",[418],{"type":35,"tag":255,"props":419,"children":420},{"__ignoreMap":8},[421,436,450,459,468],{"type":35,"tag":361,"props":422,"children":423},{"class":363,"line":364},[424,430],{"type":35,"tag":361,"props":425,"children":427},{"style":426},"--shiki-default:#D73A49;--shiki-dark:#F97583;--shiki-sepia:#F92672",[428],{"type":41,"value":429},"export",{"type":35,"tag":361,"props":431,"children":433},{"style":432},"--shiki-default:#24292E;--shiki-dark:#E1E4E8;--shiki-sepia:#F8F8F2",[434],{"type":41,"value":435}," default defineNuxtConfig({\n",{"type":35,"tag":361,"props":437,"children":439},{"class":363,"line":438},2,[440,445],{"type":35,"tag":361,"props":441,"children":442},{"style":368},[443],{"type":41,"value":444},"  modules:",{"type":35,"tag":361,"props":446,"children":447},{"style":432},[448],{"type":41,"value":449}," [\n",{"type":35,"tag":361,"props":451,"children":453},{"class":363,"line":452},3,[454],{"type":35,"tag":361,"props":455,"children":456},{"style":368},[457],{"type":41,"value":458},"    '@nuxt/content'\n",{"type":35,"tag":361,"props":460,"children":462},{"class":363,"line":461},4,[463],{"type":35,"tag":361,"props":464,"children":465},{"style":432},[466],{"type":41,"value":467},"  ],\n",{"type":35,"tag":361,"props":469,"children":471},{"class":363,"line":470},5,[472],{"type":35,"tag":361,"props":473,"children":474},{"style":432},[475],{"type":41,"value":476},"})\n",{"type":35,"tag":48,"props":478,"children":480},{"id":479},"content-配置",[481],{"type":41,"value":482},"Content 配置",{"type":35,"tag":246,"props":484,"children":485},{},[486],{"type":35,"tag":43,"props":487,"children":488},{},[489,490],{"type":41,"value":338},{"type":35,"tag":60,"props":491,"children":494},{"href":492,"rel":493},"https://content.nuxt.com/get-started/configuration",[64],[495],{"type":41,"value":492},{"type":35,"tag":43,"props":497,"children":498},{},[499,501,506],{"type":41,"value":500},"还是在 ",{"type":35,"tag":255,"props":502,"children":504},{"className":503},[],[505],{"type":41,"value":403},{"type":41,"value":507},"，增加一坨对 Content 的配置：",{"type":35,"tag":351,"props":509,"children":513},{"code":510,"language":511,"meta":8,"className":512,"style":8},"import { resolve } from \"node:path\";\n\nexport default defineNuxtConfig({\n  content: {\n    sources: {\n      blogs: {\n        prefix: '/blogs/',\n        driver: 'fs',\n        base: resolve(__dirname, 'public/blogs')\n      }\n    },\n    highlight: {\n      langs: ['c', 'go', 'js', 'py', 'sh'],\n      theme: 'github-light',\n    },\n    markdown: {\n      rehypePlugins: {\n        \"rehype-katex\": { output: 'mathml' }\n      },\n      remarkPlugins: [\n        'remark-math'\n      ],\n    },\n  },\n})\n","ts","language-ts shiki shiki-themes github-light github-dark monokai",[514],{"type":35,"tag":255,"props":515,"children":516},{"__ignoreMap":8},[517,545,554,576,584,592,601,620,638,667,676,685,694,750,768,776,785,794,818,827,836,845,854,862,871],{"type":35,"tag":361,"props":518,"children":519},{"class":363,"line":364},[520,525,530,535,540],{"type":35,"tag":361,"props":521,"children":522},{"style":426},[523],{"type":41,"value":524},"import",{"type":35,"tag":361,"props":526,"children":527},{"style":432},[528],{"type":41,"value":529}," { resolve } ",{"type":35,"tag":361,"props":531,"children":532},{"style":426},[533],{"type":41,"value":534},"from",{"type":35,"tag":361,"props":536,"children":537},{"style":374},[538],{"type":41,"value":539}," \"node:path\"",{"type":35,"tag":361,"props":541,"children":542},{"style":432},[543],{"type":41,"value":544},";\n",{"type":35,"tag":361,"props":546,"children":547},{"class":363,"line":438},[548],{"type":35,"tag":361,"props":549,"children":551},{"emptyLinePlaceholder":550},true,[552],{"type":41,"value":553},"\n",{"type":35,"tag":361,"props":555,"children":556},{"class":363,"line":452},[557,561,566,571],{"type":35,"tag":361,"props":558,"children":559},{"style":426},[560],{"type":41,"value":429},{"type":35,"tag":361,"props":562,"children":563},{"style":426},[564],{"type":41,"value":565}," default",{"type":35,"tag":361,"props":567,"children":568},{"style":368},[569],{"type":41,"value":570}," defineNuxtConfig",{"type":35,"tag":361,"props":572,"children":573},{"style":432},[574],{"type":41,"value":575},"({\n",{"type":35,"tag":361,"props":577,"children":578},{"class":363,"line":461},[579],{"type":35,"tag":361,"props":580,"children":581},{"style":432},[582],{"type":41,"value":583},"  content: {\n",{"type":35,"tag":361,"props":585,"children":586},{"class":363,"line":470},[587],{"type":35,"tag":361,"props":588,"children":589},{"style":432},[590],{"type":41,"value":591},"    sources: {\n",{"type":35,"tag":361,"props":593,"children":595},{"class":363,"line":594},6,[596],{"type":35,"tag":361,"props":597,"children":598},{"style":432},[599],{"type":41,"value":600},"      blogs: {\n",{"type":35,"tag":361,"props":602,"children":604},{"class":363,"line":603},7,[605,610,615],{"type":35,"tag":361,"props":606,"children":607},{"style":432},[608],{"type":41,"value":609},"        prefix: ",{"type":35,"tag":361,"props":611,"children":612},{"style":374},[613],{"type":41,"value":614},"'/blogs/'",{"type":35,"tag":361,"props":616,"children":617},{"style":432},[618],{"type":41,"value":619},",\n",{"type":35,"tag":361,"props":621,"children":623},{"class":363,"line":622},8,[624,629,634],{"type":35,"tag":361,"props":625,"children":626},{"style":432},[627],{"type":41,"value":628},"        driver: ",{"type":35,"tag":361,"props":630,"children":631},{"style":374},[632],{"type":41,"value":633},"'fs'",{"type":35,"tag":361,"props":635,"children":636},{"style":432},[637],{"type":41,"value":619},{"type":35,"tag":361,"props":639,"children":641},{"class":363,"line":640},9,[642,647,652,657,662],{"type":35,"tag":361,"props":643,"children":644},{"style":432},[645],{"type":41,"value":646},"        base: ",{"type":35,"tag":361,"props":648,"children":649},{"style":368},[650],{"type":41,"value":651},"resolve",{"type":35,"tag":361,"props":653,"children":654},{"style":432},[655],{"type":41,"value":656},"(__dirname, ",{"type":35,"tag":361,"props":658,"children":659},{"style":374},[660],{"type":41,"value":661},"'public/blogs'",{"type":35,"tag":361,"props":663,"children":664},{"style":432},[665],{"type":41,"value":666},")\n",{"type":35,"tag":361,"props":668,"children":670},{"class":363,"line":669},10,[671],{"type":35,"tag":361,"props":672,"children":673},{"style":432},[674],{"type":41,"value":675},"      }\n",{"type":35,"tag":361,"props":677,"children":679},{"class":363,"line":678},11,[680],{"type":35,"tag":361,"props":681,"children":682},{"style":432},[683],{"type":41,"value":684},"    },\n",{"type":35,"tag":361,"props":686,"children":688},{"class":363,"line":687},12,[689],{"type":35,"tag":361,"props":690,"children":691},{"style":432},[692],{"type":41,"value":693},"    highlight: {\n",{"type":35,"tag":361,"props":695,"children":697},{"class":363,"line":696},13,[698,703,708,713,718,722,727,731,736,740,745],{"type":35,"tag":361,"props":699,"children":700},{"style":432},[701],{"type":41,"value":702},"      langs: [",{"type":35,"tag":361,"props":704,"children":705},{"style":374},[706],{"type":41,"value":707},"'c'",{"type":35,"tag":361,"props":709,"children":710},{"style":432},[711],{"type":41,"value":712},", ",{"type":35,"tag":361,"props":714,"children":715},{"style":374},[716],{"type":41,"value":717},"'go'",{"type":35,"tag":361,"props":719,"children":720},{"style":432},[721],{"type":41,"value":712},{"type":35,"tag":361,"props":723,"children":724},{"style":374},[725],{"type":41,"value":726},"'js'",{"type":35,"tag":361,"props":728,"children":729},{"style":432},[730],{"type":41,"value":712},{"type":35,"tag":361,"props":732,"children":733},{"style":374},[734],{"type":41,"value":735},"'py'",{"type":35,"tag":361,"props":737,"children":738},{"style":432},[739],{"type":41,"value":712},{"type":35,"tag":361,"props":741,"children":742},{"style":374},[743],{"type":41,"value":744},"'sh'",{"type":35,"tag":361,"props":746,"children":747},{"style":432},[748],{"type":41,"value":749},"],\n",{"type":35,"tag":361,"props":751,"children":753},{"class":363,"line":752},14,[754,759,764],{"type":35,"tag":361,"props":755,"children":756},{"style":432},[757],{"type":41,"value":758},"      theme: ",{"type":35,"tag":361,"props":760,"children":761},{"style":374},[762],{"type":41,"value":763},"'github-light'",{"type":35,"tag":361,"props":765,"children":766},{"style":432},[767],{"type":41,"value":619},{"type":35,"tag":361,"props":769,"children":771},{"class":363,"line":770},15,[772],{"type":35,"tag":361,"props":773,"children":774},{"style":432},[775],{"type":41,"value":684},{"type":35,"tag":361,"props":777,"children":779},{"class":363,"line":778},16,[780],{"type":35,"tag":361,"props":781,"children":782},{"style":432},[783],{"type":41,"value":784},"    markdown: {\n",{"type":35,"tag":361,"props":786,"children":788},{"class":363,"line":787},17,[789],{"type":35,"tag":361,"props":790,"children":791},{"style":432},[792],{"type":41,"value":793},"      rehypePlugins: {\n",{"type":35,"tag":361,"props":795,"children":797},{"class":363,"line":796},18,[798,803,808,813],{"type":35,"tag":361,"props":799,"children":800},{"style":374},[801],{"type":41,"value":802},"        \"rehype-katex\"",{"type":35,"tag":361,"props":804,"children":805},{"style":432},[806],{"type":41,"value":807},": { output: ",{"type":35,"tag":361,"props":809,"children":810},{"style":374},[811],{"type":41,"value":812},"'mathml'",{"type":35,"tag":361,"props":814,"children":815},{"style":432},[816],{"type":41,"value":817}," }\n",{"type":35,"tag":361,"props":819,"children":821},{"class":363,"line":820},19,[822],{"type":35,"tag":361,"props":823,"children":824},{"style":432},[825],{"type":41,"value":826},"      },\n",{"type":35,"tag":361,"props":828,"children":830},{"class":363,"line":829},20,[831],{"type":35,"tag":361,"props":832,"children":833},{"style":432},[834],{"type":41,"value":835},"      remarkPlugins: [\n",{"type":35,"tag":361,"props":837,"children":839},{"class":363,"line":838},21,[840],{"type":35,"tag":361,"props":841,"children":842},{"style":374},[843],{"type":41,"value":844},"        'remark-math'\n",{"type":35,"tag":361,"props":846,"children":848},{"class":363,"line":847},22,[849],{"type":35,"tag":361,"props":850,"children":851},{"style":432},[852],{"type":41,"value":853},"      ],\n",{"type":35,"tag":361,"props":855,"children":857},{"class":363,"line":856},23,[858],{"type":35,"tag":361,"props":859,"children":860},{"style":432},[861],{"type":41,"value":684},{"type":35,"tag":361,"props":863,"children":865},{"class":363,"line":864},24,[866],{"type":35,"tag":361,"props":867,"children":868},{"style":432},[869],{"type":41,"value":870},"  },\n",{"type":35,"tag":361,"props":872,"children":874},{"class":363,"line":873},25,[875],{"type":35,"tag":361,"props":876,"children":877},{"style":432},[878],{"type":41,"value":476},{"type":35,"tag":43,"props":880,"children":881},{},[882],{"type":41,"value":883},"上面是一些基本的、常用的配置。下面我们一项项详细介绍。",{"type":35,"tag":885,"props":886,"children":888},"h3",{"id":887},"sources",[889],{"type":41,"value":887},{"type":35,"tag":43,"props":891,"children":892},{},[893,899],{"type":35,"tag":255,"props":894,"children":896},{"className":895},[],[897],{"type":41,"value":898},"content.source",{"type":41,"value":900}," 配置 Nuxt Content 要读取的内容源。",{"type":35,"tag":351,"props":902,"children":904},{"code":903,"language":511,"meta":8,"className":512,"style":8},"export default defineNuxtConfig({\n  content: {\n    sources: {\n      blogs: {\n        prefix: '/blogs/',\n        driver: 'fs',\n        base: resolve(__dirname, 'public/blogs')\n      }\n    },\n  },\n})\n",[905],{"type":35,"tag":255,"props":906,"children":907},{"__ignoreMap":8},[908,927,934,941,948,963,978,1001,1008,1015,1022],{"type":35,"tag":361,"props":909,"children":910},{"class":363,"line":364},[911,915,919,923],{"type":35,"tag":361,"props":912,"children":913},{"style":426},[914],{"type":41,"value":429},{"type":35,"tag":361,"props":916,"children":917},{"style":426},[918],{"type":41,"value":565},{"type":35,"tag":361,"props":920,"children":921},{"style":368},[922],{"type":41,"value":570},{"type":35,"tag":361,"props":924,"children":925},{"style":432},[926],{"type":41,"value":575},{"type":35,"tag":361,"props":928,"children":929},{"class":363,"line":438},[930],{"type":35,"tag":361,"props":931,"children":932},{"style":432},[933],{"type":41,"value":583},{"type":35,"tag":361,"props":935,"children":936},{"class":363,"line":452},[937],{"type":35,"tag":361,"props":938,"children":939},{"style":432},[940],{"type":41,"value":591},{"type":35,"tag":361,"props":942,"children":943},{"class":363,"line":461},[944],{"type":35,"tag":361,"props":945,"children":946},{"style":432},[947],{"type":41,"value":600},{"type":35,"tag":361,"props":949,"children":950},{"class":363,"line":470},[951,955,959],{"type":35,"tag":361,"props":952,"children":953},{"style":432},[954],{"type":41,"value":609},{"type":35,"tag":361,"props":956,"children":957},{"style":374},[958],{"type":41,"value":614},{"type":35,"tag":361,"props":960,"children":961},{"style":432},[962],{"type":41,"value":619},{"type":35,"tag":361,"props":964,"children":965},{"class":363,"line":594},[966,970,974],{"type":35,"tag":361,"props":967,"children":968},{"style":432},[969],{"type":41,"value":628},{"type":35,"tag":361,"props":971,"children":972},{"style":374},[973],{"type":41,"value":633},{"type":35,"tag":361,"props":975,"children":976},{"style":432},[977],{"type":41,"value":619},{"type":35,"tag":361,"props":979,"children":980},{"class":363,"line":603},[981,985,989,993,997],{"type":35,"tag":361,"props":982,"children":983},{"style":432},[984],{"type":41,"value":646},{"type":35,"tag":361,"props":986,"children":987},{"style":368},[988],{"type":41,"value":651},{"type":35,"tag":361,"props":990,"children":991},{"style":432},[992],{"type":41,"value":656},{"type":35,"tag":361,"props":994,"children":995},{"style":374},[996],{"type":41,"value":661},{"type":35,"tag":361,"props":998,"children":999},{"style":432},[1000],{"type":41,"value":666},{"type":35,"tag":361,"props":1002,"children":1003},{"class":363,"line":622},[1004],{"type":35,"tag":361,"props":1005,"children":1006},{"style":432},[1007],{"type":41,"value":675},{"type":35,"tag":361,"props":1009,"children":1010},{"class":363,"line":640},[1011],{"type":35,"tag":361,"props":1012,"children":1013},{"style":432},[1014],{"type":41,"value":684},{"type":35,"tag":361,"props":1016,"children":1017},{"class":363,"line":669},[1018],{"type":35,"tag":361,"props":1019,"children":1020},{"style":432},[1021],{"type":41,"value":870},{"type":35,"tag":361,"props":1023,"children":1024},{"class":363,"line":678},[1025],{"type":35,"tag":361,"props":1026,"children":1027},{"style":432},[1028],{"type":41,"value":476},{"type":35,"tag":246,"props":1030,"children":1031},{},[1032],{"type":35,"tag":43,"props":1033,"children":1034},{},[1035,1036],{"type":41,"value":338},{"type":35,"tag":60,"props":1037,"children":1040},{"href":1038,"rel":1039},"https://content.nuxt.com/get-started/configuration#sources",[64],[1041],{"type":41,"value":1038},{"type":35,"tag":43,"props":1043,"children":1044},{},[1045,1047,1052,1054,1060],{"type":41,"value":1046},"默认的源是项目源码根目录下的 ",{"type":35,"tag":255,"props":1048,"children":1050},{"className":1049},[],[1051],{"type":41,"value":260},{"type":41,"value":1053}," 目录，映射到路由 ",{"type":35,"tag":255,"props":1055,"children":1057},{"className":1056},[],[1058],{"type":41,"value":1059},"/content",{"type":41,"value":1061},"。如果不想用默认的，不要创建这个目录就行。",{"type":35,"tag":43,"props":1063,"children":1064},{},[1065,1067,1072,1074,1080,1082,1088,1090,1096],{"type":41,"value":1066},"除了默认的，还可以添加多个自定义的源。例如，上面的例子中，创建了一个叫做 ",{"type":35,"tag":255,"props":1068,"children":1070},{"className":1069},[],[1071],{"type":41,"value":20},{"type":41,"value":1073}," 的源，使用 ",{"type":35,"tag":255,"props":1075,"children":1077},{"className":1076},[],[1078],{"type":41,"value":1079},"fs",{"type":41,"value":1081}," driver，即读取本地源文件，将 ",{"type":35,"tag":255,"props":1083,"children":1085},{"className":1084},[],[1086],{"type":41,"value":1087},"public/blogs",{"type":41,"value":1089}," 下的内容（Markdown 文档）映射到 ",{"type":35,"tag":255,"props":1091,"children":1093},{"className":1092},[],[1094],{"type":41,"value":1095},"/blogs",{"type":41,"value":1097}," 路由下：",{"type":35,"tag":1099,"props":1100,"children":1101},"table",{},[1102,1130],{"type":35,"tag":1103,"props":1104,"children":1105},"thead",{},[1106],{"type":35,"tag":1107,"props":1108,"children":1109},"tr",{},[1110,1115,1120,1125],{"type":35,"tag":1111,"props":1112,"children":1114},"th",{"align":1113},"center",[],{"type":35,"tag":1111,"props":1116,"children":1117},{},[1118],{"type":41,"value":1119},"src",{"type":35,"tag":1111,"props":1121,"children":1122},{"align":1113},[1123],{"type":41,"value":1124},"-->",{"type":35,"tag":1111,"props":1126,"children":1127},{},[1128],{"type":41,"value":1129},"dist",{"type":35,"tag":1131,"props":1132,"children":1133},"tbody",{},[1134,1157],{"type":35,"tag":1107,"props":1135,"children":1136},{},[1137,1143,1148,1152],{"type":35,"tag":1138,"props":1139,"children":1140},"td",{"align":1113},[1141],{"type":41,"value":1142},"类型",{"type":35,"tag":1138,"props":1144,"children":1145},{},[1146],{"type":41,"value":1147},"Markdown 文件",{"type":35,"tag":1138,"props":1149,"children":1150},{"align":1113},[1151],{"type":41,"value":1124},{"type":35,"tag":1138,"props":1153,"children":1154},{},[1155],{"type":41,"value":1156},"页面路由",{"type":35,"tag":1107,"props":1158,"children":1159},{},[1160,1165,1170,1174],{"type":35,"tag":1138,"props":1161,"children":1162},{"align":1113},[1163],{"type":41,"value":1164},"路径",{"type":35,"tag":1138,"props":1166,"children":1167},{},[1168],{"type":41,"value":1169},"/public/blogs/xx/yy.md",{"type":35,"tag":1138,"props":1171,"children":1172},{"align":1113},[1173],{"type":41,"value":1124},{"type":35,"tag":1138,"props":1175,"children":1176},{},[1177],{"type":41,"value":1178},"/blogs/xx/yy",{"type":35,"tag":43,"props":1180,"children":1181},{},[1182,1184,1190,1192,1198],{"type":41,"value":1183},"这里我做了一个不太常规的事：把 ",{"type":35,"tag":255,"props":1185,"children":1187},{"className":1186},[],[1188],{"type":41,"value":1189},"base",{"type":41,"value":1191}," 配置到了 ",{"type":35,"tag":255,"props":1193,"children":1195},{"className":1194},[],[1196],{"type":41,"value":1197},"public/",{"type":41,"value":1199}," 目录下。",{"type":35,"tag":43,"props":1201,"children":1202},{},[1203,1205,1210],{"type":41,"value":1204},"我们知道 ",{"type":35,"tag":255,"props":1206,"children":1208},{"className":1207},[],[1209],{"type":41,"value":1197},{"type":41,"value":1211}," 目录下的东西会在编译打包时，被全部无脑扔到生成的 dist 目录中。把 Content 源放在这个目录下，带来了两个好处：",{"type":35,"tag":1213,"props":1214,"children":1215},"ul",{},[1216,1222],{"type":35,"tag":1217,"props":1218,"children":1219},"li",{},[1220],{"type":41,"value":1221},"可以把 Markdown 文档需要的附件（主要是图片），和 Markdown 文档本身放到同一个目录下，用相对路径去引用。这是我惯用的组织方式，因为它通常能够完美适配各种编辑器和 Git 仓库，而无需任何特殊设置。",{"type":35,"tag":1217,"props":1223,"children":1224},{},[1225,1227,1232],{"type":41,"value":1226},"用户在访问系统时，可以通过在博客页面 URL 后面加上 ",{"type":35,"tag":255,"props":1228,"children":1230},{"className":1229},[],[1231],{"type":41,"value":268},{"type":41,"value":1233}," 访问到未经渲染的博客源文件，这可能对于一些有特殊癖好的用户（例如希望把看到的东西保存到自己的文档库中）或者非人类用户（我向来主张平等对待来自机器和人类的所有善意访问）提供一些便利。",{"type":35,"tag":43,"props":1235,"children":1236},{},[1237,1239,1244],{"type":41,"value":1238},"⚠️ 但这也会引入一个",{"type":35,"tag":156,"props":1240,"children":1241},{},[1242],{"type":41,"value":1243},"缺陷",{"type":41,"value":1245},"：",{"type":35,"tag":1213,"props":1247,"children":1248},{},[1249],{"type":35,"tag":1217,"props":1250,"children":1251},{},[1252,1254,1259],{"type":41,"value":1253},"源中的所有文章，即便是没有准备好发布的，只要加到源里了，项目打包过后，就可以使用加 ",{"type":35,"tag":255,"props":1255,"children":1257},{"className":1256},[],[1258],{"type":41,"value":268},{"type":41,"value":1260}," 的方式访问到。",{"type":35,"tag":43,"props":1262,"children":1263},{},[1264,1266,1272],{"type":41,"value":1265},"这可能不是一些用户期望的行为。但对于我的需求来说，反正一整个 ",{"type":35,"tag":60,"props":1267,"children":1270},{"href":1268,"rel":1269},"https://github.com/murchinroom/murchinroom-web",[64],[1271],{"type":41,"value":17},{"type":41,"value":1273},"  都是开源的，本来也就完全不设防，所以无所谓。",{"type":35,"tag":885,"props":1275,"children":1277},{"id":1276},"highlight",[1278],{"type":41,"value":1276},{"type":35,"tag":43,"props":1280,"children":1281},{},[1282],{"type":41,"value":1283},"毕竟是开发者，博客难免要有代码块，语法高亮不能少。",{"type":35,"tag":351,"props":1285,"children":1287},{"code":1286,"language":511,"meta":8,"className":512,"style":8},"export default defineNuxtConfig({\n  content: {\n    highlight: {\n      langs: ['c', 'go', 'js', 'py', 'sh', '总之就是你用的各种语言'],\n      theme: {\n        default: 'github-light', // Default theme\n        dark: 'github-dark', // Theme used if `html.dark`\n      },\n    },\n  },\n})\n",[1288],{"type":35,"tag":255,"props":1289,"children":1290},{"__ignoreMap":8},[1291,1310,1317,1324,1380,1388,1410,1432,1439,1446,1453],{"type":35,"tag":361,"props":1292,"children":1293},{"class":363,"line":364},[1294,1298,1302,1306],{"type":35,"tag":361,"props":1295,"children":1296},{"style":426},[1297],{"type":41,"value":429},{"type":35,"tag":361,"props":1299,"children":1300},{"style":426},[1301],{"type":41,"value":565},{"type":35,"tag":361,"props":1303,"children":1304},{"style":368},[1305],{"type":41,"value":570},{"type":35,"tag":361,"props":1307,"children":1308},{"style":432},[1309],{"type":41,"value":575},{"type":35,"tag":361,"props":1311,"children":1312},{"class":363,"line":438},[1313],{"type":35,"tag":361,"props":1314,"children":1315},{"style":432},[1316],{"type":41,"value":583},{"type":35,"tag":361,"props":1318,"children":1319},{"class":363,"line":452},[1320],{"type":35,"tag":361,"props":1321,"children":1322},{"style":432},[1323],{"type":41,"value":693},{"type":35,"tag":361,"props":1325,"children":1326},{"class":363,"line":461},[1327,1331,1335,1339,1343,1347,1351,1355,1359,1363,1367,1371,1376],{"type":35,"tag":361,"props":1328,"children":1329},{"style":432},[1330],{"type":41,"value":702},{"type":35,"tag":361,"props":1332,"children":1333},{"style":374},[1334],{"type":41,"value":707},{"type":35,"tag":361,"props":1336,"children":1337},{"style":432},[1338],{"type":41,"value":712},{"type":35,"tag":361,"props":1340,"children":1341},{"style":374},[1342],{"type":41,"value":717},{"type":35,"tag":361,"props":1344,"children":1345},{"style":432},[1346],{"type":41,"value":712},{"type":35,"tag":361,"props":1348,"children":1349},{"style":374},[1350],{"type":41,"value":726},{"type":35,"tag":361,"props":1352,"children":1353},{"style":432},[1354],{"type":41,"value":712},{"type":35,"tag":361,"props":1356,"children":1357},{"style":374},[1358],{"type":41,"value":735},{"type":35,"tag":361,"props":1360,"children":1361},{"style":432},[1362],{"type":41,"value":712},{"type":35,"tag":361,"props":1364,"children":1365},{"style":374},[1366],{"type":41,"value":744},{"type":35,"tag":361,"props":1368,"children":1369},{"style":432},[1370],{"type":41,"value":712},{"type":35,"tag":361,"props":1372,"children":1373},{"style":374},[1374],{"type":41,"value":1375},"'总之就是你用的各种语言'",{"type":35,"tag":361,"props":1377,"children":1378},{"style":432},[1379],{"type":41,"value":749},{"type":35,"tag":361,"props":1381,"children":1382},{"class":363,"line":470},[1383],{"type":35,"tag":361,"props":1384,"children":1385},{"style":432},[1386],{"type":41,"value":1387},"      theme: {\n",{"type":35,"tag":361,"props":1389,"children":1390},{"class":363,"line":594},[1391,1396,1400,1404],{"type":35,"tag":361,"props":1392,"children":1393},{"style":432},[1394],{"type":41,"value":1395},"        default: ",{"type":35,"tag":361,"props":1397,"children":1398},{"style":374},[1399],{"type":41,"value":763},{"type":35,"tag":361,"props":1401,"children":1402},{"style":432},[1403],{"type":41,"value":712},{"type":35,"tag":361,"props":1405,"children":1407},{"style":1406},"--shiki-default:#6A737D;--shiki-dark:#6A737D;--shiki-sepia:#88846F",[1408],{"type":41,"value":1409},"// Default theme\n",{"type":35,"tag":361,"props":1411,"children":1412},{"class":363,"line":603},[1413,1418,1423,1427],{"type":35,"tag":361,"props":1414,"children":1415},{"style":432},[1416],{"type":41,"value":1417},"        dark: ",{"type":35,"tag":361,"props":1419,"children":1420},{"style":374},[1421],{"type":41,"value":1422},"'github-dark'",{"type":35,"tag":361,"props":1424,"children":1425},{"style":432},[1426],{"type":41,"value":712},{"type":35,"tag":361,"props":1428,"children":1429},{"style":1406},[1430],{"type":41,"value":1431},"// Theme used if `html.dark`\n",{"type":35,"tag":361,"props":1433,"children":1434},{"class":363,"line":622},[1435],{"type":35,"tag":361,"props":1436,"children":1437},{"style":432},[1438],{"type":41,"value":826},{"type":35,"tag":361,"props":1440,"children":1441},{"class":363,"line":640},[1442],{"type":35,"tag":361,"props":1443,"children":1444},{"style":432},[1445],{"type":41,"value":684},{"type":35,"tag":361,"props":1447,"children":1448},{"class":363,"line":669},[1449],{"type":35,"tag":361,"props":1450,"children":1451},{"style":432},[1452],{"type":41,"value":870},{"type":35,"tag":361,"props":1454,"children":1455},{"class":363,"line":678},[1456],{"type":35,"tag":361,"props":1457,"children":1458},{"style":432},[1459],{"type":41,"value":476},{"type":35,"tag":246,"props":1461,"children":1462},{},[1463],{"type":35,"tag":43,"props":1464,"children":1465},{},[1466,1468],{"type":41,"value":1467},"文档: ",{"type":35,"tag":60,"props":1469,"children":1472},{"href":1470,"rel":1471},"https://content.nuxt.com/get-started/configuration#highlight",[64],[1473],{"type":41,"value":1470},{"type":35,"tag":43,"props":1475,"children":1476},{},[1477,1479,1485,1487,1494],{"type":41,"value":1478},"你需要把需要用到的各种语言都加到 ",{"type":35,"tag":255,"props":1480,"children":1482},{"className":1481},[],[1483],{"type":41,"value":1484},"langs",{"type":41,"value":1486}," 数组中，Nuxt Content 才会高亮对应语言的代码块。同时你也可以配置你喜欢的代码块主题。语法高亮使用的是 ",{"type":35,"tag":60,"props":1488,"children":1491},{"href":1489,"rel":1490},"https://github.com/shikijs/shiki",[64],[1492],{"type":41,"value":1493},"shiki",{"type":41,"value":1495}," ，所以：",{"type":35,"tag":1213,"props":1497,"children":1498},{},[1499,1511],{"type":35,"tag":1217,"props":1500,"children":1501},{},[1502,1504],{"type":41,"value":1503},"langs：支持的语言列表在这里: ",{"type":35,"tag":60,"props":1505,"children":1508},{"href":1506,"rel":1507},"https://github.com/shikijs/textmate-grammars-themes/tree/main/packages/tm-grammars",[64],[1509],{"type":41,"value":1510},"tm-grammars",{"type":35,"tag":1217,"props":1512,"children":1513},{},[1514,1516],{"type":41,"value":1515},"theme：支持的主题列表在这里：",{"type":35,"tag":60,"props":1517,"children":1520},{"href":1518,"rel":1519},"https://github.com/shikijs/textmate-grammars-themes/tree/main/packages/tm-themes",[64],[1521],{"type":41,"value":1522},"tm-themes",{"type":35,"tag":43,"props":1524,"children":1525},{},[1526],{"type":41,"value":1527},"向我们这种杂食小丑，写的语言可能有一点多，一时半会儿也想不全，全加上好像又会增大一点点体积？所以下面这串命令可能可以帮你从一个现有的 Markdown 仓库中，挖掘出你到底写过哪些语言：",{"type":35,"tag":351,"props":1529,"children":1531},{"code":1530,"language":354,"meta":8,"className":355,"style":8},"grep -IRn '```' | grep -v '```$' | grep '.md:' | grep -v '/plugins' | cut -d'`' -f4 | tr '[:upper:]' '[:lower:]' | sort | uniq | xargs\n",[1532],{"type":35,"tag":255,"props":1533,"children":1534},{"__ignoreMap":8},[1535],{"type":35,"tag":361,"props":1536,"children":1537},{"class":363,"line":364},[1538,1543,1549,1554,1559,1564,1569,1574,1578,1582,1587,1591,1595,1599,1604,1608,1613,1618,1623,1628,1632,1637,1642,1647,1651,1656,1660,1665,1669],{"type":35,"tag":361,"props":1539,"children":1540},{"style":368},[1541],{"type":41,"value":1542},"grep",{"type":35,"tag":361,"props":1544,"children":1546},{"style":1545},"--shiki-default:#005CC5;--shiki-dark:#79B8FF;--shiki-sepia:#AE81FF",[1547],{"type":41,"value":1548}," -IRn",{"type":35,"tag":361,"props":1550,"children":1551},{"style":374},[1552],{"type":41,"value":1553}," '```'",{"type":35,"tag":361,"props":1555,"children":1556},{"style":426},[1557],{"type":41,"value":1558}," |",{"type":35,"tag":361,"props":1560,"children":1561},{"style":368},[1562],{"type":41,"value":1563}," grep",{"type":35,"tag":361,"props":1565,"children":1566},{"style":1545},[1567],{"type":41,"value":1568}," -v",{"type":35,"tag":361,"props":1570,"children":1571},{"style":374},[1572],{"type":41,"value":1573}," '```$'",{"type":35,"tag":361,"props":1575,"children":1576},{"style":426},[1577],{"type":41,"value":1558},{"type":35,"tag":361,"props":1579,"children":1580},{"style":368},[1581],{"type":41,"value":1563},{"type":35,"tag":361,"props":1583,"children":1584},{"style":374},[1585],{"type":41,"value":1586}," '.md:'",{"type":35,"tag":361,"props":1588,"children":1589},{"style":426},[1590],{"type":41,"value":1558},{"type":35,"tag":361,"props":1592,"children":1593},{"style":368},[1594],{"type":41,"value":1563},{"type":35,"tag":361,"props":1596,"children":1597},{"style":1545},[1598],{"type":41,"value":1568},{"type":35,"tag":361,"props":1600,"children":1601},{"style":374},[1602],{"type":41,"value":1603}," '/plugins'",{"type":35,"tag":361,"props":1605,"children":1606},{"style":426},[1607],{"type":41,"value":1558},{"type":35,"tag":361,"props":1609,"children":1610},{"style":368},[1611],{"type":41,"value":1612}," cut",{"type":35,"tag":361,"props":1614,"children":1615},{"style":1545},[1616],{"type":41,"value":1617}," -d",{"type":35,"tag":361,"props":1619,"children":1620},{"style":374},[1621],{"type":41,"value":1622},"'`'",{"type":35,"tag":361,"props":1624,"children":1625},{"style":1545},[1626],{"type":41,"value":1627}," -f4",{"type":35,"tag":361,"props":1629,"children":1630},{"style":426},[1631],{"type":41,"value":1558},{"type":35,"tag":361,"props":1633,"children":1634},{"style":368},[1635],{"type":41,"value":1636}," tr",{"type":35,"tag":361,"props":1638,"children":1639},{"style":374},[1640],{"type":41,"value":1641}," '[:upper:]'",{"type":35,"tag":361,"props":1643,"children":1644},{"style":374},[1645],{"type":41,"value":1646}," '[:lower:]'",{"type":35,"tag":361,"props":1648,"children":1649},{"style":426},[1650],{"type":41,"value":1558},{"type":35,"tag":361,"props":1652,"children":1653},{"style":368},[1654],{"type":41,"value":1655}," sort",{"type":35,"tag":361,"props":1657,"children":1658},{"style":426},[1659],{"type":41,"value":1558},{"type":35,"tag":361,"props":1661,"children":1662},{"style":368},[1663],{"type":41,"value":1664}," uniq",{"type":35,"tag":361,"props":1666,"children":1667},{"style":426},[1668],{"type":41,"value":1558},{"type":35,"tag":361,"props":1670,"children":1671},{"style":368},[1672],{"type":41,"value":1673}," xargs\n",{"type":35,"tag":885,"props":1675,"children":1677},{"id":1676},"数学支持",[1678],{"type":41,"value":1676},{"type":35,"tag":43,"props":1680,"children":1681},{},[1682,1684,1715],{"type":41,"value":1683},"基于 ",{"type":35,"tag":361,"props":1685,"children":1688},{"className":1686},[1687],"katex",[1689],{"type":35,"tag":1690,"props":1691,"children":1693},"math",{"xmlns":1692},"http://www.w3.org/1998/Math/MathML",[1694],{"type":35,"tag":1695,"props":1696,"children":1697},"semantics",{},[1698,1708],{"type":35,"tag":1699,"props":1700,"children":1701},"mrow",{},[1702],{"type":35,"tag":1703,"props":1704,"children":1705},"mtext",{},[1706],{"type":41,"value":1707},"TeX",{"type":35,"tag":1709,"props":1710,"children":1712},"annotation",{"encoding":1711},"application/x-tex",[1713],{"type":41,"value":1714},"\\TeX",{"type":41,"value":1716}," 的公式支持也是我觉得常用的一个点，这个功能可以通过增加 markdown 插件来实现。",{"type":35,"tag":351,"props":1718,"children":1720},{"code":1719,"language":511,"meta":8,"className":512,"style":8},"export default defineNuxtConfig({\n  content: {\n    markdown: {\n      rehypePlugins: {\n        \"rehype-katex\": { output: 'mathml' }\n      },\n      remarkPlugins: [\n        'remark-math'\n      ],\n    },\n  },\n})\n",[1721],{"type":35,"tag":255,"props":1722,"children":1723},{"__ignoreMap":8},[1724,1743,1750,1757,1764,1783,1790,1797,1804,1811,1818,1825],{"type":35,"tag":361,"props":1725,"children":1726},{"class":363,"line":364},[1727,1731,1735,1739],{"type":35,"tag":361,"props":1728,"children":1729},{"style":426},[1730],{"type":41,"value":429},{"type":35,"tag":361,"props":1732,"children":1733},{"style":426},[1734],{"type":41,"value":565},{"type":35,"tag":361,"props":1736,"children":1737},{"style":368},[1738],{"type":41,"value":570},{"type":35,"tag":361,"props":1740,"children":1741},{"style":432},[1742],{"type":41,"value":575},{"type":35,"tag":361,"props":1744,"children":1745},{"class":363,"line":438},[1746],{"type":35,"tag":361,"props":1747,"children":1748},{"style":432},[1749],{"type":41,"value":583},{"type":35,"tag":361,"props":1751,"children":1752},{"class":363,"line":452},[1753],{"type":35,"tag":361,"props":1754,"children":1755},{"style":432},[1756],{"type":41,"value":784},{"type":35,"tag":361,"props":1758,"children":1759},{"class":363,"line":461},[1760],{"type":35,"tag":361,"props":1761,"children":1762},{"style":432},[1763],{"type":41,"value":793},{"type":35,"tag":361,"props":1765,"children":1766},{"class":363,"line":470},[1767,1771,1775,1779],{"type":35,"tag":361,"props":1768,"children":1769},{"style":374},[1770],{"type":41,"value":802},{"type":35,"tag":361,"props":1772,"children":1773},{"style":432},[1774],{"type":41,"value":807},{"type":35,"tag":361,"props":1776,"children":1777},{"style":374},[1778],{"type":41,"value":812},{"type":35,"tag":361,"props":1780,"children":1781},{"style":432},[1782],{"type":41,"value":817},{"type":35,"tag":361,"props":1784,"children":1785},{"class":363,"line":594},[1786],{"type":35,"tag":361,"props":1787,"children":1788},{"style":432},[1789],{"type":41,"value":826},{"type":35,"tag":361,"props":1791,"children":1792},{"class":363,"line":603},[1793],{"type":35,"tag":361,"props":1794,"children":1795},{"style":432},[1796],{"type":41,"value":835},{"type":35,"tag":361,"props":1798,"children":1799},{"class":363,"line":622},[1800],{"type":35,"tag":361,"props":1801,"children":1802},{"style":374},[1803],{"type":41,"value":844},{"type":35,"tag":361,"props":1805,"children":1806},{"class":363,"line":640},[1807],{"type":35,"tag":361,"props":1808,"children":1809},{"style":432},[1810],{"type":41,"value":853},{"type":35,"tag":361,"props":1812,"children":1813},{"class":363,"line":669},[1814],{"type":35,"tag":361,"props":1815,"children":1816},{"style":432},[1817],{"type":41,"value":684},{"type":35,"tag":361,"props":1819,"children":1820},{"class":363,"line":678},[1821],{"type":35,"tag":361,"props":1822,"children":1823},{"style":432},[1824],{"type":41,"value":870},{"type":35,"tag":361,"props":1826,"children":1827},{"class":363,"line":687},[1828],{"type":35,"tag":361,"props":1829,"children":1830},{"style":432},[1831],{"type":41,"value":476},{"type":35,"tag":246,"props":1833,"children":1834},{},[1835],{"type":35,"tag":43,"props":1836,"children":1837},{},[1838,1840],{"type":41,"value":1839},"参考讨论: ",{"type":35,"tag":60,"props":1841,"children":1844},{"href":1842,"rel":1843},"https://github.com/nuxt/content/discussions/2561",[64],[1845],{"type":41,"value":1842},{"type":35,"tag":43,"props":1847,"children":1848},{},[1849,1851,1858,1859,1866],{"type":41,"value":1850},"Nuxt Content 处理 Markdown 时，可以用 ",{"type":35,"tag":60,"props":1852,"children":1855},{"href":1853,"rel":1854},"https://github.com/remarkjs/remark",[64],[1856],{"type":41,"value":1857},"remark",{"type":41,"value":285},{"type":35,"tag":60,"props":1860,"children":1863},{"href":1861,"rel":1862},"https://github.com/rehypejs/rehype",[64],[1864],{"type":41,"value":1865},"rehype",{"type":41,"value":1867}," 插件。",{"type":35,"tag":1213,"props":1869,"children":1870},{},[1871,1881,1891],{"type":35,"tag":1217,"props":1872,"children":1873},{},[1874,1879],{"type":35,"tag":60,"props":1875,"children":1877},{"href":1853,"rel":1876},[64],[1878],{"type":41,"value":1857},{"type":41,"value":1880}," is a tool that transforms markdown with plugins. These plugins can inspect and change your markup.",{"type":35,"tag":1217,"props":1882,"children":1883},{},[1884,1889],{"type":35,"tag":60,"props":1885,"children":1887},{"href":1861,"rel":1886},[64],[1888],{"type":41,"value":1865},{"type":41,"value":1890}," is a tool that transforms HTML with plugins. These plugins can inspect and change the HTML.",{"type":35,"tag":1217,"props":1892,"children":1893},{},[1894,1901],{"type":35,"tag":60,"props":1895,"children":1898},{"href":1896,"rel":1897},"https://github.com/remarkjs/remark-rehype",[64],[1899],{"type":41,"value":1900},"remark-rehype",{"type":41,"value":1902}," is a remark plugin that turns markdown into HTML to support rehype.",{"type":35,"tag":43,"props":1904,"children":1905},{},[1906,1908,1914,1915,1921,1923,1956],{"type":41,"value":1907},"这套系统的插件就很丰富了。我们通过引入 ",{"type":35,"tag":255,"props":1909,"children":1911},{"className":1910},[],[1912],{"type":41,"value":1913},"remark-math",{"type":41,"value":285},{"type":35,"tag":255,"props":1916,"children":1918},{"className":1917},[],[1919],{"type":41,"value":1920},"rehype-katex",{"type":41,"value":1922}," 就能把 Markdown 中的 LaTeX 数学公式渲染为人类可读的样子。支持行内的 ",{"type":35,"tag":361,"props":1924,"children":1926},{"className":1925},[1687],[1927],{"type":35,"tag":1690,"props":1928,"children":1929},{"xmlns":1692},[1930],{"type":35,"tag":1695,"props":1931,"children":1932},{},[1933,1951],{"type":35,"tag":1699,"props":1934,"children":1935},{},[1936],{"type":35,"tag":1937,"props":1938,"children":1939},"mfrac",{},[1940,1946],{"type":35,"tag":1941,"props":1942,"children":1943},"mn",{},[1944],{"type":41,"value":1945},"1",{"type":35,"tag":1941,"props":1947,"children":1948},{},[1949],{"type":41,"value":1950},"2",{"type":35,"tag":1709,"props":1952,"children":1953},{"encoding":1711},[1954],{"type":41,"value":1955},"\\frac{1}{2}",{"type":41,"value":1957}," 和块环境：",{"type":35,"tag":361,"props":1959,"children":1961},{"className":1960},[1687],[1962],{"type":35,"tag":1690,"props":1963,"children":1965},{"xmlns":1692,"display":1964},"block",[1966],{"type":35,"tag":1695,"props":1967,"children":1968},{},[1969,2170],{"type":35,"tag":1699,"props":1970,"children":1971},{},[1972,1978,1983,1988,1992,1996,2000,2006],{"type":35,"tag":1973,"props":1974,"children":1975},"mi",{},[1976],{"type":41,"value":1977},"o",{"type":35,"tag":1973,"props":1979,"children":1980},{},[1981],{"type":41,"value":1982},"u",{"type":35,"tag":1973,"props":1984,"children":1985},{},[1986],{"type":41,"value":1987},"t",{"type":35,"tag":1973,"props":1989,"children":1990},{},[1991],{"type":41,"value":43},{"type":35,"tag":1973,"props":1993,"children":1994},{},[1995],{"type":41,"value":1982},{"type":35,"tag":1973,"props":1997,"children":1998},{},[1999],{"type":41,"value":1987},{"type":35,"tag":2001,"props":2002,"children":2003},"mo",{},[2004],{"type":41,"value":2005},"=",{"type":35,"tag":1699,"props":2007,"children":2008},{},[2009,2015],{"type":35,"tag":2001,"props":2010,"children":2012},{"fence":2011},"true",[2013],{"type":41,"value":2014},"{",{"type":35,"tag":2016,"props":2017,"children":2021},"mtable",{"rowspacing":2018,"columnalign":2019,"columnspacing":2020},"0.36em","left left","1em",[2022,2102],{"type":35,"tag":2023,"props":2024,"children":2025},"mtr",{},[2026,2040],{"type":35,"tag":2027,"props":2028,"children":2029},"mtd",{},[2030],{"type":35,"tag":2031,"props":2032,"children":2035},"mstyle",{"scriptlevel":2033,"displaystyle":2034},"0","false",[2036],{"type":35,"tag":1941,"props":2037,"children":2038},{},[2039],{"type":41,"value":2033},{"type":35,"tag":2027,"props":2041,"children":2042},{},[2043],{"type":35,"tag":2031,"props":2044,"children":2045},{"scriptlevel":2033,"displaystyle":2034},[2046],{"type":35,"tag":1699,"props":2047,"children":2048},{},[2049,2054,2068,2080,2092,2097],{"type":35,"tag":1703,"props":2050,"children":2051},{},[2052],{"type":41,"value":2053},"if ",{"type":35,"tag":2055,"props":2056,"children":2057},"msub",{},[2058,2063],{"type":35,"tag":2001,"props":2059,"children":2060},{},[2061],{"type":41,"value":2062},"∑",{"type":35,"tag":1973,"props":2064,"children":2065},{},[2066],{"type":41,"value":2067},"j",{"type":35,"tag":2055,"props":2069,"children":2070},{},[2071,2076],{"type":35,"tag":1973,"props":2072,"children":2073},{},[2074],{"type":41,"value":2075},"w",{"type":35,"tag":1973,"props":2077,"children":2078},{},[2079],{"type":41,"value":2067},{"type":35,"tag":2055,"props":2081,"children":2082},{},[2083,2088],{"type":35,"tag":1973,"props":2084,"children":2085},{},[2086],{"type":41,"value":2087},"x",{"type":35,"tag":1973,"props":2089,"children":2090},{},[2091],{"type":41,"value":2067},{"type":35,"tag":2001,"props":2093,"children":2094},{},[2095],{"type":41,"value":2096},"≤",{"type":35,"tag":1703,"props":2098,"children":2099},{},[2100],{"type":41,"value":2101},"threshold",{"type":35,"tag":2023,"props":2103,"children":2104},{},[2105,2115],{"type":35,"tag":2027,"props":2106,"children":2107},{},[2108],{"type":35,"tag":2031,"props":2109,"children":2110},{"scriptlevel":2033,"displaystyle":2034},[2111],{"type":35,"tag":1941,"props":2112,"children":2113},{},[2114],{"type":41,"value":1945},{"type":35,"tag":2027,"props":2116,"children":2117},{},[2118],{"type":35,"tag":2031,"props":2119,"children":2120},{"scriptlevel":2033,"displaystyle":2034},[2121],{"type":35,"tag":1699,"props":2122,"children":2123},{},[2124,2128,2139,2150,2161,2166],{"type":35,"tag":1703,"props":2125,"children":2126},{},[2127],{"type":41,"value":2053},{"type":35,"tag":2055,"props":2129,"children":2130},{},[2131,2135],{"type":35,"tag":2001,"props":2132,"children":2133},{},[2134],{"type":41,"value":2062},{"type":35,"tag":1973,"props":2136,"children":2137},{},[2138],{"type":41,"value":2067},{"type":35,"tag":2055,"props":2140,"children":2141},{},[2142,2146],{"type":35,"tag":1973,"props":2143,"children":2144},{},[2145],{"type":41,"value":2075},{"type":35,"tag":1973,"props":2147,"children":2148},{},[2149],{"type":41,"value":2067},{"type":35,"tag":2055,"props":2151,"children":2152},{},[2153,2157],{"type":35,"tag":1973,"props":2154,"children":2155},{},[2156],{"type":41,"value":2087},{"type":35,"tag":1973,"props":2158,"children":2159},{},[2160],{"type":41,"value":2067},{"type":35,"tag":2001,"props":2162,"children":2163},{},[2164],{"type":41,"value":2165},">",{"type":35,"tag":1703,"props":2167,"children":2168},{},[2169],{"type":41,"value":2101},{"type":35,"tag":1709,"props":2171,"children":2172},{"encoding":1711},[2173],{"type":41,"value":2174},"output =\n\\begin{cases}\n0 & \\text{if } \\sum_j w_j x_j \\leq \\text{threshold} \\\\\n1 & \\text{if } \\sum_j w_j x_j > \\text{threshold}\n\\end{cases}",{"type":35,"tag":43,"props":2176,"children":2177},{},[2178],{"type":41,"value":2179},"对应的 Markdown 源码如下：",{"type":35,"tag":351,"props":2181,"children":2184},{"code":2182,"language":23,"meta":8,"className":2183,"style":8},"支持行内的 $\\frac{1}{2}$ 和块环境：\n\n$$\noutput =\n\\begin{cases}\n0 & \\text{if } \\sum j w_j x_j \\leq \\text{threshold} \\\\\n1 & \\text{if } \\sum_j w_j x_j > \\text{threshold}\n\\end{cases}\n$$\n","language-md shiki shiki-themes github-light github-dark monokai",[2185],{"type":35,"tag":255,"props":2186,"children":2187},{"__ignoreMap":8},[2188,2196,2203,2211,2219,2227,2240,2248,2256],{"type":35,"tag":361,"props":2189,"children":2190},{"class":363,"line":364},[2191],{"type":35,"tag":361,"props":2192,"children":2193},{"style":432},[2194],{"type":41,"value":2195},"支持行内的 $\\frac{1}{2}$ 和块环境：\n",{"type":35,"tag":361,"props":2197,"children":2198},{"class":363,"line":438},[2199],{"type":35,"tag":361,"props":2200,"children":2201},{"emptyLinePlaceholder":550},[2202],{"type":41,"value":553},{"type":35,"tag":361,"props":2204,"children":2205},{"class":363,"line":452},[2206],{"type":35,"tag":361,"props":2207,"children":2208},{"style":432},[2209],{"type":41,"value":2210},"$$\n",{"type":35,"tag":361,"props":2212,"children":2213},{"class":363,"line":461},[2214],{"type":35,"tag":361,"props":2215,"children":2216},{"style":432},[2217],{"type":41,"value":2218},"output =\n",{"type":35,"tag":361,"props":2220,"children":2221},{"class":363,"line":470},[2222],{"type":35,"tag":361,"props":2223,"children":2224},{"style":432},[2225],{"type":41,"value":2226},"\\begin{cases}\n",{"type":35,"tag":361,"props":2228,"children":2229},{"class":363,"line":594},[2230,2235],{"type":35,"tag":361,"props":2231,"children":2232},{"style":432},[2233],{"type":41,"value":2234},"0 & \\text{if } \\sum j w_j x_j \\leq \\text{threshold} ",{"type":35,"tag":361,"props":2236,"children":2237},{"style":1545},[2238],{"type":41,"value":2239},"\\\\\n",{"type":35,"tag":361,"props":2241,"children":2242},{"class":363,"line":603},[2243],{"type":35,"tag":361,"props":2244,"children":2245},{"style":432},[2246],{"type":41,"value":2247},"1 & \\text{if } \\sum_j w_j x_j > \\text{threshold}\n",{"type":35,"tag":361,"props":2249,"children":2250},{"class":363,"line":622},[2251],{"type":35,"tag":361,"props":2252,"children":2253},{"style":432},[2254],{"type":41,"value":2255},"\\end{cases}\n",{"type":35,"tag":361,"props":2257,"children":2258},{"class":363,"line":640},[2259],{"type":35,"tag":361,"props":2260,"children":2261},{"style":432},[2262],{"type":41,"value":2210},{"type":35,"tag":43,"props":2264,"children":2265},{},[2266],{"type":41,"value":2267},"当然，你需要在项目中添加对应的包才能使用这些插件：",{"type":35,"tag":351,"props":2269,"children":2271},{"code":2270,"language":354,"meta":8,"className":355,"style":8},"pnpm add rehype-katex\npnpm add remark-math\n",[2272],{"type":35,"tag":255,"props":2273,"children":2274},{"__ignoreMap":8},[2275,2292],{"type":35,"tag":361,"props":2276,"children":2277},{"class":363,"line":364},[2278,2283,2287],{"type":35,"tag":361,"props":2279,"children":2280},{"style":368},[2281],{"type":41,"value":2282},"pnpm",{"type":35,"tag":361,"props":2284,"children":2285},{"style":374},[2286],{"type":41,"value":387},{"type":35,"tag":361,"props":2288,"children":2289},{"style":374},[2290],{"type":41,"value":2291}," rehype-katex\n",{"type":35,"tag":361,"props":2293,"children":2294},{"class":363,"line":438},[2295,2299,2303],{"type":35,"tag":361,"props":2296,"children":2297},{"style":368},[2298],{"type":41,"value":2282},{"type":35,"tag":361,"props":2300,"children":2301},{"style":374},[2302],{"type":41,"value":387},{"type":35,"tag":361,"props":2304,"children":2305},{"style":374},[2306],{"type":41,"value":2307}," remark-math\n",{"type":35,"tag":43,"props":2309,"children":2310},{},[2311,2313,2319,2321,2327,2329,2335],{"type":41,"value":2312},"使用 KaTeX 时要注意，他默认会输出一份精美排版的 ",{"type":35,"tag":255,"props":2314,"children":2316},{"className":2315},[],[2317],{"type":41,"value":2318},"mathml",{"type":41,"value":2320},"，和一份粗劣排版的 ",{"type":35,"tag":255,"props":2322,"children":2324},{"className":2323},[],[2325],{"type":41,"value":2326},"html",{"type":41,"value":2328}," 叠加到一起，以备 MathML 不受支持的情况。但放到 Nuxt Content 里就可能会乱套，你会看到渲染好的公式后面跟一堆丑陋的字符，使用 ",{"type":35,"tag":255,"props":2330,"children":2332},{"className":2331},[],[2333],{"type":41,"value":2334},"\"rehype-katex\": { output: 'mathml' }",{"type":41,"value":2336}," 配置就可以避免掉这种情况。",{"type":35,"tag":43,"props":2338,"children":2339},{},[2340,2342,2348],{"type":41,"value":2341},"用 KaTeX 完全是出于我个人喜好，你也可以用 ",{"type":35,"tag":255,"props":2343,"children":2345},{"className":2344},[],[2346],{"type":41,"value":2347},"rehype-mathjax",{"type":41,"value":2349}," 来渲染公式。其实 MathJax 渲染出来感觉还更标准一些。但我不喜欢 MathJax 的点是，默认渲染出来有锯齿、字体字重啥的就和正文有种割裂感。",{"type":35,"tag":2351,"props":2352,"children":2354},"h4",{"id":2353},"屏蔽警告",[2355],{"type":41,"value":2353},{"type":35,"tag":43,"props":2357,"children":2358},{},[2359,2361,2367],{"type":41,"value":2360},"在安装了对应的插件包，配置好 Content，扔一篇带有数学公式的文章进去测试，你会看到，浏览器页面短暂卡住，",{"type":35,"tag":255,"props":2362,"children":2364},{"className":2363},[],[2365],{"type":41,"value":2366},"pnpm run dev",{"type":41,"value":2368}," 刷屏输出数千行的 WARN 信息，非常恶心。",{"type":35,"tag":351,"props":2370,"children":2372},{"code":2371,"language":354,"meta":8,"className":355,"style":8},"[WARN]: Failed to resolve component: Mo\nIf this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.\n",[2373],{"type":35,"tag":255,"props":2374,"children":2375},{"__ignoreMap":8},[2376,2384],{"type":35,"tag":361,"props":2377,"children":2378},{"class":363,"line":364},[2379],{"type":35,"tag":361,"props":2380,"children":2381},{"style":432},[2382],{"type":41,"value":2383},"[WARN]: Failed to resolve component: Mo\n",{"type":35,"tag":361,"props":2385,"children":2386},{"class":363,"line":438},[2387,2392,2397,2402,2407,2412,2417,2422,2427,2432,2437,2442,2447,2452,2457,2462,2467],{"type":35,"tag":361,"props":2388,"children":2389},{"style":368},[2390],{"type":41,"value":2391},"If",{"type":35,"tag":361,"props":2393,"children":2394},{"style":374},[2395],{"type":41,"value":2396}," this",{"type":35,"tag":361,"props":2398,"children":2399},{"style":374},[2400],{"type":41,"value":2401}," is",{"type":35,"tag":361,"props":2403,"children":2404},{"style":374},[2405],{"type":41,"value":2406}," a",{"type":35,"tag":361,"props":2408,"children":2409},{"style":374},[2410],{"type":41,"value":2411}," native",{"type":35,"tag":361,"props":2413,"children":2414},{"style":374},[2415],{"type":41,"value":2416}," custom",{"type":35,"tag":361,"props":2418,"children":2419},{"style":374},[2420],{"type":41,"value":2421}," element,",{"type":35,"tag":361,"props":2423,"children":2424},{"style":374},[2425],{"type":41,"value":2426}," make",{"type":35,"tag":361,"props":2428,"children":2429},{"style":374},[2430],{"type":41,"value":2431}," sure",{"type":35,"tag":361,"props":2433,"children":2434},{"style":374},[2435],{"type":41,"value":2436}," to",{"type":35,"tag":361,"props":2438,"children":2439},{"style":374},[2440],{"type":41,"value":2441}," exclude",{"type":35,"tag":361,"props":2443,"children":2444},{"style":374},[2445],{"type":41,"value":2446}," it",{"type":35,"tag":361,"props":2448,"children":2449},{"style":374},[2450],{"type":41,"value":2451}," from",{"type":35,"tag":361,"props":2453,"children":2454},{"style":374},[2455],{"type":41,"value":2456}," component",{"type":35,"tag":361,"props":2458,"children":2459},{"style":374},[2460],{"type":41,"value":2461}," resolution",{"type":35,"tag":361,"props":2463,"children":2464},{"style":374},[2465],{"type":41,"value":2466}," via",{"type":35,"tag":361,"props":2468,"children":2469},{"style":374},[2470],{"type":41,"value":2471}," compilerOptions.isCustomElement.\n",{"type":35,"tag":246,"props":2473,"children":2474},{},[2475],{"type":35,"tag":43,"props":2476,"children":2477},{},[2478,2479],{"type":41,"value":1839},{"type":35,"tag":60,"props":2480,"children":2483},{"href":2481,"rel":2482},"https://github.com/nuxt/content/issues/1774",[64],[2484],{"type":41,"value":2481},{"type":35,"tag":43,"props":2486,"children":2487},{},[2488,2490,2497],{"type":41,"value":2489},"这个事情是由于渲染数学公式的过程用到了 ",{"type":35,"tag":60,"props":2491,"children":2494},{"href":2492,"rel":2493},"https://developer.mozilla.org/en-US/docs/Web/MathML",[64],[2495],{"type":41,"value":2496},"MathML",{"type":41,"value":2498},"，就是一些特殊的 HTML（或者说 XML 更合适一点）标签，Vue（或者说 Vite）不认识这些标签，以为是你没定义这些东西，警告你一下，并且可能还会十分“贴心”地带上栈，以防你找不到是哪里发生的错误。",{"type":35,"tag":43,"props":2500,"children":2501},{},[2502],{"type":41,"value":2503},"问题就在于，他这个错误栈是非常非常长的，而且他每遇到一个 MathML 标签都爆这么一个 WARN，光做 IO 都卡住了，非常尴尬。😅",{"type":35,"tag":43,"props":2505,"children":2506},{},[2507,2509,2515],{"type":41,"value":2508},"虽然它报错第二行就附上了一个解决方案，但这个好像没用虽然自定义的 ",{"type":35,"tag":255,"props":2510,"children":2512},{"className":2511},[],[2513],{"type":41,"value":2514},"isCustomElement",{"type":41,"value":2516}," 执行到了，但这个 WARN 还是爆出来了，不知道为啥，懒得深究。",{"type":35,"tag":43,"props":2518,"children":2519},{},[2520,2522,2528],{"type":41,"value":2521},"最终的解决方案是，写一个 Nuxt 插件，劫持 warnHandler，不允许它报这个错。在项目根目录的 ",{"type":35,"tag":255,"props":2523,"children":2525},{"className":2524},[],[2526],{"type":41,"value":2527},"plugins",{"type":41,"value":2529}," 目录里，新建一个插件：",{"type":35,"tag":351,"props":2531,"children":2533},{"code":2532,"language":354,"meta":8,"className":355,"style":8},"mkdir -p plugins\ntouch plugins/suppressWarnings.ts\n",[2534],{"type":35,"tag":255,"props":2535,"children":2536},{"__ignoreMap":8},[2537,2555],{"type":35,"tag":361,"props":2538,"children":2539},{"class":363,"line":364},[2540,2545,2550],{"type":35,"tag":361,"props":2541,"children":2542},{"style":368},[2543],{"type":41,"value":2544},"mkdir",{"type":35,"tag":361,"props":2546,"children":2547},{"style":1545},[2548],{"type":41,"value":2549}," -p",{"type":35,"tag":361,"props":2551,"children":2552},{"style":374},[2553],{"type":41,"value":2554}," plugins\n",{"type":35,"tag":361,"props":2556,"children":2557},{"class":363,"line":438},[2558,2563],{"type":35,"tag":361,"props":2559,"children":2560},{"style":368},[2561],{"type":41,"value":2562},"touch",{"type":35,"tag":361,"props":2564,"children":2565},{"style":374},[2566],{"type":41,"value":2567}," plugins/suppressWarnings.ts\n",{"type":35,"tag":43,"props":2569,"children":2570},{},[2571,2577,2579,2585,2587,2593],{"type":35,"tag":255,"props":2572,"children":2574},{"className":2573},[],[2575],{"type":41,"value":2576},"plugins/suppressWarnings.ts",{"type":41,"value":2578},": 在里面写一个 ",{"type":35,"tag":255,"props":2580,"children":2582},{"className":2581},[],[2583],{"type":41,"value":2584},"defineNuxtPlugin",{"type":41,"value":2586},"来覆写",{"type":35,"tag":255,"props":2588,"children":2590},{"className":2589},[],[2591],{"type":41,"value":2592},"nuxtApp.vueApp.config.warnHandler",{"type":41,"value":2594},"。",{"type":35,"tag":351,"props":2596,"children":2598},{"code":2597,"language":511,"meta":8,"className":512,"style":8},"// plugins/suppressWarnings.ts\n\nconst mathElements = [\n    // MathJax:\n    'G', 'Use', 'Defs', 'Rect', 'MjxContainer', 'Path',\n    // KaTeX:\n    'Math', 'Maction', 'Annotation', 'Annotation-xml', 'Menclose', 'Merror', 'Mfenced', 'Mfrac', 'Mi', 'Mmultiscripts', 'Mn', 'Mo', 'Mover', 'Mpadded', 'Mphantom', 'Mprescripts', 'Mroot', 'Mrow', 'Ms', 'Semantics', 'Mspace', 'Msqrt', 'Mstyle', 'Msub', 'Msup', 'Msubsup', 'Mtable', 'Mtd', 'Mtext', 'Mtr', 'Munder', 'Munderover',\n]\n\nexport default defineNuxtPlugin((nuxtApp) => {\n    nuxtApp.vueApp.config.warnHandler = (msg: string, instance: ComponentPublicInstance | null, trace: string) => {\n        // WARN  Failed to resolve component: Mo\n        if (msg.startsWith('Failed to resolve component')) {\n            try {\n                const firstLine = msg.slice(0, msg.indexOf(\"\\n\"))\n                const component = firstLine.split(\":\", 2)[1].trim()\n                if (mathElements.includes(component)) {\n                    return;\n                }\n            } catch {\n                /* pass; */\n            }\n        }\n\n        // 其他错误：正常报错\n        console.warn(msg, trace);\n    }\n})\n",[2599],{"type":35,"tag":255,"props":2600,"children":2601},{"__ignoreMap":8},[2602,2610,2617,2641,2649,2706,2714,3005,3013,3020,3062,3157,3165,3198,3210,3278,3344,3367,3379,3387,3404,3412,3420,3428,3435,3443,3462,3471],{"type":35,"tag":361,"props":2603,"children":2604},{"class":363,"line":364},[2605],{"type":35,"tag":361,"props":2606,"children":2607},{"style":1406},[2608],{"type":41,"value":2609},"// plugins/suppressWarnings.ts\n",{"type":35,"tag":361,"props":2611,"children":2612},{"class":363,"line":438},[2613],{"type":35,"tag":361,"props":2614,"children":2615},{"emptyLinePlaceholder":550},[2616],{"type":41,"value":553},{"type":35,"tag":361,"props":2618,"children":2619},{"class":363,"line":452},[2620,2626,2632,2637],{"type":35,"tag":361,"props":2621,"children":2623},{"style":2622},"--shiki-default:#D73A49;--shiki-default-font-style:inherit;--shiki-dark:#F97583;--shiki-dark-font-style:inherit;--shiki-sepia:#66D9EF;--shiki-sepia-font-style:italic",[2624],{"type":41,"value":2625},"const",{"type":35,"tag":361,"props":2627,"children":2629},{"style":2628},"--shiki-default:#005CC5;--shiki-dark:#79B8FF;--shiki-sepia:#F8F8F2",[2630],{"type":41,"value":2631}," mathElements",{"type":35,"tag":361,"props":2633,"children":2634},{"style":426},[2635],{"type":41,"value":2636}," =",{"type":35,"tag":361,"props":2638,"children":2639},{"style":432},[2640],{"type":41,"value":449},{"type":35,"tag":361,"props":2642,"children":2643},{"class":363,"line":461},[2644],{"type":35,"tag":361,"props":2645,"children":2646},{"style":1406},[2647],{"type":41,"value":2648},"    // MathJax:\n",{"type":35,"tag":361,"props":2650,"children":2651},{"class":363,"line":470},[2652,2657,2661,2666,2670,2675,2679,2684,2688,2693,2697,2702],{"type":35,"tag":361,"props":2653,"children":2654},{"style":374},[2655],{"type":41,"value":2656},"    'G'",{"type":35,"tag":361,"props":2658,"children":2659},{"style":432},[2660],{"type":41,"value":712},{"type":35,"tag":361,"props":2662,"children":2663},{"style":374},[2664],{"type":41,"value":2665},"'Use'",{"type":35,"tag":361,"props":2667,"children":2668},{"style":432},[2669],{"type":41,"value":712},{"type":35,"tag":361,"props":2671,"children":2672},{"style":374},[2673],{"type":41,"value":2674},"'Defs'",{"type":35,"tag":361,"props":2676,"children":2677},{"style":432},[2678],{"type":41,"value":712},{"type":35,"tag":361,"props":2680,"children":2681},{"style":374},[2682],{"type":41,"value":2683},"'Rect'",{"type":35,"tag":361,"props":2685,"children":2686},{"style":432},[2687],{"type":41,"value":712},{"type":35,"tag":361,"props":2689,"children":2690},{"style":374},[2691],{"type":41,"value":2692},"'MjxContainer'",{"type":35,"tag":361,"props":2694,"children":2695},{"style":432},[2696],{"type":41,"value":712},{"type":35,"tag":361,"props":2698,"children":2699},{"style":374},[2700],{"type":41,"value":2701},"'Path'",{"type":35,"tag":361,"props":2703,"children":2704},{"style":432},[2705],{"type":41,"value":619},{"type":35,"tag":361,"props":2707,"children":2708},{"class":363,"line":594},[2709],{"type":35,"tag":361,"props":2710,"children":2711},{"style":1406},[2712],{"type":41,"value":2713},"    // KaTeX:\n",{"type":35,"tag":361,"props":2715,"children":2716},{"class":363,"line":603},[2717,2722,2726,2731,2735,2740,2744,2749,2753,2758,2762,2767,2771,2776,2780,2785,2789,2794,2798,2803,2807,2812,2816,2821,2825,2830,2834,2839,2843,2848,2852,2857,2861,2866,2870,2875,2879,2884,2888,2893,2897,2902,2906,2911,2915,2920,2924,2929,2933,2938,2942,2947,2951,2956,2960,2965,2969,2974,2978,2983,2987,2992,2996,3001],{"type":35,"tag":361,"props":2718,"children":2719},{"style":374},[2720],{"type":41,"value":2721},"    'Math'",{"type":35,"tag":361,"props":2723,"children":2724},{"style":432},[2725],{"type":41,"value":712},{"type":35,"tag":361,"props":2727,"children":2728},{"style":374},[2729],{"type":41,"value":2730},"'Maction'",{"type":35,"tag":361,"props":2732,"children":2733},{"style":432},[2734],{"type":41,"value":712},{"type":35,"tag":361,"props":2736,"children":2737},{"style":374},[2738],{"type":41,"value":2739},"'Annotation'",{"type":35,"tag":361,"props":2741,"children":2742},{"style":432},[2743],{"type":41,"value":712},{"type":35,"tag":361,"props":2745,"children":2746},{"style":374},[2747],{"type":41,"value":2748},"'Annotation-xml'",{"type":35,"tag":361,"props":2750,"children":2751},{"style":432},[2752],{"type":41,"value":712},{"type":35,"tag":361,"props":2754,"children":2755},{"style":374},[2756],{"type":41,"value":2757},"'Menclose'",{"type":35,"tag":361,"props":2759,"children":2760},{"style":432},[2761],{"type":41,"value":712},{"type":35,"tag":361,"props":2763,"children":2764},{"style":374},[2765],{"type":41,"value":2766},"'Merror'",{"type":35,"tag":361,"props":2768,"children":2769},{"style":432},[2770],{"type":41,"value":712},{"type":35,"tag":361,"props":2772,"children":2773},{"style":374},[2774],{"type":41,"value":2775},"'Mfenced'",{"type":35,"tag":361,"props":2777,"children":2778},{"style":432},[2779],{"type":41,"value":712},{"type":35,"tag":361,"props":2781,"children":2782},{"style":374},[2783],{"type":41,"value":2784},"'Mfrac'",{"type":35,"tag":361,"props":2786,"children":2787},{"style":432},[2788],{"type":41,"value":712},{"type":35,"tag":361,"props":2790,"children":2791},{"style":374},[2792],{"type":41,"value":2793},"'Mi'",{"type":35,"tag":361,"props":2795,"children":2796},{"style":432},[2797],{"type":41,"value":712},{"type":35,"tag":361,"props":2799,"children":2800},{"style":374},[2801],{"type":41,"value":2802},"'Mmultiscripts'",{"type":35,"tag":361,"props":2804,"children":2805},{"style":432},[2806],{"type":41,"value":712},{"type":35,"tag":361,"props":2808,"children":2809},{"style":374},[2810],{"type":41,"value":2811},"'Mn'",{"type":35,"tag":361,"props":2813,"children":2814},{"style":432},[2815],{"type":41,"value":712},{"type":35,"tag":361,"props":2817,"children":2818},{"style":374},[2819],{"type":41,"value":2820},"'Mo'",{"type":35,"tag":361,"props":2822,"children":2823},{"style":432},[2824],{"type":41,"value":712},{"type":35,"tag":361,"props":2826,"children":2827},{"style":374},[2828],{"type":41,"value":2829},"'Mover'",{"type":35,"tag":361,"props":2831,"children":2832},{"style":432},[2833],{"type":41,"value":712},{"type":35,"tag":361,"props":2835,"children":2836},{"style":374},[2837],{"type":41,"value":2838},"'Mpadded'",{"type":35,"tag":361,"props":2840,"children":2841},{"style":432},[2842],{"type":41,"value":712},{"type":35,"tag":361,"props":2844,"children":2845},{"style":374},[2846],{"type":41,"value":2847},"'Mphantom'",{"type":35,"tag":361,"props":2849,"children":2850},{"style":432},[2851],{"type":41,"value":712},{"type":35,"tag":361,"props":2853,"children":2854},{"style":374},[2855],{"type":41,"value":2856},"'Mprescripts'",{"type":35,"tag":361,"props":2858,"children":2859},{"style":432},[2860],{"type":41,"value":712},{"type":35,"tag":361,"props":2862,"children":2863},{"style":374},[2864],{"type":41,"value":2865},"'Mroot'",{"type":35,"tag":361,"props":2867,"children":2868},{"style":432},[2869],{"type":41,"value":712},{"type":35,"tag":361,"props":2871,"children":2872},{"style":374},[2873],{"type":41,"value":2874},"'Mrow'",{"type":35,"tag":361,"props":2876,"children":2877},{"style":432},[2878],{"type":41,"value":712},{"type":35,"tag":361,"props":2880,"children":2881},{"style":374},[2882],{"type":41,"value":2883},"'Ms'",{"type":35,"tag":361,"props":2885,"children":2886},{"style":432},[2887],{"type":41,"value":712},{"type":35,"tag":361,"props":2889,"children":2890},{"style":374},[2891],{"type":41,"value":2892},"'Semantics'",{"type":35,"tag":361,"props":2894,"children":2895},{"style":432},[2896],{"type":41,"value":712},{"type":35,"tag":361,"props":2898,"children":2899},{"style":374},[2900],{"type":41,"value":2901},"'Mspace'",{"type":35,"tag":361,"props":2903,"children":2904},{"style":432},[2905],{"type":41,"value":712},{"type":35,"tag":361,"props":2907,"children":2908},{"style":374},[2909],{"type":41,"value":2910},"'Msqrt'",{"type":35,"tag":361,"props":2912,"children":2913},{"style":432},[2914],{"type":41,"value":712},{"type":35,"tag":361,"props":2916,"children":2917},{"style":374},[2918],{"type":41,"value":2919},"'Mstyle'",{"type":35,"tag":361,"props":2921,"children":2922},{"style":432},[2923],{"type":41,"value":712},{"type":35,"tag":361,"props":2925,"children":2926},{"style":374},[2927],{"type":41,"value":2928},"'Msub'",{"type":35,"tag":361,"props":2930,"children":2931},{"style":432},[2932],{"type":41,"value":712},{"type":35,"tag":361,"props":2934,"children":2935},{"style":374},[2936],{"type":41,"value":2937},"'Msup'",{"type":35,"tag":361,"props":2939,"children":2940},{"style":432},[2941],{"type":41,"value":712},{"type":35,"tag":361,"props":2943,"children":2944},{"style":374},[2945],{"type":41,"value":2946},"'Msubsup'",{"type":35,"tag":361,"props":2948,"children":2949},{"style":432},[2950],{"type":41,"value":712},{"type":35,"tag":361,"props":2952,"children":2953},{"style":374},[2954],{"type":41,"value":2955},"'Mtable'",{"type":35,"tag":361,"props":2957,"children":2958},{"style":432},[2959],{"type":41,"value":712},{"type":35,"tag":361,"props":2961,"children":2962},{"style":374},[2963],{"type":41,"value":2964},"'Mtd'",{"type":35,"tag":361,"props":2966,"children":2967},{"style":432},[2968],{"type":41,"value":712},{"type":35,"tag":361,"props":2970,"children":2971},{"style":374},[2972],{"type":41,"value":2973},"'Mtext'",{"type":35,"tag":361,"props":2975,"children":2976},{"style":432},[2977],{"type":41,"value":712},{"type":35,"tag":361,"props":2979,"children":2980},{"style":374},[2981],{"type":41,"value":2982},"'Mtr'",{"type":35,"tag":361,"props":2984,"children":2985},{"style":432},[2986],{"type":41,"value":712},{"type":35,"tag":361,"props":2988,"children":2989},{"style":374},[2990],{"type":41,"value":2991},"'Munder'",{"type":35,"tag":361,"props":2993,"children":2994},{"style":432},[2995],{"type":41,"value":712},{"type":35,"tag":361,"props":2997,"children":2998},{"style":374},[2999],{"type":41,"value":3000},"'Munderover'",{"type":35,"tag":361,"props":3002,"children":3003},{"style":432},[3004],{"type":41,"value":619},{"type":35,"tag":361,"props":3006,"children":3007},{"class":363,"line":622},[3008],{"type":35,"tag":361,"props":3009,"children":3010},{"style":432},[3011],{"type":41,"value":3012},"]\n",{"type":35,"tag":361,"props":3014,"children":3015},{"class":363,"line":640},[3016],{"type":35,"tag":361,"props":3017,"children":3018},{"emptyLinePlaceholder":550},[3019],{"type":41,"value":553},{"type":35,"tag":361,"props":3021,"children":3022},{"class":363,"line":669},[3023,3027,3031,3036,3041,3047,3052,3057],{"type":35,"tag":361,"props":3024,"children":3025},{"style":426},[3026],{"type":41,"value":429},{"type":35,"tag":361,"props":3028,"children":3029},{"style":426},[3030],{"type":41,"value":565},{"type":35,"tag":361,"props":3032,"children":3033},{"style":368},[3034],{"type":41,"value":3035}," defineNuxtPlugin",{"type":35,"tag":361,"props":3037,"children":3038},{"style":432},[3039],{"type":41,"value":3040},"((",{"type":35,"tag":361,"props":3042,"children":3044},{"style":3043},"--shiki-default:#E36209;--shiki-default-font-style:inherit;--shiki-dark:#FFAB70;--shiki-dark-font-style:inherit;--shiki-sepia:#FD971F;--shiki-sepia-font-style:italic",[3045],{"type":41,"value":3046},"nuxtApp",{"type":35,"tag":361,"props":3048,"children":3049},{"style":432},[3050],{"type":41,"value":3051},") ",{"type":35,"tag":361,"props":3053,"children":3054},{"style":2622},[3055],{"type":41,"value":3056},"=>",{"type":35,"tag":361,"props":3058,"children":3059},{"style":432},[3060],{"type":41,"value":3061}," {\n",{"type":35,"tag":361,"props":3063,"children":3064},{"class":363,"line":678},[3065,3070,3075,3079,3084,3089,3094,3100,3104,3109,3113,3119,3123,3128,3132,3137,3141,3145,3149,3153],{"type":35,"tag":361,"props":3066,"children":3067},{"style":432},[3068],{"type":41,"value":3069},"    nuxtApp.vueApp.config.",{"type":35,"tag":361,"props":3071,"children":3072},{"style":368},[3073],{"type":41,"value":3074},"warnHandler",{"type":35,"tag":361,"props":3076,"children":3077},{"style":426},[3078],{"type":41,"value":2636},{"type":35,"tag":361,"props":3080,"children":3081},{"style":432},[3082],{"type":41,"value":3083}," (",{"type":35,"tag":361,"props":3085,"children":3086},{"style":3043},[3087],{"type":41,"value":3088},"msg",{"type":35,"tag":361,"props":3090,"children":3091},{"style":426},[3092],{"type":41,"value":3093},":",{"type":35,"tag":361,"props":3095,"children":3097},{"style":3096},"--shiki-default:#005CC5;--shiki-default-font-style:inherit;--shiki-dark:#79B8FF;--shiki-dark-font-style:inherit;--shiki-sepia:#66D9EF;--shiki-sepia-font-style:italic",[3098],{"type":41,"value":3099}," string",{"type":35,"tag":361,"props":3101,"children":3102},{"style":432},[3103],{"type":41,"value":712},{"type":35,"tag":361,"props":3105,"children":3106},{"style":3043},[3107],{"type":41,"value":3108},"instance",{"type":35,"tag":361,"props":3110,"children":3111},{"style":426},[3112],{"type":41,"value":3093},{"type":35,"tag":361,"props":3114,"children":3116},{"style":3115},"--shiki-default:#6F42C1;--shiki-default-text-decoration:inherit;--shiki-dark:#B392F0;--shiki-dark-text-decoration:inherit;--shiki-sepia:#A6E22E;--shiki-sepia-text-decoration:underline",[3117],{"type":41,"value":3118}," ComponentPublicInstance",{"type":35,"tag":361,"props":3120,"children":3121},{"style":426},[3122],{"type":41,"value":1558},{"type":35,"tag":361,"props":3124,"children":3125},{"style":3096},[3126],{"type":41,"value":3127}," null",{"type":35,"tag":361,"props":3129,"children":3130},{"style":432},[3131],{"type":41,"value":712},{"type":35,"tag":361,"props":3133,"children":3134},{"style":3043},[3135],{"type":41,"value":3136},"trace",{"type":35,"tag":361,"props":3138,"children":3139},{"style":426},[3140],{"type":41,"value":3093},{"type":35,"tag":361,"props":3142,"children":3143},{"style":3096},[3144],{"type":41,"value":3099},{"type":35,"tag":361,"props":3146,"children":3147},{"style":432},[3148],{"type":41,"value":3051},{"type":35,"tag":361,"props":3150,"children":3151},{"style":2622},[3152],{"type":41,"value":3056},{"type":35,"tag":361,"props":3154,"children":3155},{"style":432},[3156],{"type":41,"value":3061},{"type":35,"tag":361,"props":3158,"children":3159},{"class":363,"line":687},[3160],{"type":35,"tag":361,"props":3161,"children":3162},{"style":1406},[3163],{"type":41,"value":3164},"        // WARN  Failed to resolve component: Mo\n",{"type":35,"tag":361,"props":3166,"children":3167},{"class":363,"line":696},[3168,3173,3178,3183,3188,3193],{"type":35,"tag":361,"props":3169,"children":3170},{"style":426},[3171],{"type":41,"value":3172},"        if",{"type":35,"tag":361,"props":3174,"children":3175},{"style":432},[3176],{"type":41,"value":3177}," (msg.",{"type":35,"tag":361,"props":3179,"children":3180},{"style":368},[3181],{"type":41,"value":3182},"startsWith",{"type":35,"tag":361,"props":3184,"children":3185},{"style":432},[3186],{"type":41,"value":3187},"(",{"type":35,"tag":361,"props":3189,"children":3190},{"style":374},[3191],{"type":41,"value":3192},"'Failed to resolve component'",{"type":35,"tag":361,"props":3194,"children":3195},{"style":432},[3196],{"type":41,"value":3197},")) {\n",{"type":35,"tag":361,"props":3199,"children":3200},{"class":363,"line":752},[3201,3206],{"type":35,"tag":361,"props":3202,"children":3203},{"style":426},[3204],{"type":41,"value":3205},"            try",{"type":35,"tag":361,"props":3207,"children":3208},{"style":432},[3209],{"type":41,"value":3061},{"type":35,"tag":361,"props":3211,"children":3212},{"class":363,"line":770},[3213,3218,3223,3227,3232,3237,3241,3245,3250,3255,3259,3264,3269,3273],{"type":35,"tag":361,"props":3214,"children":3215},{"style":2622},[3216],{"type":41,"value":3217},"                const",{"type":35,"tag":361,"props":3219,"children":3220},{"style":2628},[3221],{"type":41,"value":3222}," firstLine",{"type":35,"tag":361,"props":3224,"children":3225},{"style":426},[3226],{"type":41,"value":2636},{"type":35,"tag":361,"props":3228,"children":3229},{"style":432},[3230],{"type":41,"value":3231}," msg.",{"type":35,"tag":361,"props":3233,"children":3234},{"style":368},[3235],{"type":41,"value":3236},"slice",{"type":35,"tag":361,"props":3238,"children":3239},{"style":432},[3240],{"type":41,"value":3187},{"type":35,"tag":361,"props":3242,"children":3243},{"style":1545},[3244],{"type":41,"value":2033},{"type":35,"tag":361,"props":3246,"children":3247},{"style":432},[3248],{"type":41,"value":3249},", msg.",{"type":35,"tag":361,"props":3251,"children":3252},{"style":368},[3253],{"type":41,"value":3254},"indexOf",{"type":35,"tag":361,"props":3256,"children":3257},{"style":432},[3258],{"type":41,"value":3187},{"type":35,"tag":361,"props":3260,"children":3261},{"style":374},[3262],{"type":41,"value":3263},"\"",{"type":35,"tag":361,"props":3265,"children":3266},{"style":1545},[3267],{"type":41,"value":3268},"\\n",{"type":35,"tag":361,"props":3270,"children":3271},{"style":374},[3272],{"type":41,"value":3263},{"type":35,"tag":361,"props":3274,"children":3275},{"style":432},[3276],{"type":41,"value":3277},"))\n",{"type":35,"tag":361,"props":3279,"children":3280},{"class":363,"line":778},[3281,3285,3289,3293,3298,3303,3307,3312,3316,3320,3325,3329,3334,3339],{"type":35,"tag":361,"props":3282,"children":3283},{"style":2622},[3284],{"type":41,"value":3217},{"type":35,"tag":361,"props":3286,"children":3287},{"style":2628},[3288],{"type":41,"value":2456},{"type":35,"tag":361,"props":3290,"children":3291},{"style":426},[3292],{"type":41,"value":2636},{"type":35,"tag":361,"props":3294,"children":3295},{"style":432},[3296],{"type":41,"value":3297}," firstLine.",{"type":35,"tag":361,"props":3299,"children":3300},{"style":368},[3301],{"type":41,"value":3302},"split",{"type":35,"tag":361,"props":3304,"children":3305},{"style":432},[3306],{"type":41,"value":3187},{"type":35,"tag":361,"props":3308,"children":3309},{"style":374},[3310],{"type":41,"value":3311},"\":\"",{"type":35,"tag":361,"props":3313,"children":3314},{"style":432},[3315],{"type":41,"value":712},{"type":35,"tag":361,"props":3317,"children":3318},{"style":1545},[3319],{"type":41,"value":1950},{"type":35,"tag":361,"props":3321,"children":3322},{"style":432},[3323],{"type":41,"value":3324},")[",{"type":35,"tag":361,"props":3326,"children":3327},{"style":1545},[3328],{"type":41,"value":1945},{"type":35,"tag":361,"props":3330,"children":3331},{"style":432},[3332],{"type":41,"value":3333},"].",{"type":35,"tag":361,"props":3335,"children":3336},{"style":368},[3337],{"type":41,"value":3338},"trim",{"type":35,"tag":361,"props":3340,"children":3341},{"style":432},[3342],{"type":41,"value":3343},"()\n",{"type":35,"tag":361,"props":3345,"children":3346},{"class":363,"line":787},[3347,3352,3357,3362],{"type":35,"tag":361,"props":3348,"children":3349},{"style":426},[3350],{"type":41,"value":3351},"                if",{"type":35,"tag":361,"props":3353,"children":3354},{"style":432},[3355],{"type":41,"value":3356}," (mathElements.",{"type":35,"tag":361,"props":3358,"children":3359},{"style":368},[3360],{"type":41,"value":3361},"includes",{"type":35,"tag":361,"props":3363,"children":3364},{"style":432},[3365],{"type":41,"value":3366},"(component)) {\n",{"type":35,"tag":361,"props":3368,"children":3369},{"class":363,"line":796},[3370,3375],{"type":35,"tag":361,"props":3371,"children":3372},{"style":426},[3373],{"type":41,"value":3374},"                    return",{"type":35,"tag":361,"props":3376,"children":3377},{"style":432},[3378],{"type":41,"value":544},{"type":35,"tag":361,"props":3380,"children":3381},{"class":363,"line":820},[3382],{"type":35,"tag":361,"props":3383,"children":3384},{"style":432},[3385],{"type":41,"value":3386},"                }\n",{"type":35,"tag":361,"props":3388,"children":3389},{"class":363,"line":829},[3390,3395,3400],{"type":35,"tag":361,"props":3391,"children":3392},{"style":432},[3393],{"type":41,"value":3394},"            } ",{"type":35,"tag":361,"props":3396,"children":3397},{"style":426},[3398],{"type":41,"value":3399},"catch",{"type":35,"tag":361,"props":3401,"children":3402},{"style":432},[3403],{"type":41,"value":3061},{"type":35,"tag":361,"props":3405,"children":3406},{"class":363,"line":838},[3407],{"type":35,"tag":361,"props":3408,"children":3409},{"style":1406},[3410],{"type":41,"value":3411},"                /* pass; */\n",{"type":35,"tag":361,"props":3413,"children":3414},{"class":363,"line":847},[3415],{"type":35,"tag":361,"props":3416,"children":3417},{"style":432},[3418],{"type":41,"value":3419},"            }\n",{"type":35,"tag":361,"props":3421,"children":3422},{"class":363,"line":856},[3423],{"type":35,"tag":361,"props":3424,"children":3425},{"style":432},[3426],{"type":41,"value":3427},"        }\n",{"type":35,"tag":361,"props":3429,"children":3430},{"class":363,"line":864},[3431],{"type":35,"tag":361,"props":3432,"children":3433},{"emptyLinePlaceholder":550},[3434],{"type":41,"value":553},{"type":35,"tag":361,"props":3436,"children":3437},{"class":363,"line":873},[3438],{"type":35,"tag":361,"props":3439,"children":3440},{"style":1406},[3441],{"type":41,"value":3442},"        // 其他错误：正常报错\n",{"type":35,"tag":361,"props":3444,"children":3446},{"class":363,"line":3445},26,[3447,3452,3457],{"type":35,"tag":361,"props":3448,"children":3449},{"style":432},[3450],{"type":41,"value":3451},"        console.",{"type":35,"tag":361,"props":3453,"children":3454},{"style":368},[3455],{"type":41,"value":3456},"warn",{"type":35,"tag":361,"props":3458,"children":3459},{"style":432},[3460],{"type":41,"value":3461},"(msg, trace);\n",{"type":35,"tag":361,"props":3463,"children":3465},{"class":363,"line":3464},27,[3466],{"type":35,"tag":361,"props":3467,"children":3468},{"style":432},[3469],{"type":41,"value":3470},"    }\n",{"type":35,"tag":361,"props":3472,"children":3474},{"class":363,"line":3473},28,[3475],{"type":35,"tag":361,"props":3476,"children":3477},{"style":432},[3478],{"type":41,"value":476},{"type":35,"tag":43,"props":3480,"children":3481},{},[3482],{"type":41,"value":3483},"这里我们尽量只屏蔽了对 MathML 元素的警告，其他警告还是照旧打出来。",{"type":35,"tag":48,"props":3485,"children":3487},{"id":3486},"content-页面开发",[3488],{"type":41,"value":3489},"Content 页面开发",{"type":35,"tag":43,"props":3491,"children":3492},{},[3493],{"type":41,"value":3494},"完成配置后，至少还需要开发一个现实渲染后的 Markdown 文档的内容页吧。",{"type":35,"tag":885,"props":3496,"children":3498},{"id":3497},"内容页",[3499],{"type":41,"value":3497},{"type":35,"tag":246,"props":3501,"children":3502},{},[3503],{"type":35,"tag":43,"props":3504,"children":3505},{},[3506,3507],{"type":41,"value":1467},{"type":35,"tag":60,"props":3508,"children":3511},{"href":3509,"rel":3510},"https://content.nuxt.com/usage/render",[64],[3512],{"type":41,"value":3509},{"type":35,"tag":43,"props":3514,"children":3515},{},[3516,3518,3524],{"type":41,"value":3517},"创建一个 ",{"type":35,"tag":255,"props":3519,"children":3521},{"className":3520},[],[3522],{"type":41,"value":3523},"pages/[...slug].vue",{"type":41,"value":3525}," 文件（是的，文件名就是带方括号和三个点的）：",{"type":35,"tag":351,"props":3527,"children":3529},{"code":3528,"language":354,"meta":8,"className":355,"style":8},"touch 'pages/[...slug].vue'\n",[3530],{"type":35,"tag":255,"props":3531,"children":3532},{"__ignoreMap":8},[3533],{"type":35,"tag":361,"props":3534,"children":3535},{"class":363,"line":364},[3536,3540],{"type":35,"tag":361,"props":3537,"children":3538},{"style":368},[3539],{"type":41,"value":2562},{"type":35,"tag":361,"props":3541,"children":3542},{"style":374},[3543],{"type":41,"value":3544}," 'pages/[...slug].vue'\n",{"type":35,"tag":43,"props":3546,"children":3547},{},[3548,3550,3557],{"type":41,"value":3549},"不常写现代前端的同学可能比较陌生，这种奇怪的文件命名是把这个页面作为一个 ",{"type":35,"tag":60,"props":3551,"children":3554},{"href":3552,"rel":3553},"https://nuxt.com/docs/guide/directory-structure/pages/#catch-all-route",[64],[3555],{"type":41,"value":3556},"catch all route",{"type":41,"value":3558},"，当用户访问没有对应其他路由的未知页面，就发给这个页面来处理。",{"type":35,"tag":43,"props":3560,"children":3561},{},[3562,3567],{"type":35,"tag":255,"props":3563,"children":3565},{"className":3564},[],[3566],{"type":41,"value":3523},{"type":41,"value":3093},{"type":35,"tag":351,"props":3569,"children":3573},{"code":3570,"language":3571,"meta":8,"className":3572,"style":8},"\u003Ctemplate>\n  \u003Cmain>\n    \u003CContentDoc />\n  \u003C/main>\n\u003C/template>\n","vue","language-vue shiki shiki-themes github-light github-dark monokai",[3574],{"type":35,"tag":255,"props":3575,"children":3576},{"__ignoreMap":8},[3577,3596,3613,3631,3647],{"type":35,"tag":361,"props":3578,"children":3579},{"class":363,"line":364},[3580,3585,3591],{"type":35,"tag":361,"props":3581,"children":3582},{"style":432},[3583],{"type":41,"value":3584},"\u003C",{"type":35,"tag":361,"props":3586,"children":3588},{"style":3587},"--shiki-default:#22863A;--shiki-dark:#85E89D;--shiki-sepia:#F92672",[3589],{"type":41,"value":3590},"template",{"type":35,"tag":361,"props":3592,"children":3593},{"style":432},[3594],{"type":41,"value":3595},">\n",{"type":35,"tag":361,"props":3597,"children":3598},{"class":363,"line":438},[3599,3604,3609],{"type":35,"tag":361,"props":3600,"children":3601},{"style":432},[3602],{"type":41,"value":3603},"  \u003C",{"type":35,"tag":361,"props":3605,"children":3606},{"style":3587},[3607],{"type":41,"value":3608},"main",{"type":35,"tag":361,"props":3610,"children":3611},{"style":432},[3612],{"type":41,"value":3595},{"type":35,"tag":361,"props":3614,"children":3615},{"class":363,"line":452},[3616,3621,3626],{"type":35,"tag":361,"props":3617,"children":3618},{"style":432},[3619],{"type":41,"value":3620},"    \u003C",{"type":35,"tag":361,"props":3622,"children":3623},{"style":3587},[3624],{"type":41,"value":3625},"ContentDoc",{"type":35,"tag":361,"props":3627,"children":3628},{"style":432},[3629],{"type":41,"value":3630}," />\n",{"type":35,"tag":361,"props":3632,"children":3633},{"class":363,"line":461},[3634,3639,3643],{"type":35,"tag":361,"props":3635,"children":3636},{"style":432},[3637],{"type":41,"value":3638},"  \u003C/",{"type":35,"tag":361,"props":3640,"children":3641},{"style":3587},[3642],{"type":41,"value":3608},{"type":35,"tag":361,"props":3644,"children":3645},{"style":432},[3646],{"type":41,"value":3595},{"type":35,"tag":361,"props":3648,"children":3649},{"class":363,"line":470},[3650,3655,3659],{"type":35,"tag":361,"props":3651,"children":3652},{"style":432},[3653],{"type":41,"value":3654},"\u003C/",{"type":35,"tag":361,"props":3656,"children":3657},{"style":3587},[3658],{"type":41,"value":3590},{"type":35,"tag":361,"props":3660,"children":3661},{"style":432},[3662],{"type":41,"value":3595},{"type":35,"tag":43,"props":3664,"children":3665},{},[3666,3671,3673,3678],{"type":35,"tag":255,"props":3667,"children":3669},{"className":3668},[],[3670],{"type":41,"value":3625},{"type":41,"value":3672}," 组件会尝试解析当前路由，与 ",{"type":35,"tag":255,"props":3674,"children":3676},{"className":3675},[],[3677],{"type":41,"value":403},{"type":41,"value":3679}," 中配置的 content source 的 prefix 匹配，如果匹配上了就显示渲染出来的页面了。",{"type":35,"tag":43,"props":3681,"children":3682},{},[3683,3685,3690,3692,3697,3699,3704,3706,3712,3714,3719,3721,3727],{"type":41,"value":3684},"理论上，在 ",{"type":35,"tag":255,"props":3686,"children":3688},{"className":3687},[],[3689],{"type":41,"value":403},{"type":41,"value":3691}," 中完成设置和实现 ",{"type":35,"tag":255,"props":3693,"children":3695},{"className":3694},[],[3696],{"type":41,"value":3523},{"type":41,"value":3698}," 页面后，如果不出意外，Nuxt Content 系统就已经可以工作了，你可以尝试在 ",{"type":35,"tag":255,"props":3700,"children":3702},{"className":3701},[],[3703],{"type":41,"value":1087},{"type":41,"value":3705},"，放入一篇 ",{"type":35,"tag":255,"props":3707,"children":3709},{"className":3708},[],[3710],{"type":41,"value":3711},"md-test.md",{"type":41,"value":3713},"，运行 ",{"type":35,"tag":255,"props":3715,"children":3717},{"className":3716},[],[3718],{"type":41,"value":2366},{"type":41,"value":3720}," 拉起程序，然后浏览器访问 ",{"type":35,"tag":255,"props":3722,"children":3724},{"className":3723},[],[3725],{"type":41,"value":3726},"localhost:3000/blogs/md-test",{"type":41,"value":2594},{"type":35,"tag":43,"props":3729,"children":3730},{},[3731],{"type":41,"value":3732},"（或者你可以用任何其他你喜欢的 Content source、Markdown 文件名、包管理工具、使用 run dev 打印的端口、访问你的 Content source prefix 和 Markdown 文件名对应的路径。）",{"type":35,"tag":43,"props":3734,"children":3735},{},[3736],{"type":41,"value":3737},"如果不出意外，你会看到一个朴素页面（下面这个截图我甚至没配代码块语法高亮所以显得更加素了）：",{"type":35,"tag":43,"props":3739,"children":3740},{},[3741],{"type":35,"tag":148,"props":3742,"children":3745},{"alt":3743,"src":3744},"Nuxt Content 渲染出的博客内容页面截图，显示效果是未经 CSS 修饰的裸 HTML 样式","attachments/nuxt-content-default-page.png",[],{"type":35,"tag":43,"props":3747,"children":3748},{},[3749],{"type":41,"value":3750},"虽然比较寡淡，但核心功能是有了，接下来亿点点优化就行。参考其他正常的博客，我们添加以下两个常见功能：",{"type":35,"tag":1213,"props":3752,"children":3753},{},[3754,3759],{"type":35,"tag":1217,"props":3755,"children":3756},{},[3757],{"type":41,"value":3758},"索引页：从新到旧罗列的文章列表；",{"type":35,"tag":1217,"props":3760,"children":3761},{},[3762],{"type":41,"value":3763},"前后篇：一篇文章读完后，下面有个链接指向前一篇、后一篇，或者相关的文章。",{"type":35,"tag":43,"props":3765,"children":3766},{},[3767],{"type":35,"tag":148,"props":3768,"children":3771},{"alt":3769,"src":3770},"两个博客站点的截图，展示了 Swift 语言博客的索引页和 Go 语言博客中的 Next article 和 Previous article 链接","attachments/example-blogs-index-and-surround.png",[],{"type":35,"tag":885,"props":3773,"children":3775},{"id":3774},"索引页",[3776],{"type":41,"value":3774},{"type":35,"tag":43,"props":3778,"children":3779},{},[3780],{"type":41,"value":3781},"Nuxt Content 提供了一些方法，可以用来查询从 source 中搜刮到的 Content 内容，即文章列表。",{"type":35,"tag":246,"props":3783,"children":3784},{},[3785],{"type":35,"tag":43,"props":3786,"children":3787},{},[3788,3789],{"type":41,"value":1467},{"type":35,"tag":60,"props":3790,"children":3793},{"href":3791,"rel":3792},"https://content.nuxt.com/composables/query-content",[64],[3794],{"type":41,"value":3791},{"type":35,"tag":351,"props":3796,"children":3798},{"code":3797,"language":511,"meta":8,"className":512,"style":8},"const articles = await queryContent('/blogs')\n  .where({\"publishedAt\": {$exists: true}})\n  .sort({\"publishedAt\": -1})\n  .without(\"body\") // exclude article content\n  .limit(100)\n  .find();\n",[3799],{"type":35,"tag":255,"props":3800,"children":3801},{"__ignoreMap":8},[3802,3841,3878,3916,3946,3971],{"type":35,"tag":361,"props":3803,"children":3804},{"class":363,"line":364},[3805,3809,3814,3818,3823,3828,3832,3837],{"type":35,"tag":361,"props":3806,"children":3807},{"style":2622},[3808],{"type":41,"value":2625},{"type":35,"tag":361,"props":3810,"children":3811},{"style":2628},[3812],{"type":41,"value":3813}," articles",{"type":35,"tag":361,"props":3815,"children":3816},{"style":426},[3817],{"type":41,"value":2636},{"type":35,"tag":361,"props":3819,"children":3820},{"style":426},[3821],{"type":41,"value":3822}," await",{"type":35,"tag":361,"props":3824,"children":3825},{"style":368},[3826],{"type":41,"value":3827}," queryContent",{"type":35,"tag":361,"props":3829,"children":3830},{"style":432},[3831],{"type":41,"value":3187},{"type":35,"tag":361,"props":3833,"children":3834},{"style":374},[3835],{"type":41,"value":3836},"'/blogs'",{"type":35,"tag":361,"props":3838,"children":3839},{"style":432},[3840],{"type":41,"value":666},{"type":35,"tag":361,"props":3842,"children":3843},{"class":363,"line":438},[3844,3849,3854,3859,3864,3869,3873],{"type":35,"tag":361,"props":3845,"children":3846},{"style":432},[3847],{"type":41,"value":3848},"  .",{"type":35,"tag":361,"props":3850,"children":3851},{"style":368},[3852],{"type":41,"value":3853},"where",{"type":35,"tag":361,"props":3855,"children":3856},{"style":432},[3857],{"type":41,"value":3858},"({",{"type":35,"tag":361,"props":3860,"children":3861},{"style":374},[3862],{"type":41,"value":3863},"\"publishedAt\"",{"type":35,"tag":361,"props":3865,"children":3866},{"style":432},[3867],{"type":41,"value":3868},": {$exists: ",{"type":35,"tag":361,"props":3870,"children":3871},{"style":1545},[3872],{"type":41,"value":2011},{"type":35,"tag":361,"props":3874,"children":3875},{"style":432},[3876],{"type":41,"value":3877},"}})\n",{"type":35,"tag":361,"props":3879,"children":3880},{"class":363,"line":452},[3881,3885,3890,3894,3898,3903,3908,3912],{"type":35,"tag":361,"props":3882,"children":3883},{"style":432},[3884],{"type":41,"value":3848},{"type":35,"tag":361,"props":3886,"children":3887},{"style":368},[3888],{"type":41,"value":3889},"sort",{"type":35,"tag":361,"props":3891,"children":3892},{"style":432},[3893],{"type":41,"value":3858},{"type":35,"tag":361,"props":3895,"children":3896},{"style":374},[3897],{"type":41,"value":3863},{"type":35,"tag":361,"props":3899,"children":3900},{"style":432},[3901],{"type":41,"value":3902},": ",{"type":35,"tag":361,"props":3904,"children":3905},{"style":426},[3906],{"type":41,"value":3907},"-",{"type":35,"tag":361,"props":3909,"children":3910},{"style":1545},[3911],{"type":41,"value":1945},{"type":35,"tag":361,"props":3913,"children":3914},{"style":432},[3915],{"type":41,"value":476},{"type":35,"tag":361,"props":3917,"children":3918},{"class":363,"line":461},[3919,3923,3928,3932,3937,3941],{"type":35,"tag":361,"props":3920,"children":3921},{"style":432},[3922],{"type":41,"value":3848},{"type":35,"tag":361,"props":3924,"children":3925},{"style":368},[3926],{"type":41,"value":3927},"without",{"type":35,"tag":361,"props":3929,"children":3930},{"style":432},[3931],{"type":41,"value":3187},{"type":35,"tag":361,"props":3933,"children":3934},{"style":374},[3935],{"type":41,"value":3936},"\"body\"",{"type":35,"tag":361,"props":3938,"children":3939},{"style":432},[3940],{"type":41,"value":3051},{"type":35,"tag":361,"props":3942,"children":3943},{"style":1406},[3944],{"type":41,"value":3945},"// exclude article content\n",{"type":35,"tag":361,"props":3947,"children":3948},{"class":363,"line":470},[3949,3953,3958,3962,3967],{"type":35,"tag":361,"props":3950,"children":3951},{"style":432},[3952],{"type":41,"value":3848},{"type":35,"tag":361,"props":3954,"children":3955},{"style":368},[3956],{"type":41,"value":3957},"limit",{"type":35,"tag":361,"props":3959,"children":3960},{"style":432},[3961],{"type":41,"value":3187},{"type":35,"tag":361,"props":3963,"children":3964},{"style":1545},[3965],{"type":41,"value":3966},"100",{"type":35,"tag":361,"props":3968,"children":3969},{"style":432},[3970],{"type":41,"value":666},{"type":35,"tag":361,"props":3972,"children":3973},{"class":363,"line":594},[3974,3978,3983],{"type":35,"tag":361,"props":3975,"children":3976},{"style":432},[3977],{"type":41,"value":3848},{"type":35,"tag":361,"props":3979,"children":3980},{"style":368},[3981],{"type":41,"value":3982},"find",{"type":35,"tag":361,"props":3984,"children":3985},{"style":432},[3986],{"type":41,"value":3987},"();\n",{"type":35,"tag":43,"props":3989,"children":3990},{},[3991,3993,3999,4001,4006,4008,4014],{"type":41,"value":3992},"上面这个 ",{"type":35,"tag":255,"props":3994,"children":3996},{"className":3995},[],[3997],{"type":41,"value":3998},"articles",{"type":41,"value":4000}," 就查询出了 prefix 为 ",{"type":35,"tag":255,"props":4002,"children":4004},{"className":4003},[],[4005],{"type":41,"value":1095},{"type":41,"value":4007}," 的 source 下，按照名为 ",{"type":35,"tag":255,"props":4009,"children":4011},{"className":4010},[],[4012],{"type":41,"value":4013},"publishedAt",{"type":41,"value":4015}," 的 key 排列，新的在前旧的在后，剔除了正文部分的文章列表，并限制最多查询出 100 条结果。查询出来的结果长下面这个样子：",{"type":35,"tag":351,"props":4017,"children":4021},{"code":4018,"language":4019,"meta":8,"className":4020,"style":8},"[\n  {\n    \"_path\": \"/blogs/md-test\",\n    \"_dir\": \"blogs\",\n    \"_draft\": false,\n    \"_partial\": false,\n    \"_locale\": \"\",\n    \"title\": \"Markdown Test\",\n    \"description\": \"Hello, world!\",\n    \"publishedAt\": \"2033-12-15\",\n    \"_type\": \"markdown\",\n    \"_id\": \"blogs:blogs:md-test.md\",\n    \"_source\": \"blogs\",\n    \"_file\": \"blogs/md-test.md\",\n    \"_stem\": \"blogs/md-test\",\n    \"_extension\": \"md\"\n  }\n]\n","json","language-json shiki shiki-themes github-light github-dark monokai",[4022],{"type":35,"tag":255,"props":4023,"children":4024},{"__ignoreMap":8},[4025,4033,4041,4063,4084,4104,4124,4145,4166,4187,4208,4229,4250,4270,4291,4312,4329,4337],{"type":35,"tag":361,"props":4026,"children":4027},{"class":363,"line":364},[4028],{"type":35,"tag":361,"props":4029,"children":4030},{"style":432},[4031],{"type":41,"value":4032},"[\n",{"type":35,"tag":361,"props":4034,"children":4035},{"class":363,"line":438},[4036],{"type":35,"tag":361,"props":4037,"children":4038},{"style":432},[4039],{"type":41,"value":4040},"  {\n",{"type":35,"tag":361,"props":4042,"children":4043},{"class":363,"line":452},[4044,4049,4053,4059],{"type":35,"tag":361,"props":4045,"children":4046},{"style":3096},[4047],{"type":41,"value":4048},"    \"_path\"",{"type":35,"tag":361,"props":4050,"children":4051},{"style":432},[4052],{"type":41,"value":3902},{"type":35,"tag":361,"props":4054,"children":4056},{"style":4055},"--shiki-default:#032F62;--shiki-dark:#9ECBFF;--shiki-sepia:#CFCFC2",[4057],{"type":41,"value":4058},"\"/blogs/md-test\"",{"type":35,"tag":361,"props":4060,"children":4061},{"style":432},[4062],{"type":41,"value":619},{"type":35,"tag":361,"props":4064,"children":4065},{"class":363,"line":461},[4066,4071,4075,4080],{"type":35,"tag":361,"props":4067,"children":4068},{"style":3096},[4069],{"type":41,"value":4070},"    \"_dir\"",{"type":35,"tag":361,"props":4072,"children":4073},{"style":432},[4074],{"type":41,"value":3902},{"type":35,"tag":361,"props":4076,"children":4077},{"style":4055},[4078],{"type":41,"value":4079},"\"blogs\"",{"type":35,"tag":361,"props":4081,"children":4082},{"style":432},[4083],{"type":41,"value":619},{"type":35,"tag":361,"props":4085,"children":4086},{"class":363,"line":470},[4087,4092,4096,4100],{"type":35,"tag":361,"props":4088,"children":4089},{"style":3096},[4090],{"type":41,"value":4091},"    \"_draft\"",{"type":35,"tag":361,"props":4093,"children":4094},{"style":432},[4095],{"type":41,"value":3902},{"type":35,"tag":361,"props":4097,"children":4098},{"style":1545},[4099],{"type":41,"value":2034},{"type":35,"tag":361,"props":4101,"children":4102},{"style":432},[4103],{"type":41,"value":619},{"type":35,"tag":361,"props":4105,"children":4106},{"class":363,"line":594},[4107,4112,4116,4120],{"type":35,"tag":361,"props":4108,"children":4109},{"style":3096},[4110],{"type":41,"value":4111},"    \"_partial\"",{"type":35,"tag":361,"props":4113,"children":4114},{"style":432},[4115],{"type":41,"value":3902},{"type":35,"tag":361,"props":4117,"children":4118},{"style":1545},[4119],{"type":41,"value":2034},{"type":35,"tag":361,"props":4121,"children":4122},{"style":432},[4123],{"type":41,"value":619},{"type":35,"tag":361,"props":4125,"children":4126},{"class":363,"line":603},[4127,4132,4136,4141],{"type":35,"tag":361,"props":4128,"children":4129},{"style":3096},[4130],{"type":41,"value":4131},"    \"_locale\"",{"type":35,"tag":361,"props":4133,"children":4134},{"style":432},[4135],{"type":41,"value":3902},{"type":35,"tag":361,"props":4137,"children":4138},{"style":4055},[4139],{"type":41,"value":4140},"\"\"",{"type":35,"tag":361,"props":4142,"children":4143},{"style":432},[4144],{"type":41,"value":619},{"type":35,"tag":361,"props":4146,"children":4147},{"class":363,"line":622},[4148,4153,4157,4162],{"type":35,"tag":361,"props":4149,"children":4150},{"style":3096},[4151],{"type":41,"value":4152},"    \"title\"",{"type":35,"tag":361,"props":4154,"children":4155},{"style":432},[4156],{"type":41,"value":3902},{"type":35,"tag":361,"props":4158,"children":4159},{"style":4055},[4160],{"type":41,"value":4161},"\"Markdown Test\"",{"type":35,"tag":361,"props":4163,"children":4164},{"style":432},[4165],{"type":41,"value":619},{"type":35,"tag":361,"props":4167,"children":4168},{"class":363,"line":640},[4169,4174,4178,4183],{"type":35,"tag":361,"props":4170,"children":4171},{"style":3096},[4172],{"type":41,"value":4173},"    \"description\"",{"type":35,"tag":361,"props":4175,"children":4176},{"style":432},[4177],{"type":41,"value":3902},{"type":35,"tag":361,"props":4179,"children":4180},{"style":4055},[4181],{"type":41,"value":4182},"\"Hello, world!\"",{"type":35,"tag":361,"props":4184,"children":4185},{"style":432},[4186],{"type":41,"value":619},{"type":35,"tag":361,"props":4188,"children":4189},{"class":363,"line":669},[4190,4195,4199,4204],{"type":35,"tag":361,"props":4191,"children":4192},{"style":3096},[4193],{"type":41,"value":4194},"    \"publishedAt\"",{"type":35,"tag":361,"props":4196,"children":4197},{"style":432},[4198],{"type":41,"value":3902},{"type":35,"tag":361,"props":4200,"children":4201},{"style":4055},[4202],{"type":41,"value":4203},"\"2033-12-15\"",{"type":35,"tag":361,"props":4205,"children":4206},{"style":432},[4207],{"type":41,"value":619},{"type":35,"tag":361,"props":4209,"children":4210},{"class":363,"line":678},[4211,4216,4220,4225],{"type":35,"tag":361,"props":4212,"children":4213},{"style":3096},[4214],{"type":41,"value":4215},"    \"_type\"",{"type":35,"tag":361,"props":4217,"children":4218},{"style":432},[4219],{"type":41,"value":3902},{"type":35,"tag":361,"props":4221,"children":4222},{"style":4055},[4223],{"type":41,"value":4224},"\"markdown\"",{"type":35,"tag":361,"props":4226,"children":4227},{"style":432},[4228],{"type":41,"value":619},{"type":35,"tag":361,"props":4230,"children":4231},{"class":363,"line":687},[4232,4237,4241,4246],{"type":35,"tag":361,"props":4233,"children":4234},{"style":3096},[4235],{"type":41,"value":4236},"    \"_id\"",{"type":35,"tag":361,"props":4238,"children":4239},{"style":432},[4240],{"type":41,"value":3902},{"type":35,"tag":361,"props":4242,"children":4243},{"style":4055},[4244],{"type":41,"value":4245},"\"blogs:blogs:md-test.md\"",{"type":35,"tag":361,"props":4247,"children":4248},{"style":432},[4249],{"type":41,"value":619},{"type":35,"tag":361,"props":4251,"children":4252},{"class":363,"line":696},[4253,4258,4262,4266],{"type":35,"tag":361,"props":4254,"children":4255},{"style":3096},[4256],{"type":41,"value":4257},"    \"_source\"",{"type":35,"tag":361,"props":4259,"children":4260},{"style":432},[4261],{"type":41,"value":3902},{"type":35,"tag":361,"props":4263,"children":4264},{"style":4055},[4265],{"type":41,"value":4079},{"type":35,"tag":361,"props":4267,"children":4268},{"style":432},[4269],{"type":41,"value":619},{"type":35,"tag":361,"props":4271,"children":4272},{"class":363,"line":752},[4273,4278,4282,4287],{"type":35,"tag":361,"props":4274,"children":4275},{"style":3096},[4276],{"type":41,"value":4277},"    \"_file\"",{"type":35,"tag":361,"props":4279,"children":4280},{"style":432},[4281],{"type":41,"value":3902},{"type":35,"tag":361,"props":4283,"children":4284},{"style":4055},[4285],{"type":41,"value":4286},"\"blogs/md-test.md\"",{"type":35,"tag":361,"props":4288,"children":4289},{"style":432},[4290],{"type":41,"value":619},{"type":35,"tag":361,"props":4292,"children":4293},{"class":363,"line":770},[4294,4299,4303,4308],{"type":35,"tag":361,"props":4295,"children":4296},{"style":3096},[4297],{"type":41,"value":4298},"    \"_stem\"",{"type":35,"tag":361,"props":4300,"children":4301},{"style":432},[4302],{"type":41,"value":3902},{"type":35,"tag":361,"props":4304,"children":4305},{"style":4055},[4306],{"type":41,"value":4307},"\"blogs/md-test\"",{"type":35,"tag":361,"props":4309,"children":4310},{"style":432},[4311],{"type":41,"value":619},{"type":35,"tag":361,"props":4313,"children":4314},{"class":363,"line":778},[4315,4320,4324],{"type":35,"tag":361,"props":4316,"children":4317},{"style":3096},[4318],{"type":41,"value":4319},"    \"_extension\"",{"type":35,"tag":361,"props":4321,"children":4322},{"style":432},[4323],{"type":41,"value":3902},{"type":35,"tag":361,"props":4325,"children":4326},{"style":4055},[4327],{"type":41,"value":4328},"\"md\"\n",{"type":35,"tag":361,"props":4330,"children":4331},{"class":363,"line":787},[4332],{"type":35,"tag":361,"props":4333,"children":4334},{"style":432},[4335],{"type":41,"value":4336},"  }\n",{"type":35,"tag":361,"props":4338,"children":4339},{"class":363,"line":796},[4340],{"type":35,"tag":361,"props":4341,"children":4342},{"style":432},[4343],{"type":41,"value":3012},{"type":35,"tag":43,"props":4345,"children":4346},{},[4347,4349,4354],{"type":41,"value":4348},"注意，",{"type":35,"tag":255,"props":4350,"children":4352},{"className":4351},[],[4353],{"type":41,"value":4013},{"type":41,"value":4355}," 并不是 Nuxt Content 自带的东西，而是我们通过在每篇 Markdown 文档顶部添加 YAML 信息来指定的：",{"type":35,"tag":351,"props":4357,"children":4359},{"code":4358,"language":23,"meta":8,"className":2183,"style":8},"---\npublishedAt: 2033-12-15\n---\n\n# Markdown Test\n\nHello, world!\n",[4360],{"type":35,"tag":255,"props":4361,"children":4362},{"__ignoreMap":8},[4363,4372,4380,4388,4395,4403,4410],{"type":35,"tag":361,"props":4364,"children":4365},{"class":363,"line":364},[4366],{"type":35,"tag":361,"props":4367,"children":4369},{"style":4368},"--shiki-default:#005CC5;--shiki-default-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold;--shiki-sepia:#F8F8F2;--shiki-sepia-font-weight:inherit",[4370],{"type":41,"value":4371},"---\n",{"type":35,"tag":361,"props":4373,"children":4374},{"class":363,"line":438},[4375],{"type":35,"tag":361,"props":4376,"children":4377},{"style":432},[4378],{"type":41,"value":4379},"publishedAt: 2033-12-15\n",{"type":35,"tag":361,"props":4381,"children":4382},{"class":363,"line":452},[4383],{"type":35,"tag":361,"props":4384,"children":4386},{"style":4385},"--shiki-default:#005CC5;--shiki-default-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold;--shiki-sepia:#A6E22E;--shiki-sepia-font-weight:bold",[4387],{"type":41,"value":4371},{"type":35,"tag":361,"props":4389,"children":4390},{"class":363,"line":461},[4391],{"type":35,"tag":361,"props":4392,"children":4393},{"emptyLinePlaceholder":550},[4394],{"type":41,"value":553},{"type":35,"tag":361,"props":4396,"children":4397},{"class":363,"line":470},[4398],{"type":35,"tag":361,"props":4399,"children":4400},{"style":4385},[4401],{"type":41,"value":4402},"# Markdown Test\n",{"type":35,"tag":361,"props":4404,"children":4405},{"class":363,"line":594},[4406],{"type":35,"tag":361,"props":4407,"children":4408},{"emptyLinePlaceholder":550},[4409],{"type":41,"value":553},{"type":35,"tag":361,"props":4411,"children":4412},{"class":363,"line":603},[4413],{"type":35,"tag":361,"props":4414,"children":4415},{"style":432},[4416],{"type":41,"value":4417},"Hello, world!\n",{"type":35,"tag":43,"props":4419,"children":4420},{},[4421,4423,4428],{"type":41,"value":4422},"言归正传，为博客添加一个索引页面，对应路由 ",{"type":35,"tag":255,"props":4424,"children":4426},{"className":4425},[],[4427],{"type":41,"value":1095},{"type":41,"value":1245},{"type":35,"tag":351,"props":4430,"children":4432},{"code":4431,"language":354,"meta":8,"className":355,"style":8},"touch pages/blogs/index.vue\n",[4433],{"type":35,"tag":255,"props":4434,"children":4435},{"__ignoreMap":8},[4436],{"type":35,"tag":361,"props":4437,"children":4438},{"class":363,"line":364},[4439,4443],{"type":35,"tag":361,"props":4440,"children":4441},{"style":368},[4442],{"type":41,"value":2562},{"type":35,"tag":361,"props":4444,"children":4445},{"style":374},[4446],{"type":41,"value":4447}," pages/blogs/index.vue\n",{"type":35,"tag":43,"props":4449,"children":4450},{},[4451],{"type":41,"value":4452},"写入上面那个查询，再加上一些简单的视图：",{"type":35,"tag":351,"props":4454,"children":4456},{"code":4455,"language":3571,"meta":8,"className":3572,"style":8},"\u003Cscript setup lang=\"ts\">\nimport {queryContent} from \"#imports\";\n\nconst articles = await queryContent('/blogs')\n  .where({\"publishedAt\": {$exists: true}})\n  .sort({\"publishedAt\": -1})\n  .without(\"body\")\n  .limit(100)\n  .find();\n\u003C/script>\n\n\u003Ctemplate>\n    \u003Cdiv>\n      \u003Cdiv v-if=\"articles.length \u003C= 0\">\n        No blog found.\n      \u003C/div>\n\n      \u003Ch1>My Blogs\u003C/h1>\n      \u003Cdiv v-for=\"article in articles\" :key=\"article._path\">\n        \u003Ca :href=\"article._path\">\n          \u003Ch3>{{article.title}}\u003C/h3>\n          \u003Ccode>{{article._path}}  {{article.publishedAt}}\u003C/code>\n          \u003Cp>{{article.description}}\u003C/p>\n        \u003C/a>\n      \u003C/div>\n  \u003C/div>\n\u003C/template>\n",[4457],{"type":35,"tag":255,"props":4458,"children":4459},{"__ignoreMap":8},[4460,4495,4520,4527,4562,4593,4628,4651,4674,4689,4704,4711,4726,4742,4796,4804,4820,4827,4851,4924,4965,4990,5014,5038,5054,5069,5084],{"type":35,"tag":361,"props":4461,"children":4462},{"class":363,"line":364},[4463,4467,4472,4477,4482,4486,4491],{"type":35,"tag":361,"props":4464,"children":4465},{"style":432},[4466],{"type":41,"value":3584},{"type":35,"tag":361,"props":4468,"children":4469},{"style":3587},[4470],{"type":41,"value":4471},"script",{"type":35,"tag":361,"props":4473,"children":4474},{"style":368},[4475],{"type":41,"value":4476}," setup",{"type":35,"tag":361,"props":4478,"children":4479},{"style":368},[4480],{"type":41,"value":4481}," lang",{"type":35,"tag":361,"props":4483,"children":4484},{"style":432},[4485],{"type":41,"value":2005},{"type":35,"tag":361,"props":4487,"children":4488},{"style":374},[4489],{"type":41,"value":4490},"\"ts\"",{"type":35,"tag":361,"props":4492,"children":4493},{"style":432},[4494],{"type":41,"value":3595},{"type":35,"tag":361,"props":4496,"children":4497},{"class":363,"line":438},[4498,4502,4507,4511,4516],{"type":35,"tag":361,"props":4499,"children":4500},{"style":426},[4501],{"type":41,"value":524},{"type":35,"tag":361,"props":4503,"children":4504},{"style":432},[4505],{"type":41,"value":4506}," {queryContent} ",{"type":35,"tag":361,"props":4508,"children":4509},{"style":426},[4510],{"type":41,"value":534},{"type":35,"tag":361,"props":4512,"children":4513},{"style":374},[4514],{"type":41,"value":4515}," \"#imports\"",{"type":35,"tag":361,"props":4517,"children":4518},{"style":432},[4519],{"type":41,"value":544},{"type":35,"tag":361,"props":4521,"children":4522},{"class":363,"line":452},[4523],{"type":35,"tag":361,"props":4524,"children":4525},{"emptyLinePlaceholder":550},[4526],{"type":41,"value":553},{"type":35,"tag":361,"props":4528,"children":4529},{"class":363,"line":461},[4530,4534,4538,4542,4546,4550,4554,4558],{"type":35,"tag":361,"props":4531,"children":4532},{"style":2622},[4533],{"type":41,"value":2625},{"type":35,"tag":361,"props":4535,"children":4536},{"style":2628},[4537],{"type":41,"value":3813},{"type":35,"tag":361,"props":4539,"children":4540},{"style":426},[4541],{"type":41,"value":2636},{"type":35,"tag":361,"props":4543,"children":4544},{"style":426},[4545],{"type":41,"value":3822},{"type":35,"tag":361,"props":4547,"children":4548},{"style":368},[4549],{"type":41,"value":3827},{"type":35,"tag":361,"props":4551,"children":4552},{"style":432},[4553],{"type":41,"value":3187},{"type":35,"tag":361,"props":4555,"children":4556},{"style":374},[4557],{"type":41,"value":3836},{"type":35,"tag":361,"props":4559,"children":4560},{"style":432},[4561],{"type":41,"value":666},{"type":35,"tag":361,"props":4563,"children":4564},{"class":363,"line":470},[4565,4569,4573,4577,4581,4585,4589],{"type":35,"tag":361,"props":4566,"children":4567},{"style":432},[4568],{"type":41,"value":3848},{"type":35,"tag":361,"props":4570,"children":4571},{"style":368},[4572],{"type":41,"value":3853},{"type":35,"tag":361,"props":4574,"children":4575},{"style":432},[4576],{"type":41,"value":3858},{"type":35,"tag":361,"props":4578,"children":4579},{"style":374},[4580],{"type":41,"value":3863},{"type":35,"tag":361,"props":4582,"children":4583},{"style":432},[4584],{"type":41,"value":3868},{"type":35,"tag":361,"props":4586,"children":4587},{"style":1545},[4588],{"type":41,"value":2011},{"type":35,"tag":361,"props":4590,"children":4591},{"style":432},[4592],{"type":41,"value":3877},{"type":35,"tag":361,"props":4594,"children":4595},{"class":363,"line":594},[4596,4600,4604,4608,4612,4616,4620,4624],{"type":35,"tag":361,"props":4597,"children":4598},{"style":432},[4599],{"type":41,"value":3848},{"type":35,"tag":361,"props":4601,"children":4602},{"style":368},[4603],{"type":41,"value":3889},{"type":35,"tag":361,"props":4605,"children":4606},{"style":432},[4607],{"type":41,"value":3858},{"type":35,"tag":361,"props":4609,"children":4610},{"style":374},[4611],{"type":41,"value":3863},{"type":35,"tag":361,"props":4613,"children":4614},{"style":432},[4615],{"type":41,"value":3902},{"type":35,"tag":361,"props":4617,"children":4618},{"style":426},[4619],{"type":41,"value":3907},{"type":35,"tag":361,"props":4621,"children":4622},{"style":1545},[4623],{"type":41,"value":1945},{"type":35,"tag":361,"props":4625,"children":4626},{"style":432},[4627],{"type":41,"value":476},{"type":35,"tag":361,"props":4629,"children":4630},{"class":363,"line":603},[4631,4635,4639,4643,4647],{"type":35,"tag":361,"props":4632,"children":4633},{"style":432},[4634],{"type":41,"value":3848},{"type":35,"tag":361,"props":4636,"children":4637},{"style":368},[4638],{"type":41,"value":3927},{"type":35,"tag":361,"props":4640,"children":4641},{"style":432},[4642],{"type":41,"value":3187},{"type":35,"tag":361,"props":4644,"children":4645},{"style":374},[4646],{"type":41,"value":3936},{"type":35,"tag":361,"props":4648,"children":4649},{"style":432},[4650],{"type":41,"value":666},{"type":35,"tag":361,"props":4652,"children":4653},{"class":363,"line":622},[4654,4658,4662,4666,4670],{"type":35,"tag":361,"props":4655,"children":4656},{"style":432},[4657],{"type":41,"value":3848},{"type":35,"tag":361,"props":4659,"children":4660},{"style":368},[4661],{"type":41,"value":3957},{"type":35,"tag":361,"props":4663,"children":4664},{"style":432},[4665],{"type":41,"value":3187},{"type":35,"tag":361,"props":4667,"children":4668},{"style":1545},[4669],{"type":41,"value":3966},{"type":35,"tag":361,"props":4671,"children":4672},{"style":432},[4673],{"type":41,"value":666},{"type":35,"tag":361,"props":4675,"children":4676},{"class":363,"line":640},[4677,4681,4685],{"type":35,"tag":361,"props":4678,"children":4679},{"style":432},[4680],{"type":41,"value":3848},{"type":35,"tag":361,"props":4682,"children":4683},{"style":368},[4684],{"type":41,"value":3982},{"type":35,"tag":361,"props":4686,"children":4687},{"style":432},[4688],{"type":41,"value":3987},{"type":35,"tag":361,"props":4690,"children":4691},{"class":363,"line":669},[4692,4696,4700],{"type":35,"tag":361,"props":4693,"children":4694},{"style":432},[4695],{"type":41,"value":3654},{"type":35,"tag":361,"props":4697,"children":4698},{"style":3587},[4699],{"type":41,"value":4471},{"type":35,"tag":361,"props":4701,"children":4702},{"style":432},[4703],{"type":41,"value":3595},{"type":35,"tag":361,"props":4705,"children":4706},{"class":363,"line":678},[4707],{"type":35,"tag":361,"props":4708,"children":4709},{"emptyLinePlaceholder":550},[4710],{"type":41,"value":553},{"type":35,"tag":361,"props":4712,"children":4713},{"class":363,"line":687},[4714,4718,4722],{"type":35,"tag":361,"props":4715,"children":4716},{"style":432},[4717],{"type":41,"value":3584},{"type":35,"tag":361,"props":4719,"children":4720},{"style":3587},[4721],{"type":41,"value":3590},{"type":35,"tag":361,"props":4723,"children":4724},{"style":432},[4725],{"type":41,"value":3595},{"type":35,"tag":361,"props":4727,"children":4728},{"class":363,"line":696},[4729,4733,4738],{"type":35,"tag":361,"props":4730,"children":4731},{"style":432},[4732],{"type":41,"value":3620},{"type":35,"tag":361,"props":4734,"children":4735},{"style":3587},[4736],{"type":41,"value":4737},"div",{"type":35,"tag":361,"props":4739,"children":4740},{"style":432},[4741],{"type":41,"value":3595},{"type":35,"tag":361,"props":4743,"children":4744},{"class":363,"line":752},[4745,4750,4754,4759,4763,4768,4773,4778,4783,4788,4792],{"type":35,"tag":361,"props":4746,"children":4747},{"style":432},[4748],{"type":41,"value":4749},"      \u003C",{"type":35,"tag":361,"props":4751,"children":4752},{"style":3587},[4753],{"type":41,"value":4737},{"type":35,"tag":361,"props":4755,"children":4756},{"style":426},[4757],{"type":41,"value":4758}," v-if",{"type":35,"tag":361,"props":4760,"children":4761},{"style":432},[4762],{"type":41,"value":2005},{"type":35,"tag":361,"props":4764,"children":4766},{"style":4765},"--shiki-default:#032F62;--shiki-dark:#9ECBFF;--shiki-sepia:#F8F8F2",[4767],{"type":41,"value":3263},{"type":35,"tag":361,"props":4769,"children":4770},{"style":432},[4771],{"type":41,"value":4772},"articles.",{"type":35,"tag":361,"props":4774,"children":4775},{"style":2628},[4776],{"type":41,"value":4777},"length",{"type":35,"tag":361,"props":4779,"children":4780},{"style":426},[4781],{"type":41,"value":4782}," \u003C=",{"type":35,"tag":361,"props":4784,"children":4785},{"style":1545},[4786],{"type":41,"value":4787}," 0",{"type":35,"tag":361,"props":4789,"children":4790},{"style":4765},[4791],{"type":41,"value":3263},{"type":35,"tag":361,"props":4793,"children":4794},{"style":432},[4795],{"type":41,"value":3595},{"type":35,"tag":361,"props":4797,"children":4798},{"class":363,"line":770},[4799],{"type":35,"tag":361,"props":4800,"children":4801},{"style":432},[4802],{"type":41,"value":4803},"        No blog found.\n",{"type":35,"tag":361,"props":4805,"children":4806},{"class":363,"line":778},[4807,4812,4816],{"type":35,"tag":361,"props":4808,"children":4809},{"style":432},[4810],{"type":41,"value":4811},"      \u003C/",{"type":35,"tag":361,"props":4813,"children":4814},{"style":3587},[4815],{"type":41,"value":4737},{"type":35,"tag":361,"props":4817,"children":4818},{"style":432},[4819],{"type":41,"value":3595},{"type":35,"tag":361,"props":4821,"children":4822},{"class":363,"line":787},[4823],{"type":35,"tag":361,"props":4824,"children":4825},{"emptyLinePlaceholder":550},[4826],{"type":41,"value":553},{"type":35,"tag":361,"props":4828,"children":4829},{"class":363,"line":796},[4830,4834,4838,4843,4847],{"type":35,"tag":361,"props":4831,"children":4832},{"style":432},[4833],{"type":41,"value":4749},{"type":35,"tag":361,"props":4835,"children":4836},{"style":3587},[4837],{"type":41,"value":36},{"type":35,"tag":361,"props":4839,"children":4840},{"style":432},[4841],{"type":41,"value":4842},">My Blogs\u003C/",{"type":35,"tag":361,"props":4844,"children":4845},{"style":3587},[4846],{"type":41,"value":36},{"type":35,"tag":361,"props":4848,"children":4849},{"style":432},[4850],{"type":41,"value":3595},{"type":35,"tag":361,"props":4852,"children":4853},{"class":363,"line":820},[4854,4858,4862,4867,4871,4875,4880,4885,4889,4893,4898,4903,4907,4911,4916,4920],{"type":35,"tag":361,"props":4855,"children":4856},{"style":432},[4857],{"type":41,"value":4749},{"type":35,"tag":361,"props":4859,"children":4860},{"style":3587},[4861],{"type":41,"value":4737},{"type":35,"tag":361,"props":4863,"children":4864},{"style":426},[4865],{"type":41,"value":4866}," v-for",{"type":35,"tag":361,"props":4868,"children":4869},{"style":432},[4870],{"type":41,"value":2005},{"type":35,"tag":361,"props":4872,"children":4873},{"style":4765},[4874],{"type":41,"value":3263},{"type":35,"tag":361,"props":4876,"children":4877},{"style":432},[4878],{"type":41,"value":4879},"article ",{"type":35,"tag":361,"props":4881,"children":4882},{"style":426},[4883],{"type":41,"value":4884},"in",{"type":35,"tag":361,"props":4886,"children":4887},{"style":432},[4888],{"type":41,"value":3813},{"type":35,"tag":361,"props":4890,"children":4891},{"style":4765},[4892],{"type":41,"value":3263},{"type":35,"tag":361,"props":4894,"children":4895},{"style":432},[4896],{"type":41,"value":4897}," :",{"type":35,"tag":361,"props":4899,"children":4900},{"style":368},[4901],{"type":41,"value":4902},"key",{"type":35,"tag":361,"props":4904,"children":4905},{"style":432},[4906],{"type":41,"value":2005},{"type":35,"tag":361,"props":4908,"children":4909},{"style":4765},[4910],{"type":41,"value":3263},{"type":35,"tag":361,"props":4912,"children":4913},{"style":432},[4914],{"type":41,"value":4915},"article._path",{"type":35,"tag":361,"props":4917,"children":4918},{"style":4765},[4919],{"type":41,"value":3263},{"type":35,"tag":361,"props":4921,"children":4922},{"style":432},[4923],{"type":41,"value":3595},{"type":35,"tag":361,"props":4925,"children":4926},{"class":363,"line":829},[4927,4932,4936,4940,4945,4949,4953,4957,4961],{"type":35,"tag":361,"props":4928,"children":4929},{"style":432},[4930],{"type":41,"value":4931},"        \u003C",{"type":35,"tag":361,"props":4933,"children":4934},{"style":3587},[4935],{"type":41,"value":60},{"type":35,"tag":361,"props":4937,"children":4938},{"style":432},[4939],{"type":41,"value":4897},{"type":35,"tag":361,"props":4941,"children":4942},{"style":368},[4943],{"type":41,"value":4944},"href",{"type":35,"tag":361,"props":4946,"children":4947},{"style":432},[4948],{"type":41,"value":2005},{"type":35,"tag":361,"props":4950,"children":4951},{"style":4765},[4952],{"type":41,"value":3263},{"type":35,"tag":361,"props":4954,"children":4955},{"style":432},[4956],{"type":41,"value":4915},{"type":35,"tag":361,"props":4958,"children":4959},{"style":4765},[4960],{"type":41,"value":3263},{"type":35,"tag":361,"props":4962,"children":4963},{"style":432},[4964],{"type":41,"value":3595},{"type":35,"tag":361,"props":4966,"children":4967},{"class":363,"line":838},[4968,4973,4977,4982,4986],{"type":35,"tag":361,"props":4969,"children":4970},{"style":432},[4971],{"type":41,"value":4972},"          \u003C",{"type":35,"tag":361,"props":4974,"children":4975},{"style":3587},[4976],{"type":41,"value":885},{"type":35,"tag":361,"props":4978,"children":4979},{"style":432},[4980],{"type":41,"value":4981},">{{article.title}}\u003C/",{"type":35,"tag":361,"props":4983,"children":4984},{"style":3587},[4985],{"type":41,"value":885},{"type":35,"tag":361,"props":4987,"children":4988},{"style":432},[4989],{"type":41,"value":3595},{"type":35,"tag":361,"props":4991,"children":4992},{"class":363,"line":847},[4993,4997,5001,5006,5010],{"type":35,"tag":361,"props":4994,"children":4995},{"style":432},[4996],{"type":41,"value":4972},{"type":35,"tag":361,"props":4998,"children":4999},{"style":3587},[5000],{"type":41,"value":255},{"type":35,"tag":361,"props":5002,"children":5003},{"style":432},[5004],{"type":41,"value":5005},">{{article._path}}  {{article.publishedAt}}\u003C/",{"type":35,"tag":361,"props":5007,"children":5008},{"style":3587},[5009],{"type":41,"value":255},{"type":35,"tag":361,"props":5011,"children":5012},{"style":432},[5013],{"type":41,"value":3595},{"type":35,"tag":361,"props":5015,"children":5016},{"class":363,"line":856},[5017,5021,5025,5030,5034],{"type":35,"tag":361,"props":5018,"children":5019},{"style":432},[5020],{"type":41,"value":4972},{"type":35,"tag":361,"props":5022,"children":5023},{"style":3587},[5024],{"type":41,"value":43},{"type":35,"tag":361,"props":5026,"children":5027},{"style":432},[5028],{"type":41,"value":5029},">{{article.description}}\u003C/",{"type":35,"tag":361,"props":5031,"children":5032},{"style":3587},[5033],{"type":41,"value":43},{"type":35,"tag":361,"props":5035,"children":5036},{"style":432},[5037],{"type":41,"value":3595},{"type":35,"tag":361,"props":5039,"children":5040},{"class":363,"line":864},[5041,5046,5050],{"type":35,"tag":361,"props":5042,"children":5043},{"style":432},[5044],{"type":41,"value":5045},"        \u003C/",{"type":35,"tag":361,"props":5047,"children":5048},{"style":3587},[5049],{"type":41,"value":60},{"type":35,"tag":361,"props":5051,"children":5052},{"style":432},[5053],{"type":41,"value":3595},{"type":35,"tag":361,"props":5055,"children":5056},{"class":363,"line":873},[5057,5061,5065],{"type":35,"tag":361,"props":5058,"children":5059},{"style":432},[5060],{"type":41,"value":4811},{"type":35,"tag":361,"props":5062,"children":5063},{"style":3587},[5064],{"type":41,"value":4737},{"type":35,"tag":361,"props":5066,"children":5067},{"style":432},[5068],{"type":41,"value":3595},{"type":35,"tag":361,"props":5070,"children":5071},{"class":363,"line":3445},[5072,5076,5080],{"type":35,"tag":361,"props":5073,"children":5074},{"style":432},[5075],{"type":41,"value":3638},{"type":35,"tag":361,"props":5077,"children":5078},{"style":3587},[5079],{"type":41,"value":4737},{"type":35,"tag":361,"props":5081,"children":5082},{"style":432},[5083],{"type":41,"value":3595},{"type":35,"tag":361,"props":5085,"children":5086},{"class":363,"line":3464},[5087,5091,5095],{"type":35,"tag":361,"props":5088,"children":5089},{"style":432},[5090],{"type":41,"value":3654},{"type":35,"tag":361,"props":5092,"children":5093},{"style":3587},[5094],{"type":41,"value":3590},{"type":35,"tag":361,"props":5096,"children":5097},{"style":432},[5098],{"type":41,"value":3595},{"type":35,"tag":43,"props":5100,"children":5101},{},[5102],{"type":41,"value":5103},"一个简单的索引（或者说导航）页就有了（下面这个截图我加了一个边框和一些 debug 信息，为了保持简洁上面的代码实现略去了这些无关紧要的东西）：",{"type":35,"tag":43,"props":5105,"children":5106},{},[5107],{"type":35,"tag":148,"props":5108,"children":5111},{"alt":5109,"src":5110},"实现的索引页截图","attachments/nuxt-content-basic-blogs-index-page.png",[],{"type":35,"tag":43,"props":5113,"children":5114},{},[5115],{"type":41,"value":5116},"按照你的喜好，稍微修改一下样式，就可以得到一个基本可用的页面了。例如，目前 murchinroom 的博客索引页：",{"type":35,"tag":43,"props":5118,"children":5119},{},[5120],{"type":35,"tag":148,"props":5121,"children":5124},{"alt":5122,"src":5123},"murchinroom 的 blogs 索引页截图","attachments/murchinroom-blogs-index-page.png",[],{"type":35,"tag":43,"props":5126,"children":5127},{},[5128,5130,5136,5138,5144],{"type":41,"value":5129},"其实就是把前面代码中 ",{"type":35,"tag":255,"props":5131,"children":5133},{"className":5132},[],[5134],{"type":41,"value":5135},"\u003Ca>",{"type":41,"value":5137}," 里面的东西换成了一个卡片组件来显示文章对象 ",{"type":35,"tag":255,"props":5139,"children":5141},{"className":5140},[],[5142],{"type":41,"value":5143},"components/blogs/Card.vue",{"type":41,"value":5145},"（请务必原谅丑陋的大段 Tailwind CSS 魔法，托付给大模型写的东西就是这样的）：",{"type":35,"tag":351,"props":5147,"children":5149},{"code":5148,"language":3571,"meta":8,"className":3572,"style":8},"\u003Cscript setup lang=\"ts\">\ndefineProps\u003C{\n  article?: {\n    title?: string,\n    description?: string,\n    publishedAt?: string,\n  }\n}>()\n\u003C/script>\n\n\u003Ctemplate>\n  \u003Cdiv class=\"min-w-full p-6 bg-white border border-gray-200 rounded-lg shadow hover:bg-gray-100 dark:bg-gray-800 dark:border-gray-700 dark:hover:bg-gray-700 hover:-translate-y-1 duration-300 \">\n    \u003Ch5 class=\"min-h-8 min-w-16 mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{{ article?.title }}\u003C/h5>\n    \u003Cp class=\"min-h-8 min-w-16 font-normal text-gray-700 dark:text-gray-400\">{{ article?.description }}\u003C/p>\n    \u003Cspan class=\"min-h-8 min-w-16 font-mono\">{{ article?.publishedAt }}\u003C/span>\n  \u003C/div>\n\u003C/template>\n",[5150],{"type":35,"tag":255,"props":5151,"children":5152},{"__ignoreMap":8},[5153,5184,5197,5215,5235,5255,5275,5282,5290,5305,5312,5327,5356,5394,5431,5468,5483],{"type":35,"tag":361,"props":5154,"children":5155},{"class":363,"line":364},[5156,5160,5164,5168,5172,5176,5180],{"type":35,"tag":361,"props":5157,"children":5158},{"style":432},[5159],{"type":41,"value":3584},{"type":35,"tag":361,"props":5161,"children":5162},{"style":3587},[5163],{"type":41,"value":4471},{"type":35,"tag":361,"props":5165,"children":5166},{"style":368},[5167],{"type":41,"value":4476},{"type":35,"tag":361,"props":5169,"children":5170},{"style":368},[5171],{"type":41,"value":4481},{"type":35,"tag":361,"props":5173,"children":5174},{"style":432},[5175],{"type":41,"value":2005},{"type":35,"tag":361,"props":5177,"children":5178},{"style":374},[5179],{"type":41,"value":4490},{"type":35,"tag":361,"props":5181,"children":5182},{"style":432},[5183],{"type":41,"value":3595},{"type":35,"tag":361,"props":5185,"children":5186},{"class":363,"line":438},[5187,5192],{"type":35,"tag":361,"props":5188,"children":5189},{"style":368},[5190],{"type":41,"value":5191},"defineProps",{"type":35,"tag":361,"props":5193,"children":5194},{"style":432},[5195],{"type":41,"value":5196},"\u003C{\n",{"type":35,"tag":361,"props":5198,"children":5199},{"class":363,"line":452},[5200,5206,5211],{"type":35,"tag":361,"props":5201,"children":5203},{"style":5202},"--shiki-default:#E36209;--shiki-dark:#FFAB70;--shiki-sepia:#F8F8F2",[5204],{"type":41,"value":5205},"  article",{"type":35,"tag":361,"props":5207,"children":5208},{"style":426},[5209],{"type":41,"value":5210},"?:",{"type":35,"tag":361,"props":5212,"children":5213},{"style":432},[5214],{"type":41,"value":3061},{"type":35,"tag":361,"props":5216,"children":5217},{"class":363,"line":461},[5218,5223,5227,5231],{"type":35,"tag":361,"props":5219,"children":5220},{"style":5202},[5221],{"type":41,"value":5222},"    title",{"type":35,"tag":361,"props":5224,"children":5225},{"style":426},[5226],{"type":41,"value":5210},{"type":35,"tag":361,"props":5228,"children":5229},{"style":3096},[5230],{"type":41,"value":3099},{"type":35,"tag":361,"props":5232,"children":5233},{"style":432},[5234],{"type":41,"value":619},{"type":35,"tag":361,"props":5236,"children":5237},{"class":363,"line":470},[5238,5243,5247,5251],{"type":35,"tag":361,"props":5239,"children":5240},{"style":5202},[5241],{"type":41,"value":5242},"    description",{"type":35,"tag":361,"props":5244,"children":5245},{"style":426},[5246],{"type":41,"value":5210},{"type":35,"tag":361,"props":5248,"children":5249},{"style":3096},[5250],{"type":41,"value":3099},{"type":35,"tag":361,"props":5252,"children":5253},{"style":432},[5254],{"type":41,"value":619},{"type":35,"tag":361,"props":5256,"children":5257},{"class":363,"line":594},[5258,5263,5267,5271],{"type":35,"tag":361,"props":5259,"children":5260},{"style":5202},[5261],{"type":41,"value":5262},"    publishedAt",{"type":35,"tag":361,"props":5264,"children":5265},{"style":426},[5266],{"type":41,"value":5210},{"type":35,"tag":361,"props":5268,"children":5269},{"style":3096},[5270],{"type":41,"value":3099},{"type":35,"tag":361,"props":5272,"children":5273},{"style":432},[5274],{"type":41,"value":619},{"type":35,"tag":361,"props":5276,"children":5277},{"class":363,"line":603},[5278],{"type":35,"tag":361,"props":5279,"children":5280},{"style":432},[5281],{"type":41,"value":4336},{"type":35,"tag":361,"props":5283,"children":5284},{"class":363,"line":622},[5285],{"type":35,"tag":361,"props":5286,"children":5287},{"style":432},[5288],{"type":41,"value":5289},"}>()\n",{"type":35,"tag":361,"props":5291,"children":5292},{"class":363,"line":640},[5293,5297,5301],{"type":35,"tag":361,"props":5294,"children":5295},{"style":432},[5296],{"type":41,"value":3654},{"type":35,"tag":361,"props":5298,"children":5299},{"style":3587},[5300],{"type":41,"value":4471},{"type":35,"tag":361,"props":5302,"children":5303},{"style":432},[5304],{"type":41,"value":3595},{"type":35,"tag":361,"props":5306,"children":5307},{"class":363,"line":669},[5308],{"type":35,"tag":361,"props":5309,"children":5310},{"emptyLinePlaceholder":550},[5311],{"type":41,"value":553},{"type":35,"tag":361,"props":5313,"children":5314},{"class":363,"line":678},[5315,5319,5323],{"type":35,"tag":361,"props":5316,"children":5317},{"style":432},[5318],{"type":41,"value":3584},{"type":35,"tag":361,"props":5320,"children":5321},{"style":3587},[5322],{"type":41,"value":3590},{"type":35,"tag":361,"props":5324,"children":5325},{"style":432},[5326],{"type":41,"value":3595},{"type":35,"tag":361,"props":5328,"children":5329},{"class":363,"line":687},[5330,5334,5338,5343,5347,5352],{"type":35,"tag":361,"props":5331,"children":5332},{"style":432},[5333],{"type":41,"value":3603},{"type":35,"tag":361,"props":5335,"children":5336},{"style":3587},[5337],{"type":41,"value":4737},{"type":35,"tag":361,"props":5339,"children":5340},{"style":368},[5341],{"type":41,"value":5342}," class",{"type":35,"tag":361,"props":5344,"children":5345},{"style":432},[5346],{"type":41,"value":2005},{"type":35,"tag":361,"props":5348,"children":5349},{"style":374},[5350],{"type":41,"value":5351},"\"min-w-full p-6 bg-white border border-gray-200 rounded-lg shadow hover:bg-gray-100 dark:bg-gray-800 dark:border-gray-700 dark:hover:bg-gray-700 hover:-translate-y-1 duration-300 \"",{"type":35,"tag":361,"props":5353,"children":5354},{"style":432},[5355],{"type":41,"value":3595},{"type":35,"tag":361,"props":5357,"children":5358},{"class":363,"line":696},[5359,5363,5368,5372,5376,5381,5386,5390],{"type":35,"tag":361,"props":5360,"children":5361},{"style":432},[5362],{"type":41,"value":3620},{"type":35,"tag":361,"props":5364,"children":5365},{"style":3587},[5366],{"type":41,"value":5367},"h5",{"type":35,"tag":361,"props":5369,"children":5370},{"style":368},[5371],{"type":41,"value":5342},{"type":35,"tag":361,"props":5373,"children":5374},{"style":432},[5375],{"type":41,"value":2005},{"type":35,"tag":361,"props":5377,"children":5378},{"style":374},[5379],{"type":41,"value":5380},"\"min-h-8 min-w-16 mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\"",{"type":35,"tag":361,"props":5382,"children":5383},{"style":432},[5384],{"type":41,"value":5385},">{{ article?.title }}\u003C/",{"type":35,"tag":361,"props":5387,"children":5388},{"style":3587},[5389],{"type":41,"value":5367},{"type":35,"tag":361,"props":5391,"children":5392},{"style":432},[5393],{"type":41,"value":3595},{"type":35,"tag":361,"props":5395,"children":5396},{"class":363,"line":752},[5397,5401,5405,5409,5413,5418,5423,5427],{"type":35,"tag":361,"props":5398,"children":5399},{"style":432},[5400],{"type":41,"value":3620},{"type":35,"tag":361,"props":5402,"children":5403},{"style":3587},[5404],{"type":41,"value":43},{"type":35,"tag":361,"props":5406,"children":5407},{"style":368},[5408],{"type":41,"value":5342},{"type":35,"tag":361,"props":5410,"children":5411},{"style":432},[5412],{"type":41,"value":2005},{"type":35,"tag":361,"props":5414,"children":5415},{"style":374},[5416],{"type":41,"value":5417},"\"min-h-8 min-w-16 font-normal text-gray-700 dark:text-gray-400\"",{"type":35,"tag":361,"props":5419,"children":5420},{"style":432},[5421],{"type":41,"value":5422},">{{ article?.description }}\u003C/",{"type":35,"tag":361,"props":5424,"children":5425},{"style":3587},[5426],{"type":41,"value":43},{"type":35,"tag":361,"props":5428,"children":5429},{"style":432},[5430],{"type":41,"value":3595},{"type":35,"tag":361,"props":5432,"children":5433},{"class":363,"line":770},[5434,5438,5442,5446,5450,5455,5460,5464],{"type":35,"tag":361,"props":5435,"children":5436},{"style":432},[5437],{"type":41,"value":3620},{"type":35,"tag":361,"props":5439,"children":5440},{"style":3587},[5441],{"type":41,"value":361},{"type":35,"tag":361,"props":5443,"children":5444},{"style":368},[5445],{"type":41,"value":5342},{"type":35,"tag":361,"props":5447,"children":5448},{"style":432},[5449],{"type":41,"value":2005},{"type":35,"tag":361,"props":5451,"children":5452},{"style":374},[5453],{"type":41,"value":5454},"\"min-h-8 min-w-16 font-mono\"",{"type":35,"tag":361,"props":5456,"children":5457},{"style":432},[5458],{"type":41,"value":5459},">{{ article?.publishedAt }}\u003C/",{"type":35,"tag":361,"props":5461,"children":5462},{"style":3587},[5463],{"type":41,"value":361},{"type":35,"tag":361,"props":5465,"children":5466},{"style":432},[5467],{"type":41,"value":3595},{"type":35,"tag":361,"props":5469,"children":5470},{"class":363,"line":778},[5471,5475,5479],{"type":35,"tag":361,"props":5472,"children":5473},{"style":432},[5474],{"type":41,"value":3638},{"type":35,"tag":361,"props":5476,"children":5477},{"style":3587},[5478],{"type":41,"value":4737},{"type":35,"tag":361,"props":5480,"children":5481},{"style":432},[5482],{"type":41,"value":3595},{"type":35,"tag":361,"props":5484,"children":5485},{"class":363,"line":787},[5486,5490,5494],{"type":35,"tag":361,"props":5487,"children":5488},{"style":432},[5489],{"type":41,"value":3654},{"type":35,"tag":361,"props":5491,"children":5492},{"style":3587},[5493],{"type":41,"value":3590},{"type":35,"tag":361,"props":5495,"children":5496},{"style":432},[5497],{"type":41,"value":3595},{"type":35,"tag":885,"props":5499,"children":5501},{"id":5500},"前后文",[5502],{"type":41,"value":5500},{"type":35,"tag":43,"props":5504,"children":5505},{},[5506],{"type":41,"value":5507},"接下来，实现文章末尾的上一篇、下一篇功能。",{"type":35,"tag":43,"props":5509,"children":5510},{},[5511,5513,5519,5521,5527,5529,5535],{"type":41,"value":5512},"这个其实和索引页的实现很类似，依然是借助 ",{"type":35,"tag":255,"props":5514,"children":5516},{"className":5515},[],[5517],{"type":41,"value":5518},"queryContent",{"type":41,"value":5520}," 来查询，只不过把最后的 ",{"type":35,"tag":255,"props":5522,"children":5524},{"className":5523},[],[5525],{"type":41,"value":5526},".find()",{"type":41,"value":5528}," 改成 ",{"type":35,"tag":255,"props":5530,"children":5532},{"className":5531},[],[5533],{"type":41,"value":5534},".findSurround()",{"type":41,"value":5536},"，传入当前页面的路径，即可查询出当前文章的 next 和 previous：",{"type":35,"tag":351,"props":5538,"children":5540},{"code":5539,"language":511,"meta":8,"className":512,"style":8},"const [prevArticle, nextArticle] = await queryContent(\"/blogs\")\n    .where({\"publishedAt\": {$exists: true}})\n    .sort({\"publishedAt\": 1})\n    .without(\"body\")\n    .findSurround(route.path);\n",[5541],{"type":35,"tag":255,"props":5542,"children":5543},{"__ignoreMap":8},[5544,5600,5632,5663,5686],{"type":35,"tag":361,"props":5545,"children":5546},{"class":363,"line":364},[5547,5551,5556,5561,5565,5570,5575,5579,5583,5587,5591,5596],{"type":35,"tag":361,"props":5548,"children":5549},{"style":2622},[5550],{"type":41,"value":2625},{"type":35,"tag":361,"props":5552,"children":5553},{"style":432},[5554],{"type":41,"value":5555}," [",{"type":35,"tag":361,"props":5557,"children":5558},{"style":2628},[5559],{"type":41,"value":5560},"prevArticle",{"type":35,"tag":361,"props":5562,"children":5563},{"style":432},[5564],{"type":41,"value":712},{"type":35,"tag":361,"props":5566,"children":5567},{"style":2628},[5568],{"type":41,"value":5569},"nextArticle",{"type":35,"tag":361,"props":5571,"children":5572},{"style":432},[5573],{"type":41,"value":5574},"] ",{"type":35,"tag":361,"props":5576,"children":5577},{"style":426},[5578],{"type":41,"value":2005},{"type":35,"tag":361,"props":5580,"children":5581},{"style":426},[5582],{"type":41,"value":3822},{"type":35,"tag":361,"props":5584,"children":5585},{"style":368},[5586],{"type":41,"value":3827},{"type":35,"tag":361,"props":5588,"children":5589},{"style":432},[5590],{"type":41,"value":3187},{"type":35,"tag":361,"props":5592,"children":5593},{"style":374},[5594],{"type":41,"value":5595},"\"/blogs\"",{"type":35,"tag":361,"props":5597,"children":5598},{"style":432},[5599],{"type":41,"value":666},{"type":35,"tag":361,"props":5601,"children":5602},{"class":363,"line":438},[5603,5608,5612,5616,5620,5624,5628],{"type":35,"tag":361,"props":5604,"children":5605},{"style":432},[5606],{"type":41,"value":5607},"    .",{"type":35,"tag":361,"props":5609,"children":5610},{"style":368},[5611],{"type":41,"value":3853},{"type":35,"tag":361,"props":5613,"children":5614},{"style":432},[5615],{"type":41,"value":3858},{"type":35,"tag":361,"props":5617,"children":5618},{"style":374},[5619],{"type":41,"value":3863},{"type":35,"tag":361,"props":5621,"children":5622},{"style":432},[5623],{"type":41,"value":3868},{"type":35,"tag":361,"props":5625,"children":5626},{"style":1545},[5627],{"type":41,"value":2011},{"type":35,"tag":361,"props":5629,"children":5630},{"style":432},[5631],{"type":41,"value":3877},{"type":35,"tag":361,"props":5633,"children":5634},{"class":363,"line":452},[5635,5639,5643,5647,5651,5655,5659],{"type":35,"tag":361,"props":5636,"children":5637},{"style":432},[5638],{"type":41,"value":5607},{"type":35,"tag":361,"props":5640,"children":5641},{"style":368},[5642],{"type":41,"value":3889},{"type":35,"tag":361,"props":5644,"children":5645},{"style":432},[5646],{"type":41,"value":3858},{"type":35,"tag":361,"props":5648,"children":5649},{"style":374},[5650],{"type":41,"value":3863},{"type":35,"tag":361,"props":5652,"children":5653},{"style":432},[5654],{"type":41,"value":3902},{"type":35,"tag":361,"props":5656,"children":5657},{"style":1545},[5658],{"type":41,"value":1945},{"type":35,"tag":361,"props":5660,"children":5661},{"style":432},[5662],{"type":41,"value":476},{"type":35,"tag":361,"props":5664,"children":5665},{"class":363,"line":461},[5666,5670,5674,5678,5682],{"type":35,"tag":361,"props":5667,"children":5668},{"style":432},[5669],{"type":41,"value":5607},{"type":35,"tag":361,"props":5671,"children":5672},{"style":368},[5673],{"type":41,"value":3927},{"type":35,"tag":361,"props":5675,"children":5676},{"style":432},[5677],{"type":41,"value":3187},{"type":35,"tag":361,"props":5679,"children":5680},{"style":374},[5681],{"type":41,"value":3936},{"type":35,"tag":361,"props":5683,"children":5684},{"style":432},[5685],{"type":41,"value":666},{"type":35,"tag":361,"props":5687,"children":5688},{"class":363,"line":470},[5689,5693,5698],{"type":35,"tag":361,"props":5690,"children":5691},{"style":432},[5692],{"type":41,"value":5607},{"type":35,"tag":361,"props":5694,"children":5695},{"style":368},[5696],{"type":41,"value":5697},"findSurround",{"type":35,"tag":361,"props":5699,"children":5700},{"style":432},[5701],{"type":41,"value":5702},"(route.path);\n",{"type":35,"tag":43,"props":5704,"children":5705},{},[5706],{"type":41,"value":5707},"为了保证查询出来的所谓前后顺序和索引页的文章列表保持一致，这里使用的 sort 和 index page 中的是相反的。（因为索引页是从新到旧的逆序，而 findSurround 的前后关系是用正序的。）",{"type":35,"tag":43,"props":5709,"children":5710},{},[5711,5713,5719],{"type":41,"value":5712},"在 content source （",{"type":35,"tag":255,"props":5714,"children":5716},{"className":5715},[],[5717],{"type":41,"value":5718},"public/blogs/",{"type":41,"value":5720},"）中新建两篇文章测试一下，返回出来的东西是这样的：",{"type":35,"tag":351,"props":5722,"children":5724},{"code":5723,"language":4019,"meta":8,"className":4020,"style":8},"[\n  {\n    \"_path\": \"/blogs/test-prev\",\n    \"_dir\": \"blogs\",\n    \"_draft\": false,\n    \"_partial\": false,\n    \"_locale\": \"\",\n    \"title\": \"这是前一篇文章\",\n    \"description\": \"...\",\n    \"publishedAt\": \"2004-01-01\",\n    \"_type\": \"markdown\",\n    \"_id\": \"blogs:blogs:test-prev.md\",\n    \"_source\": \"blogs\",\n    \"_file\": \"blogs/test-prev.md\",\n    \"_stem\": \"blogs/test-prev\",\n    \"_extension\": \"md\"\n  },\n  {\n    \"_path\": \"/blogs/test-next\",\n    \"_dir\": \"blogs\",\n    \"_draft\": false,\n    \"_partial\": false,\n    \"_locale\": \"\",\n    \"title\": \"这是后一篇文章\",\n    \"description\": \"...\",\n    \"publishedAt\": \"2058-10-10\",\n    \"_type\": \"markdown\",\n    \"_id\": \"blogs:blogs:test-next.md\",\n    \"_source\": \"blogs\",\n    \"_file\": \"blogs/test-next.md\",\n    \"_stem\": \"blogs/test-next\",\n    \"_extension\": \"md\"\n  }\n]\n",[5725],{"type":35,"tag":255,"props":5726,"children":5727},{"__ignoreMap":8},[5728,5735,5742,5762,5781,5800,5819,5838,5858,5878,5898,5917,5937,5956,5976,5996,6011,6018,6025,6045,6064,6083,6102,6121,6141,6160,6180,6199,6219,6239,6260,6281,6297,6305],{"type":35,"tag":361,"props":5729,"children":5730},{"class":363,"line":364},[5731],{"type":35,"tag":361,"props":5732,"children":5733},{"style":432},[5734],{"type":41,"value":4032},{"type":35,"tag":361,"props":5736,"children":5737},{"class":363,"line":438},[5738],{"type":35,"tag":361,"props":5739,"children":5740},{"style":432},[5741],{"type":41,"value":4040},{"type":35,"tag":361,"props":5743,"children":5744},{"class":363,"line":452},[5745,5749,5753,5758],{"type":35,"tag":361,"props":5746,"children":5747},{"style":3096},[5748],{"type":41,"value":4048},{"type":35,"tag":361,"props":5750,"children":5751},{"style":432},[5752],{"type":41,"value":3902},{"type":35,"tag":361,"props":5754,"children":5755},{"style":4055},[5756],{"type":41,"value":5757},"\"/blogs/test-prev\"",{"type":35,"tag":361,"props":5759,"children":5760},{"style":432},[5761],{"type":41,"value":619},{"type":35,"tag":361,"props":5763,"children":5764},{"class":363,"line":461},[5765,5769,5773,5777],{"type":35,"tag":361,"props":5766,"children":5767},{"style":3096},[5768],{"type":41,"value":4070},{"type":35,"tag":361,"props":5770,"children":5771},{"style":432},[5772],{"type":41,"value":3902},{"type":35,"tag":361,"props":5774,"children":5775},{"style":4055},[5776],{"type":41,"value":4079},{"type":35,"tag":361,"props":5778,"children":5779},{"style":432},[5780],{"type":41,"value":619},{"type":35,"tag":361,"props":5782,"children":5783},{"class":363,"line":470},[5784,5788,5792,5796],{"type":35,"tag":361,"props":5785,"children":5786},{"style":3096},[5787],{"type":41,"value":4091},{"type":35,"tag":361,"props":5789,"children":5790},{"style":432},[5791],{"type":41,"value":3902},{"type":35,"tag":361,"props":5793,"children":5794},{"style":1545},[5795],{"type":41,"value":2034},{"type":35,"tag":361,"props":5797,"children":5798},{"style":432},[5799],{"type":41,"value":619},{"type":35,"tag":361,"props":5801,"children":5802},{"class":363,"line":594},[5803,5807,5811,5815],{"type":35,"tag":361,"props":5804,"children":5805},{"style":3096},[5806],{"type":41,"value":4111},{"type":35,"tag":361,"props":5808,"children":5809},{"style":432},[5810],{"type":41,"value":3902},{"type":35,"tag":361,"props":5812,"children":5813},{"style":1545},[5814],{"type":41,"value":2034},{"type":35,"tag":361,"props":5816,"children":5817},{"style":432},[5818],{"type":41,"value":619},{"type":35,"tag":361,"props":5820,"children":5821},{"class":363,"line":603},[5822,5826,5830,5834],{"type":35,"tag":361,"props":5823,"children":5824},{"style":3096},[5825],{"type":41,"value":4131},{"type":35,"tag":361,"props":5827,"children":5828},{"style":432},[5829],{"type":41,"value":3902},{"type":35,"tag":361,"props":5831,"children":5832},{"style":4055},[5833],{"type":41,"value":4140},{"type":35,"tag":361,"props":5835,"children":5836},{"style":432},[5837],{"type":41,"value":619},{"type":35,"tag":361,"props":5839,"children":5840},{"class":363,"line":622},[5841,5845,5849,5854],{"type":35,"tag":361,"props":5842,"children":5843},{"style":3096},[5844],{"type":41,"value":4152},{"type":35,"tag":361,"props":5846,"children":5847},{"style":432},[5848],{"type":41,"value":3902},{"type":35,"tag":361,"props":5850,"children":5851},{"style":4055},[5852],{"type":41,"value":5853},"\"这是前一篇文章\"",{"type":35,"tag":361,"props":5855,"children":5856},{"style":432},[5857],{"type":41,"value":619},{"type":35,"tag":361,"props":5859,"children":5860},{"class":363,"line":640},[5861,5865,5869,5874],{"type":35,"tag":361,"props":5862,"children":5863},{"style":3096},[5864],{"type":41,"value":4173},{"type":35,"tag":361,"props":5866,"children":5867},{"style":432},[5868],{"type":41,"value":3902},{"type":35,"tag":361,"props":5870,"children":5871},{"style":4055},[5872],{"type":41,"value":5873},"\"...\"",{"type":35,"tag":361,"props":5875,"children":5876},{"style":432},[5877],{"type":41,"value":619},{"type":35,"tag":361,"props":5879,"children":5880},{"class":363,"line":669},[5881,5885,5889,5894],{"type":35,"tag":361,"props":5882,"children":5883},{"style":3096},[5884],{"type":41,"value":4194},{"type":35,"tag":361,"props":5886,"children":5887},{"style":432},[5888],{"type":41,"value":3902},{"type":35,"tag":361,"props":5890,"children":5891},{"style":4055},[5892],{"type":41,"value":5893},"\"2004-01-01\"",{"type":35,"tag":361,"props":5895,"children":5896},{"style":432},[5897],{"type":41,"value":619},{"type":35,"tag":361,"props":5899,"children":5900},{"class":363,"line":678},[5901,5905,5909,5913],{"type":35,"tag":361,"props":5902,"children":5903},{"style":3096},[5904],{"type":41,"value":4215},{"type":35,"tag":361,"props":5906,"children":5907},{"style":432},[5908],{"type":41,"value":3902},{"type":35,"tag":361,"props":5910,"children":5911},{"style":4055},[5912],{"type":41,"value":4224},{"type":35,"tag":361,"props":5914,"children":5915},{"style":432},[5916],{"type":41,"value":619},{"type":35,"tag":361,"props":5918,"children":5919},{"class":363,"line":687},[5920,5924,5928,5933],{"type":35,"tag":361,"props":5921,"children":5922},{"style":3096},[5923],{"type":41,"value":4236},{"type":35,"tag":361,"props":5925,"children":5926},{"style":432},[5927],{"type":41,"value":3902},{"type":35,"tag":361,"props":5929,"children":5930},{"style":4055},[5931],{"type":41,"value":5932},"\"blogs:blogs:test-prev.md\"",{"type":35,"tag":361,"props":5934,"children":5935},{"style":432},[5936],{"type":41,"value":619},{"type":35,"tag":361,"props":5938,"children":5939},{"class":363,"line":696},[5940,5944,5948,5952],{"type":35,"tag":361,"props":5941,"children":5942},{"style":3096},[5943],{"type":41,"value":4257},{"type":35,"tag":361,"props":5945,"children":5946},{"style":432},[5947],{"type":41,"value":3902},{"type":35,"tag":361,"props":5949,"children":5950},{"style":4055},[5951],{"type":41,"value":4079},{"type":35,"tag":361,"props":5953,"children":5954},{"style":432},[5955],{"type":41,"value":619},{"type":35,"tag":361,"props":5957,"children":5958},{"class":363,"line":752},[5959,5963,5967,5972],{"type":35,"tag":361,"props":5960,"children":5961},{"style":3096},[5962],{"type":41,"value":4277},{"type":35,"tag":361,"props":5964,"children":5965},{"style":432},[5966],{"type":41,"value":3902},{"type":35,"tag":361,"props":5968,"children":5969},{"style":4055},[5970],{"type":41,"value":5971},"\"blogs/test-prev.md\"",{"type":35,"tag":361,"props":5973,"children":5974},{"style":432},[5975],{"type":41,"value":619},{"type":35,"tag":361,"props":5977,"children":5978},{"class":363,"line":770},[5979,5983,5987,5992],{"type":35,"tag":361,"props":5980,"children":5981},{"style":3096},[5982],{"type":41,"value":4298},{"type":35,"tag":361,"props":5984,"children":5985},{"style":432},[5986],{"type":41,"value":3902},{"type":35,"tag":361,"props":5988,"children":5989},{"style":4055},[5990],{"type":41,"value":5991},"\"blogs/test-prev\"",{"type":35,"tag":361,"props":5993,"children":5994},{"style":432},[5995],{"type":41,"value":619},{"type":35,"tag":361,"props":5997,"children":5998},{"class":363,"line":778},[5999,6003,6007],{"type":35,"tag":361,"props":6000,"children":6001},{"style":3096},[6002],{"type":41,"value":4319},{"type":35,"tag":361,"props":6004,"children":6005},{"style":432},[6006],{"type":41,"value":3902},{"type":35,"tag":361,"props":6008,"children":6009},{"style":4055},[6010],{"type":41,"value":4328},{"type":35,"tag":361,"props":6012,"children":6013},{"class":363,"line":787},[6014],{"type":35,"tag":361,"props":6015,"children":6016},{"style":432},[6017],{"type":41,"value":870},{"type":35,"tag":361,"props":6019,"children":6020},{"class":363,"line":796},[6021],{"type":35,"tag":361,"props":6022,"children":6023},{"style":432},[6024],{"type":41,"value":4040},{"type":35,"tag":361,"props":6026,"children":6027},{"class":363,"line":820},[6028,6032,6036,6041],{"type":35,"tag":361,"props":6029,"children":6030},{"style":3096},[6031],{"type":41,"value":4048},{"type":35,"tag":361,"props":6033,"children":6034},{"style":432},[6035],{"type":41,"value":3902},{"type":35,"tag":361,"props":6037,"children":6038},{"style":4055},[6039],{"type":41,"value":6040},"\"/blogs/test-next\"",{"type":35,"tag":361,"props":6042,"children":6043},{"style":432},[6044],{"type":41,"value":619},{"type":35,"tag":361,"props":6046,"children":6047},{"class":363,"line":829},[6048,6052,6056,6060],{"type":35,"tag":361,"props":6049,"children":6050},{"style":3096},[6051],{"type":41,"value":4070},{"type":35,"tag":361,"props":6053,"children":6054},{"style":432},[6055],{"type":41,"value":3902},{"type":35,"tag":361,"props":6057,"children":6058},{"style":4055},[6059],{"type":41,"value":4079},{"type":35,"tag":361,"props":6061,"children":6062},{"style":432},[6063],{"type":41,"value":619},{"type":35,"tag":361,"props":6065,"children":6066},{"class":363,"line":838},[6067,6071,6075,6079],{"type":35,"tag":361,"props":6068,"children":6069},{"style":3096},[6070],{"type":41,"value":4091},{"type":35,"tag":361,"props":6072,"children":6073},{"style":432},[6074],{"type":41,"value":3902},{"type":35,"tag":361,"props":6076,"children":6077},{"style":1545},[6078],{"type":41,"value":2034},{"type":35,"tag":361,"props":6080,"children":6081},{"style":432},[6082],{"type":41,"value":619},{"type":35,"tag":361,"props":6084,"children":6085},{"class":363,"line":847},[6086,6090,6094,6098],{"type":35,"tag":361,"props":6087,"children":6088},{"style":3096},[6089],{"type":41,"value":4111},{"type":35,"tag":361,"props":6091,"children":6092},{"style":432},[6093],{"type":41,"value":3902},{"type":35,"tag":361,"props":6095,"children":6096},{"style":1545},[6097],{"type":41,"value":2034},{"type":35,"tag":361,"props":6099,"children":6100},{"style":432},[6101],{"type":41,"value":619},{"type":35,"tag":361,"props":6103,"children":6104},{"class":363,"line":856},[6105,6109,6113,6117],{"type":35,"tag":361,"props":6106,"children":6107},{"style":3096},[6108],{"type":41,"value":4131},{"type":35,"tag":361,"props":6110,"children":6111},{"style":432},[6112],{"type":41,"value":3902},{"type":35,"tag":361,"props":6114,"children":6115},{"style":4055},[6116],{"type":41,"value":4140},{"type":35,"tag":361,"props":6118,"children":6119},{"style":432},[6120],{"type":41,"value":619},{"type":35,"tag":361,"props":6122,"children":6123},{"class":363,"line":864},[6124,6128,6132,6137],{"type":35,"tag":361,"props":6125,"children":6126},{"style":3096},[6127],{"type":41,"value":4152},{"type":35,"tag":361,"props":6129,"children":6130},{"style":432},[6131],{"type":41,"value":3902},{"type":35,"tag":361,"props":6133,"children":6134},{"style":4055},[6135],{"type":41,"value":6136},"\"这是后一篇文章\"",{"type":35,"tag":361,"props":6138,"children":6139},{"style":432},[6140],{"type":41,"value":619},{"type":35,"tag":361,"props":6142,"children":6143},{"class":363,"line":873},[6144,6148,6152,6156],{"type":35,"tag":361,"props":6145,"children":6146},{"style":3096},[6147],{"type":41,"value":4173},{"type":35,"tag":361,"props":6149,"children":6150},{"style":432},[6151],{"type":41,"value":3902},{"type":35,"tag":361,"props":6153,"children":6154},{"style":4055},[6155],{"type":41,"value":5873},{"type":35,"tag":361,"props":6157,"children":6158},{"style":432},[6159],{"type":41,"value":619},{"type":35,"tag":361,"props":6161,"children":6162},{"class":363,"line":3445},[6163,6167,6171,6176],{"type":35,"tag":361,"props":6164,"children":6165},{"style":3096},[6166],{"type":41,"value":4194},{"type":35,"tag":361,"props":6168,"children":6169},{"style":432},[6170],{"type":41,"value":3902},{"type":35,"tag":361,"props":6172,"children":6173},{"style":4055},[6174],{"type":41,"value":6175},"\"2058-10-10\"",{"type":35,"tag":361,"props":6177,"children":6178},{"style":432},[6179],{"type":41,"value":619},{"type":35,"tag":361,"props":6181,"children":6182},{"class":363,"line":3464},[6183,6187,6191,6195],{"type":35,"tag":361,"props":6184,"children":6185},{"style":3096},[6186],{"type":41,"value":4215},{"type":35,"tag":361,"props":6188,"children":6189},{"style":432},[6190],{"type":41,"value":3902},{"type":35,"tag":361,"props":6192,"children":6193},{"style":4055},[6194],{"type":41,"value":4224},{"type":35,"tag":361,"props":6196,"children":6197},{"style":432},[6198],{"type":41,"value":619},{"type":35,"tag":361,"props":6200,"children":6201},{"class":363,"line":3473},[6202,6206,6210,6215],{"type":35,"tag":361,"props":6203,"children":6204},{"style":3096},[6205],{"type":41,"value":4236},{"type":35,"tag":361,"props":6207,"children":6208},{"style":432},[6209],{"type":41,"value":3902},{"type":35,"tag":361,"props":6211,"children":6212},{"style":4055},[6213],{"type":41,"value":6214},"\"blogs:blogs:test-next.md\"",{"type":35,"tag":361,"props":6216,"children":6217},{"style":432},[6218],{"type":41,"value":619},{"type":35,"tag":361,"props":6220,"children":6222},{"class":363,"line":6221},29,[6223,6227,6231,6235],{"type":35,"tag":361,"props":6224,"children":6225},{"style":3096},[6226],{"type":41,"value":4257},{"type":35,"tag":361,"props":6228,"children":6229},{"style":432},[6230],{"type":41,"value":3902},{"type":35,"tag":361,"props":6232,"children":6233},{"style":4055},[6234],{"type":41,"value":4079},{"type":35,"tag":361,"props":6236,"children":6237},{"style":432},[6238],{"type":41,"value":619},{"type":35,"tag":361,"props":6240,"children":6242},{"class":363,"line":6241},30,[6243,6247,6251,6256],{"type":35,"tag":361,"props":6244,"children":6245},{"style":3096},[6246],{"type":41,"value":4277},{"type":35,"tag":361,"props":6248,"children":6249},{"style":432},[6250],{"type":41,"value":3902},{"type":35,"tag":361,"props":6252,"children":6253},{"style":4055},[6254],{"type":41,"value":6255},"\"blogs/test-next.md\"",{"type":35,"tag":361,"props":6257,"children":6258},{"style":432},[6259],{"type":41,"value":619},{"type":35,"tag":361,"props":6261,"children":6263},{"class":363,"line":6262},31,[6264,6268,6272,6277],{"type":35,"tag":361,"props":6265,"children":6266},{"style":3096},[6267],{"type":41,"value":4298},{"type":35,"tag":361,"props":6269,"children":6270},{"style":432},[6271],{"type":41,"value":3902},{"type":35,"tag":361,"props":6273,"children":6274},{"style":4055},[6275],{"type":41,"value":6276},"\"blogs/test-next\"",{"type":35,"tag":361,"props":6278,"children":6279},{"style":432},[6280],{"type":41,"value":619},{"type":35,"tag":361,"props":6282,"children":6284},{"class":363,"line":6283},32,[6285,6289,6293],{"type":35,"tag":361,"props":6286,"children":6287},{"style":3096},[6288],{"type":41,"value":4319},{"type":35,"tag":361,"props":6290,"children":6291},{"style":432},[6292],{"type":41,"value":3902},{"type":35,"tag":361,"props":6294,"children":6295},{"style":4055},[6296],{"type":41,"value":4328},{"type":35,"tag":361,"props":6298,"children":6300},{"class":363,"line":6299},33,[6301],{"type":35,"tag":361,"props":6302,"children":6303},{"style":432},[6304],{"type":41,"value":4336},{"type":35,"tag":361,"props":6306,"children":6308},{"class":363,"line":6307},34,[6309],{"type":35,"tag":361,"props":6310,"children":6311},{"style":432},[6312],{"type":41,"value":3012},{"type":35,"tag":43,"props":6314,"children":6315},{},[6316,6318,6324],{"type":41,"value":6317},"这个上下篇的功能一般加到文章末尾，所以我们在 catch-all route 的 ",{"type":35,"tag":255,"props":6319,"children":6321},{"className":6320},[],[6322],{"type":41,"value":6323},"[...slug].vue",{"type":41,"value":6325}," 页面中添加他。",{"type":35,"tag":43,"props":6327,"children":6328},{},[6329,6331,6336,6338,6344],{"type":41,"value":6330},"但在这之前，我们先“fork”一份全局的 catch-all ",{"type":35,"tag":255,"props":6332,"children":6334},{"className":6333},[],[6335],{"type":41,"value":3523},{"type":41,"value":6337}," 到 ",{"type":35,"tag":255,"props":6339,"children":6341},{"className":6340},[],[6342],{"type":41,"value":6343},"pages/blogs/[...slug].vue",{"type":41,"value":6345},"，这样感觉层次更清晰一些。",{"type":35,"tag":351,"props":6347,"children":6349},{"code":6348,"language":354,"meta":8,"className":355,"style":8},"cp 'pages/[...slug].vue' 'pages/blogs/[...slug].vue'\n",[6350],{"type":35,"tag":255,"props":6351,"children":6352},{"__ignoreMap":8},[6353],{"type":35,"tag":361,"props":6354,"children":6355},{"class":363,"line":364},[6356,6361,6366],{"type":35,"tag":361,"props":6357,"children":6358},{"style":368},[6359],{"type":41,"value":6360},"cp",{"type":35,"tag":361,"props":6362,"children":6363},{"style":374},[6364],{"type":41,"value":6365}," 'pages/[...slug].vue'",{"type":35,"tag":361,"props":6367,"children":6368},{"style":374},[6369],{"type":41,"value":6370}," 'pages/blogs/[...slug].vue'\n",{"type":35,"tag":43,"props":6372,"children":6373},{},[6374,6379],{"type":35,"tag":255,"props":6375,"children":6377},{"className":6376},[],[6378],{"type":41,"value":6343},{"type":41,"value":3093},{"type":35,"tag":351,"props":6381,"children":6383},{"code":6382,"language":3571,"meta":8,"className":3572,"style":8},"\u003Cscript setup lang=\"ts\">\nimport {queryContent} from \"#imports\";\n\nconst route = useRoute();\n\nconst [prevArticle, nextArticle] = await queryContent(\"/blogs\")\n    .where({\"publishedAt\": {$exists: true}})\n    .sort({\"publishedAt\": 1})\n    .without(\"body\")\n    .findSurround(route.path);\n\u003C/script>\n\n\u003Ctemplate>\n  \u003Cmain>\n    \u003CContentDoc />\n    \u003Cdiv class=\"这里是新加的\">\n        \u003Chr/>\n        \u003Cp v-if=\"nextArticle\">next: \u003Ca :href=\"nextArticle._path\">{{nextArticle.title}}\u003C/a>\u003C/p>\n        \u003Cp v-if=\"prevArticle\">prev: \u003Ca :href=\"prevArticle._path\">{{prevArticle.title}}\u003C/a>\u003C/p>\n    \u003C/div>\n  \u003C/main>\n\u003C/template>\n",[6384],{"type":35,"tag":255,"props":6385,"children":6386},{"__ignoreMap":8},[6387,6418,6441,6448,6473,6480,6531,6562,6593,6616,6631,6646,6653,6668,6683,6698,6726,6743,6830,6916,6932,6947],{"type":35,"tag":361,"props":6388,"children":6389},{"class":363,"line":364},[6390,6394,6398,6402,6406,6410,6414],{"type":35,"tag":361,"props":6391,"children":6392},{"style":432},[6393],{"type":41,"value":3584},{"type":35,"tag":361,"props":6395,"children":6396},{"style":3587},[6397],{"type":41,"value":4471},{"type":35,"tag":361,"props":6399,"children":6400},{"style":368},[6401],{"type":41,"value":4476},{"type":35,"tag":361,"props":6403,"children":6404},{"style":368},[6405],{"type":41,"value":4481},{"type":35,"tag":361,"props":6407,"children":6408},{"style":432},[6409],{"type":41,"value":2005},{"type":35,"tag":361,"props":6411,"children":6412},{"style":374},[6413],{"type":41,"value":4490},{"type":35,"tag":361,"props":6415,"children":6416},{"style":432},[6417],{"type":41,"value":3595},{"type":35,"tag":361,"props":6419,"children":6420},{"class":363,"line":438},[6421,6425,6429,6433,6437],{"type":35,"tag":361,"props":6422,"children":6423},{"style":426},[6424],{"type":41,"value":524},{"type":35,"tag":361,"props":6426,"children":6427},{"style":432},[6428],{"type":41,"value":4506},{"type":35,"tag":361,"props":6430,"children":6431},{"style":426},[6432],{"type":41,"value":534},{"type":35,"tag":361,"props":6434,"children":6435},{"style":374},[6436],{"type":41,"value":4515},{"type":35,"tag":361,"props":6438,"children":6439},{"style":432},[6440],{"type":41,"value":544},{"type":35,"tag":361,"props":6442,"children":6443},{"class":363,"line":452},[6444],{"type":35,"tag":361,"props":6445,"children":6446},{"emptyLinePlaceholder":550},[6447],{"type":41,"value":553},{"type":35,"tag":361,"props":6449,"children":6450},{"class":363,"line":461},[6451,6455,6460,6464,6469],{"type":35,"tag":361,"props":6452,"children":6453},{"style":2622},[6454],{"type":41,"value":2625},{"type":35,"tag":361,"props":6456,"children":6457},{"style":2628},[6458],{"type":41,"value":6459}," route",{"type":35,"tag":361,"props":6461,"children":6462},{"style":426},[6463],{"type":41,"value":2636},{"type":35,"tag":361,"props":6465,"children":6466},{"style":368},[6467],{"type":41,"value":6468}," useRoute",{"type":35,"tag":361,"props":6470,"children":6471},{"style":432},[6472],{"type":41,"value":3987},{"type":35,"tag":361,"props":6474,"children":6475},{"class":363,"line":470},[6476],{"type":35,"tag":361,"props":6477,"children":6478},{"emptyLinePlaceholder":550},[6479],{"type":41,"value":553},{"type":35,"tag":361,"props":6481,"children":6482},{"class":363,"line":594},[6483,6487,6491,6495,6499,6503,6507,6511,6515,6519,6523,6527],{"type":35,"tag":361,"props":6484,"children":6485},{"style":2622},[6486],{"type":41,"value":2625},{"type":35,"tag":361,"props":6488,"children":6489},{"style":432},[6490],{"type":41,"value":5555},{"type":35,"tag":361,"props":6492,"children":6493},{"style":2628},[6494],{"type":41,"value":5560},{"type":35,"tag":361,"props":6496,"children":6497},{"style":432},[6498],{"type":41,"value":712},{"type":35,"tag":361,"props":6500,"children":6501},{"style":2628},[6502],{"type":41,"value":5569},{"type":35,"tag":361,"props":6504,"children":6505},{"style":432},[6506],{"type":41,"value":5574},{"type":35,"tag":361,"props":6508,"children":6509},{"style":426},[6510],{"type":41,"value":2005},{"type":35,"tag":361,"props":6512,"children":6513},{"style":426},[6514],{"type":41,"value":3822},{"type":35,"tag":361,"props":6516,"children":6517},{"style":368},[6518],{"type":41,"value":3827},{"type":35,"tag":361,"props":6520,"children":6521},{"style":432},[6522],{"type":41,"value":3187},{"type":35,"tag":361,"props":6524,"children":6525},{"style":374},[6526],{"type":41,"value":5595},{"type":35,"tag":361,"props":6528,"children":6529},{"style":432},[6530],{"type":41,"value":666},{"type":35,"tag":361,"props":6532,"children":6533},{"class":363,"line":603},[6534,6538,6542,6546,6550,6554,6558],{"type":35,"tag":361,"props":6535,"children":6536},{"style":432},[6537],{"type":41,"value":5607},{"type":35,"tag":361,"props":6539,"children":6540},{"style":368},[6541],{"type":41,"value":3853},{"type":35,"tag":361,"props":6543,"children":6544},{"style":432},[6545],{"type":41,"value":3858},{"type":35,"tag":361,"props":6547,"children":6548},{"style":374},[6549],{"type":41,"value":3863},{"type":35,"tag":361,"props":6551,"children":6552},{"style":432},[6553],{"type":41,"value":3868},{"type":35,"tag":361,"props":6555,"children":6556},{"style":1545},[6557],{"type":41,"value":2011},{"type":35,"tag":361,"props":6559,"children":6560},{"style":432},[6561],{"type":41,"value":3877},{"type":35,"tag":361,"props":6563,"children":6564},{"class":363,"line":622},[6565,6569,6573,6577,6581,6585,6589],{"type":35,"tag":361,"props":6566,"children":6567},{"style":432},[6568],{"type":41,"value":5607},{"type":35,"tag":361,"props":6570,"children":6571},{"style":368},[6572],{"type":41,"value":3889},{"type":35,"tag":361,"props":6574,"children":6575},{"style":432},[6576],{"type":41,"value":3858},{"type":35,"tag":361,"props":6578,"children":6579},{"style":374},[6580],{"type":41,"value":3863},{"type":35,"tag":361,"props":6582,"children":6583},{"style":432},[6584],{"type":41,"value":3902},{"type":35,"tag":361,"props":6586,"children":6587},{"style":1545},[6588],{"type":41,"value":1945},{"type":35,"tag":361,"props":6590,"children":6591},{"style":432},[6592],{"type":41,"value":476},{"type":35,"tag":361,"props":6594,"children":6595},{"class":363,"line":640},[6596,6600,6604,6608,6612],{"type":35,"tag":361,"props":6597,"children":6598},{"style":432},[6599],{"type":41,"value":5607},{"type":35,"tag":361,"props":6601,"children":6602},{"style":368},[6603],{"type":41,"value":3927},{"type":35,"tag":361,"props":6605,"children":6606},{"style":432},[6607],{"type":41,"value":3187},{"type":35,"tag":361,"props":6609,"children":6610},{"style":374},[6611],{"type":41,"value":3936},{"type":35,"tag":361,"props":6613,"children":6614},{"style":432},[6615],{"type":41,"value":666},{"type":35,"tag":361,"props":6617,"children":6618},{"class":363,"line":669},[6619,6623,6627],{"type":35,"tag":361,"props":6620,"children":6621},{"style":432},[6622],{"type":41,"value":5607},{"type":35,"tag":361,"props":6624,"children":6625},{"style":368},[6626],{"type":41,"value":5697},{"type":35,"tag":361,"props":6628,"children":6629},{"style":432},[6630],{"type":41,"value":5702},{"type":35,"tag":361,"props":6632,"children":6633},{"class":363,"line":678},[6634,6638,6642],{"type":35,"tag":361,"props":6635,"children":6636},{"style":432},[6637],{"type":41,"value":3654},{"type":35,"tag":361,"props":6639,"children":6640},{"style":3587},[6641],{"type":41,"value":4471},{"type":35,"tag":361,"props":6643,"children":6644},{"style":432},[6645],{"type":41,"value":3595},{"type":35,"tag":361,"props":6647,"children":6648},{"class":363,"line":687},[6649],{"type":35,"tag":361,"props":6650,"children":6651},{"emptyLinePlaceholder":550},[6652],{"type":41,"value":553},{"type":35,"tag":361,"props":6654,"children":6655},{"class":363,"line":696},[6656,6660,6664],{"type":35,"tag":361,"props":6657,"children":6658},{"style":432},[6659],{"type":41,"value":3584},{"type":35,"tag":361,"props":6661,"children":6662},{"style":3587},[6663],{"type":41,"value":3590},{"type":35,"tag":361,"props":6665,"children":6666},{"style":432},[6667],{"type":41,"value":3595},{"type":35,"tag":361,"props":6669,"children":6670},{"class":363,"line":752},[6671,6675,6679],{"type":35,"tag":361,"props":6672,"children":6673},{"style":432},[6674],{"type":41,"value":3603},{"type":35,"tag":361,"props":6676,"children":6677},{"style":3587},[6678],{"type":41,"value":3608},{"type":35,"tag":361,"props":6680,"children":6681},{"style":432},[6682],{"type":41,"value":3595},{"type":35,"tag":361,"props":6684,"children":6685},{"class":363,"line":770},[6686,6690,6694],{"type":35,"tag":361,"props":6687,"children":6688},{"style":432},[6689],{"type":41,"value":3620},{"type":35,"tag":361,"props":6691,"children":6692},{"style":3587},[6693],{"type":41,"value":3625},{"type":35,"tag":361,"props":6695,"children":6696},{"style":432},[6697],{"type":41,"value":3630},{"type":35,"tag":361,"props":6699,"children":6700},{"class":363,"line":778},[6701,6705,6709,6713,6717,6722],{"type":35,"tag":361,"props":6702,"children":6703},{"style":432},[6704],{"type":41,"value":3620},{"type":35,"tag":361,"props":6706,"children":6707},{"style":3587},[6708],{"type":41,"value":4737},{"type":35,"tag":361,"props":6710,"children":6711},{"style":368},[6712],{"type":41,"value":5342},{"type":35,"tag":361,"props":6714,"children":6715},{"style":432},[6716],{"type":41,"value":2005},{"type":35,"tag":361,"props":6718,"children":6719},{"style":374},[6720],{"type":41,"value":6721},"\"这里是新加的\"",{"type":35,"tag":361,"props":6723,"children":6724},{"style":432},[6725],{"type":41,"value":3595},{"type":35,"tag":361,"props":6727,"children":6728},{"class":363,"line":787},[6729,6733,6738],{"type":35,"tag":361,"props":6730,"children":6731},{"style":432},[6732],{"type":41,"value":4931},{"type":35,"tag":361,"props":6734,"children":6735},{"style":3587},[6736],{"type":41,"value":6737},"hr",{"type":35,"tag":361,"props":6739,"children":6740},{"style":432},[6741],{"type":41,"value":6742},"/>\n",{"type":35,"tag":361,"props":6744,"children":6745},{"class":363,"line":796},[6746,6750,6754,6758,6762,6766,6770,6774,6779,6783,6787,6791,6795,6799,6804,6808,6813,6817,6822,6826],{"type":35,"tag":361,"props":6747,"children":6748},{"style":432},[6749],{"type":41,"value":4931},{"type":35,"tag":361,"props":6751,"children":6752},{"style":3587},[6753],{"type":41,"value":43},{"type":35,"tag":361,"props":6755,"children":6756},{"style":426},[6757],{"type":41,"value":4758},{"type":35,"tag":361,"props":6759,"children":6760},{"style":432},[6761],{"type":41,"value":2005},{"type":35,"tag":361,"props":6763,"children":6764},{"style":4765},[6765],{"type":41,"value":3263},{"type":35,"tag":361,"props":6767,"children":6768},{"style":432},[6769],{"type":41,"value":5569},{"type":35,"tag":361,"props":6771,"children":6772},{"style":4765},[6773],{"type":41,"value":3263},{"type":35,"tag":361,"props":6775,"children":6776},{"style":432},[6777],{"type":41,"value":6778},">next: \u003C",{"type":35,"tag":361,"props":6780,"children":6781},{"style":3587},[6782],{"type":41,"value":60},{"type":35,"tag":361,"props":6784,"children":6785},{"style":432},[6786],{"type":41,"value":4897},{"type":35,"tag":361,"props":6788,"children":6789},{"style":368},[6790],{"type":41,"value":4944},{"type":35,"tag":361,"props":6792,"children":6793},{"style":432},[6794],{"type":41,"value":2005},{"type":35,"tag":361,"props":6796,"children":6797},{"style":4765},[6798],{"type":41,"value":3263},{"type":35,"tag":361,"props":6800,"children":6801},{"style":432},[6802],{"type":41,"value":6803},"nextArticle._path",{"type":35,"tag":361,"props":6805,"children":6806},{"style":4765},[6807],{"type":41,"value":3263},{"type":35,"tag":361,"props":6809,"children":6810},{"style":432},[6811],{"type":41,"value":6812},">{{nextArticle.title}}\u003C/",{"type":35,"tag":361,"props":6814,"children":6815},{"style":3587},[6816],{"type":41,"value":60},{"type":35,"tag":361,"props":6818,"children":6819},{"style":432},[6820],{"type":41,"value":6821},">\u003C/",{"type":35,"tag":361,"props":6823,"children":6824},{"style":3587},[6825],{"type":41,"value":43},{"type":35,"tag":361,"props":6827,"children":6828},{"style":432},[6829],{"type":41,"value":3595},{"type":35,"tag":361,"props":6831,"children":6832},{"class":363,"line":820},[6833,6837,6841,6845,6849,6853,6857,6861,6866,6870,6874,6878,6882,6886,6891,6895,6900,6904,6908,6912],{"type":35,"tag":361,"props":6834,"children":6835},{"style":432},[6836],{"type":41,"value":4931},{"type":35,"tag":361,"props":6838,"children":6839},{"style":3587},[6840],{"type":41,"value":43},{"type":35,"tag":361,"props":6842,"children":6843},{"style":426},[6844],{"type":41,"value":4758},{"type":35,"tag":361,"props":6846,"children":6847},{"style":432},[6848],{"type":41,"value":2005},{"type":35,"tag":361,"props":6850,"children":6851},{"style":4765},[6852],{"type":41,"value":3263},{"type":35,"tag":361,"props":6854,"children":6855},{"style":432},[6856],{"type":41,"value":5560},{"type":35,"tag":361,"props":6858,"children":6859},{"style":4765},[6860],{"type":41,"value":3263},{"type":35,"tag":361,"props":6862,"children":6863},{"style":432},[6864],{"type":41,"value":6865},">prev: \u003C",{"type":35,"tag":361,"props":6867,"children":6868},{"style":3587},[6869],{"type":41,"value":60},{"type":35,"tag":361,"props":6871,"children":6872},{"style":432},[6873],{"type":41,"value":4897},{"type":35,"tag":361,"props":6875,"children":6876},{"style":368},[6877],{"type":41,"value":4944},{"type":35,"tag":361,"props":6879,"children":6880},{"style":432},[6881],{"type":41,"value":2005},{"type":35,"tag":361,"props":6883,"children":6884},{"style":4765},[6885],{"type":41,"value":3263},{"type":35,"tag":361,"props":6887,"children":6888},{"style":432},[6889],{"type":41,"value":6890},"prevArticle._path",{"type":35,"tag":361,"props":6892,"children":6893},{"style":4765},[6894],{"type":41,"value":3263},{"type":35,"tag":361,"props":6896,"children":6897},{"style":432},[6898],{"type":41,"value":6899},">{{prevArticle.title}}\u003C/",{"type":35,"tag":361,"props":6901,"children":6902},{"style":3587},[6903],{"type":41,"value":60},{"type":35,"tag":361,"props":6905,"children":6906},{"style":432},[6907],{"type":41,"value":6821},{"type":35,"tag":361,"props":6909,"children":6910},{"style":3587},[6911],{"type":41,"value":43},{"type":35,"tag":361,"props":6913,"children":6914},{"style":432},[6915],{"type":41,"value":3595},{"type":35,"tag":361,"props":6917,"children":6918},{"class":363,"line":829},[6919,6924,6928],{"type":35,"tag":361,"props":6920,"children":6921},{"style":432},[6922],{"type":41,"value":6923},"    \u003C/",{"type":35,"tag":361,"props":6925,"children":6926},{"style":3587},[6927],{"type":41,"value":4737},{"type":35,"tag":361,"props":6929,"children":6930},{"style":432},[6931],{"type":41,"value":3595},{"type":35,"tag":361,"props":6933,"children":6934},{"class":363,"line":838},[6935,6939,6943],{"type":35,"tag":361,"props":6936,"children":6937},{"style":432},[6938],{"type":41,"value":3638},{"type":35,"tag":361,"props":6940,"children":6941},{"style":3587},[6942],{"type":41,"value":3608},{"type":35,"tag":361,"props":6944,"children":6945},{"style":432},[6946],{"type":41,"value":3595},{"type":35,"tag":361,"props":6948,"children":6949},{"class":363,"line":847},[6950,6954,6958],{"type":35,"tag":361,"props":6951,"children":6952},{"style":432},[6953],{"type":41,"value":3654},{"type":35,"tag":361,"props":6955,"children":6956},{"style":3587},[6957],{"type":41,"value":3590},{"type":35,"tag":361,"props":6959,"children":6960},{"style":432},[6961],{"type":41,"value":3595},{"type":35,"tag":43,"props":6963,"children":6964},{},[6965],{"type":41,"value":6966},"效果大概是这样：",{"type":35,"tag":43,"props":6968,"children":6969},{},[6970,6975,6977,6983],{"type":35,"tag":148,"props":6971,"children":6974},{"alt":6972,"src":6973},"博客页面的截图，文章最后有新增的下一篇、上一篇的链接。","attachments/nuxt-content-basic-blogs-surround.png",[],{"type":41,"value":6976},"\n同样，你按照自己的喜好，进行一些样式的自定义就能实际用了。例如 murchinroom 的实现（同样拜托给大模型写出的核心组件 ",{"type":35,"tag":255,"props":6978,"children":6980},{"className":6979},[],[6981],{"type":41,"value":6982},"components/blogs/Surround.vue",{"type":41,"value":6984},"）：",{"type":35,"tag":351,"props":6986,"children":6988},{"code":6987,"language":3571,"meta":8,"className":3572,"style":8},"\u003Cscript setup lang=\"ts\">\ninterface Article {\n  title: string,\n  _path: string,\n}\n\ndefineProps\u003C{\n  prevArticle?: Article\n  nextArticle?: Article\n}>()\n\u003C/script>\n\n\u003Ctemplate>\n  \u003Cdiv v-if=\"prevArticle || nextArticle\"\n       class=\"bg-black px-10 py-16 max-sm:py-10 mt-20 mx-auto max-w-5xl rounded-lg flex flex-col items-center text-center\">\n\n    \u003Ch2 class=\"text-white text-2xl md:text-4xl\">\n      Continue reading...\n    \u003C/h2>\n\n    \u003Cp v-if=\"nextArticle\" class=\"text-slate-500 mt-8 text-lg md:text-xl inline-flex items-center line-clamp-1\">\n      \u003Cspan class=\"mr-1\">Next\u003Cspan class=\"max-sm:hidden\"> article\u003C/span>: \u003C/span>\n      \u003Ca :href=\"nextArticle?._path\" class=\"text-slate-100 max-w-xs line-clamp-1 hover:underline\">{{ nextArticle.title }}\u003C/a>\n    \u003C/p>\n\n    \u003Cp v-if=\"prevArticle\" class=\"text-slate-500 mt-4 text-lg md:text-xl inline-flex items-center line-clamp-1\">\n      \u003Cspan class=\"mr-1\">Previous\u003Cspan  class=\"max-sm:hidden\"> article\u003C/span>: \u003C/span>\n      \u003Ca :href=\"prevArticle?._path\" class=\"text-slate-100 max-w-xs line-clamp-1 hover:underline\">{{ prevArticle.title }}\u003C/a>\n    \u003C/p>\n  \u003C/div>\n\u003C/template>\n",[6989],{"type":35,"tag":255,"props":6990,"children":6991},{"__ignoreMap":8},[6992,7023,7040,7060,7080,7088,7095,7106,7123,7139,7146,7161,7168,7183,7226,7247,7254,7282,7290,7305,7312,7360,7428,7490,7505,7512,7560,7625,7686,7701,7716],{"type":35,"tag":361,"props":6993,"children":6994},{"class":363,"line":364},[6995,6999,7003,7007,7011,7015,7019],{"type":35,"tag":361,"props":6996,"children":6997},{"style":432},[6998],{"type":41,"value":3584},{"type":35,"tag":361,"props":7000,"children":7001},{"style":3587},[7002],{"type":41,"value":4471},{"type":35,"tag":361,"props":7004,"children":7005},{"style":368},[7006],{"type":41,"value":4476},{"type":35,"tag":361,"props":7008,"children":7009},{"style":368},[7010],{"type":41,"value":4481},{"type":35,"tag":361,"props":7012,"children":7013},{"style":432},[7014],{"type":41,"value":2005},{"type":35,"tag":361,"props":7016,"children":7017},{"style":374},[7018],{"type":41,"value":4490},{"type":35,"tag":361,"props":7020,"children":7021},{"style":432},[7022],{"type":41,"value":3595},{"type":35,"tag":361,"props":7024,"children":7025},{"class":363,"line":438},[7026,7031,7036],{"type":35,"tag":361,"props":7027,"children":7028},{"style":2622},[7029],{"type":41,"value":7030},"interface",{"type":35,"tag":361,"props":7032,"children":7033},{"style":3115},[7034],{"type":41,"value":7035}," Article",{"type":35,"tag":361,"props":7037,"children":7038},{"style":432},[7039],{"type":41,"value":3061},{"type":35,"tag":361,"props":7041,"children":7042},{"class":363,"line":452},[7043,7048,7052,7056],{"type":35,"tag":361,"props":7044,"children":7045},{"style":5202},[7046],{"type":41,"value":7047},"  title",{"type":35,"tag":361,"props":7049,"children":7050},{"style":426},[7051],{"type":41,"value":3093},{"type":35,"tag":361,"props":7053,"children":7054},{"style":3096},[7055],{"type":41,"value":3099},{"type":35,"tag":361,"props":7057,"children":7058},{"style":432},[7059],{"type":41,"value":619},{"type":35,"tag":361,"props":7061,"children":7062},{"class":363,"line":461},[7063,7068,7072,7076],{"type":35,"tag":361,"props":7064,"children":7065},{"style":5202},[7066],{"type":41,"value":7067},"  _path",{"type":35,"tag":361,"props":7069,"children":7070},{"style":426},[7071],{"type":41,"value":3093},{"type":35,"tag":361,"props":7073,"children":7074},{"style":3096},[7075],{"type":41,"value":3099},{"type":35,"tag":361,"props":7077,"children":7078},{"style":432},[7079],{"type":41,"value":619},{"type":35,"tag":361,"props":7081,"children":7082},{"class":363,"line":470},[7083],{"type":35,"tag":361,"props":7084,"children":7085},{"style":432},[7086],{"type":41,"value":7087},"}\n",{"type":35,"tag":361,"props":7089,"children":7090},{"class":363,"line":594},[7091],{"type":35,"tag":361,"props":7092,"children":7093},{"emptyLinePlaceholder":550},[7094],{"type":41,"value":553},{"type":35,"tag":361,"props":7096,"children":7097},{"class":363,"line":603},[7098,7102],{"type":35,"tag":361,"props":7099,"children":7100},{"style":368},[7101],{"type":41,"value":5191},{"type":35,"tag":361,"props":7103,"children":7104},{"style":432},[7105],{"type":41,"value":5196},{"type":35,"tag":361,"props":7107,"children":7108},{"class":363,"line":622},[7109,7114,7118],{"type":35,"tag":361,"props":7110,"children":7111},{"style":5202},[7112],{"type":41,"value":7113},"  prevArticle",{"type":35,"tag":361,"props":7115,"children":7116},{"style":426},[7117],{"type":41,"value":5210},{"type":35,"tag":361,"props":7119,"children":7120},{"style":3115},[7121],{"type":41,"value":7122}," Article\n",{"type":35,"tag":361,"props":7124,"children":7125},{"class":363,"line":640},[7126,7131,7135],{"type":35,"tag":361,"props":7127,"children":7128},{"style":5202},[7129],{"type":41,"value":7130},"  nextArticle",{"type":35,"tag":361,"props":7132,"children":7133},{"style":426},[7134],{"type":41,"value":5210},{"type":35,"tag":361,"props":7136,"children":7137},{"style":3115},[7138],{"type":41,"value":7122},{"type":35,"tag":361,"props":7140,"children":7141},{"class":363,"line":669},[7142],{"type":35,"tag":361,"props":7143,"children":7144},{"style":432},[7145],{"type":41,"value":5289},{"type":35,"tag":361,"props":7147,"children":7148},{"class":363,"line":678},[7149,7153,7157],{"type":35,"tag":361,"props":7150,"children":7151},{"style":432},[7152],{"type":41,"value":3654},{"type":35,"tag":361,"props":7154,"children":7155},{"style":3587},[7156],{"type":41,"value":4471},{"type":35,"tag":361,"props":7158,"children":7159},{"style":432},[7160],{"type":41,"value":3595},{"type":35,"tag":361,"props":7162,"children":7163},{"class":363,"line":687},[7164],{"type":35,"tag":361,"props":7165,"children":7166},{"emptyLinePlaceholder":550},[7167],{"type":41,"value":553},{"type":35,"tag":361,"props":7169,"children":7170},{"class":363,"line":696},[7171,7175,7179],{"type":35,"tag":361,"props":7172,"children":7173},{"style":432},[7174],{"type":41,"value":3584},{"type":35,"tag":361,"props":7176,"children":7177},{"style":3587},[7178],{"type":41,"value":3590},{"type":35,"tag":361,"props":7180,"children":7181},{"style":432},[7182],{"type":41,"value":3595},{"type":35,"tag":361,"props":7184,"children":7185},{"class":363,"line":752},[7186,7190,7194,7198,7202,7206,7211,7216,7221],{"type":35,"tag":361,"props":7187,"children":7188},{"style":432},[7189],{"type":41,"value":3603},{"type":35,"tag":361,"props":7191,"children":7192},{"style":3587},[7193],{"type":41,"value":4737},{"type":35,"tag":361,"props":7195,"children":7196},{"style":426},[7197],{"type":41,"value":4758},{"type":35,"tag":361,"props":7199,"children":7200},{"style":432},[7201],{"type":41,"value":2005},{"type":35,"tag":361,"props":7203,"children":7204},{"style":4765},[7205],{"type":41,"value":3263},{"type":35,"tag":361,"props":7207,"children":7208},{"style":432},[7209],{"type":41,"value":7210},"prevArticle ",{"type":35,"tag":361,"props":7212,"children":7213},{"style":426},[7214],{"type":41,"value":7215},"||",{"type":35,"tag":361,"props":7217,"children":7218},{"style":432},[7219],{"type":41,"value":7220}," nextArticle",{"type":35,"tag":361,"props":7222,"children":7223},{"style":4765},[7224],{"type":41,"value":7225},"\"\n",{"type":35,"tag":361,"props":7227,"children":7228},{"class":363,"line":770},[7229,7234,7238,7243],{"type":35,"tag":361,"props":7230,"children":7231},{"style":368},[7232],{"type":41,"value":7233},"       class",{"type":35,"tag":361,"props":7235,"children":7236},{"style":432},[7237],{"type":41,"value":2005},{"type":35,"tag":361,"props":7239,"children":7240},{"style":374},[7241],{"type":41,"value":7242},"\"bg-black px-10 py-16 max-sm:py-10 mt-20 mx-auto max-w-5xl rounded-lg flex flex-col items-center text-center\"",{"type":35,"tag":361,"props":7244,"children":7245},{"style":432},[7246],{"type":41,"value":3595},{"type":35,"tag":361,"props":7248,"children":7249},{"class":363,"line":778},[7250],{"type":35,"tag":361,"props":7251,"children":7252},{"emptyLinePlaceholder":550},[7253],{"type":41,"value":553},{"type":35,"tag":361,"props":7255,"children":7256},{"class":363,"line":787},[7257,7261,7265,7269,7273,7278],{"type":35,"tag":361,"props":7258,"children":7259},{"style":432},[7260],{"type":41,"value":3620},{"type":35,"tag":361,"props":7262,"children":7263},{"style":3587},[7264],{"type":41,"value":48},{"type":35,"tag":361,"props":7266,"children":7267},{"style":368},[7268],{"type":41,"value":5342},{"type":35,"tag":361,"props":7270,"children":7271},{"style":432},[7272],{"type":41,"value":2005},{"type":35,"tag":361,"props":7274,"children":7275},{"style":374},[7276],{"type":41,"value":7277},"\"text-white text-2xl md:text-4xl\"",{"type":35,"tag":361,"props":7279,"children":7280},{"style":432},[7281],{"type":41,"value":3595},{"type":35,"tag":361,"props":7283,"children":7284},{"class":363,"line":796},[7285],{"type":35,"tag":361,"props":7286,"children":7287},{"style":432},[7288],{"type":41,"value":7289},"      Continue reading...\n",{"type":35,"tag":361,"props":7291,"children":7292},{"class":363,"line":820},[7293,7297,7301],{"type":35,"tag":361,"props":7294,"children":7295},{"style":432},[7296],{"type":41,"value":6923},{"type":35,"tag":361,"props":7298,"children":7299},{"style":3587},[7300],{"type":41,"value":48},{"type":35,"tag":361,"props":7302,"children":7303},{"style":432},[7304],{"type":41,"value":3595},{"type":35,"tag":361,"props":7306,"children":7307},{"class":363,"line":829},[7308],{"type":35,"tag":361,"props":7309,"children":7310},{"emptyLinePlaceholder":550},[7311],{"type":41,"value":553},{"type":35,"tag":361,"props":7313,"children":7314},{"class":363,"line":838},[7315,7319,7323,7327,7331,7335,7339,7343,7347,7351,7356],{"type":35,"tag":361,"props":7316,"children":7317},{"style":432},[7318],{"type":41,"value":3620},{"type":35,"tag":361,"props":7320,"children":7321},{"style":3587},[7322],{"type":41,"value":43},{"type":35,"tag":361,"props":7324,"children":7325},{"style":426},[7326],{"type":41,"value":4758},{"type":35,"tag":361,"props":7328,"children":7329},{"style":432},[7330],{"type":41,"value":2005},{"type":35,"tag":361,"props":7332,"children":7333},{"style":4765},[7334],{"type":41,"value":3263},{"type":35,"tag":361,"props":7336,"children":7337},{"style":432},[7338],{"type":41,"value":5569},{"type":35,"tag":361,"props":7340,"children":7341},{"style":4765},[7342],{"type":41,"value":3263},{"type":35,"tag":361,"props":7344,"children":7345},{"style":368},[7346],{"type":41,"value":5342},{"type":35,"tag":361,"props":7348,"children":7349},{"style":432},[7350],{"type":41,"value":2005},{"type":35,"tag":361,"props":7352,"children":7353},{"style":374},[7354],{"type":41,"value":7355},"\"text-slate-500 mt-8 text-lg md:text-xl inline-flex items-center line-clamp-1\"",{"type":35,"tag":361,"props":7357,"children":7358},{"style":432},[7359],{"type":41,"value":3595},{"type":35,"tag":361,"props":7361,"children":7362},{"class":363,"line":847},[7363,7367,7371,7375,7379,7384,7389,7393,7397,7401,7406,7411,7415,7420,7424],{"type":35,"tag":361,"props":7364,"children":7365},{"style":432},[7366],{"type":41,"value":4749},{"type":35,"tag":361,"props":7368,"children":7369},{"style":3587},[7370],{"type":41,"value":361},{"type":35,"tag":361,"props":7372,"children":7373},{"style":368},[7374],{"type":41,"value":5342},{"type":35,"tag":361,"props":7376,"children":7377},{"style":432},[7378],{"type":41,"value":2005},{"type":35,"tag":361,"props":7380,"children":7381},{"style":374},[7382],{"type":41,"value":7383},"\"mr-1\"",{"type":35,"tag":361,"props":7385,"children":7386},{"style":432},[7387],{"type":41,"value":7388},">Next\u003C",{"type":35,"tag":361,"props":7390,"children":7391},{"style":3587},[7392],{"type":41,"value":361},{"type":35,"tag":361,"props":7394,"children":7395},{"style":368},[7396],{"type":41,"value":5342},{"type":35,"tag":361,"props":7398,"children":7399},{"style":432},[7400],{"type":41,"value":2005},{"type":35,"tag":361,"props":7402,"children":7403},{"style":374},[7404],{"type":41,"value":7405},"\"max-sm:hidden\"",{"type":35,"tag":361,"props":7407,"children":7408},{"style":432},[7409],{"type":41,"value":7410},"> article\u003C/",{"type":35,"tag":361,"props":7412,"children":7413},{"style":3587},[7414],{"type":41,"value":361},{"type":35,"tag":361,"props":7416,"children":7417},{"style":432},[7418],{"type":41,"value":7419},">: \u003C/",{"type":35,"tag":361,"props":7421,"children":7422},{"style":3587},[7423],{"type":41,"value":361},{"type":35,"tag":361,"props":7425,"children":7426},{"style":432},[7427],{"type":41,"value":3595},{"type":35,"tag":361,"props":7429,"children":7430},{"class":363,"line":856},[7431,7435,7439,7443,7447,7451,7455,7460,7464,7468,7472,7477,7482,7486],{"type":35,"tag":361,"props":7432,"children":7433},{"style":432},[7434],{"type":41,"value":4749},{"type":35,"tag":361,"props":7436,"children":7437},{"style":3587},[7438],{"type":41,"value":60},{"type":35,"tag":361,"props":7440,"children":7441},{"style":432},[7442],{"type":41,"value":4897},{"type":35,"tag":361,"props":7444,"children":7445},{"style":368},[7446],{"type":41,"value":4944},{"type":35,"tag":361,"props":7448,"children":7449},{"style":432},[7450],{"type":41,"value":2005},{"type":35,"tag":361,"props":7452,"children":7453},{"style":4765},[7454],{"type":41,"value":3263},{"type":35,"tag":361,"props":7456,"children":7457},{"style":432},[7458],{"type":41,"value":7459},"nextArticle?._path",{"type":35,"tag":361,"props":7461,"children":7462},{"style":4765},[7463],{"type":41,"value":3263},{"type":35,"tag":361,"props":7465,"children":7466},{"style":368},[7467],{"type":41,"value":5342},{"type":35,"tag":361,"props":7469,"children":7470},{"style":432},[7471],{"type":41,"value":2005},{"type":35,"tag":361,"props":7473,"children":7474},{"style":374},[7475],{"type":41,"value":7476},"\"text-slate-100 max-w-xs line-clamp-1 hover:underline\"",{"type":35,"tag":361,"props":7478,"children":7479},{"style":432},[7480],{"type":41,"value":7481},">{{ nextArticle.title }}\u003C/",{"type":35,"tag":361,"props":7483,"children":7484},{"style":3587},[7485],{"type":41,"value":60},{"type":35,"tag":361,"props":7487,"children":7488},{"style":432},[7489],{"type":41,"value":3595},{"type":35,"tag":361,"props":7491,"children":7492},{"class":363,"line":864},[7493,7497,7501],{"type":35,"tag":361,"props":7494,"children":7495},{"style":432},[7496],{"type":41,"value":6923},{"type":35,"tag":361,"props":7498,"children":7499},{"style":3587},[7500],{"type":41,"value":43},{"type":35,"tag":361,"props":7502,"children":7503},{"style":432},[7504],{"type":41,"value":3595},{"type":35,"tag":361,"props":7506,"children":7507},{"class":363,"line":873},[7508],{"type":35,"tag":361,"props":7509,"children":7510},{"emptyLinePlaceholder":550},[7511],{"type":41,"value":553},{"type":35,"tag":361,"props":7513,"children":7514},{"class":363,"line":3445},[7515,7519,7523,7527,7531,7535,7539,7543,7547,7551,7556],{"type":35,"tag":361,"props":7516,"children":7517},{"style":432},[7518],{"type":41,"value":3620},{"type":35,"tag":361,"props":7520,"children":7521},{"style":3587},[7522],{"type":41,"value":43},{"type":35,"tag":361,"props":7524,"children":7525},{"style":426},[7526],{"type":41,"value":4758},{"type":35,"tag":361,"props":7528,"children":7529},{"style":432},[7530],{"type":41,"value":2005},{"type":35,"tag":361,"props":7532,"children":7533},{"style":4765},[7534],{"type":41,"value":3263},{"type":35,"tag":361,"props":7536,"children":7537},{"style":432},[7538],{"type":41,"value":5560},{"type":35,"tag":361,"props":7540,"children":7541},{"style":4765},[7542],{"type":41,"value":3263},{"type":35,"tag":361,"props":7544,"children":7545},{"style":368},[7546],{"type":41,"value":5342},{"type":35,"tag":361,"props":7548,"children":7549},{"style":432},[7550],{"type":41,"value":2005},{"type":35,"tag":361,"props":7552,"children":7553},{"style":374},[7554],{"type":41,"value":7555},"\"text-slate-500 mt-4 text-lg md:text-xl inline-flex items-center line-clamp-1\"",{"type":35,"tag":361,"props":7557,"children":7558},{"style":432},[7559],{"type":41,"value":3595},{"type":35,"tag":361,"props":7561,"children":7562},{"class":363,"line":3464},[7563,7567,7571,7575,7579,7583,7588,7592,7597,7601,7605,7609,7613,7617,7621],{"type":35,"tag":361,"props":7564,"children":7565},{"style":432},[7566],{"type":41,"value":4749},{"type":35,"tag":361,"props":7568,"children":7569},{"style":3587},[7570],{"type":41,"value":361},{"type":35,"tag":361,"props":7572,"children":7573},{"style":368},[7574],{"type":41,"value":5342},{"type":35,"tag":361,"props":7576,"children":7577},{"style":432},[7578],{"type":41,"value":2005},{"type":35,"tag":361,"props":7580,"children":7581},{"style":374},[7582],{"type":41,"value":7383},{"type":35,"tag":361,"props":7584,"children":7585},{"style":432},[7586],{"type":41,"value":7587},">Previous\u003C",{"type":35,"tag":361,"props":7589,"children":7590},{"style":3587},[7591],{"type":41,"value":361},{"type":35,"tag":361,"props":7593,"children":7594},{"style":368},[7595],{"type":41,"value":7596},"  class",{"type":35,"tag":361,"props":7598,"children":7599},{"style":432},[7600],{"type":41,"value":2005},{"type":35,"tag":361,"props":7602,"children":7603},{"style":374},[7604],{"type":41,"value":7405},{"type":35,"tag":361,"props":7606,"children":7607},{"style":432},[7608],{"type":41,"value":7410},{"type":35,"tag":361,"props":7610,"children":7611},{"style":3587},[7612],{"type":41,"value":361},{"type":35,"tag":361,"props":7614,"children":7615},{"style":432},[7616],{"type":41,"value":7419},{"type":35,"tag":361,"props":7618,"children":7619},{"style":3587},[7620],{"type":41,"value":361},{"type":35,"tag":361,"props":7622,"children":7623},{"style":432},[7624],{"type":41,"value":3595},{"type":35,"tag":361,"props":7626,"children":7627},{"class":363,"line":3473},[7628,7632,7636,7640,7644,7648,7652,7657,7661,7665,7669,7673,7678,7682],{"type":35,"tag":361,"props":7629,"children":7630},{"style":432},[7631],{"type":41,"value":4749},{"type":35,"tag":361,"props":7633,"children":7634},{"style":3587},[7635],{"type":41,"value":60},{"type":35,"tag":361,"props":7637,"children":7638},{"style":432},[7639],{"type":41,"value":4897},{"type":35,"tag":361,"props":7641,"children":7642},{"style":368},[7643],{"type":41,"value":4944},{"type":35,"tag":361,"props":7645,"children":7646},{"style":432},[7647],{"type":41,"value":2005},{"type":35,"tag":361,"props":7649,"children":7650},{"style":4765},[7651],{"type":41,"value":3263},{"type":35,"tag":361,"props":7653,"children":7654},{"style":432},[7655],{"type":41,"value":7656},"prevArticle?._path",{"type":35,"tag":361,"props":7658,"children":7659},{"style":4765},[7660],{"type":41,"value":3263},{"type":35,"tag":361,"props":7662,"children":7663},{"style":368},[7664],{"type":41,"value":5342},{"type":35,"tag":361,"props":7666,"children":7667},{"style":432},[7668],{"type":41,"value":2005},{"type":35,"tag":361,"props":7670,"children":7671},{"style":374},[7672],{"type":41,"value":7476},{"type":35,"tag":361,"props":7674,"children":7675},{"style":432},[7676],{"type":41,"value":7677},">{{ prevArticle.title }}\u003C/",{"type":35,"tag":361,"props":7679,"children":7680},{"style":3587},[7681],{"type":41,"value":60},{"type":35,"tag":361,"props":7683,"children":7684},{"style":432},[7685],{"type":41,"value":3595},{"type":35,"tag":361,"props":7687,"children":7688},{"class":363,"line":6221},[7689,7693,7697],{"type":35,"tag":361,"props":7690,"children":7691},{"style":432},[7692],{"type":41,"value":6923},{"type":35,"tag":361,"props":7694,"children":7695},{"style":3587},[7696],{"type":41,"value":43},{"type":35,"tag":361,"props":7698,"children":7699},{"style":432},[7700],{"type":41,"value":3595},{"type":35,"tag":361,"props":7702,"children":7703},{"class":363,"line":6241},[7704,7708,7712],{"type":35,"tag":361,"props":7705,"children":7706},{"style":432},[7707],{"type":41,"value":3638},{"type":35,"tag":361,"props":7709,"children":7710},{"style":3587},[7711],{"type":41,"value":4737},{"type":35,"tag":361,"props":7713,"children":7714},{"style":432},[7715],{"type":41,"value":3595},{"type":35,"tag":361,"props":7717,"children":7718},{"class":363,"line":6262},[7719,7723,7727],{"type":35,"tag":361,"props":7720,"children":7721},{"style":432},[7722],{"type":41,"value":3654},{"type":35,"tag":361,"props":7724,"children":7725},{"style":3587},[7726],{"type":41,"value":3590},{"type":35,"tag":361,"props":7728,"children":7729},{"style":432},[7730],{"type":41,"value":3595},{"type":35,"tag":43,"props":7732,"children":7733},{},[7734],{"type":41,"value":7735},"跑起来的效果是这样（有一说一这个好丑啊，迟早得给他重写了😠）：",{"type":35,"tag":43,"props":7737,"children":7738},{},[7739],{"type":35,"tag":148,"props":7740,"children":7743},{"alt":7741,"src":7742},"murchinroom 的前一篇、后一篇链接卡片截图","attachments/murchinroom-blog-surround.png",[],{"type":35,"tag":48,"props":7745,"children":7747},{"id":7746},"尾声",[7748],{"type":41,"value":7746},{"type":35,"tag":43,"props":7750,"children":7751},{},[7752],{"type":41,"value":7753},"现在，基础博客功能现在已经有比较完整了。",{"type":35,"tag":43,"props":7755,"children":7756},{},[7757,7759,7764,7766,7772,7774,7780],{"type":41,"value":7758},"我们有一个索引页：",{"type":35,"tag":255,"props":7760,"children":7762},{"className":7761},[],[7763],{"type":41,"value":1095},{"type":41,"value":7765},"，这里罗列了最近文章列表，从新到旧排列。\n从索引页点到文章，",{"type":35,"tag":255,"props":7767,"children":7769},{"className":7768},[],[7770],{"type":41,"value":7771},"/blogs/article-name",{"type":41,"value":7773}," 可以看到渲染自 ",{"type":35,"tag":255,"props":7775,"children":7777},{"className":7776},[],[7778],{"type":41,"value":7779},"public/blogs/article-name.md",{"type":41,"value":7781}," 的博客内容。\n文章读完后，有一组指向前、后文章的链接，方便用户跳转、继续阅读。",{"type":35,"tag":43,"props":7783,"children":7784},{},[7785],{"type":41,"value":7786},"在实际的应用中，我们还可以再添加一些有用的功能，都是非常简单的开发，连大模型都可以轻松搞定，此处不再赘述。",{"type":35,"tag":43,"props":7788,"children":7789},{},[7790],{"type":41,"value":7791},"例如，在 murchinroom 的博客页面中，我们还实现了文章大纲（TOC）和一个导航栏（这个也很丑，我最不满意的是这个，巨硬家的 Copilot 写代码就是逊啦），并且重写了一组 CSS 来优化正文显示效果：",{"type":35,"tag":43,"props":7793,"children":7794},{},[7795],{"type":35,"tag":148,"props":7796,"children":7798},{"alt":8,"src":7797},"attachments/murchinroom-blog-toc-and-navbar.png",[],{"type":35,"tag":43,"props":7800,"children":7801},{},[7802],{"type":41,"value":7803},"总之，就看你喜好，自己往里面加东西就行了。",{"type":35,"tag":43,"props":7805,"children":7806},{},[7807],{"type":41,"value":7808},"那么最后，祝玩得开心，下次见。",{"type":35,"tag":351,"props":7810,"children":7813},{"code":7811,"language":2326,"meta":8,"className":7812,"style":8},"\u003Cp from=\"CDFMLR\">Bye.\u003C/p>\n\u003Cpre>2024.12.19\u003C/pre>\n","language-html shiki shiki-themes github-light github-dark monokai",[7814],{"type":35,"tag":255,"props":7815,"children":7816},{"__ignoreMap":8},[7817,7854],{"type":35,"tag":361,"props":7818,"children":7819},{"class":363,"line":364},[7820,7824,7828,7832,7836,7841,7846,7850],{"type":35,"tag":361,"props":7821,"children":7822},{"style":432},[7823],{"type":41,"value":3584},{"type":35,"tag":361,"props":7825,"children":7826},{"style":3587},[7827],{"type":41,"value":43},{"type":35,"tag":361,"props":7829,"children":7830},{"style":368},[7831],{"type":41,"value":2451},{"type":35,"tag":361,"props":7833,"children":7834},{"style":432},[7835],{"type":41,"value":2005},{"type":35,"tag":361,"props":7837,"children":7838},{"style":374},[7839],{"type":41,"value":7840},"\"CDFMLR\"",{"type":35,"tag":361,"props":7842,"children":7843},{"style":432},[7844],{"type":41,"value":7845},">Bye.\u003C/",{"type":35,"tag":361,"props":7847,"children":7848},{"style":3587},[7849],{"type":41,"value":43},{"type":35,"tag":361,"props":7851,"children":7852},{"style":432},[7853],{"type":41,"value":3595},{"type":35,"tag":361,"props":7855,"children":7856},{"class":363,"line":438},[7857,7861,7865,7870,7874],{"type":35,"tag":361,"props":7858,"children":7859},{"style":432},[7860],{"type":41,"value":3584},{"type":35,"tag":361,"props":7862,"children":7863},{"style":3587},[7864],{"type":41,"value":351},{"type":35,"tag":361,"props":7866,"children":7867},{"style":432},[7868],{"type":41,"value":7869},">2024.12.19\u003C/",{"type":35,"tag":361,"props":7871,"children":7872},{"style":3587},[7873],{"type":41,"value":351},{"type":35,"tag":361,"props":7875,"children":7876},{"style":432},[7877],{"type":41,"value":3595},{"type":35,"tag":48,"props":7879,"children":7881},{"id":7880},"更新内容目录组织和相对路径图片",[7882],{"type":41,"value":7883},"更新：内容目录组织和相对路径图片",{"type":35,"tag":246,"props":7885,"children":7886},{},[7887],{"type":35,"tag":43,"props":7888,"children":7889},{},[7890],{"type":41,"value":7891},"Update: 2024-12-21",{"type":35,"tag":43,"props":7893,"children":7894},{},[7895],{"type":41,"value":7896},"不出意外，系统上线必 bug。这个粗制滥造的 blog 系统当然更更逃不过这种恶毒的诅咒啦——自食狗粮哪有不噎的！！",{"type":35,"tag":43,"props":7898,"children":7899},{},[7900,7902,7909],{"type":41,"value":7901},"当这篇文章作为 ",{"type":35,"tag":60,"props":7903,"children":7906},{"href":7904,"rel":7905},"https://www.murchinroom.fun/blogs/frontend/nuxt-content-for-blog",[64],[7907],{"type":41,"value":7908},"murchinroom-web 的第一篇博客",{"type":41,"value":7910}," 发出后，就遇到了图片显示不出来的问题。",{"type":35,"tag":43,"props":7912,"children":7913},{},[7914,7916,7921],{"type":41,"value":7915},"虽然把 source 放到 ",{"type":35,"tag":255,"props":7917,"children":7919},{"className":7918},[],[7920],{"type":41,"value":1197},{"type":41,"value":7922}," 下，Markdown 就可以通过相对路径，引用自己身旁的图片了。这个没问题。但是，渲染后的页面通过相对路径请求图片时，可能会错误多带了一级路径。例如，我们的博客内容一开始是这么组织的：",{"type":35,"tag":351,"props":7924,"children":7926},{"code":7925},"public/blogs/\n    +-- subdir/\n        +-- article.md\n        +-- attachments/\n            +-- img.png\n",[7927],{"type":35,"tag":255,"props":7928,"children":7929},{"__ignoreMap":8},[7930],{"type":41,"value":7925},{"type":35,"tag":43,"props":7932,"children":7933},{},[7934,7936,7942],{"type":41,"value":7935},"Nuxt Content 会让 ",{"type":35,"tag":255,"props":7937,"children":7939},{"className":7938},[],[7940],{"type":41,"value":7941},"subdir/article.md",{"type":41,"value":7943}," 这篇文章将可以在以下两个路径访问：",{"type":35,"tag":1213,"props":7945,"children":7946},{},[7947,7956],{"type":35,"tag":1217,"props":7948,"children":7949},{},[7950],{"type":35,"tag":255,"props":7951,"children":7953},{"className":7952},[],[7954],{"type":41,"value":7955},"/blogs/subdir/article",{"type":35,"tag":1217,"props":7957,"children":7958},{},[7959],{"type":35,"tag":255,"props":7960,"children":7962},{"className":7961},[],[7963],{"type":41,"value":7964},"/blogs/subdir/article/",{"type":35,"tag":43,"props":7966,"children":7967},{},[7968,7970,7976],{"type":41,"value":7969},"考虑文章中的一个相对链接 ",{"type":35,"tag":255,"props":7971,"children":7973},{"className":7972},[],[7974],{"type":41,"value":7975},"![](attachments/img.png)",{"type":41,"value":7977}," ，",{"type":35,"tag":1213,"props":7979,"children":7980},{},[7981,8001],{"type":35,"tag":1217,"props":7982,"children":7983},{},[7984,7986,7991,7993,7999],{"type":41,"value":7985},"通过 ",{"type":35,"tag":255,"props":7987,"children":7989},{"className":7988},[],[7990],{"type":41,"value":7955},{"type":41,"value":7992}," 访问文章时，相对链接会被解析为 ",{"type":35,"tag":255,"props":7994,"children":7996},{"className":7995},[],[7997],{"type":41,"value":7998},"subdir/attachments/a.png",{"type":41,"value":8000},"，这是预期的行为，访问到了正确的图像。",{"type":35,"tag":1217,"props":8002,"children":8003},{},[8004,8006,8011,8013,8019,8021,8027],{"type":41,"value":8005},"而对于 ",{"type":35,"tag":255,"props":8007,"children":8009},{"className":8008},[],[8010],{"type":41,"value":7964},{"type":41,"value":8012},"，相对链接 ",{"type":35,"tag":255,"props":8014,"children":8016},{"className":8015},[],[8017],{"type":41,"value":8018},"![](attachments/a.png)",{"type":41,"value":8020}," 会基于当前文章的路由，被解释为 ",{"type":35,"tag":255,"props":8022,"children":8024},{"className":8023},[],[8025],{"type":41,"value":8026},"subdir/article/attachments/a.png",{"type":41,"value":8028},"，注意这就多了一层，访问到不存在的文件了，导致图片显示不出来。",{"type":35,"tag":43,"props":8030,"children":8031},{},[8032,8034,8040],{"type":41,"value":8033},"你可能觉得，那我们不要访问带 ",{"type":35,"tag":255,"props":8035,"children":8037},{"className":8036},[],[8038],{"type":41,"value":8039},"/",{"type":41,"value":8041}," 后缀的地址不就行了。对，我也一直是这么考虑的。但是——",{"type":35,"tag":43,"props":8043,"children":8044},{},[8045,8047,8052,8054,8059,8061,8066,8068,8073],{"type":41,"value":8046},"把这个问题推向风口浪尖，以至于必须从根本解决这个问题的事实是：怎么对待尾部的 ",{"type":35,"tag":255,"props":8048,"children":8050},{"className":8049},[],[8051],{"type":41,"value":8039},{"type":41,"value":8053}," 是取决于 web 服务器的，例如本地开发环境 ",{"type":35,"tag":255,"props":8055,"children":8057},{"className":8056},[],[8058],{"type":41,"value":2366},{"type":41,"value":8060}," 是区分两种情况的；而部署到 GitHub Pages 时，不管你加不加 ",{"type":35,"tag":255,"props":8062,"children":8064},{"className":8063},[],[8065],{"type":41,"value":8039},{"type":41,"value":8067}," 他都会访问到带 ",{"type":35,"tag":255,"props":8069,"children":8071},{"className":8070},[],[8072],{"type":41,"value":8039},{"type":41,"value":8074}," 的地址。",{"type":35,"tag":885,"props":8076,"children":8078},{"id":8077},"quick-fix",[8079],{"type":41,"value":8080},"Quick fix",{"type":35,"tag":43,"props":8082,"children":8083},{},[8084],{"type":41,"value":8085},"这个问题可以通过调整内容目录的组织方式来规避。",{"type":35,"tag":246,"props":8087,"children":8088},{},[8089],{"type":35,"tag":43,"props":8090,"children":8091},{},[8092,8093],{"type":41,"value":1467},{"type":35,"tag":60,"props":8094,"children":8097},{"href":8095,"rel":8096},"https://content.nuxt.com/usage/content-directory#paths",[64],[8098],{"type":41,"value":8095},{"type":35,"tag":43,"props":8100,"children":8101},{},[8102,8104,8110],{"type":41,"value":8103},"添加一级“文章目录”，并把 Markdown 文件命名为 ",{"type":35,"tag":255,"props":8105,"children":8107},{"className":8106},[],[8108],{"type":41,"value":8109},"index.md",{"type":41,"value":8111}," ：",{"type":35,"tag":1099,"props":8113,"children":8114},{},[8115,8134],{"type":35,"tag":1103,"props":8116,"children":8117},{},[8118],{"type":35,"tag":1107,"props":8119,"children":8120},{},[8121,8124,8129],{"type":35,"tag":1111,"props":8122,"children":8123},{},[],{"type":35,"tag":1111,"props":8125,"children":8126},{},[8127],{"type":41,"value":8128},"修改前",{"type":35,"tag":1111,"props":8130,"children":8131},{},[8132],{"type":41,"value":8133},"修改后",{"type":35,"tag":1131,"props":8135,"children":8136},{},[8137,8162],{"type":35,"tag":1107,"props":8138,"children":8139},{},[8140,8145,8153],{"type":35,"tag":1138,"props":8141,"children":8142},{},[8143],{"type":41,"value":8144},"文章",{"type":35,"tag":1138,"props":8146,"children":8147},{},[8148],{"type":35,"tag":255,"props":8149,"children":8151},{"className":8150},[],[8152],{"type":41,"value":7941},{"type":35,"tag":1138,"props":8154,"children":8155},{},[8156],{"type":35,"tag":255,"props":8157,"children":8159},{"className":8158},[],[8160],{"type":41,"value":8161},"subdir/article/index.md",{"type":35,"tag":1107,"props":8163,"children":8164},{},[8165,8170,8179],{"type":35,"tag":1138,"props":8166,"children":8167},{},[8168],{"type":41,"value":8169},"图片",{"type":35,"tag":1138,"props":8171,"children":8172},{},[8173],{"type":35,"tag":255,"props":8174,"children":8176},{"className":8175},[],[8177],{"type":41,"value":8178},"subdir/attachments/*.png",{"type":35,"tag":1138,"props":8180,"children":8181},{},[8182],{"type":35,"tag":255,"props":8183,"children":8185},{"className":8184},[],[8186],{"type":41,"value":8187},"subdir/article/attachments/*.png",{"type":35,"tag":43,"props":8189,"children":8190},{},[8191],{"type":41,"value":8192},"这是修改后的目录结构：",{"type":35,"tag":351,"props":8194,"children":8196},{"code":8195},"public/blogs/\n    +-- article-name/\n        +-- index.md  # ![](attachments/img.png)\n        +-- attachments/\n            +-- img.png\n",[8197],{"type":35,"tag":255,"props":8198,"children":8199},{"__ignoreMap":8},[8200],{"type":41,"value":8195},{"type":35,"tag":1213,"props":8202,"children":8203},{},[8204,8252],{"type":35,"tag":1217,"props":8205,"children":8206},{},[8207,8209,8215,8217,8223,8225,8231,8233],{"type":41,"value":8208},"类似于 web 服务器对 ",{"type":35,"tag":255,"props":8210,"children":8212},{"className":8211},[],[8213],{"type":41,"value":8214},"index.html",{"type":41,"value":8216}," 的处理，Nuxt Content 会把 ",{"type":35,"tag":255,"props":8218,"children":8220},{"className":8219},[],[8221],{"type":41,"value":8222},"subdir/index.md",{"type":41,"value":8224}," 的路径设为 ",{"type":35,"tag":255,"props":8226,"children":8228},{"className":8227},[],[8229],{"type":41,"value":8230},"subdir/",{"type":41,"value":8232},"。文章仍然可以在以下两个路径访问：\n",{"type":35,"tag":1213,"props":8234,"children":8235},{},[8236,8244],{"type":35,"tag":1217,"props":8237,"children":8238},{},[8239],{"type":35,"tag":255,"props":8240,"children":8242},{"className":8241},[],[8243],{"type":41,"value":7955},{"type":35,"tag":1217,"props":8245,"children":8246},{},[8247],{"type":35,"tag":255,"props":8248,"children":8250},{"className":8249},[],[8251],{"type":41,"value":7964},{"type":35,"tag":1217,"props":8253,"children":8254},{},[8255,8257,8262,8264,8269,8271,8277],{"type":41,"value":8256},"但在这两种情况下，相对链接 ",{"type":35,"tag":255,"props":8258,"children":8260},{"className":8259},[],[8261],{"type":41,"value":7975},{"type":41,"value":8263}," 都会从 ",{"type":35,"tag":255,"props":8265,"children":8267},{"className":8266},[],[8268],{"type":41,"value":8109},{"type":41,"value":8270}," 所在的目录出发，被正确解析为我们希望的 ",{"type":35,"tag":255,"props":8272,"children":8274},{"className":8273},[],[8275],{"type":41,"value":8276},"subdir/article/attachments/img.png",{"type":41,"value":2594},{"type":35,"tag":43,"props":8279,"children":8280},{},[8281],{"type":41,"value":8282},"改成这个样子之后，图片相对链接就好了。以后的文章都遵循这个约定也就没问题了。",{"type":35,"tag":885,"props":8284,"children":8286},{"id":8285},"todo根本解决",[8287],{"type":41,"value":8288},"TODO：根本解决",{"type":35,"tag":43,"props":8290,"children":8291},{},[8292],{"type":41,"value":8293},"这个问题的本源还是服务器对 HTTP URL 和系统对文件路径解释的分歧造成的。",{"type":35,"tag":43,"props":8295,"children":8296},{},[8297,8299,8305,8307,8313],{"type":41,"value":8298},"所以要从根本上避免这个问题，一种方式是考虑在访问文章之前，遍历修改文章中的链接，把相对路径（",{"type":35,"tag":255,"props":8300,"children":8302},{"className":8301},[],[8303],{"type":41,"value":8304},"attachments/img.png",{"type":41,"value":8306},"）重写为以站点根目录开头的绝对路径（",{"type":35,"tag":255,"props":8308,"children":8310},{"className":8309},[],[8311],{"type":41,"value":8312},"/blogs/subdir/attachments/img.png",{"type":41,"value":8314},"）。",{"type":35,"tag":43,"props":8316,"children":8317},{},[8318,8320,8327],{"type":41,"value":8319},"Nuxt Content 提供了 ",{"type":35,"tag":60,"props":8321,"children":8324},{"href":8322,"rel":8323},"https://content.nuxt.com/recipes/hooks",[64],[8325],{"type":41,"value":8326},"Hook",{"type":41,"value":8328}," 功能，似乎可以来做这个事情。但我浅尝未果。",{"type":35,"tag":43,"props":8330,"children":8331},{},[8332],{"type":41,"value":8333},"总之先这样吧。如果你能成功实现更好的解决方案请务必教我。",{"type":35,"tag":8335,"props":8336,"children":8337},"style",{},[8338],{"type":41,"value":8339},"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 .sepia .shiki span {color: var(--shiki-sepia);background: var(--shiki-sepia-bg);font-style: var(--shiki-sepia-font-style);font-weight: var(--shiki-sepia-font-weight);text-decoration: var(--shiki-sepia-text-decoration);}html.sepia .shiki span {color: var(--shiki-sepia);background: var(--shiki-sepia-bg);font-style: var(--shiki-sepia-font-style);font-weight: var(--shiki-sepia-font-weight);text-decoration: var(--shiki-sepia-text-decoration);}",{"title":8,"searchDepth":438,"depth":438,"links":8341},[8342,8343,8344,8345,8350,8355,8356],{"id":50,"depth":438,"text":53},{"id":170,"depth":438,"text":173},{"id":322,"depth":438,"text":325},{"id":479,"depth":438,"text":482,"children":8346},[8347,8348,8349],{"id":887,"depth":452,"text":887},{"id":1276,"depth":452,"text":1276},{"id":1676,"depth":452,"text":1676},{"id":3486,"depth":438,"text":3489,"children":8351},[8352,8353,8354],{"id":3497,"depth":452,"text":3497},{"id":3774,"depth":452,"text":3774},{"id":5500,"depth":452,"text":5500},{"id":7746,"depth":438,"text":7746},{"id":7880,"depth":438,"text":7883,"children":8357},[8358,8359],{"id":8077,"depth":452,"text":8080},{"id":8285,"depth":452,"text":8288},"blogs:blogs:frontend:nuxt-content-for-blog:index.md","blogs/frontend/nuxt-content-for-blog/index.md","blogs/frontend/nuxt-content-for-blog/index",[8364],{"title":8365,"_path":1095,"children":8366},"Blogs",[8367,8374],{"title":8368,"_path":8369,"children":8370},"Frontend","/blogs/frontend",[8371],{"title":28,"_path":26,"children":8372,"publishedAt":30},[8373],{"title":28,"_path":26,"publishedAt":30},{"title":8375,"_path":8376,"children":8377},"Utils","/blogs/utils",[8378],{"title":9,"_path":5,"children":8379,"publishedAt":16},[8380],{"title":9,"_path":5,"publishedAt":16},1772069647438]