[{"data":1,"prerenderedAt":2821},["ShallowReactive",2],{"series-\u002Fseries\u002Fcreate-a-blog-with-vitepress-and-vue-js-from-scratch\u002Fenhance-website-visibility-seo-metadata-and-sitemap":3,"series-context-\u002Fseries\u002Fcreate-a-blog-with-vitepress-and-vue-js-from-scratch":2513},{"id":4,"title":5,"body":6,"contentId":2499,"date":2500,"description":2501,"extension":724,"github":2502,"meetTheInstructor":2504,"meta":2505,"navigation":113,"part":214,"path":2506,"rawbody":2507,"robots":2504,"schemaOrg":2504,"seo":2508,"seriesSlug":2509,"sitemap":2510,"stem":2511,"subtitle":2504,"topics":2504,"__hash__":2512},"series\u002Fseries\u002Fcreate-a-blog-with-vitepress-and-vue-js-from-scratch\u002Fenhance-website-visibility-seo-metadata-and-sitemap.md","Enhance Website Visibility: SEO Metadata and Sitemap",{"type":7,"value":8,"toc":2490},"minimark",[9,34,51,56,63,79,149,167,228,235,242,428,439,443,454,464,649,676,685,689,707,713,720,817,820,823,838,1182,1188,1200,1205,1217,1228,1243,1266,1271,1571,1598,1604,2022,2058,2104,2125,2139,2143,2156,2166,2224,2245,2346,2355,2359,2370,2386,2480,2486],[10,11,12,13,17,18,21,22,25,26,29,30],"p",{},"For a content-focused website, ",[14,15,16],"strong",{},"Search Engine Optimization (SEO)"," is essential. It enables users to find and access your content via ",[14,19,20],{},"search engines"," like ",[14,23,24],{},"Google"," or ",[14,27,28],{},"Bing",", which is the aim of this blog. ",[31,32,33],"em",{},"If this is not your objective, feel free to skip this article.",[35,36,39],"callout",{"color":37,"icon":38},"info","i-ph-info-duotone",[10,40,41,43,44,46,47,50],{},[14,42,16],{}," enhances the quality and quantity of website traffic from ",[14,45,20],{},". It focuses on ",[14,48,49],{},"organic traffic"," instead of direct or paid traffic.",[52,53,55],"h2",{"id":54},"the-fundamentals","The fundamentals",[10,57,58,59,62],{},"Let us begin by integrating basic ",[14,60,61],{},"metadata"," into our website.",[10,64,65,66,69,70,74,75,78],{},"Initially, we must specify the ",[14,67,68],{},"language"," of our website by adding the ",[71,72,73],"code",{},"lang"," key in the ",[71,76,77],{},"config.mts"," file:",[80,81,86],"pre",{"className":82,"code":83,"filename":77,"language":84,"meta":85,"style":85},"language-ts shiki shiki-themes github-light github-light github-dark","import { defineConfig } from 'vitepress'\n\nexport default defineConfig({\n  lang: 'en-US',\n})\n","ts","",[71,87,88,108,115,131,143],{"__ignoreMap":85},[89,90,93,97,101,104],"span",{"class":91,"line":92},"line",1,[89,94,96],{"class":95},"s8jYJ","import",[89,98,100],{"class":99},"sxrX7"," { defineConfig } ",[89,102,103],{"class":95},"from",[89,105,107],{"class":106},"sIIMD"," 'vitepress'\n",[89,109,111],{"class":91,"line":110},2,[89,112,114],{"emptyLinePlaceholder":113},true,"\n",[89,116,118,121,124,128],{"class":91,"line":117},3,[89,119,120],{"class":95},"export",[89,122,123],{"class":95}," default",[89,125,127],{"class":126},"snPdu"," defineConfig",[89,129,130],{"class":99},"({\n",[89,132,134,137,140],{"class":91,"line":133},4,[89,135,136],{"class":99},"  lang: ",[89,138,139],{"class":106},"'en-US'",[89,141,142],{"class":99},",\n",[89,144,146],{"class":91,"line":145},5,[89,147,148],{"class":99},"})\n",[10,150,151,152,155,156,159,160,155,162,164,165,78],{},"Next, we establish the ",[14,153,154],{},"title"," and ",[14,157,158],{},"description"," of our website by inserting the ",[71,161,154],{},[71,163,158],{}," keys in the ",[71,166,77],{},[80,168,170],{"className":82,"code":169,"filename":77,"language":84,"meta":85,"style":85},"import { defineConfig } from 'vitepress'\n\nexport default defineConfig({\n  \u002F\u002F ...\n  title: 'Garabit',\n  description: 'A place that reflects my thoughts and ideas',\n})\n",[71,171,172,182,186,196,202,212,223],{"__ignoreMap":85},[89,173,174,176,178,180],{"class":91,"line":92},[89,175,96],{"class":95},[89,177,100],{"class":99},[89,179,103],{"class":95},[89,181,107],{"class":106},[89,183,184],{"class":91,"line":110},[89,185,114],{"emptyLinePlaceholder":113},[89,187,188,190,192,194],{"class":91,"line":117},[89,189,120],{"class":95},[89,191,123],{"class":95},[89,193,127],{"class":126},[89,195,130],{"class":99},[89,197,198],{"class":91,"line":133},[89,199,201],{"class":200},"sCsY4","  \u002F\u002F ...\n",[89,203,204,207,210],{"class":91,"line":145},[89,205,206],{"class":99},"  title: ",[89,208,209],{"class":106},"'Garabit'",[89,211,142],{"class":99},[89,213,215,218,221],{"class":91,"line":214},6,[89,216,217],{"class":99},"  description: ",[89,219,220],{"class":106},"'A place that reflects my thoughts and ideas'",[89,222,142],{"class":99},[89,224,226],{"class":91,"line":225},7,[89,227,148],{"class":99},[10,229,230,231,234],{},"The title will also serve as the suffix for each page's title. For instance, the title of the blog page will be ",[71,232,233],{},"Blog | Garabit",".",[10,236,237,238,241],{},"We can verify these additions by examining the generated HTML code in the ",[71,239,240],{},".vitepress\u002Fdist"," directory.",[80,243,248],{"className":244,"code":245,"filename":246,"language":247,"meta":85,"style":85},"language-html shiki shiki-themes github-light github-light github-dark","\u003C!DOCTYPE html>\n\u003Chtml lang=\"en-US\" dir=\"ltr\"> \u002F\u002F [!code highlight]\n  \u003Chead>\n    \u003Cmeta charset=\"utf-8\">\n    \u003Cmeta name=\"viewport\" content=\"width=device-width,initial-scale=1\">\n    \u003Ctitle>Blog | Garabit\u003C\u002Ftitle> \u002F\u002F [!code highlight]\n    \u003Cmeta name=\"description\" content=\"The latest articles, tutorials, and resources on web development, programming, and more.\"> \u002F\u002F [!code highlight]\n    \u003Cmeta name=\"generator\" content=\"VitePress v1.4.1\">\n    \u003C!-- ... -->\n  \u003C\u002Fhead>\n\u003C\u002Fhtml>\n","Example","html",[71,249,250,265,292,302,320,344,357,379,402,408,418],{"__ignoreMap":85},[89,251,252,255,259,262],{"class":91,"line":92},[89,253,254],{"class":99},"\u003C!",[89,256,258],{"class":257},"sovSZ","DOCTYPE",[89,260,261],{"class":126}," html",[89,263,264],{"class":99},">\n",[89,266,267,270,272,275,278,281,284,286,289],{"class":91,"line":110},[89,268,269],{"class":99},"\u003C",[89,271,247],{"class":257},[89,273,274],{"class":126}," lang",[89,276,277],{"class":99},"=",[89,279,280],{"class":106},"\"en-US\"",[89,282,283],{"class":126}," dir",[89,285,277],{"class":99},[89,287,288],{"class":106},"\"ltr\"",[89,290,291],{"class":99},"> \u002F\u002F [!code highlight]\n",[89,293,294,297,300],{"class":91,"line":117},[89,295,296],{"class":99},"  \u003C",[89,298,299],{"class":257},"head",[89,301,264],{"class":99},[89,303,304,307,310,313,315,318],{"class":91,"line":133},[89,305,306],{"class":99},"    \u003C",[89,308,309],{"class":257},"meta",[89,311,312],{"class":126}," charset",[89,314,277],{"class":99},[89,316,317],{"class":106},"\"utf-8\"",[89,319,264],{"class":99},[89,321,322,324,326,329,331,334,337,339,342],{"class":91,"line":145},[89,323,306],{"class":99},[89,325,309],{"class":257},[89,327,328],{"class":126}," name",[89,330,277],{"class":99},[89,332,333],{"class":106},"\"viewport\"",[89,335,336],{"class":126}," content",[89,338,277],{"class":99},[89,340,341],{"class":106},"\"width=device-width,initial-scale=1\"",[89,343,264],{"class":99},[89,345,346,348,350,353,355],{"class":91,"line":214},[89,347,306],{"class":99},[89,349,154],{"class":257},[89,351,352],{"class":99},">Blog | Garabit\u003C\u002F",[89,354,154],{"class":257},[89,356,291],{"class":99},[89,358,359,361,363,365,367,370,372,374,377],{"class":91,"line":225},[89,360,306],{"class":99},[89,362,309],{"class":257},[89,364,328],{"class":126},[89,366,277],{"class":99},[89,368,369],{"class":106},"\"description\"",[89,371,336],{"class":126},[89,373,277],{"class":99},[89,375,376],{"class":106},"\"The latest articles, tutorials, and resources on web development, programming, and more.\"",[89,378,291],{"class":99},[89,380,382,384,386,388,390,393,395,397,400],{"class":91,"line":381},8,[89,383,306],{"class":99},[89,385,309],{"class":257},[89,387,328],{"class":126},[89,389,277],{"class":99},[89,391,392],{"class":106},"\"generator\"",[89,394,336],{"class":126},[89,396,277],{"class":99},[89,398,399],{"class":106},"\"VitePress v1.4.1\"",[89,401,264],{"class":99},[89,403,405],{"class":91,"line":404},9,[89,406,407],{"class":200},"    \u003C!-- ... -->\n",[89,409,411,414,416],{"class":91,"line":410},10,[89,412,413],{"class":99},"  \u003C\u002F",[89,415,299],{"class":257},[89,417,264],{"class":99},[89,419,421,424,426],{"class":91,"line":420},11,[89,422,423],{"class":99},"\u003C\u002F",[89,425,247],{"class":257},[89,427,264],{"class":99},[35,429,430],{"color":37,"icon":38},[10,431,432,435,436,438],{},[14,433,434],{},"VitePress"," incorporates its own metadata into the generated HTML code, resulting in more ",[71,437,309],{}," tags than we manually added.",[52,440,442],{"id":441},"static-metadata","Static metadata",[10,444,445,446,449,450,453],{},"Let's now add some ",[14,447,448],{},"static metadata"," to enhance ",[14,451,452],{},"SEO"," capabilities. These metadata apply uniformly across all website pages.",[10,455,456,457,459,460,74,462,78],{},"To add static ",[14,458,61],{},", insert the ",[71,461,299],{},[71,463,77],{},[80,465,467],{"className":82,"code":466,"filename":77,"language":84,"meta":85,"style":85},"import { defineConfig } from 'vitepress'\n\nexport default defineConfig({\n  \u002F\u002F ...\n  head: [\n    ['meta', { name: 'twitter:site', content: '@soubiran_' }], \u002F\u002F Please, change this before deploying\n    ['meta', { name: 'twitter:card', content: 'summary_large_image' }],\n    ['meta', { property: 'og:image:width', content: '1200' }],\n    ['meta', { property: 'og:image:height', content: '630' }],\n    ['meta', { property: 'og:image:type', content: 'image\u002Fpng' }],\n    ['meta', { property: 'og:site_name', content: 'Garabit' }],\n    ['meta', { property: 'og:type', content: 'website' }],\n  ],\n})\n",[71,468,469,479,483,493,497,502,528,547,566,584,602,619,638,644],{"__ignoreMap":85},[89,470,471,473,475,477],{"class":91,"line":92},[89,472,96],{"class":95},[89,474,100],{"class":99},[89,476,103],{"class":95},[89,478,107],{"class":106},[89,480,481],{"class":91,"line":110},[89,482,114],{"emptyLinePlaceholder":113},[89,484,485,487,489,491],{"class":91,"line":117},[89,486,120],{"class":95},[89,488,123],{"class":95},[89,490,127],{"class":126},[89,492,130],{"class":99},[89,494,495],{"class":91,"line":133},[89,496,201],{"class":200},[89,498,499],{"class":91,"line":145},[89,500,501],{"class":99},"  head: [\n",[89,503,504,507,510,513,516,519,522,525],{"class":91,"line":214},[89,505,506],{"class":99},"    [",[89,508,509],{"class":106},"'meta'",[89,511,512],{"class":99},", { name: ",[89,514,515],{"class":106},"'twitter:site'",[89,517,518],{"class":99},", content: ",[89,520,521],{"class":106},"'@soubiran_'",[89,523,524],{"class":99}," }], ",[89,526,527],{"class":200},"\u002F\u002F Please, change this before deploying\n",[89,529,530,532,534,536,539,541,544],{"class":91,"line":225},[89,531,506],{"class":99},[89,533,509],{"class":106},[89,535,512],{"class":99},[89,537,538],{"class":106},"'twitter:card'",[89,540,518],{"class":99},[89,542,543],{"class":106},"'summary_large_image'",[89,545,546],{"class":99}," }],\n",[89,548,549,551,553,556,559,561,564],{"class":91,"line":381},[89,550,506],{"class":99},[89,552,509],{"class":106},[89,554,555],{"class":99},", { property: ",[89,557,558],{"class":106},"'og:image:width'",[89,560,518],{"class":99},[89,562,563],{"class":106},"'1200'",[89,565,546],{"class":99},[89,567,568,570,572,574,577,579,582],{"class":91,"line":404},[89,569,506],{"class":99},[89,571,509],{"class":106},[89,573,555],{"class":99},[89,575,576],{"class":106},"'og:image:height'",[89,578,518],{"class":99},[89,580,581],{"class":106},"'630'",[89,583,546],{"class":99},[89,585,586,588,590,592,595,597,600],{"class":91,"line":410},[89,587,506],{"class":99},[89,589,509],{"class":106},[89,591,555],{"class":99},[89,593,594],{"class":106},"'og:image:type'",[89,596,518],{"class":99},[89,598,599],{"class":106},"'image\u002Fpng'",[89,601,546],{"class":99},[89,603,604,606,608,610,613,615,617],{"class":91,"line":420},[89,605,506],{"class":99},[89,607,509],{"class":106},[89,609,555],{"class":99},[89,611,612],{"class":106},"'og:site_name'",[89,614,518],{"class":99},[89,616,209],{"class":106},[89,618,546],{"class":99},[89,620,622,624,626,628,631,633,636],{"class":91,"line":621},12,[89,623,506],{"class":99},[89,625,509],{"class":106},[89,627,555],{"class":99},[89,629,630],{"class":106},"'og:type'",[89,632,518],{"class":99},[89,634,635],{"class":106},"'website'",[89,637,546],{"class":99},[89,639,641],{"class":91,"line":640},13,[89,642,643],{"class":99},"  ],\n",[89,645,647],{"class":91,"line":646},14,[89,648,148],{"class":99},[10,650,651,652,654,655,21,658,155,661,664,665,668,669,672,673,234],{},"These ",[14,653,61],{}," are utilized by ",[14,656,657],{},"social platforms",[14,659,660],{},"Twitter",[14,662,663],{},"Facebook"," to display a preview of the website when shared. The ",[71,666,667],{},"og"," prefix indicates ",[14,670,671],{},"Open Graph",", a protocol that enables web pages to become rich objects in a ",[14,674,675],{},"social network",[35,677,678],{"color":37,"icon":38},[10,679,680,681,684],{},"Future articles will explore automatic ",[14,682,683],{},"Open Graph image generation"," for blog posts.",[52,686,688],{"id":687},"dynamic-metadata","Dynamic metadata",[10,690,691,692,694,695,698,699,702,703,706],{},"For optimal ",[14,693,452],{},", each page should feature an ",[14,696,697],{},"Open Graph title",", description, and ",[14,700,701],{},"canonical URL",". These are ",[14,704,705],{},"dynamic metadata"," and vary for each page.",[10,708,709,710,712],{},"We have two methods for adding ",[14,711,705],{}," to our site:",[714,715,716],"ul",{},[717,718,719],"li",{},"In each Markdown file's frontmatter: Though simple, this method is not the most maintainable. Adding new metadata requires updating every Markdown file and writing YAML with nested arrays, which can be cumbersome.",[80,721,725],{"className":722,"code":723,"filename":246,"language":724,"meta":85,"style":85},"language-md shiki shiki-themes github-light github-light github-dark","---\ntitle: My Awesome Blog Post\ndescription: A blog post that will change your life\nhead:\n  - - meta\n    - property: og:title\n      content: My Awesome Blog Post\n  - - meta\n    - property: og:description\n      content: A blog post that will change your life\n---\n","md",[71,726,727,732,742,751,758,766,779,788,794,805,813],{"__ignoreMap":85},[89,728,729],{"class":91,"line":92},[89,730,731],{"class":99},"---\n",[89,733,734,736,739],{"class":91,"line":110},[89,735,154],{"class":257},[89,737,738],{"class":99},": ",[89,740,741],{"class":106},"My Awesome Blog Post\n",[89,743,744,746,748],{"class":91,"line":117},[89,745,158],{"class":257},[89,747,738],{"class":99},[89,749,750],{"class":106},"A blog post that will change your life\n",[89,752,753,755],{"class":91,"line":133},[89,754,299],{"class":257},[89,756,757],{"class":99},":\n",[89,759,760,763],{"class":91,"line":145},[89,761,762],{"class":99},"  - - ",[89,764,765],{"class":106},"meta\n",[89,767,768,771,774,776],{"class":91,"line":214},[89,769,770],{"class":99},"    - ",[89,772,773],{"class":257},"property",[89,775,738],{"class":99},[89,777,778],{"class":106},"og:title\n",[89,780,781,784,786],{"class":91,"line":225},[89,782,783],{"class":257},"      content",[89,785,738],{"class":99},[89,787,741],{"class":106},[89,789,790,792],{"class":91,"line":381},[89,791,762],{"class":99},[89,793,765],{"class":106},[89,795,796,798,800,802],{"class":91,"line":404},[89,797,770],{"class":99},[89,799,773],{"class":257},[89,801,738],{"class":99},[89,803,804],{"class":106},"og:description\n",[89,806,807,809,811],{"class":91,"line":410},[89,808,783],{"class":257},[89,810,738],{"class":99},[89,812,750],{"class":106},[89,814,815],{"class":91,"line":420},[89,816,731],{"class":99},[10,818,819],{},"Due to redundancy and complexity, I wish to avoid this method.",[10,821,822],{},"Thankfully, a second method exists:",[714,824,825],{},[717,826,827,828,830,831,834,835,837],{},"In the ",[71,829,77],{}," file: A more maintainable solution involves using the ",[71,832,833],{},"transformPageData"," option to insert ",[14,836,705],{}," into each page, modifying the data prior to rendering.",[80,839,841],{"className":82,"code":840,"filename":77,"language":84,"meta":85,"style":85},"import { defineConfig } from 'vitepress'\n\nexport default defineConfig({\n  \u002F\u002F ...\n  transformPageData: (page, { siteConfig }) => {\n    \u002F\u002F Initialize the `head` frontmatter if it doesn't exist.\n    pageData.frontmatter.head ??= []\n\n    \u002F\u002F Add basic meta tags to the frontmatter.\n    pageData.frontmatter.head.push(\n      [\n        'meta',\n        {\n          property: 'og:title',\n          content:\n            pageData.frontmatter.title || pageData.title || siteConfig.site.title,\n        },\n      ],\n      [\n        'meta',\n        {\n          name: 'twitter:title',\n          content:\n            pageData.frontmatter.title || pageData.title || siteConfig.site.title,\n        },\n      ],\n      [\n        'meta',\n        {\n          property: 'og:description',\n          content:\n            pageData.frontmatter.description || pageData.description || siteConfig.site.description,\n        },\n      ],\n      [\n        'meta',\n        {\n          name: 'twitter:description',\n          content:\n            pageData.frontmatter.description || pageData.description || siteConfig.site.description,\n        },\n      ],\n    )\n  },\n})\n",[71,842,843,853,857,867,871,898,903,914,918,923,934,939,946,951,961,967,984,990,996,1001,1008,1013,1024,1029,1042,1047,1052,1057,1064,1069,1079,1084,1100,1105,1110,1115,1122,1127,1137,1142,1155,1160,1165,1171,1177],{"__ignoreMap":85},[89,844,845,847,849,851],{"class":91,"line":92},[89,846,96],{"class":95},[89,848,100],{"class":99},[89,850,103],{"class":95},[89,852,107],{"class":106},[89,854,855],{"class":91,"line":110},[89,856,114],{"emptyLinePlaceholder":113},[89,858,859,861,863,865],{"class":91,"line":117},[89,860,120],{"class":95},[89,862,123],{"class":95},[89,864,127],{"class":126},[89,866,130],{"class":99},[89,868,869],{"class":91,"line":133},[89,870,201],{"class":200},[89,872,873,876,879,883,886,889,892,895],{"class":91,"line":145},[89,874,875],{"class":126},"  transformPageData",[89,877,878],{"class":99},": (",[89,880,882],{"class":881},"sP4rz","page",[89,884,885],{"class":99},", { ",[89,887,888],{"class":881},"siteConfig",[89,890,891],{"class":99}," }) ",[89,893,894],{"class":95},"=>",[89,896,897],{"class":99}," {\n",[89,899,900],{"class":91,"line":214},[89,901,902],{"class":200},"    \u002F\u002F Initialize the `head` frontmatter if it doesn't exist.\n",[89,904,905,908,911],{"class":91,"line":225},[89,906,907],{"class":99},"    pageData.frontmatter.head ",[89,909,910],{"class":95},"??=",[89,912,913],{"class":99}," []\n",[89,915,916],{"class":91,"line":381},[89,917,114],{"emptyLinePlaceholder":113},[89,919,920],{"class":91,"line":404},[89,921,922],{"class":200},"    \u002F\u002F Add basic meta tags to the frontmatter.\n",[89,924,925,928,931],{"class":91,"line":410},[89,926,927],{"class":99},"    pageData.frontmatter.head.",[89,929,930],{"class":126},"push",[89,932,933],{"class":99},"(\n",[89,935,936],{"class":91,"line":420},[89,937,938],{"class":99},"      [\n",[89,940,941,944],{"class":91,"line":621},[89,942,943],{"class":106},"        'meta'",[89,945,142],{"class":99},[89,947,948],{"class":91,"line":640},[89,949,950],{"class":99},"        {\n",[89,952,953,956,959],{"class":91,"line":646},[89,954,955],{"class":99},"          property: ",[89,957,958],{"class":106},"'og:title'",[89,960,142],{"class":99},[89,962,964],{"class":91,"line":963},15,[89,965,966],{"class":99},"          content:\n",[89,968,970,973,976,979,981],{"class":91,"line":969},16,[89,971,972],{"class":99},"            pageData.frontmatter.title ",[89,974,975],{"class":95},"||",[89,977,978],{"class":99}," pageData.title ",[89,980,975],{"class":95},[89,982,983],{"class":99}," siteConfig.site.title,\n",[89,985,987],{"class":91,"line":986},17,[89,988,989],{"class":99},"        },\n",[89,991,993],{"class":91,"line":992},18,[89,994,995],{"class":99},"      ],\n",[89,997,999],{"class":91,"line":998},19,[89,1000,938],{"class":99},[89,1002,1004,1006],{"class":91,"line":1003},20,[89,1005,943],{"class":106},[89,1007,142],{"class":99},[89,1009,1011],{"class":91,"line":1010},21,[89,1012,950],{"class":99},[89,1014,1016,1019,1022],{"class":91,"line":1015},22,[89,1017,1018],{"class":99},"          name: ",[89,1020,1021],{"class":106},"'twitter:title'",[89,1023,142],{"class":99},[89,1025,1027],{"class":91,"line":1026},23,[89,1028,966],{"class":99},[89,1030,1032,1034,1036,1038,1040],{"class":91,"line":1031},24,[89,1033,972],{"class":99},[89,1035,975],{"class":95},[89,1037,978],{"class":99},[89,1039,975],{"class":95},[89,1041,983],{"class":99},[89,1043,1045],{"class":91,"line":1044},25,[89,1046,989],{"class":99},[89,1048,1050],{"class":91,"line":1049},26,[89,1051,995],{"class":99},[89,1053,1055],{"class":91,"line":1054},27,[89,1056,938],{"class":99},[89,1058,1060,1062],{"class":91,"line":1059},28,[89,1061,943],{"class":106},[89,1063,142],{"class":99},[89,1065,1067],{"class":91,"line":1066},29,[89,1068,950],{"class":99},[89,1070,1072,1074,1077],{"class":91,"line":1071},30,[89,1073,955],{"class":99},[89,1075,1076],{"class":106},"'og:description'",[89,1078,142],{"class":99},[89,1080,1082],{"class":91,"line":1081},31,[89,1083,966],{"class":99},[89,1085,1087,1090,1092,1095,1097],{"class":91,"line":1086},32,[89,1088,1089],{"class":99},"            pageData.frontmatter.description ",[89,1091,975],{"class":95},[89,1093,1094],{"class":99}," pageData.description ",[89,1096,975],{"class":95},[89,1098,1099],{"class":99}," siteConfig.site.description,\n",[89,1101,1103],{"class":91,"line":1102},33,[89,1104,989],{"class":99},[89,1106,1108],{"class":91,"line":1107},34,[89,1109,995],{"class":99},[89,1111,1113],{"class":91,"line":1112},35,[89,1114,938],{"class":99},[89,1116,1118,1120],{"class":91,"line":1117},36,[89,1119,943],{"class":106},[89,1121,142],{"class":99},[89,1123,1125],{"class":91,"line":1124},37,[89,1126,950],{"class":99},[89,1128,1130,1132,1135],{"class":91,"line":1129},38,[89,1131,1018],{"class":99},[89,1133,1134],{"class":106},"'twitter:description'",[89,1136,142],{"class":99},[89,1138,1140],{"class":91,"line":1139},39,[89,1141,966],{"class":99},[89,1143,1145,1147,1149,1151,1153],{"class":91,"line":1144},40,[89,1146,1089],{"class":99},[89,1148,975],{"class":95},[89,1150,1094],{"class":99},[89,1152,975],{"class":95},[89,1154,1099],{"class":99},[89,1156,1158],{"class":91,"line":1157},41,[89,1159,989],{"class":99},[89,1161,1163],{"class":91,"line":1162},42,[89,1164,995],{"class":99},[89,1166,1168],{"class":91,"line":1167},43,[89,1169,1170],{"class":99},"    )\n",[89,1172,1174],{"class":91,"line":1173},44,[89,1175,1176],{"class":99},"  },\n",[89,1178,1180],{"class":91,"line":1179},45,[89,1181,148],{"class":99},[10,1183,1184,1185,1187],{},"This approach is efficient, allowing for the addition of multiple ",[14,1186,705],{}," without modifying every Markdown file or duplicating metadata. In that case, we define some fallbacks in case the metadata is missing.",[35,1189,1190],{"color":37,"icon":38},[10,1191,1192,1193,1195,1196,1199],{},"Should you wish to add more ",[14,1194,705],{},", you can do so in the same manner as the ",[14,1197,1198],{},"Open Graph metadata"," using this technique.",[1201,1202,1204],"h3",{"id":1203},"canonical-url","Canonical URL",[10,1206,1207,1208,1210,1211,1213,1214,1216],{},"The ",[14,1209,701],{}," specifies the preferred version of a web page, preventing duplicate content issues. Without it, ",[14,1212,20],{}," may struggle to identify the same page regardless of URL variations, potentially delaying indexing. This situation can occur more frequently than anticipated. For instance, a blog post shared in a newsletter could include a tracking parameter, leading the search engine to index the URL with the parameter instead of the original URL, or worse, not at all. Thus, it is crucial to add a ",[14,1215,701],{}," to each page.",[10,1218,827,1219,1221,1222,1225,1226,234],{},[71,1220,833],{}," function, we can access the ",[71,1223,1224],{},"path"," of the page to infer the ",[14,1227,701],{},[10,1229,1230,1231,1238,1239,1242],{},"Initially, install the ",[1232,1233,1237],"a",{"href":1234,"rel":1235},"https:\u002F\u002Fgithub.com\u002Funjs\u002Fufo",[1236],"nofollow","ufo"," package, a URL manipulation library by ",[14,1240,1241],{},"UnJS",":",[80,1244,1249],{"className":1245,"code":1246,"filename":1247,"language":1248,"meta":85,"style":85},"language-bash shiki shiki-themes github-light github-light github-dark","pnpm add -D ufo\n","terminal","bash",[71,1250,1251],{"__ignoreMap":85},[89,1252,1253,1256,1259,1263],{"class":91,"line":92},[89,1254,1255],{"class":126},"pnpm",[89,1257,1258],{"class":106}," add",[89,1260,1262],{"class":1261},"sBjJW"," -D",[89,1264,1265],{"class":106}," ufo\n",[10,1267,1268,1269,1242],{},"Next, employ this package to craft the ",[14,1270,701],{},[80,1272,1274],{"className":82,"code":1273,"filename":246,"language":84,"meta":85,"style":85},"import { joinURL, withoutTrailingSlash } from 'ufo'\nimport { defineConfig } from 'vitepress'\n\nexport default defineConfig({\n  \u002F\u002F ...\n  transformPageData: (page) => {\n    \u002F\u002F Initialize the `head` frontmatter if it doesn't exist.\n    pageData.frontmatter.head ??= []\n\n    \u002F\u002F ...\n\n    \u002F\u002F Create the canonical URL\n    pageData.frontmatter.head.push([\n      'link',\n      {\n        rel: 'canonical',\n        href: joinURL(\n          'https:\u002F\u002Fgarabit.barbapapazes.dev', \u002F\u002F Modify this prior to deployment\n          withoutTrailingSlash(pageData.filePath.replace(\u002F(index)?\\.md$\u002F, '')),\n        ),\n      },\n    ])\n\n    pageData.frontmatter.head.push([\n      'meta',\n      {\n        property: 'og:url',\n        content: joinURL(\n          'https:\u002F\u002Fgarabit.barbapapazes.dev', \u002F\u002F Modify this prior to deployment\n          withoutTrailingSlash(pageData.filePath.replace(\u002F(index)?\\.md$\u002F, '')),\n        ),\n      },\n    ])\n  },\n})\n",[71,1275,1276,1288,1298,1302,1312,1316,1331,1335,1343,1347,1352,1356,1361,1370,1377,1382,1392,1402,1413,1456,1461,1466,1471,1475,1483,1490,1494,1504,1513,1521,1551,1555,1559,1563,1567],{"__ignoreMap":85},[89,1277,1278,1280,1283,1285],{"class":91,"line":92},[89,1279,96],{"class":95},[89,1281,1282],{"class":99}," { joinURL, withoutTrailingSlash } ",[89,1284,103],{"class":95},[89,1286,1287],{"class":106}," 'ufo'\n",[89,1289,1290,1292,1294,1296],{"class":91,"line":110},[89,1291,96],{"class":95},[89,1293,100],{"class":99},[89,1295,103],{"class":95},[89,1297,107],{"class":106},[89,1299,1300],{"class":91,"line":117},[89,1301,114],{"emptyLinePlaceholder":113},[89,1303,1304,1306,1308,1310],{"class":91,"line":133},[89,1305,120],{"class":95},[89,1307,123],{"class":95},[89,1309,127],{"class":126},[89,1311,130],{"class":99},[89,1313,1314],{"class":91,"line":145},[89,1315,201],{"class":200},[89,1317,1318,1320,1322,1324,1327,1329],{"class":91,"line":214},[89,1319,875],{"class":126},[89,1321,878],{"class":99},[89,1323,882],{"class":881},[89,1325,1326],{"class":99},") ",[89,1328,894],{"class":95},[89,1330,897],{"class":99},[89,1332,1333],{"class":91,"line":225},[89,1334,902],{"class":200},[89,1336,1337,1339,1341],{"class":91,"line":381},[89,1338,907],{"class":99},[89,1340,910],{"class":95},[89,1342,913],{"class":99},[89,1344,1345],{"class":91,"line":404},[89,1346,114],{"emptyLinePlaceholder":113},[89,1348,1349],{"class":91,"line":410},[89,1350,1351],{"class":200},"    \u002F\u002F ...\n",[89,1353,1354],{"class":91,"line":420},[89,1355,114],{"emptyLinePlaceholder":113},[89,1357,1358],{"class":91,"line":621},[89,1359,1360],{"class":200},"    \u002F\u002F Create the canonical URL\n",[89,1362,1363,1365,1367],{"class":91,"line":640},[89,1364,927],{"class":99},[89,1366,930],{"class":126},[89,1368,1369],{"class":99},"([\n",[89,1371,1372,1375],{"class":91,"line":646},[89,1373,1374],{"class":106},"      'link'",[89,1376,142],{"class":99},[89,1378,1379],{"class":91,"line":963},[89,1380,1381],{"class":99},"      {\n",[89,1383,1384,1387,1390],{"class":91,"line":969},[89,1385,1386],{"class":99},"        rel: ",[89,1388,1389],{"class":106},"'canonical'",[89,1391,142],{"class":99},[89,1393,1394,1397,1400],{"class":91,"line":986},[89,1395,1396],{"class":99},"        href: ",[89,1398,1399],{"class":126},"joinURL",[89,1401,933],{"class":99},[89,1403,1404,1407,1410],{"class":91,"line":992},[89,1405,1406],{"class":106},"          'https:\u002F\u002Fgarabit.barbapapazes.dev'",[89,1408,1409],{"class":99},", ",[89,1411,1412],{"class":200},"\u002F\u002F Modify this prior to deployment\n",[89,1414,1415,1418,1421,1424,1427,1430,1434,1437,1441,1443,1446,1448,1450,1453],{"class":91,"line":998},[89,1416,1417],{"class":126},"          withoutTrailingSlash",[89,1419,1420],{"class":99},"(pageData.filePath.",[89,1422,1423],{"class":126},"replace",[89,1425,1426],{"class":99},"(",[89,1428,1429],{"class":106},"\u002F",[89,1431,1433],{"class":1432},"s3JiQ","(index)",[89,1435,1436],{"class":95},"?",[89,1438,1440],{"class":1439},"sujWL","\\.",[89,1442,724],{"class":1432},[89,1444,1445],{"class":95},"$",[89,1447,1429],{"class":106},[89,1449,1409],{"class":99},[89,1451,1452],{"class":106},"''",[89,1454,1455],{"class":99},")),\n",[89,1457,1458],{"class":91,"line":1003},[89,1459,1460],{"class":99},"        ),\n",[89,1462,1463],{"class":91,"line":1010},[89,1464,1465],{"class":99},"      },\n",[89,1467,1468],{"class":91,"line":1015},[89,1469,1470],{"class":99},"    ])\n",[89,1472,1473],{"class":91,"line":1026},[89,1474,114],{"emptyLinePlaceholder":113},[89,1476,1477,1479,1481],{"class":91,"line":1031},[89,1478,927],{"class":99},[89,1480,930],{"class":126},[89,1482,1369],{"class":99},[89,1484,1485,1488],{"class":91,"line":1044},[89,1486,1487],{"class":106},"      'meta'",[89,1489,142],{"class":99},[89,1491,1492],{"class":91,"line":1049},[89,1493,1381],{"class":99},[89,1495,1496,1499,1502],{"class":91,"line":1054},[89,1497,1498],{"class":99},"        property: ",[89,1500,1501],{"class":106},"'og:url'",[89,1503,142],{"class":99},[89,1505,1506,1509,1511],{"class":91,"line":1059},[89,1507,1508],{"class":99},"        content: ",[89,1510,1399],{"class":126},[89,1512,933],{"class":99},[89,1514,1515,1517,1519],{"class":91,"line":1066},[89,1516,1406],{"class":106},[89,1518,1409],{"class":99},[89,1520,1412],{"class":200},[89,1522,1523,1525,1527,1529,1531,1533,1535,1537,1539,1541,1543,1545,1547,1549],{"class":91,"line":1071},[89,1524,1417],{"class":126},[89,1526,1420],{"class":99},[89,1528,1423],{"class":126},[89,1530,1426],{"class":99},[89,1532,1429],{"class":106},[89,1534,1433],{"class":1432},[89,1536,1436],{"class":95},[89,1538,1440],{"class":1439},[89,1540,724],{"class":1432},[89,1542,1445],{"class":95},[89,1544,1429],{"class":106},[89,1546,1409],{"class":99},[89,1548,1452],{"class":106},[89,1550,1455],{"class":99},[89,1552,1553],{"class":91,"line":1081},[89,1554,1460],{"class":99},[89,1556,1557],{"class":91,"line":1086},[89,1558,1465],{"class":99},[89,1560,1561],{"class":91,"line":1102},[89,1562,1470],{"class":99},[89,1564,1565],{"class":91,"line":1107},[89,1566,1176],{"class":99},[89,1568,1569],{"class":91,"line":1112},[89,1570,148],{"class":99},[10,1572,1207,1573,1575,1576,1578,1579,1582,1583,1586,1587,1590,1591,25,1594,1597],{},[71,1574,1399],{}," function combines the website's base URL with the page's path, addressing the ",[71,1577,1429],{}," to prevent ",[71,1580,1581],{},"\u002F\u002F"," in the URL. The ",[71,1584,1585],{},"withoutTrailingSlash"," function removes the trailing slash from the page's path. If you prefer a trailing slash, ",[71,1588,1589],{},"withTrailingSlash"," can be used alternatively. Additionally, ",[71,1592,1593],{},"index.md",[71,1595,1596],{},".md"," must be removed from the path to generate a clean URL.",[10,1599,1600,1601,1603],{},"Each page now features a ",[14,1602,701],{},". Inspect the generated HTML code to verify the implementation.",[80,1605,1607],{"className":244,"code":1606,"filename":1593,"language":247,"meta":85,"style":85},"\u003C!DOCTYPE html>\n\u003Chtml lang=\"en-US\" dir=\"ltr\">\n  \u003Chead>\n    \u003Cmeta charset=\"utf-8\">\n    \u003Cmeta name=\"viewport\" content=\"width=device-width,initial-scale=1\">\n    \u003Ctitle>My Awesome Blog Post | Garabit\u003C\u002Ftitle>\n    \u003Cmeta name=\"description\" content=\"A blog post that will change your life\">\n    \u003Cmeta name=\"twitter:site\" content=\"@soubiran_\">\n    \u003Cmeta name=\"twitter:card\" content=\"summary_large_image\">\n    \u003Cmeta property=\"og:image:width\" content=\"1200\">\n    \u003Cmeta property=\"og:image:height\" content=\"630\">\n    \u003Cmeta property=\"og:image:type\" content=\"image\u002Fpng\">\n    \u003Cmeta property=\"og:site_name\" content=\"Garabit\">\n    \u003Cmeta property=\"og:type\" content=\"website\">\n    \u003Cmeta property=\"og:url\" content=\"https:\u002F\u002Fgarabit.barbapapazes.dev\">\n    \u003Cmeta property=\"og:title\" content=\"My Awesome Blog Post\">\n    \u003Cmeta name=\"twitter:title\" content=\"My Awesome Blog Post\">\n    \u003Cmeta property=\"og:description\" content=\"A blog post that will change your life\">\n    \u003Cmeta name=\"twitter:description\" content=\"A blog post that will change your life\">\n    \u003Clink rel=\"canonical\" href=\"https:\u002F\u002Fgarabit.barbapapazes.dev\u002Fmy-awesome-blog-post\"> \u002F\u002F [!code highlight]\n    \u003C!-- ... -->\n  \u003C\u002Fhead>\n\u003C\u002Fhtml>\n",[71,1608,1609,1619,1639,1647,1661,1681,1694,1715,1737,1759,1782,1804,1826,1848,1870,1892,1914,1935,1956,1977,2002,2006,2014],{"__ignoreMap":85},[89,1610,1611,1613,1615,1617],{"class":91,"line":92},[89,1612,254],{"class":99},[89,1614,258],{"class":257},[89,1616,261],{"class":126},[89,1618,264],{"class":99},[89,1620,1621,1623,1625,1627,1629,1631,1633,1635,1637],{"class":91,"line":110},[89,1622,269],{"class":99},[89,1624,247],{"class":257},[89,1626,274],{"class":126},[89,1628,277],{"class":99},[89,1630,280],{"class":106},[89,1632,283],{"class":126},[89,1634,277],{"class":99},[89,1636,288],{"class":106},[89,1638,264],{"class":99},[89,1640,1641,1643,1645],{"class":91,"line":117},[89,1642,296],{"class":99},[89,1644,299],{"class":257},[89,1646,264],{"class":99},[89,1648,1649,1651,1653,1655,1657,1659],{"class":91,"line":133},[89,1650,306],{"class":99},[89,1652,309],{"class":257},[89,1654,312],{"class":126},[89,1656,277],{"class":99},[89,1658,317],{"class":106},[89,1660,264],{"class":99},[89,1662,1663,1665,1667,1669,1671,1673,1675,1677,1679],{"class":91,"line":145},[89,1664,306],{"class":99},[89,1666,309],{"class":257},[89,1668,328],{"class":126},[89,1670,277],{"class":99},[89,1672,333],{"class":106},[89,1674,336],{"class":126},[89,1676,277],{"class":99},[89,1678,341],{"class":106},[89,1680,264],{"class":99},[89,1682,1683,1685,1687,1690,1692],{"class":91,"line":214},[89,1684,306],{"class":99},[89,1686,154],{"class":257},[89,1688,1689],{"class":99},">My Awesome Blog Post | Garabit\u003C\u002F",[89,1691,154],{"class":257},[89,1693,264],{"class":99},[89,1695,1696,1698,1700,1702,1704,1706,1708,1710,1713],{"class":91,"line":225},[89,1697,306],{"class":99},[89,1699,309],{"class":257},[89,1701,328],{"class":126},[89,1703,277],{"class":99},[89,1705,369],{"class":106},[89,1707,336],{"class":126},[89,1709,277],{"class":99},[89,1711,1712],{"class":106},"\"A blog post that will change your life\"",[89,1714,264],{"class":99},[89,1716,1717,1719,1721,1723,1725,1728,1730,1732,1735],{"class":91,"line":381},[89,1718,306],{"class":99},[89,1720,309],{"class":257},[89,1722,328],{"class":126},[89,1724,277],{"class":99},[89,1726,1727],{"class":106},"\"twitter:site\"",[89,1729,336],{"class":126},[89,1731,277],{"class":99},[89,1733,1734],{"class":106},"\"@soubiran_\"",[89,1736,264],{"class":99},[89,1738,1739,1741,1743,1745,1747,1750,1752,1754,1757],{"class":91,"line":404},[89,1740,306],{"class":99},[89,1742,309],{"class":257},[89,1744,328],{"class":126},[89,1746,277],{"class":99},[89,1748,1749],{"class":106},"\"twitter:card\"",[89,1751,336],{"class":126},[89,1753,277],{"class":99},[89,1755,1756],{"class":106},"\"summary_large_image\"",[89,1758,264],{"class":99},[89,1760,1761,1763,1765,1768,1770,1773,1775,1777,1780],{"class":91,"line":410},[89,1762,306],{"class":99},[89,1764,309],{"class":257},[89,1766,1767],{"class":126}," property",[89,1769,277],{"class":99},[89,1771,1772],{"class":106},"\"og:image:width\"",[89,1774,336],{"class":126},[89,1776,277],{"class":99},[89,1778,1779],{"class":106},"\"1200\"",[89,1781,264],{"class":99},[89,1783,1784,1786,1788,1790,1792,1795,1797,1799,1802],{"class":91,"line":420},[89,1785,306],{"class":99},[89,1787,309],{"class":257},[89,1789,1767],{"class":126},[89,1791,277],{"class":99},[89,1793,1794],{"class":106},"\"og:image:height\"",[89,1796,336],{"class":126},[89,1798,277],{"class":99},[89,1800,1801],{"class":106},"\"630\"",[89,1803,264],{"class":99},[89,1805,1806,1808,1810,1812,1814,1817,1819,1821,1824],{"class":91,"line":621},[89,1807,306],{"class":99},[89,1809,309],{"class":257},[89,1811,1767],{"class":126},[89,1813,277],{"class":99},[89,1815,1816],{"class":106},"\"og:image:type\"",[89,1818,336],{"class":126},[89,1820,277],{"class":99},[89,1822,1823],{"class":106},"\"image\u002Fpng\"",[89,1825,264],{"class":99},[89,1827,1828,1830,1832,1834,1836,1839,1841,1843,1846],{"class":91,"line":640},[89,1829,306],{"class":99},[89,1831,309],{"class":257},[89,1833,1767],{"class":126},[89,1835,277],{"class":99},[89,1837,1838],{"class":106},"\"og:site_name\"",[89,1840,336],{"class":126},[89,1842,277],{"class":99},[89,1844,1845],{"class":106},"\"Garabit\"",[89,1847,264],{"class":99},[89,1849,1850,1852,1854,1856,1858,1861,1863,1865,1868],{"class":91,"line":646},[89,1851,306],{"class":99},[89,1853,309],{"class":257},[89,1855,1767],{"class":126},[89,1857,277],{"class":99},[89,1859,1860],{"class":106},"\"og:type\"",[89,1862,336],{"class":126},[89,1864,277],{"class":99},[89,1866,1867],{"class":106},"\"website\"",[89,1869,264],{"class":99},[89,1871,1872,1874,1876,1878,1880,1883,1885,1887,1890],{"class":91,"line":963},[89,1873,306],{"class":99},[89,1875,309],{"class":257},[89,1877,1767],{"class":126},[89,1879,277],{"class":99},[89,1881,1882],{"class":106},"\"og:url\"",[89,1884,336],{"class":126},[89,1886,277],{"class":99},[89,1888,1889],{"class":106},"\"https:\u002F\u002Fgarabit.barbapapazes.dev\"",[89,1891,264],{"class":99},[89,1893,1894,1896,1898,1900,1902,1905,1907,1909,1912],{"class":91,"line":969},[89,1895,306],{"class":99},[89,1897,309],{"class":257},[89,1899,1767],{"class":126},[89,1901,277],{"class":99},[89,1903,1904],{"class":106},"\"og:title\"",[89,1906,336],{"class":126},[89,1908,277],{"class":99},[89,1910,1911],{"class":106},"\"My Awesome Blog Post\"",[89,1913,264],{"class":99},[89,1915,1916,1918,1920,1922,1924,1927,1929,1931,1933],{"class":91,"line":986},[89,1917,306],{"class":99},[89,1919,309],{"class":257},[89,1921,328],{"class":126},[89,1923,277],{"class":99},[89,1925,1926],{"class":106},"\"twitter:title\"",[89,1928,336],{"class":126},[89,1930,277],{"class":99},[89,1932,1911],{"class":106},[89,1934,264],{"class":99},[89,1936,1937,1939,1941,1943,1945,1948,1950,1952,1954],{"class":91,"line":992},[89,1938,306],{"class":99},[89,1940,309],{"class":257},[89,1942,1767],{"class":126},[89,1944,277],{"class":99},[89,1946,1947],{"class":106},"\"og:description\"",[89,1949,336],{"class":126},[89,1951,277],{"class":99},[89,1953,1712],{"class":106},[89,1955,264],{"class":99},[89,1957,1958,1960,1962,1964,1966,1969,1971,1973,1975],{"class":91,"line":998},[89,1959,306],{"class":99},[89,1961,309],{"class":257},[89,1963,328],{"class":126},[89,1965,277],{"class":99},[89,1967,1968],{"class":106},"\"twitter:description\"",[89,1970,336],{"class":126},[89,1972,277],{"class":99},[89,1974,1712],{"class":106},[89,1976,264],{"class":99},[89,1978,1979,1981,1984,1987,1989,1992,1995,1997,2000],{"class":91,"line":1003},[89,1980,306],{"class":99},[89,1982,1983],{"class":257},"link",[89,1985,1986],{"class":126}," rel",[89,1988,277],{"class":99},[89,1990,1991],{"class":106},"\"canonical\"",[89,1993,1994],{"class":126}," href",[89,1996,277],{"class":99},[89,1998,1999],{"class":106},"\"https:\u002F\u002Fgarabit.barbapapazes.dev\u002Fmy-awesome-blog-post\"",[89,2001,291],{"class":99},[89,2003,2004],{"class":91,"line":1010},[89,2005,407],{"class":200},[89,2007,2008,2010,2012],{"class":91,"line":1015},[89,2009,413],{"class":99},[89,2011,299],{"class":257},[89,2013,264],{"class":99},[89,2015,2016,2018,2020],{"class":91,"line":1026},[89,2017,423],{"class":99},[89,2019,247],{"class":257},[89,2021,264],{"class":99},[10,2023,2024,2025,2028,2029,2031,2032,2035,2036,2039,2040,2043,2044,2047,2048,2051,2052,2054,2055,2057],{},"Concerning clean URLs, you might notice the ",[71,2026,2027],{},".html"," extension at our URLs' end. ",[14,2030,434],{}," generates HTML files for each Markdown file, simplifying deployment since the path ",[71,2033,2034],{},"\u002Fmy-exceptional-blog-post.html"," directly correlates to the ",[71,2037,2038],{},"my-exceptional-blog-post.html"," file. However, this isn't very ",[14,2041,2042],{},"SEO-friendly"," or visually appealing. By setting ",[71,2045,2046],{},"cleanUrls"," to ",[71,2049,2050],{},"true"," in the ",[71,2053,77],{}," file, we can eliminate the ",[71,2056,2027],{}," extension from the URL:",[80,2059,2061],{"className":82,"code":2060,"filename":77,"language":84,"meta":85,"style":85},"import { defineConfig } from 'vitepress'\n\nexport default defineConfig({\n  \u002F\u002F ...\n  cleanUrls: true,\n})\n",[71,2062,2063,2073,2077,2087,2091,2100],{"__ignoreMap":85},[89,2064,2065,2067,2069,2071],{"class":91,"line":92},[89,2066,96],{"class":95},[89,2068,100],{"class":99},[89,2070,103],{"class":95},[89,2072,107],{"class":106},[89,2074,2075],{"class":91,"line":110},[89,2076,114],{"emptyLinePlaceholder":113},[89,2078,2079,2081,2083,2085],{"class":91,"line":117},[89,2080,120],{"class":95},[89,2082,123],{"class":95},[89,2084,127],{"class":126},[89,2086,130],{"class":99},[89,2088,2089],{"class":91,"line":133},[89,2090,201],{"class":200},[89,2092,2093,2096,2098],{"class":91,"line":145},[89,2094,2095],{"class":99},"  cleanUrls: ",[89,2097,2050],{"class":1261},[89,2099,142],{"class":99},[89,2101,2102],{"class":91,"line":214},[89,2103,148],{"class":99},[10,2105,2106,2107,2110,2111,2113,2114,1409,2117,2120,2121,2124],{},"When this setting is enabled, the server must be configured to serve the ",[71,2108,2109],{},"\u002Fmy-exceptional-blog-post"," URL with the ",[71,2112,2038],{}," file, without a redirect. Most deployment services like ",[14,2115,2116],{},"Cloudflare Pages",[14,2118,2119],{},"Vercel",", or ",[14,2122,2123],{},"Netlify"," accommodate this. Custom servers may need reverse proxy configuration adjustments.",[35,2126,2129],{"color":2127,"icon":2128},"warning","i-ph-warning-duotone",[10,2130,2131,2132,2135,2136,2138],{},"Always ensure the ",[14,2133,2134],{},"canonical URL matches the server-served URL",". If you opt not to enable this setting, append the ",[71,2137,2027],{}," extension to the canonical URL.",[52,2140,2142],{"id":2141},"sitemap","Sitemap",[10,2144,2145,2146,2148,2149,2151,2152,2155],{},"A ",[14,2147,2141],{}," assists ",[14,2150,20],{}," in indexing a website. It's an ",[14,2153,2154],{},"XML file"," listing all website URLs, allowing search engines to efficiently discover new URLs without entirely crawling the site.",[10,2157,2158,2160,2161,2163,2164,78],{},[14,2159,434],{}," simplifies ",[14,2162,2141],{}," generation. Just add three lines of code in the ",[71,2165,77],{},[80,2167,2169],{"className":82,"code":2168,"filename":77,"language":84,"meta":85,"style":85},"import { defineConfig } from 'vitepress'\n\nexport default defineConfig({\n  \u002F\u002F ...\n  sitemap: {\n    hostname: 'https:\u002F\u002Fgarabit.barbapapazes.dev', \u002F\u002F Please, change this before deploying\n  },\n})\n",[71,2170,2171,2181,2185,2195,2199,2204,2216,2220],{"__ignoreMap":85},[89,2172,2173,2175,2177,2179],{"class":91,"line":92},[89,2174,96],{"class":95},[89,2176,100],{"class":99},[89,2178,103],{"class":95},[89,2180,107],{"class":106},[89,2182,2183],{"class":91,"line":110},[89,2184,114],{"emptyLinePlaceholder":113},[89,2186,2187,2189,2191,2193],{"class":91,"line":117},[89,2188,120],{"class":95},[89,2190,123],{"class":95},[89,2192,127],{"class":126},[89,2194,130],{"class":99},[89,2196,2197],{"class":91,"line":133},[89,2198,201],{"class":200},[89,2200,2201],{"class":91,"line":145},[89,2202,2203],{"class":99},"  sitemap: {\n",[89,2205,2206,2209,2212,2214],{"class":91,"line":214},[89,2207,2208],{"class":99},"    hostname: ",[89,2210,2211],{"class":106},"'https:\u002F\u002Fgarabit.barbapapazes.dev'",[89,2213,1409],{"class":99},[89,2215,527],{"class":200},[89,2217,2218],{"class":91,"line":225},[89,2219,1176],{"class":99},[89,2221,2222],{"class":91,"line":381},[89,2223,148],{"class":99},[10,2225,2226,2227,2230,2231,2233,2234,2237,2238,2241,2242,234],{},"This will produce a ",[71,2228,2229],{},"sitemap.xml"," file in the ",[71,2232,240],{}," directory when building the website with ",[71,2235,2236],{},"pnpm run build",". You can submit this file to the ",[14,2239,2240],{},"SEO console"," of your preferred ",[14,2243,2244],{},"search engine",[80,2246,2250],{"className":2247,"code":2248,"filename":246,"language":2249,"meta":85,"style":85},"language-xml shiki shiki-themes github-light github-light github-dark","\u003C?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\u003Curlset\n  xmlns=\"http:\u002F\u002Fwww.sitemaps.org\u002Fschemas\u002Fsitemap\u002F0.9\"\n  xmlns:news=\"http:\u002F\u002Fwww.google.com\u002Fschemas\u002Fsitemap-news\u002F0.9\"\n  xmlns:xhtml=\"http:\u002F\u002Fwww.w3.org\u002F1999\u002Fxhtml\"\n  xmlns:image=\"http:\u002F\u002Fwww.google.com\u002Fschemas\u002Fsitemap-image\u002F1.1\"\n  xmlns:video=\"http:\u002F\u002Fwww.google.com\u002Fschemas\u002Fsitemap-video\u002F1.1\">\n  \u003Curl>\n    \u003Cloc>https:\u002F\u002Fgarabit.barbapapazes.dev\u002Fblog.html\u003C\u002Floc>\n  \u003C\u002Furl>\n  \u003Curl>\n    \u003Cloc>https:\u002F\u002Fgarabit.barbapapazes.dev\u002Fblog\u002Fgetting-started-with-vue3-and-vite.html\u003C\u002Floc>\n  \u003C\u002Furl>\n  \u003Curl>\n    \u003Cloc>https:\u002F\u002Fgarabit.barbapapazes.dev\u002Fblog\u002Fgetting-started-with-laravel.html\u003C\u002Floc>\n  \u003C\u002Furl>\n  \u003Curl>\n    \u003Cloc>https:\u002F\u002Fgarabit.barbapapazes.dev\u002F\u003C\u002Floc>\n  \u003C\u002Furl>\n\u003C\u002Furlset>\n","xml",[71,2251,2252,2257,2262,2267,2272,2277,2282,2287,2292,2297,2302,2306,2311,2315,2319,2324,2328,2332,2337,2341],{"__ignoreMap":85},[89,2253,2254],{"class":91,"line":92},[89,2255,2256],{},"\u003C?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",[89,2258,2259],{"class":91,"line":110},[89,2260,2261],{},"\u003Curlset\n",[89,2263,2264],{"class":91,"line":117},[89,2265,2266],{},"  xmlns=\"http:\u002F\u002Fwww.sitemaps.org\u002Fschemas\u002Fsitemap\u002F0.9\"\n",[89,2268,2269],{"class":91,"line":133},[89,2270,2271],{},"  xmlns:news=\"http:\u002F\u002Fwww.google.com\u002Fschemas\u002Fsitemap-news\u002F0.9\"\n",[89,2273,2274],{"class":91,"line":145},[89,2275,2276],{},"  xmlns:xhtml=\"http:\u002F\u002Fwww.w3.org\u002F1999\u002Fxhtml\"\n",[89,2278,2279],{"class":91,"line":214},[89,2280,2281],{},"  xmlns:image=\"http:\u002F\u002Fwww.google.com\u002Fschemas\u002Fsitemap-image\u002F1.1\"\n",[89,2283,2284],{"class":91,"line":225},[89,2285,2286],{},"  xmlns:video=\"http:\u002F\u002Fwww.google.com\u002Fschemas\u002Fsitemap-video\u002F1.1\">\n",[89,2288,2289],{"class":91,"line":381},[89,2290,2291],{},"  \u003Curl>\n",[89,2293,2294],{"class":91,"line":404},[89,2295,2296],{},"    \u003Cloc>https:\u002F\u002Fgarabit.barbapapazes.dev\u002Fblog.html\u003C\u002Floc>\n",[89,2298,2299],{"class":91,"line":410},[89,2300,2301],{},"  \u003C\u002Furl>\n",[89,2303,2304],{"class":91,"line":420},[89,2305,2291],{},[89,2307,2308],{"class":91,"line":621},[89,2309,2310],{},"    \u003Cloc>https:\u002F\u002Fgarabit.barbapapazes.dev\u002Fblog\u002Fgetting-started-with-vue3-and-vite.html\u003C\u002Floc>\n",[89,2312,2313],{"class":91,"line":640},[89,2314,2301],{},[89,2316,2317],{"class":91,"line":646},[89,2318,2291],{},[89,2320,2321],{"class":91,"line":963},[89,2322,2323],{},"    \u003Cloc>https:\u002F\u002Fgarabit.barbapapazes.dev\u002Fblog\u002Fgetting-started-with-laravel.html\u003C\u002Floc>\n",[89,2325,2326],{"class":91,"line":969},[89,2327,2301],{},[89,2329,2330],{"class":91,"line":986},[89,2331,2291],{},[89,2333,2334],{"class":91,"line":992},[89,2335,2336],{},"    \u003Cloc>https:\u002F\u002Fgarabit.barbapapazes.dev\u002F\u003C\u002Floc>\n",[89,2338,2339],{"class":91,"line":998},[89,2340,2301],{},[89,2342,2343],{"class":91,"line":1003},[89,2344,2345],{},"\u003C\u002Furlset>\n",[10,2347,2348,2349,2351,2352,2354],{},"And there you have it, the ",[14,2350,2141],{}," is primed for inclusion in the ",[14,2353,2240],{}," of your choice.",[52,2356,2358],{"id":2357},"layout-automation","Layout automation",[10,2360,2361,2362,2365,2366,2369],{},"To conclude this section, let's streamline our blog's article layout. Previously, we needed to manually set the ",[71,2363,2364],{},"layout"," key to ",[71,2367,2368],{},"blog-show"," in each article's frontmatter. While not challenging, this step is forgettable and repetitive across articles, much like metadata.",[10,2371,2372,2373,2375,2376,2378,2379,2382,2383,241],{},"To automate this, reuse the ",[71,2374,833],{}," option to insert the ",[71,2377,2364],{}," key into the frontmatter of each article, verifying if the ",[71,2380,2381],{},"filePath"," is located in the ",[71,2384,2385],{},"src\u002Fblog",[80,2387,2389],{"className":82,"code":2388,"filename":246,"language":84,"meta":85,"style":85},"import { defineConfig } from 'vitepress'\n\nexport default defineConfig({\n  \u002F\u002F ...\n  transformPageData: (page) => {\n    \u002F\u002F Set layout for blog articles\n    if (pageData.filePath.startsWith('blog\u002F')) {\n      pageData.frontmatter.layout = 'blog-show'\n    }\n  },\n})\n",[71,2390,2391,2401,2405,2415,2419,2433,2438,2457,2467,2472,2476],{"__ignoreMap":85},[89,2392,2393,2395,2397,2399],{"class":91,"line":92},[89,2394,96],{"class":95},[89,2396,100],{"class":99},[89,2398,103],{"class":95},[89,2400,107],{"class":106},[89,2402,2403],{"class":91,"line":110},[89,2404,114],{"emptyLinePlaceholder":113},[89,2406,2407,2409,2411,2413],{"class":91,"line":117},[89,2408,120],{"class":95},[89,2410,123],{"class":95},[89,2412,127],{"class":126},[89,2414,130],{"class":99},[89,2416,2417],{"class":91,"line":133},[89,2418,201],{"class":200},[89,2420,2421,2423,2425,2427,2429,2431],{"class":91,"line":145},[89,2422,875],{"class":126},[89,2424,878],{"class":99},[89,2426,882],{"class":881},[89,2428,1326],{"class":99},[89,2430,894],{"class":95},[89,2432,897],{"class":99},[89,2434,2435],{"class":91,"line":214},[89,2436,2437],{"class":200},"    \u002F\u002F Set layout for blog articles\n",[89,2439,2440,2443,2446,2449,2451,2454],{"class":91,"line":225},[89,2441,2442],{"class":95},"    if",[89,2444,2445],{"class":99}," (pageData.filePath.",[89,2447,2448],{"class":126},"startsWith",[89,2450,1426],{"class":99},[89,2452,2453],{"class":106},"'blog\u002F'",[89,2455,2456],{"class":99},")) {\n",[89,2458,2459,2462,2464],{"class":91,"line":381},[89,2460,2461],{"class":99},"      pageData.frontmatter.layout ",[89,2463,277],{"class":95},[89,2465,2466],{"class":106}," 'blog-show'\n",[89,2468,2469],{"class":91,"line":404},[89,2470,2471],{"class":99},"    }\n",[89,2473,2474],{"class":91,"line":410},[89,2475,1176],{"class":99},[89,2477,2478],{"class":91,"line":420},[89,2479,148],{"class":99},[10,2481,2482,2483,2485],{},"This approach allows for removing the ",[71,2484,2364],{}," key from each article's frontmatter, reducing oversight risks and minimizing redundancy. This exemplifies the strength of automation!",[2487,2488,2489],"style",{},"html pre.shiki code .s8jYJ, html code.shiki .s8jYJ{--shiki-light:#D73A49;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sxrX7, html code.shiki .sxrX7{--shiki-light:#24292E;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sIIMD, html code.shiki .sIIMD{--shiki-light:#032F62;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .snPdu, html code.shiki .snPdu{--shiki-light:#6F42C1;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sCsY4, html code.shiki .sCsY4{--shiki-light:#6A737D;--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .sovSZ, html code.shiki .sovSZ{--shiki-light:#22863A;--shiki-default:#22863A;--shiki-dark:#85E89D}html pre.shiki code .sP4rz, html code.shiki .sP4rz{--shiki-light:#E36209;--shiki-default:#E36209;--shiki-dark:#FFAB70}html pre.shiki code .sBjJW, html code.shiki .sBjJW{--shiki-light:#005CC5;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .s3JiQ, html code.shiki .s3JiQ{--shiki-light:#032F62;--shiki-default:#032F62;--shiki-dark:#DBEDFF}html pre.shiki code .sujWL, html code.shiki .sujWL{--shiki-light:#22863A;--shiki-light-font-weight:bold;--shiki-default:#22863A;--shiki-default-font-weight:bold;--shiki-dark:#85E89D;--shiki-dark-font-weight:bold}",{"title":85,"searchDepth":110,"depth":110,"links":2491},[2492,2493,2494,2497,2498],{"id":54,"depth":110,"text":55},{"id":441,"depth":110,"text":442},{"id":687,"depth":110,"text":688,"children":2495},[2496],{"id":1203,"depth":117,"text":1204},{"id":2141,"depth":110,"text":2142},{"id":2357,"depth":110,"text":2358},"66af9aaf-d6d3-4151-a51b-806835988340","2024-10-29","Enhance website traffic through strategic SEO metadata and sitemaps for improved indexing. Learn how to automate metadata generation for each page.",{"branch":2503},"06.seo-metadata-and-sitemap",null,{},"\u002Fseries\u002Fcreate-a-blog-with-vitepress-and-vue-js-from-scratch\u002Fenhance-website-visibility-seo-metadata-and-sitemap","---\ncontentId: 66af9aaf-d6d3-4151-a51b-806835988340\npart: 6\ntitle: \"Enhance Website Visibility: SEO Metadata and Sitemap\"\ndescription: Enhance website traffic through strategic SEO metadata and sitemaps for improved indexing. Learn how to automate metadata generation for each page.\ngithub:\n  branch: 06.seo-metadata-and-sitemap\ndate: 2024-10-29\nseriesSlug: create-a-blog-with-vitepress-and-vue-js-from-scratch\n---\n\nFor a content-focused website, **Search Engine Optimization (SEO)** is essential. It enables users to find and access your content via **search engines** like **Google** or **Bing**, which is the aim of this blog. _If this is not your objective, feel free to skip this article._\n\n::callout{icon=\"i-ph-info-duotone\" color=\"info\"}\n**Search Engine Optimization (SEO)** enhances the quality and quantity of website traffic from **search engines**. It focuses on **organic traffic** instead of direct or paid traffic.\n::\n\n## The fundamentals\n\nLet us begin by integrating basic **metadata** into our website.\n\nInitially, we must specify the **language** of our website by adding the `lang` key in the `config.mts` file:\n\n```ts [config.mts]\nimport { defineConfig } from 'vitepress'\n\nexport default defineConfig({\n  lang: 'en-US',\n})\n```\n\nNext, we establish the **title** and **description** of our website by inserting the `title` and `description` keys in the `config.mts` file:\n\n```ts [config.mts]\nimport { defineConfig } from 'vitepress'\n\nexport default defineConfig({\n  \u002F\u002F ...\n  title: 'Garabit',\n  description: 'A place that reflects my thoughts and ideas',\n})\n```\n\nThe title will also serve as the suffix for each page's title. For instance, the title of the blog page will be `Blog | Garabit`.\n\nWe can verify these additions by examining the generated HTML code in the `.vitepress\u002Fdist` directory.\n\n```html [Example]\n\u003C!DOCTYPE html>\n\u003Chtml lang=\"en-US\" dir=\"ltr\"> \u002F\u002F [!code highlight]\n  \u003Chead>\n    \u003Cmeta charset=\"utf-8\">\n    \u003Cmeta name=\"viewport\" content=\"width=device-width,initial-scale=1\">\n    \u003Ctitle>Blog | Garabit\u003C\u002Ftitle> \u002F\u002F [!code highlight]\n    \u003Cmeta name=\"description\" content=\"The latest articles, tutorials, and resources on web development, programming, and more.\"> \u002F\u002F [!code highlight]\n    \u003Cmeta name=\"generator\" content=\"VitePress v1.4.1\">\n    \u003C!-- ... -->\n  \u003C\u002Fhead>\n\u003C\u002Fhtml>\n```\n\n::callout{icon=\"i-ph-info-duotone\" color=\"info\"}\n**VitePress** incorporates its own metadata into the generated HTML code, resulting in more `meta` tags than we manually added.\n::\n\n## Static metadata\n\nLet's now add some **static metadata** to enhance **SEO** capabilities. These metadata apply uniformly across all website pages.\n\nTo add static **metadata**, insert the `head` key in the `config.mts` file:\n\n```ts [config.mts]\nimport { defineConfig } from 'vitepress'\n\nexport default defineConfig({\n  \u002F\u002F ...\n  head: [\n    ['meta', { name: 'twitter:site', content: '@soubiran_' }], \u002F\u002F Please, change this before deploying\n    ['meta', { name: 'twitter:card', content: 'summary_large_image' }],\n    ['meta', { property: 'og:image:width', content: '1200' }],\n    ['meta', { property: 'og:image:height', content: '630' }],\n    ['meta', { property: 'og:image:type', content: 'image\u002Fpng' }],\n    ['meta', { property: 'og:site_name', content: 'Garabit' }],\n    ['meta', { property: 'og:type', content: 'website' }],\n  ],\n})\n```\n\nThese **metadata** are utilized by **social platforms** like **Twitter** and **Facebook** to display a preview of the website when shared. The `og` prefix indicates **Open Graph**, a protocol that enables web pages to become rich objects in a **social network**.\n\n::callout{icon=\"i-ph-info-duotone\" color=\"info\"}\nFuture articles will explore automatic **Open Graph image generation** for blog posts.\n::\n\n## Dynamic metadata\n\nFor optimal **SEO**, each page should feature an **Open Graph title**, description, and **canonical URL**. These are **dynamic metadata** and vary for each page.\n\nWe have two methods for adding **dynamic metadata** to our site:\n\n- In each Markdown file's frontmatter: Though simple, this method is not the most maintainable. Adding new metadata requires updating every Markdown file and writing YAML with nested arrays, which can be cumbersome.\n\n```md [Example]\n---\ntitle: My Awesome Blog Post\ndescription: A blog post that will change your life\nhead:\n  - - meta\n    - property: og:title\n      content: My Awesome Blog Post\n  - - meta\n    - property: og:description\n      content: A blog post that will change your life\n---\n```\n\nDue to redundancy and complexity, I wish to avoid this method.\n\nThankfully, a second method exists:\n\n- In the `config.mts` file: A more maintainable solution involves using the `transformPageData` option to insert **dynamic metadata** into each page, modifying the data prior to rendering.\n\n```ts [config.mts]\nimport { defineConfig } from 'vitepress'\n\nexport default defineConfig({\n  \u002F\u002F ...\n  transformPageData: (page, { siteConfig }) => {\n    \u002F\u002F Initialize the `head` frontmatter if it doesn't exist.\n    pageData.frontmatter.head ??= []\n\n    \u002F\u002F Add basic meta tags to the frontmatter.\n    pageData.frontmatter.head.push(\n      [\n        'meta',\n        {\n          property: 'og:title',\n          content:\n            pageData.frontmatter.title || pageData.title || siteConfig.site.title,\n        },\n      ],\n      [\n        'meta',\n        {\n          name: 'twitter:title',\n          content:\n            pageData.frontmatter.title || pageData.title || siteConfig.site.title,\n        },\n      ],\n      [\n        'meta',\n        {\n          property: 'og:description',\n          content:\n            pageData.frontmatter.description || pageData.description || siteConfig.site.description,\n        },\n      ],\n      [\n        'meta',\n        {\n          name: 'twitter:description',\n          content:\n            pageData.frontmatter.description || pageData.description || siteConfig.site.description,\n        },\n      ],\n    )\n  },\n})\n```\n\nThis approach is efficient, allowing for the addition of multiple **dynamic metadata** without modifying every Markdown file or duplicating metadata. In that case, we define some fallbacks in case the metadata is missing.\n\n::callout{icon=\"i-ph-info-duotone\" color=\"info\"}\nShould you wish to add more **dynamic metadata**, you can do so in the same manner as the **Open Graph metadata** using this technique.\n::\n\n### Canonical URL\n\nThe **canonical URL** specifies the preferred version of a web page, preventing duplicate content issues. Without it, **search engines** may struggle to identify the same page regardless of URL variations, potentially delaying indexing. This situation can occur more frequently than anticipated. For instance, a blog post shared in a newsletter could include a tracking parameter, leading the search engine to index the URL with the parameter instead of the original URL, or worse, not at all. Thus, it is crucial to add a **canonical URL** to each page.\n\nIn the `transformPageData` function, we can access the `path` of the page to infer the **canonical URL**.\n\nInitially, install the [ufo](https:\u002F\u002Fgithub.com\u002Funjs\u002Fufo) package, a URL manipulation library by **UnJS**:\n\n```bash [terminal]\npnpm add -D ufo\n```\n\nNext, employ this package to craft the **canonical URL**:\n\n```ts [Example]\nimport { joinURL, withoutTrailingSlash } from 'ufo'\nimport { defineConfig } from 'vitepress'\n\nexport default defineConfig({\n  \u002F\u002F ...\n  transformPageData: (page) => {\n    \u002F\u002F Initialize the `head` frontmatter if it doesn't exist.\n    pageData.frontmatter.head ??= []\n\n    \u002F\u002F ...\n\n    \u002F\u002F Create the canonical URL\n    pageData.frontmatter.head.push([\n      'link',\n      {\n        rel: 'canonical',\n        href: joinURL(\n          'https:\u002F\u002Fgarabit.barbapapazes.dev', \u002F\u002F Modify this prior to deployment\n          withoutTrailingSlash(pageData.filePath.replace(\u002F(index)?\\.md$\u002F, '')),\n        ),\n      },\n    ])\n\n    pageData.frontmatter.head.push([\n      'meta',\n      {\n        property: 'og:url',\n        content: joinURL(\n          'https:\u002F\u002Fgarabit.barbapapazes.dev', \u002F\u002F Modify this prior to deployment\n          withoutTrailingSlash(pageData.filePath.replace(\u002F(index)?\\.md$\u002F, '')),\n        ),\n      },\n    ])\n  },\n})\n```\n\nThe `joinURL` function combines the website's base URL with the page's path, addressing the `\u002F` to prevent `\u002F\u002F` in the URL. The `withoutTrailingSlash` function removes the trailing slash from the page's path. If you prefer a trailing slash, `withTrailingSlash` can be used alternatively. Additionally, `index.md` or `.md` must be removed from the path to generate a clean URL.\n\nEach page now features a **canonical URL**. Inspect the generated HTML code to verify the implementation.\n\n```html [index.md]\n\u003C!DOCTYPE html>\n\u003Chtml lang=\"en-US\" dir=\"ltr\">\n  \u003Chead>\n    \u003Cmeta charset=\"utf-8\">\n    \u003Cmeta name=\"viewport\" content=\"width=device-width,initial-scale=1\">\n    \u003Ctitle>My Awesome Blog Post | Garabit\u003C\u002Ftitle>\n    \u003Cmeta name=\"description\" content=\"A blog post that will change your life\">\n    \u003Cmeta name=\"twitter:site\" content=\"@soubiran_\">\n    \u003Cmeta name=\"twitter:card\" content=\"summary_large_image\">\n    \u003Cmeta property=\"og:image:width\" content=\"1200\">\n    \u003Cmeta property=\"og:image:height\" content=\"630\">\n    \u003Cmeta property=\"og:image:type\" content=\"image\u002Fpng\">\n    \u003Cmeta property=\"og:site_name\" content=\"Garabit\">\n    \u003Cmeta property=\"og:type\" content=\"website\">\n    \u003Cmeta property=\"og:url\" content=\"https:\u002F\u002Fgarabit.barbapapazes.dev\">\n    \u003Cmeta property=\"og:title\" content=\"My Awesome Blog Post\">\n    \u003Cmeta name=\"twitter:title\" content=\"My Awesome Blog Post\">\n    \u003Cmeta property=\"og:description\" content=\"A blog post that will change your life\">\n    \u003Cmeta name=\"twitter:description\" content=\"A blog post that will change your life\">\n    \u003Clink rel=\"canonical\" href=\"https:\u002F\u002Fgarabit.barbapapazes.dev\u002Fmy-awesome-blog-post\"> \u002F\u002F [!code highlight]\n    \u003C!-- ... -->\n  \u003C\u002Fhead>\n\u003C\u002Fhtml>\n```\n\nConcerning clean URLs, you might notice the `.html` extension at our URLs' end. **VitePress** generates HTML files for each Markdown file, simplifying deployment since the path `\u002Fmy-exceptional-blog-post.html` directly correlates to the `my-exceptional-blog-post.html` file. However, this isn't very **SEO-friendly** or visually appealing. By setting `cleanUrls` to `true` in the `config.mts` file, we can eliminate the `.html` extension from the URL:\n\n```ts [config.mts]\nimport { defineConfig } from 'vitepress'\n\nexport default defineConfig({\n  \u002F\u002F ...\n  cleanUrls: true,\n})\n```\n\nWhen this setting is enabled, the server must be configured to serve the `\u002Fmy-exceptional-blog-post` URL with the `my-exceptional-blog-post.html` file, without a redirect. Most deployment services like **Cloudflare Pages**, **Vercel**, or **Netlify** accommodate this. Custom servers may need reverse proxy configuration adjustments.\n\n::callout{icon=\"i-ph-warning-duotone\" color=\"warning\"}\nAlways ensure the **canonical URL matches the server-served URL**. If you opt not to enable this setting, append the `.html` extension to the canonical URL.\n::\n\n## Sitemap\n\nA **sitemap** assists **search engines** in indexing a website. It's an **XML file** listing all website URLs, allowing search engines to efficiently discover new URLs without entirely crawling the site.\n\n**VitePress** simplifies **sitemap** generation. Just add three lines of code in the `config.mts` file:\n\n```ts [config.mts]\nimport { defineConfig } from 'vitepress'\n\nexport default defineConfig({\n  \u002F\u002F ...\n  sitemap: {\n    hostname: 'https:\u002F\u002Fgarabit.barbapapazes.dev', \u002F\u002F Please, change this before deploying\n  },\n})\n```\n\nThis will produce a `sitemap.xml` file in the `.vitepress\u002Fdist` directory when building the website with `pnpm run build`. You can submit this file to the **SEO console** of your preferred **search engine**.\n\n```xml [Example]\n\u003C?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\u003Curlset\n  xmlns=\"http:\u002F\u002Fwww.sitemaps.org\u002Fschemas\u002Fsitemap\u002F0.9\"\n  xmlns:news=\"http:\u002F\u002Fwww.google.com\u002Fschemas\u002Fsitemap-news\u002F0.9\"\n  xmlns:xhtml=\"http:\u002F\u002Fwww.w3.org\u002F1999\u002Fxhtml\"\n  xmlns:image=\"http:\u002F\u002Fwww.google.com\u002Fschemas\u002Fsitemap-image\u002F1.1\"\n  xmlns:video=\"http:\u002F\u002Fwww.google.com\u002Fschemas\u002Fsitemap-video\u002F1.1\">\n  \u003Curl>\n    \u003Cloc>https:\u002F\u002Fgarabit.barbapapazes.dev\u002Fblog.html\u003C\u002Floc>\n  \u003C\u002Furl>\n  \u003Curl>\n    \u003Cloc>https:\u002F\u002Fgarabit.barbapapazes.dev\u002Fblog\u002Fgetting-started-with-vue3-and-vite.html\u003C\u002Floc>\n  \u003C\u002Furl>\n  \u003Curl>\n    \u003Cloc>https:\u002F\u002Fgarabit.barbapapazes.dev\u002Fblog\u002Fgetting-started-with-laravel.html\u003C\u002Floc>\n  \u003C\u002Furl>\n  \u003Curl>\n    \u003Cloc>https:\u002F\u002Fgarabit.barbapapazes.dev\u002F\u003C\u002Floc>\n  \u003C\u002Furl>\n\u003C\u002Furlset>\n```\n\nAnd there you have it, the **sitemap** is primed for inclusion in the **SEO console** of your choice.\n\n## Layout automation\n\nTo conclude this section, let's streamline our blog's article layout. Previously, we needed to manually set the `layout` key to `blog-show` in each article's frontmatter. While not challenging, this step is forgettable and repetitive across articles, much like metadata.\n\nTo automate this, reuse the `transformPageData` option to insert the `layout` key into the frontmatter of each article, verifying if the `filePath` is located in the `src\u002Fblog` directory.\n\n```ts [Example]\nimport { defineConfig } from 'vitepress'\n\nexport default defineConfig({\n  \u002F\u002F ...\n  transformPageData: (page) => {\n    \u002F\u002F Set layout for blog articles\n    if (pageData.filePath.startsWith('blog\u002F')) {\n      pageData.frontmatter.layout = 'blog-show'\n    }\n  },\n})\n```\n\nThis approach allows for removing the `layout` key from each article's frontmatter, reducing oversight risks and minimizing redundancy. This exemplifies the strength of automation!\n",{"title":5,"description":2501},"create-a-blog-with-vitepress-and-vue-js-from-scratch",{"loc":2506},"series\u002Fcreate-a-blog-with-vitepress-and-vue-js-from-scratch\u002Fenhance-website-visibility-seo-metadata-and-sitemap","je62jbKWzfBQN0nA7k9FvCOp4cmpyxAuxxfPOG_hWDY",{"overview":2514,"chapters":2751},{"id":2515,"title":2516,"body":2517,"contentId":2731,"date":2732,"description":2733,"extension":724,"github":2734,"meetTheInstructor":2737,"meta":2738,"navigation":113,"part":2504,"path":2739,"rawbody":2740,"robots":2504,"schemaOrg":2504,"seo":2741,"seriesSlug":2509,"sitemap":2742,"stem":2745,"subtitle":2746,"topics":2747,"__hash__":2750},"series\u002Fseries\u002Fcreate-a-blog-with-vitepress-and-vue-js-from-scratch.md","Create a Blog with VitePress and Vue.js from Scratch",{"type":7,"value":2518,"toc":2728},[2519,2522,2535,2548,2683,2694,2705,2712,2715,2718,2722],[10,2520,2521],{},"Hello and welcome! 👋",[10,2523,2524,2525,2528,2529,155,2531,2534],{},"You're about to embark on the \"Create a ",[14,2526,2527],{},"Blog"," with ",[14,2530,434],{},[14,2532,2533],{},"Vue.js"," from Scratch\" series!",[10,2536,2537,2538,2544,2545,2547],{},"Throughout this journey, we will construct a practical blog from the ground up using ",[1232,2539,2542],{"href":2540,"rel":2541},"https:\u002F\u002Fvitepress.dev\u002F",[1236],[14,2543,434],{},". We will explore a range of topics from initial configuration to deploying on ",[14,2546,2116],{},", including:",[714,2549,2550,2575,2584,2590,2603,2609,2619,2629,2639,2651,2668,2674],{},[717,2551,2552,2555,2556,2559,2560,155,2567,2574],{},[14,2553,2554],{},"Getting Started with VitePress: Project Setup and Essentials",": Learn to set up a fresh ",[14,2557,2558],{},"VitePress project"," by incorporating ",[1232,2561,2564],{"href":2562,"rel":2563},"https:\u002F\u002Ftailwindcss.com\u002F",[1236],[14,2565,2566],{},"Tailwind CSS",[1232,2568,2571],{"href":2569,"rel":2570},"https:\u002F\u002Fgithub.com\u002Funplugin\u002Funplugin-vue-components",[1236],[14,2572,2573],{},"unplugin-vue-components"," for an enhanced development process.",[717,2576,2577,2580,2581],{},[14,2578,2579],{},"From Default to Custom: Building a VitePress Blog Theme",": We will entirely remove the default theme and create a personalized theme. ",[31,2582,2583],{},"You'll be surprised by its simplicity!",[717,2585,2586,2589],{},[14,2587,2588],{},"Optimize Your VitePress Blog's Architecture Design",": Discover how to organize code and design your blog for scalability and maintainability.",[717,2591,2592,2595,2596,234],{},[14,2593,2594],{},"Implementing Blog Index with VitePress and Tailwind CSS",": Create a list of blog posts. This will introduce ",[1232,2597,2600],{"href":2598,"rel":2599},"https:\u002F\u002Fvitepress.dev\u002Fguide\u002Fdata-loading",[1236],[14,2601,2602],{},"data loaders from VitePress",[717,2604,2605,2608],{},[14,2606,2607],{},"Single Blog Rendering in VitePress with Tailwind Typography",": Create a page dedicated to reading each blog post.",[717,2610,2611,2614,2615,2618],{},[14,2612,2613],{},"Deploy VitePress Blog Globally with Cloudflare Pages",": Integrate ",[14,2616,2617],{},"SEO metadata"," for improved search engine visibility, eliminating the need for manual updates.",[717,2620,2621,2624,2625,2628],{},[14,2622,2623],{},"Showcase Your GitHub Projects on Your VitePress Blog",": Develop a page to display your ",[14,2626,2627],{},"GitHub"," endeavors, extending the use of data loaders and demonstrating their flexibility.",[717,2630,2631,2634,2635,2638],{},[14,2632,2633],{},"Creating Open Graph Images Automatically for Each Blog Post",": Efficiently create ",[14,2636,2637],{},"Open Graph images"," for each post, saving time and enhancing appeal.",[717,2640,2641,2643,2644,2650],{},[14,2642,2613],{},": Seamlessly deploy your blog to ",[1232,2645,2648],{"href":2646,"rel":2647},"https:\u002F\u002Fpages.cloudflare.com\u002F",[1236],[14,2649,2116],{},", achieving this in just a few clicks!",[717,2652,2653,2656,2657,2528,2660,2667],{},[14,2654,2655],{},"Ensure Blog Quality with Playwright Automated Testing",": Implement ",[14,2658,2659],{},"end-to-end testing",[1232,2661,2664],{"href":2662,"rel":2663},"https:\u002F\u002Fplaywright.dev\u002F",[1236],[14,2665,2666],{},"Playwright"," to ensure your blog functions as expected.",[717,2669,2670,2673],{},[14,2671,2672],{},"An Internal Refactor for the Future Growth of our Blog",": Prepare your blog for future growth by refactoring the codebase, ensuring it remains maintainable and scalable.",[717,2675,2676,2679,2680,2682],{},[14,2677,2678],{},"Migrating Our VitePress Blog to Tailwind CSS Version 4",": Upgrade our blog to the latest version of ",[14,2681,2566],{}," to leverage its new features and improvements.",[10,2684,2685,2686,2689,2690,2693],{},"By the conclusion, you will possess a fully operational and captivating ",[14,2687,2688],{},"blog",", allowing you to concentrate exclusively on producing ",[14,2691,2692],{},"content",", which is paramount. Simply write and publish, as the blog will autonomously manage the rest.",[2695,2696,2697,2702],"figure",{},[2698,2699],"img",{"alt":2700,"src":2701},"Home Page of our Blog","\u002Fseries\u002Fcreate-a-blog-with-vitepress-and-vue-js-from-scratch\u002Fdeploy-vitepress-blog-globally-with-cloudflare-pages\u002Fvitepress-home.png",[2703,2704,2700],"figcaption",{},[10,2706,2707,2708,2711],{},"This series offers a detailed, step-by-step ",[14,2709,2710],{},"guide",". Rest assured, each aspect will be thoroughly elucidated, from selecting to implementing every feature. While each feature will be minimal and focused on the core, this does not mean we will forgo creating a visually pleasing and functional blog.",[10,2713,2714],{},"Should you have any inquiries, please feel free to engage in the comments section under each article.",[10,2716,2717],{},"I hope you find this series truly enjoyable! 🚀",[52,2719,2721],{"id":2720},"chapters","Chapters",[2723,2724],"series-chapters-list",{"className":2725},[2726,2727],"mx-auto","max-w-5xl",{"title":85,"searchDepth":110,"depth":110,"links":2729},[2730],{"id":2720,"depth":110,"text":2721},"43c95b33-041c-4108-ab98-0d21ef60ed7f","2024-10-10","Build a dynamic blog with VitePress and Vue.js from scratch. Learn setup, SEO, and deployment for a seamless blogging experience.",{"name":2735,"repository":2736},"garabit","barbapapazes\u002Fgarabit","I create this series because \u003Cstrong>VitePress\u003C\u002Fstrong> is way more powerful than it seems at the first glance. I was amazed by the \u003Cstrong>flexibility\u003C\u002Fstrong> and the \u003Cstrong>simplicity\u003C\u002Fstrong> of the tool while building my blog and wanted the community to know about it.",{},"\u002Fseries\u002Fcreate-a-blog-with-vitepress-and-vue-js-from-scratch","---\ncontentId: 43c95b33-041c-4108-ab98-0d21ef60ed7f\ntitle: Create a Blog with VitePress and Vue.js from Scratch\nsubtitle: A new perspective on blogging with VitePress and Vue.js\ndescription: Build a dynamic blog with VitePress and Vue.js from scratch. Learn setup, SEO, and deployment for a seamless blogging experience.\ndate: 2024-10-10\ntopics:\n  - vuejs\n  - vitepress\n  - blog\ngithub:\n  name: garabit\n  repository: barbapapazes\u002Fgarabit\nmeetTheInstructor: I create this series because \u003Cstrong>VitePress\u003C\u002Fstrong> is way more powerful than it seems at the first glance. I was amazed by the \u003Cstrong>flexibility\u003C\u002Fstrong> and the \u003Cstrong>simplicity\u003C\u002Fstrong> of the tool while building my blog and wanted the community to know about it.\nseriesSlug: create-a-blog-with-vitepress-and-vue-js-from-scratch\n---\n\nHello and welcome! 👋\n\nYou're about to embark on the \"Create a **Blog** with **VitePress** and **Vue.js** from Scratch\" series!\n\nThroughout this journey, we will construct a practical blog from the ground up using [**VitePress**](https:\u002F\u002Fvitepress.dev\u002F). We will explore a range of topics from initial configuration to deploying on **Cloudflare Pages**, including:\n\n- **Getting Started with VitePress: Project Setup and Essentials**: Learn to set up a fresh **VitePress project** by incorporating [**Tailwind CSS**](https:\u002F\u002Ftailwindcss.com\u002F) and [**unplugin-vue-components**](https:\u002F\u002Fgithub.com\u002Funplugin\u002Funplugin-vue-components) for an enhanced development process.\n- **From Default to Custom: Building a VitePress Blog Theme**: We will entirely remove the default theme and create a personalized theme. _You'll be surprised by its simplicity!_\n- **Optimize Your VitePress Blog's Architecture Design**: Discover how to organize code and design your blog for scalability and maintainability.\n- **Implementing Blog Index with VitePress and Tailwind CSS**: Create a list of blog posts. This will introduce [**data loaders from VitePress**](https:\u002F\u002Fvitepress.dev\u002Fguide\u002Fdata-loading).\n- **Single Blog Rendering in VitePress with Tailwind Typography**: Create a page dedicated to reading each blog post.\n- **Deploy VitePress Blog Globally with Cloudflare Pages**: Integrate **SEO metadata** for improved search engine visibility, eliminating the need for manual updates.\n- **Showcase Your GitHub Projects on Your VitePress Blog**: Develop a page to display your **GitHub** endeavors, extending the use of data loaders and demonstrating their flexibility.\n- **Creating Open Graph Images Automatically for Each Blog Post**: Efficiently create **Open Graph images** for each post, saving time and enhancing appeal.\n- **Deploy VitePress Blog Globally with Cloudflare Pages**: Seamlessly deploy your blog to [**Cloudflare Pages**](https:\u002F\u002Fpages.cloudflare.com\u002F), achieving this in just a few clicks!\n- **Ensure Blog Quality with Playwright Automated Testing**: Implement **end-to-end testing** with [**Playwright**](https:\u002F\u002Fplaywright.dev\u002F) to ensure your blog functions as expected.\n- **An Internal Refactor for the Future Growth of our Blog**: Prepare your blog for future growth by refactoring the codebase, ensuring it remains maintainable and scalable.\n- **Migrating Our VitePress Blog to Tailwind CSS Version 4**: Upgrade our blog to the latest version of **Tailwind CSS** to leverage its new features and improvements.\n\nBy the conclusion, you will possess a fully operational and captivating **blog**, allowing you to concentrate exclusively on producing **content**, which is paramount. Simply write and publish, as the blog will autonomously manage the rest.\n\n![Home Page of our Blog](\u002Fseries\u002Fcreate-a-blog-with-vitepress-and-vue-js-from-scratch\u002Fdeploy-vitepress-blog-globally-with-cloudflare-pages\u002Fvitepress-home.png)\n\nThis series offers a detailed, step-by-step **guide**. Rest assured, each aspect will be thoroughly elucidated, from selecting to implementing every feature. While each feature will be minimal and focused on the core, this does not mean we will forgo creating a visually pleasing and functional blog.\n\nShould you have any inquiries, please feel free to engage in the comments section under each article.\n\nI hope you find this series truly enjoyable! 🚀\n\n## Chapters\n\n::series-chapters-list\n---\nclass: mx-auto max-w-5xl\n---\n::\n",{"title":2516,"description":2733},{"loc":2739,"images":2743},[2744],{"loc":2701},"series\u002Fcreate-a-blog-with-vitepress-and-vue-js-from-scratch","A new perspective on blogging with VitePress and Vue.js",[2748,2749,2688],"vuejs","vitepress","H9cubHgLKM0Siblzkwf7mDsFVYr2CLbh_ciFOpQrSVk",[2752,2758,2764,2770,2776,2782,2784,2790,2796,2802,2808,2815],{"contentId":2753,"title":2554,"description":2754,"path":2755,"part":92,"github":2756,"topics":2504},"b1b99d95-ac6d-4f25-a121-0851988102a2","From setup to styling with Tailwind CSS and automatic Vue imports, build your content-driven site effortlessly.","\u002Fseries\u002Fcreate-a-blog-with-vitepress-and-vue-js-from-scratch\u002Fgetting-started-with-vitepress-project-setup-and-essentials",{"branch":2757},"01.project-initialization",{"contentId":2759,"title":2579,"description":2760,"path":2761,"part":110,"github":2762,"topics":2504},"172f2a41-2f7c-44e9-855d-322adc536279","Step-by-step VitePress theme customization: guide to building a unique theme layout, adding Markdown content, and removing defaults.","\u002Fseries\u002Fcreate-a-blog-with-vitepress-and-vue-js-from-scratch\u002Ffrom-default-to-custom-building-a-vitepress-blog-theme",{"branch":2763},"02.the-basics-for-a-custom-theme",{"contentId":2765,"title":2588,"description":2766,"path":2767,"part":117,"github":2768,"topics":2504},"900d11a5-ff68-4cc9-8ace-66a5cb1577fa","Discover how to optimize your VitePress blog's architecture design with scalable solutions and efficient Vite plugin integration.","\u002Fseries\u002Fcreate-a-blog-with-vitepress-and-vue-js-from-scratch\u002Foptimize-your-vitepress-blog-architecture-design",{"branch":2769},"03.define-the-design-of-the-blog-architecture",{"contentId":2771,"title":2594,"description":2772,"path":2773,"part":133,"github":2774,"topics":2504},"4d93a3c5-f3ff-4ff6-a569-5234ef805850","Learn to create a list of blog articles using VitePress, a crucial feature for any content-centric website. Utilize data loaders to load articles.","\u002Fseries\u002Fcreate-a-blog-with-vitepress-and-vue-js-from-scratch\u002Fimplementing-blog-index-with-vitepress-and-tailwind-css",{"branch":2775},"04.comprehensive-guide-to-listing-blog-articles",{"contentId":2777,"title":2607,"description":2778,"path":2779,"part":145,"github":2780,"topics":2504},"15b9a49c-b9fb-4d76-a08d-2acaf55ff205","Enhance your VitePress blog with Tailwind Typography. Learn to render markdown beautifully with syntax highlights.","\u002Fseries\u002Fcreate-a-blog-with-vitepress-and-vue-js-from-scratch\u002Fsingle-blog-rendering-in-vitepress-with-tailwind-typography",{"branch":2781},"05.read-a-single-blog-article",{"contentId":2499,"title":5,"description":2501,"path":2506,"part":214,"github":2783,"topics":2504},{"branch":2503},{"contentId":2785,"title":2623,"description":2786,"path":2787,"part":225,"github":2788,"topics":2504},"a4a933b8-07a5-4587-ad54-c3f9e30cbf45","Enhance your VitePress blog with GitHub projects. Learn API data retrieval and how to display your projects on your blog.","\u002Fseries\u002Fcreate-a-blog-with-vitepress-and-vue-js-from-scratch\u002Fshowcase-your-github-projects-on-your-vitepress-blog",{"branch":2789},"07.showcase-your-github-projects",{"contentId":2791,"title":2633,"description":2792,"path":2793,"part":381,"github":2794,"topics":2504},"c76a349e-a495-4890-ab05-3e8b6bb90add","Learn how to dynamically generate Open Graph images for each blog post, enhancing the visual appeal when sharing content on social media.","\u002Fseries\u002Fcreate-a-blog-with-vitepress-and-vue-js-from-scratch\u002Fcreating-open-graph-images-automatically-for-each-blog-post",{"branch":2795},"08.automatically-generated-open-graph-images",{"contentId":2797,"title":2613,"description":2798,"path":2799,"part":404,"github":2800,"topics":2504},"c05ae463-c5ae-4c43-872d-bb05263c7f74","Deploy the blog to Cloudflare Pages for global accessibility. Discover how to deploy the blog to Cloudflare Pages and share it worldwide with ease.","\u002Fseries\u002Fcreate-a-blog-with-vitepress-and-vue-js-from-scratch\u002Fdeploy-vitepress-blog-globally-with-cloudflare-pages",{"branch":2801},"09.share-the-blog-globally",{"contentId":2803,"title":2655,"description":2804,"path":2805,"part":410,"github":2806,"topics":2504},"aa5392e0-6287-4673-9365-34313f0af1fa","Enhance web development with Playwright-induced automated testing. Elevate blog quality through comprehensive end-to-end and SEO tests.","\u002Fseries\u002Fcreate-a-blog-with-vitepress-and-vue-js-from-scratch\u002Fensure-blog-quality-with-playwright-automated-testing",{"branch":2807},"10.automate-testing",{"contentId":2809,"title":2810,"description":2811,"path":2812,"part":420,"github":2813,"topics":2504},"5b1b6117-14f0-4f1d-ba13-5b3583f341bf","An Internal Refactor for the Future Growth of Our Blog","Prepare your blog for future growth by refactoring the codebase to ensure it remains maintainable and scalable.","\u002Fseries\u002Fcreate-a-blog-with-vitepress-and-vue-js-from-scratch\u002Fan-internal-refactor-for-the-future-growth-of-our-blog",{"branch":2814},"11.internal-refactor",{"contentId":2816,"title":2678,"description":2817,"path":2818,"part":621,"github":2819,"topics":2504},"3499bbd1-20a6-43f0-9bb7-be1da2bb6eac","A step-by-step guide on upgrading our VitePress blog to Tailwind CSS 4.0 to leverage its latest features and improvements.","\u002Fseries\u002Fcreate-a-blog-with-vitepress-and-vue-js-from-scratch\u002Fmigrating-our-vitepress-blog-to-tailwind-css-version-4",{"branch":2820},"12.migration-to-tailwind-css-4",1795016692479]