[{"data":1,"prerenderedAt":5545},["ShallowReactive",2],{"article-en-coverage-of-jest-unit-tests-using-github-action":3,"linked-en-coverage-of-jest-unit-tests-using-github-action":882,"coverage-of-jest-unit-tests-using-github-action-surround":5542},{"article":4,"isFallback":881},{"id":5,"title":6,"author":7,"body":8,"date":865,"description":866,"extension":867,"meta":868,"navigation":869,"path":870,"seo":871,"sitemap":872,"stem":873,"tags":874,"thumbnail":879,"__hash__":880},"en_articles/articles/en/coverage-of-jest-unit-tests-using-github-action.md","Coverage of Jest unit tests using GitHub actiong","Edwin Gonzalez",{"type":9,"value":10,"toc":862},"minimark",[11,15,18,21,31,37,44,49,62,192,201,303,328,391,396,454,459,597,600,823,826,829,835,838,855,858],[12,13,14],"p",{},"Code coverage is an important metric for measuring the quality of your software tests. It provides a way to quantify how much of your code is being tested and helps you identify areas of your code that may not be adequately covered by your tests.",[12,16,17],{},"When you use Jest with GitHub Actions, you can automate the process of running your tests and getting coverage reports, making it easier to track your code coverage over time. This can help you ensure that your code is well-tested, reduce the risk of introducing bugs into your code, and make it easier to maintain your code in the future.",[12,19,20],{},"Additionally, having code coverage reports available in your GitHub repository can help you communicate the quality of your tests to other stakeholders, such as team members or customers. This can increase trust in your code and help build confidence in your development process.",[12,22,23,24],{},"Now, we will use the following tool: ",[25,26,30],"a",{"href":27,"rel":28},"https://www.covbot.dev/",[29],"nofollow","Jest coverage report action",[32,33,34],"tip",{},[12,35,36],{},"It’s a tool that helps you keep track of coverage of your project. Forms a reporting comment for each PR. In addition, highlights files with reduced coverage and new files",[12,38,39],{},[40,41],"img",{"alt":42,"src":43},"Track code","https://res.cloudinary.com/dhgcfzhm0/image/upload/v1779231244/track-code_ss1ich.webp",[45,46,48],"h2",{"id":47},"how-can-we-set-up-our-project","How can we set up our project?",[50,51,52],"ol",{},[53,54,55,56],"li",{},"Create a new script to run all unit tests and generate a coverage report.\n",[57,58,59],"warning",{},[12,60,61],{},"NOTE: This script generates a new file with a JSON extension, so for our GitHub action to work well, this file must already be added to the project when doing our PR. Since if it is not generated an error that the file is not found.",[63,64,69],"pre",{"className":65,"code":66,"language":67,"meta":68,"style":68},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","//package.json\n{\n  \"name\": \"my project\",\n  \"version\": \"1.0.0\",\n  \"scripts\": {\n    \"coverage\": \"jest --json --coverage --outputFile=report.json\"\n  }\n //...\n}\n","json","",[70,71,72,81,88,116,137,152,174,180,186],"code",{"__ignoreMap":68},[73,74,77],"span",{"class":75,"line":76},"line",1,[73,78,80],{"class":79},"sHwdD","//package.json\n",[73,82,84],{"class":75,"line":83},2,[73,85,87],{"class":86},"sMK4o","{\n",[73,89,91,94,98,101,104,107,111,113],{"class":75,"line":90},3,[73,92,93],{"class":86},"  \"",[73,95,97],{"class":96},"spNyl","name",[73,99,100],{"class":86},"\"",[73,102,103],{"class":86},":",[73,105,106],{"class":86}," \"",[73,108,110],{"class":109},"sfazB","my project",[73,112,100],{"class":86},[73,114,115],{"class":86},",\n",[73,117,119,121,124,126,128,130,133,135],{"class":75,"line":118},4,[73,120,93],{"class":86},[73,122,123],{"class":96},"version",[73,125,100],{"class":86},[73,127,103],{"class":86},[73,129,106],{"class":86},[73,131,132],{"class":109},"1.0.0",[73,134,100],{"class":86},[73,136,115],{"class":86},[73,138,140,142,145,147,149],{"class":75,"line":139},5,[73,141,93],{"class":86},[73,143,144],{"class":96},"scripts",[73,146,100],{"class":86},[73,148,103],{"class":86},[73,150,151],{"class":86}," {\n",[73,153,155,158,162,164,166,168,171],{"class":75,"line":154},6,[73,156,157],{"class":86},"    \"",[73,159,161],{"class":160},"sBMFI","coverage",[73,163,100],{"class":86},[73,165,103],{"class":86},[73,167,106],{"class":86},[73,169,170],{"class":109},"jest --json --coverage --outputFile=report.json",[73,172,173],{"class":86},"\"\n",[73,175,177],{"class":75,"line":176},7,[73,178,179],{"class":86},"  }\n",[73,181,183],{"class":75,"line":182},8,[73,184,185],{"class":79}," //...\n",[73,187,189],{"class":75,"line":188},9,[73,190,191],{"class":86},"}\n",[50,193,194],{"start":83},[53,195,196,197,200],{},"Edit coverage reports from ",[70,198,199],{},"jest.config.js"," or jest script file.",[63,202,206],{"className":203,"code":204,"language":205,"meta":68,"style":68},"language-js shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","//jest.config.js\nmodule.exports = {\n  collectCoverage: true,\n  collectCoverageFrom: [\"**/*.{js,vue}\", \"!**/node_modules/**\"],\n  coverageReporters: [ \"text\", \"text-summary\"]\n}\n","js",[70,207,208,213,223,237,270,299],{"__ignoreMap":68},[73,209,210],{"class":75,"line":76},[73,211,212],{"class":79},"//jest.config.js\n",[73,214,215,218,221],{"class":75,"line":83},[73,216,217],{"class":86},"module.exports",[73,219,220],{"class":86}," =",[73,222,151],{"class":86},[73,224,225,229,231,235],{"class":75,"line":90},[73,226,228],{"class":227},"swJcz","  collectCoverage",[73,230,103],{"class":86},[73,232,234],{"class":233},"sfNiH"," true",[73,236,115],{"class":86},[73,238,239,242,244,248,250,253,255,258,260,263,265,268],{"class":75,"line":118},[73,240,241],{"class":227},"  collectCoverageFrom",[73,243,103],{"class":86},[73,245,247],{"class":246},"sTEyZ"," [",[73,249,100],{"class":86},[73,251,252],{"class":109},"**/*.{js,vue}",[73,254,100],{"class":86},[73,256,257],{"class":86},",",[73,259,106],{"class":86},[73,261,262],{"class":109},"!**/node_modules/**",[73,264,100],{"class":86},[73,266,267],{"class":246},"]",[73,269,115],{"class":86},[73,271,272,275,277,280,282,285,287,289,291,294,296],{"class":75,"line":139},[73,273,274],{"class":227},"  coverageReporters",[73,276,103],{"class":86},[73,278,279],{"class":246}," [ ",[73,281,100],{"class":86},[73,283,284],{"class":109},"text",[73,286,100],{"class":86},[73,288,257],{"class":86},[73,290,106],{"class":86},[73,292,293],{"class":109},"text-summary",[73,295,100],{"class":86},[73,297,298],{"class":246},"]\n",[73,300,301],{"class":75,"line":154},[73,302,191],{"class":86},[50,304,305,319,325],{"start":90},[53,306,307,308,311,312,315,316,318],{},"Create a new workflow file in your project: Workflow files are stored in the ",[70,309,310],{},".github/workflows"," directory of your repository and define the steps that the GitHub Actions runner will take. To create a new workflow file, you can create a new ",[70,313,314],{},".yml"," file in the ",[70,317,310],{}," directory.",[53,320,321,322],{},"Add a new step to your GitHub Actions workflow file.\n",[70,323,324],{},"(e.g, coverage.yml)",[53,326,327],{},"Now, we need to configure in which environment of our branches we want our GitHub action to run.",[63,329,333],{"className":330,"code":331,"language":332,"meta":68,"style":68},"language-yml shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","#coverage.yml\nname: 'coverage'\non:\n  pull_request:\n    branches:\n      - main\n      - develop\n","yml",[70,334,335,340,354,362,369,376,384],{"__ignoreMap":68},[73,336,337],{"class":75,"line":76},[73,338,339],{"class":79},"#coverage.yml\n",[73,341,342,344,346,349,351],{"class":75,"line":83},[73,343,97],{"class":227},[73,345,103],{"class":86},[73,347,348],{"class":86}," '",[73,350,161],{"class":109},[73,352,353],{"class":86},"'\n",[73,355,356,359],{"class":75,"line":90},[73,357,358],{"class":233},"on",[73,360,361],{"class":86},":\n",[73,363,364,367],{"class":75,"line":118},[73,365,366],{"class":227},"  pull_request",[73,368,361],{"class":86},[73,370,371,374],{"class":75,"line":139},[73,372,373],{"class":227},"    branches",[73,375,361],{"class":86},[73,377,378,381],{"class":75,"line":154},[73,379,380],{"class":86},"      -",[73,382,383],{"class":109}," main\n",[73,385,386,388],{"class":75,"line":176},[73,387,380],{"class":86},[73,389,390],{"class":109}," develop\n",[50,392,393],{"start":154},[53,394,395],{},"Enable permissions about our GitHub action can run.",[63,397,399],{"className":330,"code":398,"language":332,"meta":68,"style":68},"#coverage.yml\njobs:\n  coverage:\n    permissions:\n      checks: write\n      pull-requests: write\n      contents: write\n",[70,400,401,405,412,419,426,436,445],{"__ignoreMap":68},[73,402,403],{"class":75,"line":76},[73,404,339],{"class":79},[73,406,407,410],{"class":75,"line":83},[73,408,409],{"class":227},"jobs",[73,411,361],{"class":86},[73,413,414,417],{"class":75,"line":90},[73,415,416],{"class":227},"  coverage",[73,418,361],{"class":86},[73,420,421,424],{"class":75,"line":118},[73,422,423],{"class":227},"    permissions",[73,425,361],{"class":86},[73,427,428,431,433],{"class":75,"line":139},[73,429,430],{"class":227},"      checks",[73,432,103],{"class":86},[73,434,435],{"class":109}," write\n",[73,437,438,441,443],{"class":75,"line":154},[73,439,440],{"class":227},"      pull-requests",[73,442,103],{"class":86},[73,444,435],{"class":109},[73,446,447,450,452],{"class":75,"line":176},[73,448,449],{"class":227},"      contents",[73,451,103],{"class":86},[73,453,435],{"class":109},[50,455,456],{"start":176},[53,457,458],{},"It’s time to set up the final report steps.",[63,460,462],{"className":330,"code":461,"language":332,"meta":68,"style":68}," runs-on: ubuntu-latest\n steps:\n   - uses: actions/checkout@v3\n   - uses: actions/setup-node@v3\n     with:\n       cache: 'yarn'\n   - uses: ArtiomTr/jest-coverage-report-action@v2.1.2\n     id: coverage\n     with:\n       annotations: none\n       package-manager: yarn\n       test-script: yarn coverage\n       icons: emoji \n",[70,463,464,474,481,494,505,512,526,537,547,553,564,575,586],{"__ignoreMap":68},[73,465,466,469,471],{"class":75,"line":76},[73,467,468],{"class":227}," runs-on",[73,470,103],{"class":86},[73,472,473],{"class":109}," ubuntu-latest\n",[73,475,476,479],{"class":75,"line":83},[73,477,478],{"class":227}," steps",[73,480,361],{"class":86},[73,482,483,486,489,491],{"class":75,"line":90},[73,484,485],{"class":86},"   -",[73,487,488],{"class":227}," uses",[73,490,103],{"class":86},[73,492,493],{"class":109}," actions/checkout@v3\n",[73,495,496,498,500,502],{"class":75,"line":118},[73,497,485],{"class":86},[73,499,488],{"class":227},[73,501,103],{"class":86},[73,503,504],{"class":109}," actions/setup-node@v3\n",[73,506,507,510],{"class":75,"line":139},[73,508,509],{"class":227},"     with",[73,511,361],{"class":86},[73,513,514,517,519,521,524],{"class":75,"line":154},[73,515,516],{"class":227},"       cache",[73,518,103],{"class":86},[73,520,348],{"class":86},[73,522,523],{"class":109},"yarn",[73,525,353],{"class":86},[73,527,528,530,532,534],{"class":75,"line":176},[73,529,485],{"class":86},[73,531,488],{"class":227},[73,533,103],{"class":86},[73,535,536],{"class":109}," ArtiomTr/jest-coverage-report-action@v2.1.2\n",[73,538,539,542,544],{"class":75,"line":182},[73,540,541],{"class":227},"     id",[73,543,103],{"class":86},[73,545,546],{"class":109}," coverage\n",[73,548,549,551],{"class":75,"line":188},[73,550,509],{"class":227},[73,552,361],{"class":86},[73,554,556,559,561],{"class":75,"line":555},10,[73,557,558],{"class":227},"       annotations",[73,560,103],{"class":86},[73,562,563],{"class":109}," none\n",[73,565,567,570,572],{"class":75,"line":566},11,[73,568,569],{"class":227},"       package-manager",[73,571,103],{"class":86},[73,573,574],{"class":109}," yarn\n",[73,576,578,581,583],{"class":75,"line":577},12,[73,579,580],{"class":227},"       test-script",[73,582,103],{"class":86},[73,584,585],{"class":109}," yarn coverage\n",[73,587,589,592,594],{"class":75,"line":588},13,[73,590,591],{"class":227},"       icons",[73,593,103],{"class":86},[73,595,596],{"class":109}," emoji\n",[12,598,599],{},"In the end, you will have a complete configuration like the following:",[63,601,603],{"className":330,"code":602,"language":332,"meta":68,"style":68},"#coverage.yml\nname: 'coverage'\non:\n  pull_request:\n    branches:\n      - main\n      - develop\njobs:\n  coverage:\n    permissions:\n      checks: write\n      pull-requests: write\n      contents: write\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n      - uses: actions/setup-node@v3\n        with:\n          cache: 'yarn'\n      - uses: ArtiomTr/jest-coverage-report-action@v2.1.2\n        id: coverage\n        with:\n          annotations: none\n          package-manager: yarn\n          test-script: yarn coverage\n          icons: emoji\n",[70,604,605,609,621,627,633,639,645,651,657,663,669,677,685,693,703,711,722,733,741,755,766,776,783,793,803,813],{"__ignoreMap":68},[73,606,607],{"class":75,"line":76},[73,608,339],{"class":79},[73,610,611,613,615,617,619],{"class":75,"line":83},[73,612,97],{"class":227},[73,614,103],{"class":86},[73,616,348],{"class":86},[73,618,161],{"class":109},[73,620,353],{"class":86},[73,622,623,625],{"class":75,"line":90},[73,624,358],{"class":233},[73,626,361],{"class":86},[73,628,629,631],{"class":75,"line":118},[73,630,366],{"class":227},[73,632,361],{"class":86},[73,634,635,637],{"class":75,"line":139},[73,636,373],{"class":227},[73,638,361],{"class":86},[73,640,641,643],{"class":75,"line":154},[73,642,380],{"class":86},[73,644,383],{"class":109},[73,646,647,649],{"class":75,"line":176},[73,648,380],{"class":86},[73,650,390],{"class":109},[73,652,653,655],{"class":75,"line":182},[73,654,409],{"class":227},[73,656,361],{"class":86},[73,658,659,661],{"class":75,"line":188},[73,660,416],{"class":227},[73,662,361],{"class":86},[73,664,665,667],{"class":75,"line":555},[73,666,423],{"class":227},[73,668,361],{"class":86},[73,670,671,673,675],{"class":75,"line":566},[73,672,430],{"class":227},[73,674,103],{"class":86},[73,676,435],{"class":109},[73,678,679,681,683],{"class":75,"line":577},[73,680,440],{"class":227},[73,682,103],{"class":86},[73,684,435],{"class":109},[73,686,687,689,691],{"class":75,"line":588},[73,688,449],{"class":227},[73,690,103],{"class":86},[73,692,435],{"class":109},[73,694,696,699,701],{"class":75,"line":695},14,[73,697,698],{"class":227},"    runs-on",[73,700,103],{"class":86},[73,702,473],{"class":109},[73,704,706,709],{"class":75,"line":705},15,[73,707,708],{"class":227},"    steps",[73,710,361],{"class":86},[73,712,714,716,718,720],{"class":75,"line":713},16,[73,715,380],{"class":86},[73,717,488],{"class":227},[73,719,103],{"class":86},[73,721,493],{"class":109},[73,723,725,727,729,731],{"class":75,"line":724},17,[73,726,380],{"class":86},[73,728,488],{"class":227},[73,730,103],{"class":86},[73,732,504],{"class":109},[73,734,736,739],{"class":75,"line":735},18,[73,737,738],{"class":227},"        with",[73,740,361],{"class":86},[73,742,744,747,749,751,753],{"class":75,"line":743},19,[73,745,746],{"class":227},"          cache",[73,748,103],{"class":86},[73,750,348],{"class":86},[73,752,523],{"class":109},[73,754,353],{"class":86},[73,756,758,760,762,764],{"class":75,"line":757},20,[73,759,380],{"class":86},[73,761,488],{"class":227},[73,763,103],{"class":86},[73,765,536],{"class":109},[73,767,769,772,774],{"class":75,"line":768},21,[73,770,771],{"class":227},"        id",[73,773,103],{"class":86},[73,775,546],{"class":109},[73,777,779,781],{"class":75,"line":778},22,[73,780,738],{"class":227},[73,782,361],{"class":86},[73,784,786,789,791],{"class":75,"line":785},23,[73,787,788],{"class":227},"          annotations",[73,790,103],{"class":86},[73,792,563],{"class":109},[73,794,796,799,801],{"class":75,"line":795},24,[73,797,798],{"class":227},"          package-manager",[73,800,103],{"class":86},[73,802,574],{"class":109},[73,804,806,809,811],{"class":75,"line":805},25,[73,807,808],{"class":227},"          test-script",[73,810,103],{"class":86},[73,812,585],{"class":109},[73,814,816,819,821],{"class":75,"line":815},26,[73,817,818],{"class":227},"          icons",[73,820,103],{"class":86},[73,822,596],{"class":109},[12,824,825],{},"I share the final result, once you execute your GitHub action, which we can observe as our report the percentages, the number of tests, and the number of test suites that were executed at that moment.",[12,827,828],{},"Also mention that the report is executed again if a new commit is made to the PR.",[12,830,831],{},[40,832],{"alt":833,"src":834},"Pull request","https://res.cloudinary.com/dhgcfzhm0/image/upload/v1779231244/pull-request_jmcnhs.webp",[12,836,837],{},"In summary, coverage of Jest unit tests using GitHub Actions is important because it helps you:",[50,839,840,843,846,849,852],{},[53,841,842],{},"Ensure that your code is well-tested.",[53,844,845],{},"Reduce the risk of introducing bugs into your code.",[53,847,848],{},"Easily track the quality of your tests over time.",[53,850,851],{},"Communicate the quality of your tests to others.",[53,853,854],{},"Build confidence in your development process.",[12,856,857],{},"Thank you for reading! we read soon. 🙌🏽🙌🏽",[859,860,861],"style",{},"html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}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 .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}",{"title":68,"searchDepth":83,"depth":83,"links":863},[864],{"id":47,"depth":83,"text":48},"2023-02-03T00:00:00.000Z","Discover how to set up a GitHub Action to generate and visualize coverage reports for Jest unit tests.","md",{},true,"/articles/en/coverage-of-jest-unit-tests-using-github-action",{"title":6,"description":866},{"loc":870},"articles/en/coverage-of-jest-unit-tests-using-github-action",[875,876,877,878],"jest","github-action","javascript","webdev","https://res.cloudinary.com/dhgcfzhm0/image/upload/v1779231244/thumbnail_dwb5ue.webp","m9QjUXQANBcf9TmLNyxpQHSO9Oi-jmSseAoo7BMTaS4",false,[883,1645,4387,4781,5158],{"id":884,"title":885,"author":7,"body":886,"date":1633,"description":1634,"extension":867,"meta":1635,"navigation":869,"path":1636,"seo":1637,"sitemap":1638,"stem":1639,"tags":1640,"thumbnail":1643,"__hash__":1644},"en_articles/articles/en/creating-custom-routes-in-nuxt3.md","Creating Custom Routes in Nuxt3 (Without Losing Your Mind)",{"type":9,"value":887,"toc":1630},[888,891,894,898,901,904,1104,1114,1117,1187,1190,1193,1265,1268,1490,1493,1624,1627],[12,889,890],{},"I'd like to share an experience I had a couple of days ago during a work challenge, which may have happened to you or could happen to you if you use Nuxt3. Let's jump!",[12,892,893],{},"In Nuxt3, the routing system is based on the file structure within the pages directory, which facilitates automatic route creation. However, being built on top of vue-router, Nuxt3 also allows for flexible custom routes. This gives you the ability to extend or modify the router's behavior to suit your project's specific needs (I needed to have dynamic routes to manage subdomains for different types of users, but end users can also use the application in embed or normal format, the latter using the same components, I just needed to modify the routes).",[45,895,897],{"id":896},"so-how-do-we-achieve-this","So, how do we achieve this?",[12,899,900],{},"We must be located inside the app/ directory because that folder is specifically designed to extend or customize the internal behavior of the framework.",[12,902,903],{},"Then, we can create a router.options.ts file, using router options we can optionally override or extend your routes using a function that accepts the scanned routes and returns customized routes. The following example code.",[63,905,909],{"className":906,"code":907,"language":908,"meta":68,"style":68},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","// app/router.options.ts\n// Import the RouterConfig type for proper typing\nimport type { RouterConfig } from '@nuxt/schema'\n\nexport default {\n  // Define custom routes manually\n  routes: (_routes) => [\n    {\n      // Route name (used in programmatic navigation)\n      name: 'home',\n      // URL path\n      path: '/',\n      // Lazy-load the component\n      component: () => import('~/pages/home.vue')\n    }\n  ],\n} satisfies RouterConfig;\n// Ensures the object matches Nuxt's expected router config\n\n","ts",[70,910,911,916,921,949,954,964,969,993,998,1003,1020,1025,1041,1046,1074,1079,1086,1099],{"__ignoreMap":68},[73,912,913],{"class":75,"line":76},[73,914,915],{"class":79},"// app/router.options.ts\n",[73,917,918],{"class":75,"line":83},[73,919,920],{"class":79},"// Import the RouterConfig type for proper typing\n",[73,922,923,927,930,933,936,939,942,944,947],{"class":75,"line":90},[73,924,926],{"class":925},"s7zQu","import",[73,928,929],{"class":925}," type",[73,931,932],{"class":86}," {",[73,934,935],{"class":246}," RouterConfig",[73,937,938],{"class":86}," }",[73,940,941],{"class":925}," from",[73,943,348],{"class":86},[73,945,946],{"class":109},"@nuxt/schema",[73,948,353],{"class":86},[73,950,951],{"class":75,"line":118},[73,952,953],{"emptyLinePlaceholder":869},"\n",[73,955,956,959,962],{"class":75,"line":139},[73,957,958],{"class":925},"export",[73,960,961],{"class":925}," default",[73,963,151],{"class":86},[73,965,966],{"class":75,"line":154},[73,967,968],{"class":79},"  // Define custom routes manually\n",[73,970,971,975,977,980,984,987,990],{"class":75,"line":176},[73,972,974],{"class":973},"s2Zo4","  routes",[73,976,103],{"class":86},[73,978,979],{"class":86}," (",[73,981,983],{"class":982},"sHdIc","_routes",[73,985,986],{"class":86},")",[73,988,989],{"class":96}," =>",[73,991,992],{"class":246}," [\n",[73,994,995],{"class":75,"line":182},[73,996,997],{"class":86},"    {\n",[73,999,1000],{"class":75,"line":188},[73,1001,1002],{"class":79},"      // Route name (used in programmatic navigation)\n",[73,1004,1005,1008,1010,1012,1015,1018],{"class":75,"line":555},[73,1006,1007],{"class":227},"      name",[73,1009,103],{"class":86},[73,1011,348],{"class":86},[73,1013,1014],{"class":109},"home",[73,1016,1017],{"class":86},"'",[73,1019,115],{"class":86},[73,1021,1022],{"class":75,"line":566},[73,1023,1024],{"class":79},"      // URL path\n",[73,1026,1027,1030,1032,1034,1037,1039],{"class":75,"line":577},[73,1028,1029],{"class":227},"      path",[73,1031,103],{"class":86},[73,1033,348],{"class":86},[73,1035,1036],{"class":109},"/",[73,1038,1017],{"class":86},[73,1040,115],{"class":86},[73,1042,1043],{"class":75,"line":588},[73,1044,1045],{"class":79},"      // Lazy-load the component\n",[73,1047,1048,1051,1053,1056,1058,1061,1064,1066,1069,1071],{"class":75,"line":695},[73,1049,1050],{"class":973},"      component",[73,1052,103],{"class":86},[73,1054,1055],{"class":86}," ()",[73,1057,989],{"class":96},[73,1059,1060],{"class":86}," import",[73,1062,1063],{"class":246},"(",[73,1065,1017],{"class":86},[73,1067,1068],{"class":109},"~/pages/home.vue",[73,1070,1017],{"class":86},[73,1072,1073],{"class":246},")\n",[73,1075,1076],{"class":75,"line":705},[73,1077,1078],{"class":86},"    }\n",[73,1080,1081,1084],{"class":75,"line":713},[73,1082,1083],{"class":246},"  ]",[73,1085,115],{"class":86},[73,1087,1088,1091,1094,1096],{"class":75,"line":724},[73,1089,1090],{"class":86},"}",[73,1092,1093],{"class":925}," satisfies",[73,1095,935],{"class":160},[73,1097,1098],{"class":86},";\n",[73,1100,1101],{"class":75,"line":735},[73,1102,1103],{"class":79},"// Ensures the object matches Nuxt's expected router config\n",[1105,1106,1107],"note",{},[12,1108,1109,1110],{},"Documentation reference: ",[25,1111,1112],{"href":1112,"rel":1113},"https://nuxt.com/docs/guide/recipes/custom-routing#router-options",[29],[12,1115,1116],{},"Something that cannot be seen directly in the documentation link is that if we need to override our routes manually, the automatic route system must be disabled from the pages option in our nuxt.config.ts",[63,1118,1120],{"className":906,"code":1119,"language":908,"meta":68,"style":68},"// nuxt.config.ts\nexport default defineNuxtConfig({\n  devtools: { enabled: true },\n  // ...our_config,\n  pages: false, // Add this code (by default is true)\n});\n",[70,1121,1122,1127,1140,1159,1164,1179],{"__ignoreMap":68},[73,1123,1124],{"class":75,"line":76},[73,1125,1126],{"class":79},"// nuxt.config.ts\n",[73,1128,1129,1131,1133,1136,1138],{"class":75,"line":83},[73,1130,958],{"class":925},[73,1132,961],{"class":925},[73,1134,1135],{"class":973}," defineNuxtConfig",[73,1137,1063],{"class":246},[73,1139,87],{"class":86},[73,1141,1142,1145,1147,1149,1152,1154,1156],{"class":75,"line":90},[73,1143,1144],{"class":227},"  devtools",[73,1146,103],{"class":86},[73,1148,932],{"class":86},[73,1150,1151],{"class":227}," enabled",[73,1153,103],{"class":86},[73,1155,234],{"class":233},[73,1157,1158],{"class":86}," },\n",[73,1160,1161],{"class":75,"line":118},[73,1162,1163],{"class":79},"  // ...our_config,\n",[73,1165,1166,1169,1171,1174,1176],{"class":75,"line":139},[73,1167,1168],{"class":227},"  pages",[73,1170,103],{"class":86},[73,1172,1173],{"class":233}," false",[73,1175,257],{"class":86},[73,1177,1178],{"class":79}," // Add this code (by default is true)\n",[73,1180,1181,1183,1185],{"class":75,"line":154},[73,1182,1090],{"class":86},[73,1184,986],{"class":246},[73,1186,1098],{"class":86},[12,1188,1189],{},"Before I go, I would like to share an extra tip that can help you organize your routes better and avoid having an extremely large file if your project will have many routes.",[12,1191,1192],{},"You can create a route-only import file (you can call it router.imports.ts).",[63,1194,1196],{"className":906,"code":1195,"language":908,"meta":68,"style":68},"// router.imports.ts\nexport { default as WebsiteHome } from '~~/pages/website/home.vue';\nexport { default as WebsiteAbout } from '~~/pages/website/about.vue';\n...\n...\n",[70,1197,1198,1203,1230,1256,1261],{"__ignoreMap":68},[73,1199,1200],{"class":75,"line":76},[73,1201,1202],{"class":79},"// router.imports.ts\n",[73,1204,1205,1207,1209,1211,1214,1217,1219,1221,1223,1226,1228],{"class":75,"line":83},[73,1206,958],{"class":925},[73,1208,932],{"class":86},[73,1210,961],{"class":925},[73,1212,1213],{"class":925}," as",[73,1215,1216],{"class":246}," WebsiteHome",[73,1218,938],{"class":86},[73,1220,941],{"class":925},[73,1222,348],{"class":86},[73,1224,1225],{"class":109},"~~/pages/website/home.vue",[73,1227,1017],{"class":86},[73,1229,1098],{"class":86},[73,1231,1232,1234,1236,1238,1240,1243,1245,1247,1249,1252,1254],{"class":75,"line":90},[73,1233,958],{"class":925},[73,1235,932],{"class":86},[73,1237,961],{"class":925},[73,1239,1213],{"class":925},[73,1241,1242],{"class":246}," WebsiteAbout",[73,1244,938],{"class":86},[73,1246,941],{"class":925},[73,1248,348],{"class":86},[73,1250,1251],{"class":109},"~~/pages/website/about.vue",[73,1253,1017],{"class":86},[73,1255,1098],{"class":86},[73,1257,1258],{"class":75,"line":118},[73,1259,1260],{"class":86},"...\n",[73,1262,1263],{"class":75,"line":139},[73,1264,1260],{"class":86},[12,1266,1267],{},"Now we can create another barrel file for route definition (website.routes.ts)",[63,1269,1271],{"className":906,"code":1270,"language":908,"meta":68,"style":68},"// website.routes.ts\nimport {\n  WebsiteHome,\n  WebsiteAbout\n} from './routes.import';\n\nconst websiteChildren = [\n  {\n    name: 'WebsiteHome',\n    path: '',\n    component: WebsiteHome,\n  },\n  {\n    name: 'Website',\n    path: 'about',\n    component: WebsiteAbout,\n  },\n]\n\nexport const websiteRoutes = {\n  name: 'WebsiteRoot',\n  path: '',\n  children: websiteChildren,\n}\n",[70,1272,1273,1278,1284,1291,1296,1311,1315,1328,1333,1349,1361,1372,1377,1381,1396,1411,1421,1425,1429,1433,1447,1463,1474,1486],{"__ignoreMap":68},[73,1274,1275],{"class":75,"line":76},[73,1276,1277],{"class":79},"// website.routes.ts\n",[73,1279,1280,1282],{"class":75,"line":83},[73,1281,926],{"class":925},[73,1283,151],{"class":86},[73,1285,1286,1289],{"class":75,"line":90},[73,1287,1288],{"class":246},"  WebsiteHome",[73,1290,115],{"class":86},[73,1292,1293],{"class":75,"line":118},[73,1294,1295],{"class":246},"  WebsiteAbout\n",[73,1297,1298,1300,1302,1304,1307,1309],{"class":75,"line":139},[73,1299,1090],{"class":86},[73,1301,941],{"class":925},[73,1303,348],{"class":86},[73,1305,1306],{"class":109},"./routes.import",[73,1308,1017],{"class":86},[73,1310,1098],{"class":86},[73,1312,1313],{"class":75,"line":154},[73,1314,953],{"emptyLinePlaceholder":869},[73,1316,1317,1320,1323,1326],{"class":75,"line":176},[73,1318,1319],{"class":96},"const",[73,1321,1322],{"class":246}," websiteChildren ",[73,1324,1325],{"class":86},"=",[73,1327,992],{"class":246},[73,1329,1330],{"class":75,"line":182},[73,1331,1332],{"class":86},"  {\n",[73,1334,1335,1338,1340,1342,1345,1347],{"class":75,"line":188},[73,1336,1337],{"class":227},"    name",[73,1339,103],{"class":86},[73,1341,348],{"class":86},[73,1343,1344],{"class":109},"WebsiteHome",[73,1346,1017],{"class":86},[73,1348,115],{"class":86},[73,1350,1351,1354,1356,1359],{"class":75,"line":555},[73,1352,1353],{"class":227},"    path",[73,1355,103],{"class":86},[73,1357,1358],{"class":86}," ''",[73,1360,115],{"class":86},[73,1362,1363,1366,1368,1370],{"class":75,"line":566},[73,1364,1365],{"class":227},"    component",[73,1367,103],{"class":86},[73,1369,1216],{"class":246},[73,1371,115],{"class":86},[73,1373,1374],{"class":75,"line":577},[73,1375,1376],{"class":86},"  },\n",[73,1378,1379],{"class":75,"line":588},[73,1380,1332],{"class":86},[73,1382,1383,1385,1387,1389,1392,1394],{"class":75,"line":695},[73,1384,1337],{"class":227},[73,1386,103],{"class":86},[73,1388,348],{"class":86},[73,1390,1391],{"class":109},"Website",[73,1393,1017],{"class":86},[73,1395,115],{"class":86},[73,1397,1398,1400,1402,1404,1407,1409],{"class":75,"line":705},[73,1399,1353],{"class":227},[73,1401,103],{"class":86},[73,1403,348],{"class":86},[73,1405,1406],{"class":109},"about",[73,1408,1017],{"class":86},[73,1410,115],{"class":86},[73,1412,1413,1415,1417,1419],{"class":75,"line":713},[73,1414,1365],{"class":227},[73,1416,103],{"class":86},[73,1418,1242],{"class":246},[73,1420,115],{"class":86},[73,1422,1423],{"class":75,"line":724},[73,1424,1376],{"class":86},[73,1426,1427],{"class":75,"line":735},[73,1428,298],{"class":246},[73,1430,1431],{"class":75,"line":743},[73,1432,953],{"emptyLinePlaceholder":869},[73,1434,1435,1437,1440,1443,1445],{"class":75,"line":757},[73,1436,958],{"class":925},[73,1438,1439],{"class":96}," const",[73,1441,1442],{"class":246}," websiteRoutes ",[73,1444,1325],{"class":86},[73,1446,151],{"class":86},[73,1448,1449,1452,1454,1456,1459,1461],{"class":75,"line":768},[73,1450,1451],{"class":227},"  name",[73,1453,103],{"class":86},[73,1455,348],{"class":86},[73,1457,1458],{"class":109},"WebsiteRoot",[73,1460,1017],{"class":86},[73,1462,115],{"class":86},[73,1464,1465,1468,1470,1472],{"class":75,"line":778},[73,1466,1467],{"class":227},"  path",[73,1469,103],{"class":86},[73,1471,1358],{"class":86},[73,1473,115],{"class":86},[73,1475,1476,1479,1481,1484],{"class":75,"line":785},[73,1477,1478],{"class":227},"  children",[73,1480,103],{"class":86},[73,1482,1483],{"class":246}," websiteChildren",[73,1485,115],{"class":86},[73,1487,1488],{"class":75,"line":795},[73,1489,191],{"class":86},[12,1491,1492],{},"Finally, we can use our router.options.ts with the route imports defined like this:",[63,1494,1496],{"className":906,"code":1495,"language":908,"meta":68,"style":68},"import type { RouterConfig } from '@nuxt/schema';\nimport { exampleRoutes } from './example.routes';\nimport { websiteRoutes } from './website.routes'\n\nexport default {\n  routes: (_routes) => [\n    exampleRoutes,\n    websiteRoutes,\n    //...\n  ],\n} satisfies RouterConfig\n\n",[70,1497,1498,1520,1542,1562,1566,1574,1590,1597,1604,1609,1615],{"__ignoreMap":68},[73,1499,1500,1502,1504,1506,1508,1510,1512,1514,1516,1518],{"class":75,"line":76},[73,1501,926],{"class":925},[73,1503,929],{"class":925},[73,1505,932],{"class":86},[73,1507,935],{"class":246},[73,1509,938],{"class":86},[73,1511,941],{"class":925},[73,1513,348],{"class":86},[73,1515,946],{"class":109},[73,1517,1017],{"class":86},[73,1519,1098],{"class":86},[73,1521,1522,1524,1526,1529,1531,1533,1535,1538,1540],{"class":75,"line":83},[73,1523,926],{"class":925},[73,1525,932],{"class":86},[73,1527,1528],{"class":246}," exampleRoutes",[73,1530,938],{"class":86},[73,1532,941],{"class":925},[73,1534,348],{"class":86},[73,1536,1537],{"class":109},"./example.routes",[73,1539,1017],{"class":86},[73,1541,1098],{"class":86},[73,1543,1544,1546,1548,1551,1553,1555,1557,1560],{"class":75,"line":90},[73,1545,926],{"class":925},[73,1547,932],{"class":86},[73,1549,1550],{"class":246}," websiteRoutes",[73,1552,938],{"class":86},[73,1554,941],{"class":925},[73,1556,348],{"class":86},[73,1558,1559],{"class":109},"./website.routes",[73,1561,353],{"class":86},[73,1563,1564],{"class":75,"line":118},[73,1565,953],{"emptyLinePlaceholder":869},[73,1567,1568,1570,1572],{"class":75,"line":139},[73,1569,958],{"class":925},[73,1571,961],{"class":925},[73,1573,151],{"class":86},[73,1575,1576,1578,1580,1582,1584,1586,1588],{"class":75,"line":154},[73,1577,974],{"class":973},[73,1579,103],{"class":86},[73,1581,979],{"class":86},[73,1583,983],{"class":982},[73,1585,986],{"class":86},[73,1587,989],{"class":96},[73,1589,992],{"class":246},[73,1591,1592,1595],{"class":75,"line":176},[73,1593,1594],{"class":246},"    exampleRoutes",[73,1596,115],{"class":86},[73,1598,1599,1602],{"class":75,"line":182},[73,1600,1601],{"class":246},"    websiteRoutes",[73,1603,115],{"class":86},[73,1605,1606],{"class":75,"line":188},[73,1607,1608],{"class":79},"    //...\n",[73,1610,1611,1613],{"class":75,"line":555},[73,1612,1083],{"class":246},[73,1614,115],{"class":86},[73,1616,1617,1619,1621],{"class":75,"line":566},[73,1618,1090],{"class":86},[73,1620,1093],{"class":925},[73,1622,1623],{"class":160}," RouterConfig\n",[12,1625,1626],{},"It has been a pleasure to share this experience with you, see you next time!!. :)",[859,1628,1629],{},"html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html .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 .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}",{"title":68,"searchDepth":83,"depth":83,"links":1631},[1632],{"id":896,"depth":83,"text":897},"2025-05-05T00:00:00.000Z","Learn how to create custom routes in Nuxt 3 without losing your mind, how to disable automatic routing, and how to organize your route files with a clean architecture.",{},"/articles/en/creating-custom-routes-in-nuxt3",{"title":885,"description":1634},{"loc":1636},"articles/en/creating-custom-routes-in-nuxt3",[1641,1642,877,878],"nuxt3","vue","https://res.cloudinary.com/dhgcfzhm0/image/upload/v1779231246/creating-custom-routes-in-nuxt3_brrrmq.webp","uwtvgF3lh1OBLbpkxOKHwwub_ofXihqCNTaVLHLC4vo",{"id":1646,"title":1647,"author":7,"body":1648,"date":4376,"description":4377,"extension":867,"meta":4378,"navigation":869,"path":4379,"seo":4380,"sitemap":4381,"stem":4382,"tags":4383,"thumbnail":4385,"__hash__":4386},"en_articles/articles/en/effortlessly-build-and-test-your-frontend-applications-with-vitepress.md","Effortlessly Build and Test Your Frontend Applications with VitePress: A Step-by-Step Tutorial to Create a Blog",{"type":9,"value":1649,"toc":4370},[1650,1653,1656,1660,1668,1692,1697,1709,1714,1744,1749,1754,1861,1866,1913,1918,2204,2208,2211,2214,2222,2227,2799,2804,2824,2828,2833,3069,3074,3459,3464,3935,3946,4346,4350,4359,4365,4367],[12,1651,1652],{},"First of all, we must talk about what is vitepress. VitePress is a modern static site generator based on the Vite front-end build tool. It is designed to be fast and efficient, making it a great choice for building small to medium-sized websites and blogs. With its easy-to-use interface and compatibility with a wide range of technologies, including Vue.js, JavaScript, and CSS, VitePress is a versatile option for front-end development.",[12,1654,1655],{},"Here’s how to get started with VitePress:",[45,1657,1659],{"id":1658},"installation","Installation",[50,1661,1662,1665],{},[53,1663,1664],{},"Install Node.js and yarn or npm if you haven’t already.",[53,1666,1667],{},"Create a new folder project.",[63,1669,1673],{"className":1670,"code":1671,"language":1672,"meta":68,"style":68},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","mkdir vitepress-project && cd vitepress-project\n","bash",[70,1674,1675],{"__ignoreMap":68},[73,1676,1677,1680,1683,1686,1689],{"class":75,"line":76},[73,1678,1679],{"class":160},"mkdir",[73,1681,1682],{"class":109}," vitepress-project",[73,1684,1685],{"class":86}," &&",[73,1687,1688],{"class":973}," cd",[73,1690,1691],{"class":109}," vitepress-project\n",[50,1693,1694],{"start":90},[53,1695,1696],{},"Initialize our project with your preferred package manager.",[63,1698,1700],{"className":1670,"code":1699,"language":1672,"meta":68,"style":68},"yarn init\n",[70,1701,1702],{"__ignoreMap":68},[73,1703,1704,1706],{"class":75,"line":76},[73,1705,523],{"class":160},[73,1707,1708],{"class":109}," init\n",[50,1710,1711],{"start":118},[53,1712,1713],{},"Now, install some packages including vitePress. (These last 4 will help create our collection of JSON pages).",[63,1715,1717],{"className":1670,"code":1716,"language":1672,"meta":68,"style":68},"yarn add vitepress vue nodemon gray-matter remove-markdown concurrently\n",[70,1718,1719],{"__ignoreMap":68},[73,1720,1721,1723,1726,1729,1732,1735,1738,1741],{"class":75,"line":76},[73,1722,523],{"class":160},[73,1724,1725],{"class":109}," add",[73,1727,1728],{"class":109}," vitepress",[73,1730,1731],{"class":109}," vue",[73,1733,1734],{"class":109}," nodemon",[73,1736,1737],{"class":109}," gray-matter",[73,1739,1740],{"class":109}," remove-markdown",[73,1742,1743],{"class":109}," concurrently\n",[50,1745,1746],{"start":139},[53,1747,1748],{},"Set up our scripts in package.json.",[57,1750,1751],{},[12,1752,1753],{},"NOTE: Every time we run our development environment, the data collection mentioned below will be updated.",[63,1755,1757],{"className":65,"code":1756,"language":67,"meta":68,"style":68},"{\n  ...\n  \"scripts\": {\n    \"dev\": \"concurrently \\\"nodemon --watch blog -e md collection.mjs\\\" && vitepress dev\",\n    \"build\": \"node collection.mjs && vitepress build\",\n    \"preview\": \"vitepress preview\"\n  },\n  ...\n}\n",[70,1758,1759,1763,1768,1780,1811,1831,1849,1853,1857],{"__ignoreMap":68},[73,1760,1761],{"class":75,"line":76},[73,1762,87],{"class":86},[73,1764,1765],{"class":75,"line":83},[73,1766,1767],{"class":246},"  ...\n",[73,1769,1770,1772,1774,1776,1778],{"class":75,"line":90},[73,1771,93],{"class":86},[73,1773,144],{"class":96},[73,1775,100],{"class":86},[73,1777,103],{"class":86},[73,1779,151],{"class":86},[73,1781,1782,1784,1787,1789,1791,1793,1796,1799,1802,1804,1807,1809],{"class":75,"line":118},[73,1783,157],{"class":86},[73,1785,1786],{"class":160},"dev",[73,1788,100],{"class":86},[73,1790,103],{"class":86},[73,1792,106],{"class":86},[73,1794,1795],{"class":109},"concurrently ",[73,1797,1798],{"class":246},"\\\"",[73,1800,1801],{"class":109},"nodemon --watch blog -e md collection.mjs",[73,1803,1798],{"class":246},[73,1805,1806],{"class":109}," && vitepress dev",[73,1808,100],{"class":86},[73,1810,115],{"class":86},[73,1812,1813,1815,1818,1820,1822,1824,1827,1829],{"class":75,"line":139},[73,1814,157],{"class":86},[73,1816,1817],{"class":160},"build",[73,1819,100],{"class":86},[73,1821,103],{"class":86},[73,1823,106],{"class":86},[73,1825,1826],{"class":109},"node collection.mjs && vitepress build",[73,1828,100],{"class":86},[73,1830,115],{"class":86},[73,1832,1833,1835,1838,1840,1842,1844,1847],{"class":75,"line":154},[73,1834,157],{"class":86},[73,1836,1837],{"class":160},"preview",[73,1839,100],{"class":86},[73,1841,103],{"class":86},[73,1843,106],{"class":86},[73,1845,1846],{"class":109},"vitepress preview",[73,1848,173],{"class":86},[73,1850,1851],{"class":75,"line":176},[73,1852,1376],{"class":86},[73,1854,1855],{"class":75,"line":182},[73,1856,1767],{"class":246},[73,1858,1859],{"class":75,"line":188},[73,1860,191],{"class":86},[50,1862,1863],{"start":154},[53,1864,1865],{},"Create our first views.",[63,1867,1869],{"className":1670,"code":1868,"language":1672,"meta":68,"style":68},"echo '# Hello from Index' > index.md\nmkdir blog && echo '# Hello from First Article' > blog/first_article.md\n",[70,1870,1871,1889],{"__ignoreMap":68},[73,1872,1873,1876,1878,1881,1883,1886],{"class":75,"line":76},[73,1874,1875],{"class":973},"echo",[73,1877,348],{"class":86},[73,1879,1880],{"class":109},"# Hello from Index",[73,1882,1017],{"class":86},[73,1884,1885],{"class":86}," >",[73,1887,1888],{"class":109}," index.md\n",[73,1890,1891,1893,1896,1898,1901,1903,1906,1908,1910],{"class":75,"line":83},[73,1892,1679],{"class":160},[73,1894,1895],{"class":109}," blog",[73,1897,1685],{"class":86},[73,1899,1900],{"class":973}," echo",[73,1902,348],{"class":86},[73,1904,1905],{"class":109},"# Hello from First Article",[73,1907,1017],{"class":86},[73,1909,1885],{"class":86},[73,1911,1912],{"class":109}," blog/first_article.md\n",[50,1914,1915],{"start":176},[53,1916,1917],{},"It is also possible to configure our project, for SEO, and themes, among others. Here is an example:",[63,1919,1921],{"className":203,"code":1920,"language":205,"meta":68,"style":68},"// .vitepress/config.js\nconst META_TITLE = 'Blog VitePress';\n\nexport default {\n  lang: 'es',\n  title: META_TITLE,\n  description: 'A new website',\n  themeConfig: {\n    siteTitle: false,\n    socialLinks: [\n      { icon: 'github', link: '' },\n    ]\n  },\n  head: [\n    ['link', { rel: 'icon', type: 'image/x-icon', href: '/vite.ico' }],\n    ['link', { rel: 'icon', type: 'image/png', href: '/vite.png' }],\n  ],\n}\n",[70,1922,1923,1928,1946,1950,1958,1974,1986,2002,2011,2022,2031,2059,2064,2068,2077,2138,2194,2200],{"__ignoreMap":68},[73,1924,1925],{"class":75,"line":76},[73,1926,1927],{"class":79},"// .vitepress/config.js\n",[73,1929,1930,1932,1935,1937,1939,1942,1944],{"class":75,"line":83},[73,1931,1319],{"class":96},[73,1933,1934],{"class":246}," META_TITLE ",[73,1936,1325],{"class":86},[73,1938,348],{"class":86},[73,1940,1941],{"class":109},"Blog VitePress",[73,1943,1017],{"class":86},[73,1945,1098],{"class":86},[73,1947,1948],{"class":75,"line":90},[73,1949,953],{"emptyLinePlaceholder":869},[73,1951,1952,1954,1956],{"class":75,"line":118},[73,1953,958],{"class":925},[73,1955,961],{"class":925},[73,1957,151],{"class":86},[73,1959,1960,1963,1965,1967,1970,1972],{"class":75,"line":139},[73,1961,1962],{"class":227},"  lang",[73,1964,103],{"class":86},[73,1966,348],{"class":86},[73,1968,1969],{"class":109},"es",[73,1971,1017],{"class":86},[73,1973,115],{"class":86},[73,1975,1976,1979,1981,1984],{"class":75,"line":154},[73,1977,1978],{"class":227},"  title",[73,1980,103],{"class":86},[73,1982,1983],{"class":246}," META_TITLE",[73,1985,115],{"class":86},[73,1987,1988,1991,1993,1995,1998,2000],{"class":75,"line":176},[73,1989,1990],{"class":227},"  description",[73,1992,103],{"class":86},[73,1994,348],{"class":86},[73,1996,1997],{"class":109},"A new website",[73,1999,1017],{"class":86},[73,2001,115],{"class":86},[73,2003,2004,2007,2009],{"class":75,"line":182},[73,2005,2006],{"class":227},"  themeConfig",[73,2008,103],{"class":86},[73,2010,151],{"class":86},[73,2012,2013,2016,2018,2020],{"class":75,"line":188},[73,2014,2015],{"class":227},"    siteTitle",[73,2017,103],{"class":86},[73,2019,1173],{"class":233},[73,2021,115],{"class":86},[73,2023,2024,2027,2029],{"class":75,"line":555},[73,2025,2026],{"class":227},"    socialLinks",[73,2028,103],{"class":86},[73,2030,992],{"class":246},[73,2032,2033,2036,2039,2041,2043,2046,2048,2050,2053,2055,2057],{"class":75,"line":566},[73,2034,2035],{"class":86},"      {",[73,2037,2038],{"class":227}," icon",[73,2040,103],{"class":86},[73,2042,348],{"class":86},[73,2044,2045],{"class":109},"github",[73,2047,1017],{"class":86},[73,2049,257],{"class":86},[73,2051,2052],{"class":227}," link",[73,2054,103],{"class":86},[73,2056,1358],{"class":86},[73,2058,1158],{"class":86},[73,2060,2061],{"class":75,"line":577},[73,2062,2063],{"class":246},"    ]\n",[73,2065,2066],{"class":75,"line":588},[73,2067,1376],{"class":86},[73,2069,2070,2073,2075],{"class":75,"line":695},[73,2071,2072],{"class":227},"  head",[73,2074,103],{"class":86},[73,2076,992],{"class":246},[73,2078,2079,2082,2084,2087,2089,2091,2093,2096,2098,2100,2103,2105,2107,2109,2111,2113,2116,2118,2120,2123,2125,2127,2130,2132,2134,2136],{"class":75,"line":705},[73,2080,2081],{"class":246},"    [",[73,2083,1017],{"class":86},[73,2085,2086],{"class":109},"link",[73,2088,1017],{"class":86},[73,2090,257],{"class":86},[73,2092,932],{"class":86},[73,2094,2095],{"class":227}," rel",[73,2097,103],{"class":86},[73,2099,348],{"class":86},[73,2101,2102],{"class":109},"icon",[73,2104,1017],{"class":86},[73,2106,257],{"class":86},[73,2108,929],{"class":227},[73,2110,103],{"class":86},[73,2112,348],{"class":86},[73,2114,2115],{"class":109},"image/x-icon",[73,2117,1017],{"class":86},[73,2119,257],{"class":86},[73,2121,2122],{"class":227}," href",[73,2124,103],{"class":86},[73,2126,348],{"class":86},[73,2128,2129],{"class":109},"/vite.ico",[73,2131,1017],{"class":86},[73,2133,938],{"class":86},[73,2135,267],{"class":246},[73,2137,115],{"class":86},[73,2139,2140,2142,2144,2146,2148,2150,2152,2154,2156,2158,2160,2162,2164,2166,2168,2170,2173,2175,2177,2179,2181,2183,2186,2188,2190,2192],{"class":75,"line":713},[73,2141,2081],{"class":246},[73,2143,1017],{"class":86},[73,2145,2086],{"class":109},[73,2147,1017],{"class":86},[73,2149,257],{"class":86},[73,2151,932],{"class":86},[73,2153,2095],{"class":227},[73,2155,103],{"class":86},[73,2157,348],{"class":86},[73,2159,2102],{"class":109},[73,2161,1017],{"class":86},[73,2163,257],{"class":86},[73,2165,929],{"class":227},[73,2167,103],{"class":86},[73,2169,348],{"class":86},[73,2171,2172],{"class":109},"image/png",[73,2174,1017],{"class":86},[73,2176,257],{"class":86},[73,2178,2122],{"class":227},[73,2180,103],{"class":86},[73,2182,348],{"class":86},[73,2184,2185],{"class":109},"/vite.png",[73,2187,1017],{"class":86},[73,2189,938],{"class":86},[73,2191,267],{"class":246},[73,2193,115],{"class":86},[73,2195,2196,2198],{"class":75,"line":724},[73,2197,1083],{"class":246},[73,2199,115],{"class":86},[73,2201,2202],{"class":75,"line":735},[73,2203,191],{"class":86},[45,2205,2207],{"id":2206},"convert-our-markdown-pages-to-a-json-collection","Convert our markdown pages to a JSON collection",[12,2209,2210],{},"Why is it important? 🤔🤔",[12,2212,2213],{},"The answer is simple, the collections help us to create previews of our articles without the need to create double information. (It’s like we have an API)",[12,2215,2216,2217,2221],{},"This is possible thanks to ",[2218,2219,2220],"strong",{},"nodemon, gray-matter, remove-markdown, simultaneously",". Which work together to process and convert a markdown file to a JSON file.",[50,2223,2224],{},[53,2225,2226],{},"Configure our collection data articles.",[63,2228,2230],{"className":203,"code":2229,"language":205,"meta":68,"style":68},"// collection.mjs\nimport fs from 'node:fs/promises';\nimport matter from 'gray-matter';\nimport removeMd from 'remove-markdown';\n\nconst articles = await fs.readdir('./blog/');\n\nconst data = await Promise.all(\n  articles.map(async (article) => {\n    const file = matter.read(`./blog/${article}`, {\n      excerpt: true,\n      excerpt_separator: ''\n    });\n\n    const { data, content, path } = file;\n    const contents = removeMd(content).trim().split(/\\r\\n|\\n|\\r/);\n\n    return {\n      ...data,\n      title: contents[0].replace(/\\s{2,}/g, '').trim(),\n      path: path.replace(/\\.md$/, '.html'),\n      description: contents.slice(1).join('').replace(/\\s{2,}/g, '').trim().substring(0, 300) + '...'\n    }\n  })\n)\n\nawait fs.writeFile('./data.json', JSON.stringify(data), 'utf-8');\n",[70,2231,2232,2237,2256,2274,2292,2296,2330,2334,2356,2382,2419,2430,2440,2449,2453,2480,2536,2540,2547,2557,2607,2646,2732,2736,2743,2747,2751],{"__ignoreMap":68},[73,2233,2234],{"class":75,"line":76},[73,2235,2236],{"class":79},"// collection.mjs\n",[73,2238,2239,2241,2244,2247,2249,2252,2254],{"class":75,"line":83},[73,2240,926],{"class":925},[73,2242,2243],{"class":246}," fs ",[73,2245,2246],{"class":925},"from",[73,2248,348],{"class":86},[73,2250,2251],{"class":109},"node:fs/promises",[73,2253,1017],{"class":86},[73,2255,1098],{"class":86},[73,2257,2258,2260,2263,2265,2267,2270,2272],{"class":75,"line":90},[73,2259,926],{"class":925},[73,2261,2262],{"class":246}," matter ",[73,2264,2246],{"class":925},[73,2266,348],{"class":86},[73,2268,2269],{"class":109},"gray-matter",[73,2271,1017],{"class":86},[73,2273,1098],{"class":86},[73,2275,2276,2278,2281,2283,2285,2288,2290],{"class":75,"line":118},[73,2277,926],{"class":925},[73,2279,2280],{"class":246}," removeMd ",[73,2282,2246],{"class":925},[73,2284,348],{"class":86},[73,2286,2287],{"class":109},"remove-markdown",[73,2289,1017],{"class":86},[73,2291,1098],{"class":86},[73,2293,2294],{"class":75,"line":139},[73,2295,953],{"emptyLinePlaceholder":869},[73,2297,2298,2300,2303,2305,2308,2311,2314,2317,2319,2321,2324,2326,2328],{"class":75,"line":154},[73,2299,1319],{"class":96},[73,2301,2302],{"class":246}," articles ",[73,2304,1325],{"class":86},[73,2306,2307],{"class":925}," await",[73,2309,2310],{"class":246}," fs",[73,2312,2313],{"class":86},".",[73,2315,2316],{"class":973},"readdir",[73,2318,1063],{"class":246},[73,2320,1017],{"class":86},[73,2322,2323],{"class":109},"./blog/",[73,2325,1017],{"class":86},[73,2327,986],{"class":246},[73,2329,1098],{"class":86},[73,2331,2332],{"class":75,"line":176},[73,2333,953],{"emptyLinePlaceholder":869},[73,2335,2336,2338,2341,2343,2345,2348,2350,2353],{"class":75,"line":182},[73,2337,1319],{"class":96},[73,2339,2340],{"class":246}," data ",[73,2342,1325],{"class":86},[73,2344,2307],{"class":925},[73,2346,2347],{"class":160}," Promise",[73,2349,2313],{"class":86},[73,2351,2352],{"class":973},"all",[73,2354,2355],{"class":246},"(\n",[73,2357,2358,2361,2363,2366,2368,2371,2373,2376,2378,2380],{"class":75,"line":188},[73,2359,2360],{"class":246},"  articles",[73,2362,2313],{"class":86},[73,2364,2365],{"class":973},"map",[73,2367,1063],{"class":246},[73,2369,2370],{"class":96},"async",[73,2372,979],{"class":86},[73,2374,2375],{"class":982},"article",[73,2377,986],{"class":86},[73,2379,989],{"class":96},[73,2381,151],{"class":86},[73,2383,2384,2387,2390,2392,2395,2397,2400,2402,2405,2407,2410,2412,2415,2417],{"class":75,"line":555},[73,2385,2386],{"class":96},"    const",[73,2388,2389],{"class":246}," file",[73,2391,220],{"class":86},[73,2393,2394],{"class":246}," matter",[73,2396,2313],{"class":86},[73,2398,2399],{"class":973},"read",[73,2401,1063],{"class":227},[73,2403,2404],{"class":86},"`",[73,2406,2323],{"class":109},[73,2408,2409],{"class":86},"${",[73,2411,2375],{"class":246},[73,2413,2414],{"class":86},"}`",[73,2416,257],{"class":86},[73,2418,151],{"class":86},[73,2420,2421,2424,2426,2428],{"class":75,"line":566},[73,2422,2423],{"class":227},"      excerpt",[73,2425,103],{"class":86},[73,2427,234],{"class":233},[73,2429,115],{"class":86},[73,2431,2432,2435,2437],{"class":75,"line":577},[73,2433,2434],{"class":227},"      excerpt_separator",[73,2436,103],{"class":86},[73,2438,2439],{"class":86}," ''\n",[73,2441,2442,2445,2447],{"class":75,"line":588},[73,2443,2444],{"class":86},"    }",[73,2446,986],{"class":227},[73,2448,1098],{"class":86},[73,2450,2451],{"class":75,"line":695},[73,2452,953],{"emptyLinePlaceholder":869},[73,2454,2455,2457,2459,2462,2464,2467,2469,2472,2474,2476,2478],{"class":75,"line":705},[73,2456,2386],{"class":96},[73,2458,932],{"class":86},[73,2460,2461],{"class":246}," data",[73,2463,257],{"class":86},[73,2465,2466],{"class":246}," content",[73,2468,257],{"class":86},[73,2470,2471],{"class":246}," path",[73,2473,938],{"class":86},[73,2475,220],{"class":86},[73,2477,2389],{"class":246},[73,2479,1098],{"class":86},[73,2481,2482,2484,2487,2489,2492,2494,2497,2499,2501,2504,2507,2509,2512,2514,2516,2519,2522,2525,2527,2530,2532,2534],{"class":75,"line":713},[73,2483,2386],{"class":96},[73,2485,2486],{"class":246}," contents",[73,2488,220],{"class":86},[73,2490,2491],{"class":973}," removeMd",[73,2493,1063],{"class":227},[73,2495,2496],{"class":246},"content",[73,2498,986],{"class":227},[73,2500,2313],{"class":86},[73,2502,2503],{"class":973},"trim",[73,2505,2506],{"class":227},"()",[73,2508,2313],{"class":86},[73,2510,2511],{"class":973},"split",[73,2513,1063],{"class":227},[73,2515,1036],{"class":86},[73,2517,2518],{"class":109},"\\r\\n",[73,2520,2521],{"class":86},"|",[73,2523,2524],{"class":109},"\\n",[73,2526,2521],{"class":86},[73,2528,2529],{"class":109},"\\r",[73,2531,1036],{"class":86},[73,2533,986],{"class":227},[73,2535,1098],{"class":86},[73,2537,2538],{"class":75,"line":724},[73,2539,953],{"emptyLinePlaceholder":869},[73,2541,2542,2545],{"class":75,"line":735},[73,2543,2544],{"class":925},"    return",[73,2546,151],{"class":86},[73,2548,2549,2552,2555],{"class":75,"line":743},[73,2550,2551],{"class":86},"      ...",[73,2553,2554],{"class":246},"data",[73,2556,115],{"class":86},[73,2558,2559,2562,2564,2566,2569,2573,2575,2577,2580,2582,2584,2587,2590,2593,2595,2597,2599,2601,2603,2605],{"class":75,"line":757},[73,2560,2561],{"class":227},"      title",[73,2563,103],{"class":86},[73,2565,2486],{"class":246},[73,2567,2568],{"class":227},"[",[73,2570,2572],{"class":2571},"sbssI","0",[73,2574,267],{"class":227},[73,2576,2313],{"class":86},[73,2578,2579],{"class":973},"replace",[73,2581,1063],{"class":227},[73,2583,1036],{"class":86},[73,2585,2586],{"class":109},"\\s",[73,2588,2589],{"class":86},"{2,}/",[73,2591,2592],{"class":2571},"g",[73,2594,257],{"class":86},[73,2596,1358],{"class":86},[73,2598,986],{"class":227},[73,2600,2313],{"class":86},[73,2602,2503],{"class":973},[73,2604,2506],{"class":227},[73,2606,115],{"class":86},[73,2608,2609,2611,2613,2615,2617,2619,2621,2623,2626,2628,2631,2633,2635,2637,2640,2642,2644],{"class":75,"line":768},[73,2610,1029],{"class":227},[73,2612,103],{"class":86},[73,2614,2471],{"class":246},[73,2616,2313],{"class":86},[73,2618,2579],{"class":973},[73,2620,1063],{"class":227},[73,2622,1036],{"class":86},[73,2624,2625],{"class":246},"\\.",[73,2627,867],{"class":109},[73,2629,2630],{"class":925},"$",[73,2632,1036],{"class":86},[73,2634,257],{"class":86},[73,2636,348],{"class":86},[73,2638,2639],{"class":109},".html",[73,2641,1017],{"class":86},[73,2643,986],{"class":227},[73,2645,115],{"class":86},[73,2647,2648,2651,2653,2655,2657,2660,2662,2665,2667,2669,2672,2674,2677,2679,2681,2683,2685,2687,2689,2691,2693,2695,2697,2699,2701,2703,2705,2707,2710,2712,2714,2716,2719,2722,2725,2727,2730],{"class":75,"line":778},[73,2649,2650],{"class":227},"      description",[73,2652,103],{"class":86},[73,2654,2486],{"class":246},[73,2656,2313],{"class":86},[73,2658,2659],{"class":973},"slice",[73,2661,1063],{"class":227},[73,2663,2664],{"class":2571},"1",[73,2666,986],{"class":227},[73,2668,2313],{"class":86},[73,2670,2671],{"class":973},"join",[73,2673,1063],{"class":227},[73,2675,2676],{"class":86},"''",[73,2678,986],{"class":227},[73,2680,2313],{"class":86},[73,2682,2579],{"class":973},[73,2684,1063],{"class":227},[73,2686,1036],{"class":86},[73,2688,2586],{"class":109},[73,2690,2589],{"class":86},[73,2692,2592],{"class":2571},[73,2694,257],{"class":86},[73,2696,1358],{"class":86},[73,2698,986],{"class":227},[73,2700,2313],{"class":86},[73,2702,2503],{"class":973},[73,2704,2506],{"class":227},[73,2706,2313],{"class":86},[73,2708,2709],{"class":973},"substring",[73,2711,1063],{"class":227},[73,2713,2572],{"class":2571},[73,2715,257],{"class":86},[73,2717,2718],{"class":2571}," 300",[73,2720,2721],{"class":227},") ",[73,2723,2724],{"class":86},"+",[73,2726,348],{"class":86},[73,2728,2729],{"class":109},"...",[73,2731,353],{"class":86},[73,2733,2734],{"class":75,"line":785},[73,2735,1078],{"class":86},[73,2737,2738,2741],{"class":75,"line":795},[73,2739,2740],{"class":86},"  }",[73,2742,1073],{"class":246},[73,2744,2745],{"class":75,"line":805},[73,2746,1073],{"class":246},[73,2748,2749],{"class":75,"line":815},[73,2750,953],{"emptyLinePlaceholder":869},[73,2752,2754,2757,2759,2761,2764,2766,2768,2771,2773,2775,2778,2780,2783,2786,2788,2790,2793,2795,2797],{"class":75,"line":2753},27,[73,2755,2756],{"class":925},"await",[73,2758,2310],{"class":246},[73,2760,2313],{"class":86},[73,2762,2763],{"class":973},"writeFile",[73,2765,1063],{"class":246},[73,2767,1017],{"class":86},[73,2769,2770],{"class":109},"./data.json",[73,2772,1017],{"class":86},[73,2774,257],{"class":86},[73,2776,2777],{"class":246}," JSON",[73,2779,2313],{"class":86},[73,2781,2782],{"class":973},"stringify",[73,2784,2785],{"class":246},"(data)",[73,2787,257],{"class":86},[73,2789,348],{"class":86},[73,2791,2792],{"class":109},"utf-8",[73,2794,1017],{"class":86},[73,2796,986],{"class":246},[73,2798,1098],{"class":86},[50,2800,2801],{"start":83},[53,2802,2803],{},"Now, build a new JSON file. (This command will generate one more file for our project, where it simplifies the markdown items to JSON).",[63,2805,2807],{"className":1670,"code":2806,"language":1672,"meta":68,"style":68},"yarn build && yarn dev\n",[70,2808,2809],{"__ignoreMap":68},[73,2810,2811,2813,2816,2818,2821],{"class":75,"line":76},[73,2812,523],{"class":160},[73,2814,2815],{"class":109}," build",[73,2817,1685],{"class":86},[73,2819,2820],{"class":160}," yarn",[73,2822,2823],{"class":109}," dev\n",[45,2825,2827],{"id":2826},"creating-new-vue-components","Creating new Vue components",[50,2829,2830],{},[53,2831,2832],{},"Create a Hero component.",[63,2834,2837],{"className":2835,"code":2836,"language":1642,"meta":68,"style":68},"language-vue shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u003C!-- .vitepress/components/Hero.vue -->\n\u003Cscript setup>\nimport DefaultTheme from 'vitepress/theme'\n\nconst { Layout } = DefaultTheme;\n\n\u003C/script>\n\n\u003Ctemplate #home-hero-before>\n  \u003Cdiv class=\"container\">\n    \u003Cdiv class=\"banner\">\n      \u003Cdiv class=\"banner-hero\">\u003C/div>\n      \u003Cdiv class=\"banner-hero-text\">\n        \u003Ch1>Creating a new blog\u003C/h1>\n      \u003C/div>\n    \u003C/div>\n  \u003C/div>\n\u003C/template>\n",[70,2838,2839,2844,2858,2874,2878,2896,2900,2909,2913,2928,2950,2970,2995,3014,3034,3043,3052,3061],{"__ignoreMap":68},[73,2840,2841],{"class":75,"line":76},[73,2842,2843],{"class":79},"\u003C!-- .vitepress/components/Hero.vue -->\n",[73,2845,2846,2849,2852,2855],{"class":75,"line":83},[73,2847,2848],{"class":86},"\u003C",[73,2850,2851],{"class":227},"script",[73,2853,2854],{"class":96}," setup",[73,2856,2857],{"class":86},">\n",[73,2859,2860,2862,2865,2867,2869,2872],{"class":75,"line":90},[73,2861,926],{"class":925},[73,2863,2864],{"class":246}," DefaultTheme ",[73,2866,2246],{"class":925},[73,2868,348],{"class":86},[73,2870,2871],{"class":109},"vitepress/theme",[73,2873,353],{"class":86},[73,2875,2876],{"class":75,"line":118},[73,2877,953],{"emptyLinePlaceholder":869},[73,2879,2880,2882,2884,2887,2889,2891,2894],{"class":75,"line":139},[73,2881,1319],{"class":96},[73,2883,932],{"class":86},[73,2885,2886],{"class":246}," Layout ",[73,2888,1090],{"class":86},[73,2890,220],{"class":86},[73,2892,2893],{"class":246}," DefaultTheme",[73,2895,1098],{"class":86},[73,2897,2898],{"class":75,"line":154},[73,2899,953],{"emptyLinePlaceholder":869},[73,2901,2902,2905,2907],{"class":75,"line":176},[73,2903,2904],{"class":86},"\u003C/",[73,2906,2851],{"class":227},[73,2908,2857],{"class":86},[73,2910,2911],{"class":75,"line":182},[73,2912,953],{"emptyLinePlaceholder":869},[73,2914,2915,2917,2920,2923,2926],{"class":75,"line":188},[73,2916,2848],{"class":86},[73,2918,2919],{"class":227},"template",[73,2921,2922],{"class":86}," #",[73,2924,2925],{"class":96},"home-hero-before",[73,2927,2857],{"class":86},[73,2929,2930,2933,2936,2939,2941,2943,2946,2948],{"class":75,"line":555},[73,2931,2932],{"class":86},"  \u003C",[73,2934,2935],{"class":227},"div",[73,2937,2938],{"class":96}," class",[73,2940,1325],{"class":86},[73,2942,100],{"class":86},[73,2944,2945],{"class":109},"container",[73,2947,100],{"class":86},[73,2949,2857],{"class":86},[73,2951,2952,2955,2957,2959,2961,2963,2966,2968],{"class":75,"line":566},[73,2953,2954],{"class":86},"    \u003C",[73,2956,2935],{"class":227},[73,2958,2938],{"class":96},[73,2960,1325],{"class":86},[73,2962,100],{"class":86},[73,2964,2965],{"class":109},"banner",[73,2967,100],{"class":86},[73,2969,2857],{"class":86},[73,2971,2972,2975,2977,2979,2981,2983,2986,2988,2991,2993],{"class":75,"line":577},[73,2973,2974],{"class":86},"      \u003C",[73,2976,2935],{"class":227},[73,2978,2938],{"class":96},[73,2980,1325],{"class":86},[73,2982,100],{"class":86},[73,2984,2985],{"class":109},"banner-hero",[73,2987,100],{"class":86},[73,2989,2990],{"class":86},">\u003C/",[73,2992,2935],{"class":227},[73,2994,2857],{"class":86},[73,2996,2997,2999,3001,3003,3005,3007,3010,3012],{"class":75,"line":588},[73,2998,2974],{"class":86},[73,3000,2935],{"class":227},[73,3002,2938],{"class":96},[73,3004,1325],{"class":86},[73,3006,100],{"class":86},[73,3008,3009],{"class":109},"banner-hero-text",[73,3011,100],{"class":86},[73,3013,2857],{"class":86},[73,3015,3016,3019,3022,3025,3028,3030,3032],{"class":75,"line":695},[73,3017,3018],{"class":86},"        \u003C",[73,3020,3021],{"class":227},"h1",[73,3023,3024],{"class":86},">",[73,3026,3027],{"class":246},"Creating a new blog",[73,3029,2904],{"class":86},[73,3031,3021],{"class":227},[73,3033,2857],{"class":86},[73,3035,3036,3039,3041],{"class":75,"line":705},[73,3037,3038],{"class":86},"      \u003C/",[73,3040,2935],{"class":227},[73,3042,2857],{"class":86},[73,3044,3045,3048,3050],{"class":75,"line":713},[73,3046,3047],{"class":86},"    \u003C/",[73,3049,2935],{"class":227},[73,3051,2857],{"class":86},[73,3053,3054,3057,3059],{"class":75,"line":724},[73,3055,3056],{"class":86},"  \u003C/",[73,3058,2935],{"class":227},[73,3060,2857],{"class":86},[73,3062,3063,3065,3067],{"class":75,"line":735},[73,3064,2904],{"class":86},[73,3066,2919],{"class":227},[73,3068,2857],{"class":86},[50,3070,3071],{"start":83},[53,3072,3073],{},"Now it’s time to create a component to list our articles that have been created in the blog folder.",[63,3075,3077],{"className":2835,"code":3076,"language":1642,"meta":68,"style":68},"\u003C!-- .vitepress/components/ListArticles.vue -->\n\u003Cscript setup>\nimport data from '../../data.json';\nimport DefaultTheme from 'vitepress/theme';\nimport Card from './Card.vue';\n\nconst { Layout } = DefaultTheme;\n\n// sort articles\nconst articles = data.sort(\n  (a, b) => new Date(b.Updated) - new Date(a.Updated)\n)\n\n\u003C/script>\n\n\u003Ctemplate>\n  \u003CLayout>\n    \u003Ctemplate #home-hero-after>\n      \u003Cdiv class=\"container\">\n        \u003Ch2 class=\"title\">List of recent added articles\u003C/h2>\u003Cbr>\n        \u003Cdiv class=\"article-container\">\n          \u003Cdiv v-for=\"article in articles\">\n            \u003CCard :article=\"article\" />\n          \u003C/div>\n        \u003C/div>\n      \u003C/div>\n    \u003C/template>\n  \u003C/Layout>\n\u003C/template>\n",[70,3078,3079,3084,3094,3111,3127,3145,3149,3165,3169,3174,3191,3236,3240,3244,3252,3256,3264,3273,3286,3304,3338,3357,3383,3407,3416,3425,3433,3441,3450],{"__ignoreMap":68},[73,3080,3081],{"class":75,"line":76},[73,3082,3083],{"class":79},"\u003C!-- .vitepress/components/ListArticles.vue -->\n",[73,3085,3086,3088,3090,3092],{"class":75,"line":83},[73,3087,2848],{"class":86},[73,3089,2851],{"class":227},[73,3091,2854],{"class":96},[73,3093,2857],{"class":86},[73,3095,3096,3098,3100,3102,3104,3107,3109],{"class":75,"line":90},[73,3097,926],{"class":925},[73,3099,2340],{"class":246},[73,3101,2246],{"class":925},[73,3103,348],{"class":86},[73,3105,3106],{"class":109},"../../data.json",[73,3108,1017],{"class":86},[73,3110,1098],{"class":86},[73,3112,3113,3115,3117,3119,3121,3123,3125],{"class":75,"line":118},[73,3114,926],{"class":925},[73,3116,2864],{"class":246},[73,3118,2246],{"class":925},[73,3120,348],{"class":86},[73,3122,2871],{"class":109},[73,3124,1017],{"class":86},[73,3126,1098],{"class":86},[73,3128,3129,3131,3134,3136,3138,3141,3143],{"class":75,"line":139},[73,3130,926],{"class":925},[73,3132,3133],{"class":246}," Card ",[73,3135,2246],{"class":925},[73,3137,348],{"class":86},[73,3139,3140],{"class":109},"./Card.vue",[73,3142,1017],{"class":86},[73,3144,1098],{"class":86},[73,3146,3147],{"class":75,"line":154},[73,3148,953],{"emptyLinePlaceholder":869},[73,3150,3151,3153,3155,3157,3159,3161,3163],{"class":75,"line":176},[73,3152,1319],{"class":96},[73,3154,932],{"class":86},[73,3156,2886],{"class":246},[73,3158,1090],{"class":86},[73,3160,220],{"class":86},[73,3162,2893],{"class":246},[73,3164,1098],{"class":86},[73,3166,3167],{"class":75,"line":182},[73,3168,953],{"emptyLinePlaceholder":869},[73,3170,3171],{"class":75,"line":188},[73,3172,3173],{"class":79},"// sort articles\n",[73,3175,3176,3178,3180,3182,3184,3186,3189],{"class":75,"line":555},[73,3177,1319],{"class":96},[73,3179,2302],{"class":246},[73,3181,1325],{"class":86},[73,3183,2461],{"class":246},[73,3185,2313],{"class":86},[73,3187,3188],{"class":973},"sort",[73,3190,2355],{"class":246},[73,3192,3193,3196,3198,3200,3203,3205,3207,3210,3213,3216,3218,3221,3224,3226,3228,3231,3233],{"class":75,"line":566},[73,3194,3195],{"class":86},"  (",[73,3197,25],{"class":982},[73,3199,257],{"class":86},[73,3201,3202],{"class":982}," b",[73,3204,986],{"class":86},[73,3206,989],{"class":96},[73,3208,3209],{"class":86}," new",[73,3211,3212],{"class":973}," Date",[73,3214,3215],{"class":246},"(b",[73,3217,2313],{"class":86},[73,3219,3220],{"class":246},"Updated) ",[73,3222,3223],{"class":86},"-",[73,3225,3209],{"class":86},[73,3227,3212],{"class":973},[73,3229,3230],{"class":246},"(a",[73,3232,2313],{"class":86},[73,3234,3235],{"class":246},"Updated)\n",[73,3237,3238],{"class":75,"line":577},[73,3239,1073],{"class":246},[73,3241,3242],{"class":75,"line":588},[73,3243,953],{"emptyLinePlaceholder":869},[73,3245,3246,3248,3250],{"class":75,"line":695},[73,3247,2904],{"class":86},[73,3249,2851],{"class":227},[73,3251,2857],{"class":86},[73,3253,3254],{"class":75,"line":705},[73,3255,953],{"emptyLinePlaceholder":869},[73,3257,3258,3260,3262],{"class":75,"line":713},[73,3259,2848],{"class":86},[73,3261,2919],{"class":227},[73,3263,2857],{"class":86},[73,3265,3266,3268,3271],{"class":75,"line":724},[73,3267,2932],{"class":86},[73,3269,3270],{"class":227},"Layout",[73,3272,2857],{"class":86},[73,3274,3275,3277,3279,3281,3284],{"class":75,"line":735},[73,3276,2954],{"class":86},[73,3278,2919],{"class":227},[73,3280,2922],{"class":86},[73,3282,3283],{"class":96},"home-hero-after",[73,3285,2857],{"class":86},[73,3287,3288,3290,3292,3294,3296,3298,3300,3302],{"class":75,"line":743},[73,3289,2974],{"class":86},[73,3291,2935],{"class":227},[73,3293,2938],{"class":96},[73,3295,1325],{"class":86},[73,3297,100],{"class":86},[73,3299,2945],{"class":109},[73,3301,100],{"class":86},[73,3303,2857],{"class":86},[73,3305,3306,3308,3310,3312,3314,3316,3319,3321,3323,3326,3328,3330,3333,3336],{"class":75,"line":757},[73,3307,3018],{"class":86},[73,3309,45],{"class":227},[73,3311,2938],{"class":96},[73,3313,1325],{"class":86},[73,3315,100],{"class":86},[73,3317,3318],{"class":109},"title",[73,3320,100],{"class":86},[73,3322,3024],{"class":86},[73,3324,3325],{"class":246},"List of recent added articles",[73,3327,2904],{"class":86},[73,3329,45],{"class":227},[73,3331,3332],{"class":86},">\u003C",[73,3334,3335],{"class":227},"br",[73,3337,2857],{"class":86},[73,3339,3340,3342,3344,3346,3348,3350,3353,3355],{"class":75,"line":768},[73,3341,3018],{"class":86},[73,3343,2935],{"class":227},[73,3345,2938],{"class":96},[73,3347,1325],{"class":86},[73,3349,100],{"class":86},[73,3351,3352],{"class":109},"article-container",[73,3354,100],{"class":86},[73,3356,2857],{"class":86},[73,3358,3359,3362,3364,3367,3369,3371,3373,3376,3379,3381],{"class":75,"line":778},[73,3360,3361],{"class":86},"          \u003C",[73,3363,2935],{"class":227},[73,3365,3366],{"class":925}," v-for",[73,3368,1325],{"class":86},[73,3370,100],{"class":86},[73,3372,2375],{"class":246},[73,3374,3375],{"class":86}," in ",[73,3377,3378],{"class":246},"articles",[73,3380,100],{"class":86},[73,3382,2857],{"class":86},[73,3384,3385,3388,3391,3394,3396,3398,3400,3402,3404],{"class":75,"line":785},[73,3386,3387],{"class":86},"            \u003C",[73,3389,3390],{"class":227},"Card",[73,3392,3393],{"class":86}," :",[73,3395,2375],{"class":96},[73,3397,1325],{"class":86},[73,3399,100],{"class":86},[73,3401,2375],{"class":246},[73,3403,100],{"class":86},[73,3405,3406],{"class":86}," />\n",[73,3408,3409,3412,3414],{"class":75,"line":795},[73,3410,3411],{"class":86},"          \u003C/",[73,3413,2935],{"class":227},[73,3415,2857],{"class":86},[73,3417,3418,3421,3423],{"class":75,"line":805},[73,3419,3420],{"class":86},"        \u003C/",[73,3422,2935],{"class":227},[73,3424,2857],{"class":86},[73,3426,3427,3429,3431],{"class":75,"line":815},[73,3428,3038],{"class":86},[73,3430,2935],{"class":227},[73,3432,2857],{"class":86},[73,3434,3435,3437,3439],{"class":75,"line":2753},[73,3436,3047],{"class":86},[73,3438,2919],{"class":227},[73,3440,2857],{"class":86},[73,3442,3444,3446,3448],{"class":75,"line":3443},28,[73,3445,3056],{"class":86},[73,3447,3270],{"class":227},[73,3449,2857],{"class":86},[73,3451,3453,3455,3457],{"class":75,"line":3452},29,[73,3454,2904],{"class":86},[73,3456,2919],{"class":227},[73,3458,2857],{"class":86},[50,3460,3461],{"start":90},[53,3462,3463],{},"We can also create a single card component for each article preview.",[63,3465,3467],{"className":2835,"code":3466,"language":1642,"meta":68,"style":68},"\u003C!-- .vitepress/components/Card.vue -->\n\u003Cscript setup>\n  defineProps({\n    article: Object\n  });\n\n  const transformDate = (date) => {\n    return new Date(date).toLocaleDateString('en-US', {\n      year: 'numeric',\n      month: 'long',\n      day: 'numeric'\n    })\n  }\n\n\u003C/script>\n\n\u003Ctemplate>\n  \u003Ca :href=\"article.path\">\n    \u003Cdiv class=\"card\">\n      \u003Cdiv class=\"card-header\">\n        \u003Cimg :src=\"article.image\" :alt=\"article.title\" />\n      \u003C/div>\n      \u003Cdiv class=\"card-body\">\n        \u003Ch4>\n          {{ article.title }}\n        \u003C/h4>\n        \u003Cp>\n          {{ article.description }}\n        \u003C/p>\n        \u003Cdiv>\n          \u003Ch5 class=\"date\">{{ transformDate(article.Updated) }}\u003C/h5>\n        \u003C/div>\n      \u003C/div>\n    \u003C/div>\n  \u003C/a>\n\u003C/template>\n",[70,3468,3469,3474,3484,3493,3503,3511,3515,3536,3568,3584,3600,3613,3619,3623,3627,3635,3639,3647,3673,3692,3711,3754,3762,3781,3790,3806,3814,3822,3835,3843,3852,3890,3899,3908,3917,3926],{"__ignoreMap":68},[73,3470,3471],{"class":75,"line":76},[73,3472,3473],{"class":79},"\u003C!-- .vitepress/components/Card.vue -->\n",[73,3475,3476,3478,3480,3482],{"class":75,"line":83},[73,3477,2848],{"class":86},[73,3479,2851],{"class":227},[73,3481,2854],{"class":96},[73,3483,2857],{"class":86},[73,3485,3486,3489,3491],{"class":75,"line":90},[73,3487,3488],{"class":973},"  defineProps",[73,3490,1063],{"class":246},[73,3492,87],{"class":86},[73,3494,3495,3498,3500],{"class":75,"line":118},[73,3496,3497],{"class":227},"    article",[73,3499,103],{"class":86},[73,3501,3502],{"class":246}," Object\n",[73,3504,3505,3507,3509],{"class":75,"line":139},[73,3506,2740],{"class":86},[73,3508,986],{"class":246},[73,3510,1098],{"class":86},[73,3512,3513],{"class":75,"line":154},[73,3514,953],{"emptyLinePlaceholder":869},[73,3516,3517,3520,3523,3525,3527,3530,3532,3534],{"class":75,"line":176},[73,3518,3519],{"class":96},"  const",[73,3521,3522],{"class":246}," transformDate ",[73,3524,1325],{"class":86},[73,3526,979],{"class":86},[73,3528,3529],{"class":982},"date",[73,3531,986],{"class":86},[73,3533,989],{"class":96},[73,3535,151],{"class":86},[73,3537,3538,3540,3542,3544,3546,3548,3550,3552,3555,3557,3559,3562,3564,3566],{"class":75,"line":182},[73,3539,2544],{"class":925},[73,3541,3209],{"class":86},[73,3543,3212],{"class":973},[73,3545,1063],{"class":227},[73,3547,3529],{"class":246},[73,3549,986],{"class":227},[73,3551,2313],{"class":86},[73,3553,3554],{"class":973},"toLocaleDateString",[73,3556,1063],{"class":227},[73,3558,1017],{"class":86},[73,3560,3561],{"class":109},"en-US",[73,3563,1017],{"class":86},[73,3565,257],{"class":86},[73,3567,151],{"class":86},[73,3569,3570,3573,3575,3577,3580,3582],{"class":75,"line":188},[73,3571,3572],{"class":227},"      year",[73,3574,103],{"class":86},[73,3576,348],{"class":86},[73,3578,3579],{"class":109},"numeric",[73,3581,1017],{"class":86},[73,3583,115],{"class":86},[73,3585,3586,3589,3591,3593,3596,3598],{"class":75,"line":555},[73,3587,3588],{"class":227},"      month",[73,3590,103],{"class":86},[73,3592,348],{"class":86},[73,3594,3595],{"class":109},"long",[73,3597,1017],{"class":86},[73,3599,115],{"class":86},[73,3601,3602,3605,3607,3609,3611],{"class":75,"line":566},[73,3603,3604],{"class":227},"      day",[73,3606,103],{"class":86},[73,3608,348],{"class":86},[73,3610,3579],{"class":109},[73,3612,353],{"class":86},[73,3614,3615,3617],{"class":75,"line":577},[73,3616,2444],{"class":86},[73,3618,1073],{"class":227},[73,3620,3621],{"class":75,"line":588},[73,3622,179],{"class":86},[73,3624,3625],{"class":75,"line":695},[73,3626,953],{"emptyLinePlaceholder":869},[73,3628,3629,3631,3633],{"class":75,"line":705},[73,3630,2904],{"class":86},[73,3632,2851],{"class":227},[73,3634,2857],{"class":86},[73,3636,3637],{"class":75,"line":713},[73,3638,953],{"emptyLinePlaceholder":869},[73,3640,3641,3643,3645],{"class":75,"line":724},[73,3642,2848],{"class":86},[73,3644,2919],{"class":227},[73,3646,2857],{"class":86},[73,3648,3649,3651,3653,3655,3658,3660,3662,3664,3666,3669,3671],{"class":75,"line":735},[73,3650,2932],{"class":86},[73,3652,25],{"class":227},[73,3654,3393],{"class":86},[73,3656,3657],{"class":96},"href",[73,3659,1325],{"class":86},[73,3661,100],{"class":86},[73,3663,2375],{"class":246},[73,3665,2313],{"class":86},[73,3667,3668],{"class":246},"path",[73,3670,100],{"class":86},[73,3672,2857],{"class":86},[73,3674,3675,3677,3679,3681,3683,3685,3688,3690],{"class":75,"line":743},[73,3676,2954],{"class":86},[73,3678,2935],{"class":227},[73,3680,2938],{"class":96},[73,3682,1325],{"class":86},[73,3684,100],{"class":86},[73,3686,3687],{"class":109},"card",[73,3689,100],{"class":86},[73,3691,2857],{"class":86},[73,3693,3694,3696,3698,3700,3702,3704,3707,3709],{"class":75,"line":757},[73,3695,2974],{"class":86},[73,3697,2935],{"class":227},[73,3699,2938],{"class":96},[73,3701,1325],{"class":86},[73,3703,100],{"class":86},[73,3705,3706],{"class":109},"card-header",[73,3708,100],{"class":86},[73,3710,2857],{"class":86},[73,3712,3713,3715,3717,3719,3722,3724,3726,3728,3730,3733,3735,3737,3740,3742,3744,3746,3748,3750,3752],{"class":75,"line":768},[73,3714,3018],{"class":86},[73,3716,40],{"class":227},[73,3718,3393],{"class":86},[73,3720,3721],{"class":96},"src",[73,3723,1325],{"class":86},[73,3725,100],{"class":86},[73,3727,2375],{"class":246},[73,3729,2313],{"class":86},[73,3731,3732],{"class":246},"image",[73,3734,100],{"class":86},[73,3736,3393],{"class":86},[73,3738,3739],{"class":96},"alt",[73,3741,1325],{"class":86},[73,3743,100],{"class":86},[73,3745,2375],{"class":246},[73,3747,2313],{"class":86},[73,3749,3318],{"class":246},[73,3751,100],{"class":86},[73,3753,3406],{"class":86},[73,3755,3756,3758,3760],{"class":75,"line":778},[73,3757,3038],{"class":86},[73,3759,2935],{"class":227},[73,3761,2857],{"class":86},[73,3763,3764,3766,3768,3770,3772,3774,3777,3779],{"class":75,"line":785},[73,3765,2974],{"class":86},[73,3767,2935],{"class":227},[73,3769,2938],{"class":96},[73,3771,1325],{"class":86},[73,3773,100],{"class":86},[73,3775,3776],{"class":109},"card-body",[73,3778,100],{"class":86},[73,3780,2857],{"class":86},[73,3782,3783,3785,3788],{"class":75,"line":795},[73,3784,3018],{"class":86},[73,3786,3787],{"class":227},"h4",[73,3789,2857],{"class":86},[73,3791,3792,3795,3798,3800,3803],{"class":75,"line":805},[73,3793,3794],{"class":86},"          {{",[73,3796,3797],{"class":246}," article",[73,3799,2313],{"class":86},[73,3801,3802],{"class":246},"title ",[73,3804,3805],{"class":86},"}}\n",[73,3807,3808,3810,3812],{"class":75,"line":815},[73,3809,3420],{"class":86},[73,3811,3787],{"class":227},[73,3813,2857],{"class":86},[73,3815,3816,3818,3820],{"class":75,"line":2753},[73,3817,3018],{"class":86},[73,3819,12],{"class":227},[73,3821,2857],{"class":86},[73,3823,3824,3826,3828,3830,3833],{"class":75,"line":3443},[73,3825,3794],{"class":86},[73,3827,3797],{"class":246},[73,3829,2313],{"class":86},[73,3831,3832],{"class":246},"description ",[73,3834,3805],{"class":86},[73,3836,3837,3839,3841],{"class":75,"line":3452},[73,3838,3420],{"class":86},[73,3840,12],{"class":227},[73,3842,2857],{"class":86},[73,3844,3846,3848,3850],{"class":75,"line":3845},30,[73,3847,3018],{"class":86},[73,3849,2935],{"class":227},[73,3851,2857],{"class":86},[73,3853,3855,3857,3860,3862,3864,3866,3868,3870,3873,3876,3879,3881,3883,3886,3888],{"class":75,"line":3854},31,[73,3856,3361],{"class":86},[73,3858,3859],{"class":227},"h5",[73,3861,2938],{"class":96},[73,3863,1325],{"class":86},[73,3865,100],{"class":86},[73,3867,3529],{"class":109},[73,3869,100],{"class":86},[73,3871,3872],{"class":86},">{{",[73,3874,3875],{"class":973}," transformDate",[73,3877,3878],{"class":246},"(article",[73,3880,2313],{"class":86},[73,3882,3220],{"class":246},[73,3884,3885],{"class":86},"}}\u003C/",[73,3887,3859],{"class":227},[73,3889,2857],{"class":86},[73,3891,3893,3895,3897],{"class":75,"line":3892},32,[73,3894,3420],{"class":86},[73,3896,2935],{"class":227},[73,3898,2857],{"class":86},[73,3900,3902,3904,3906],{"class":75,"line":3901},33,[73,3903,3038],{"class":86},[73,3905,2935],{"class":227},[73,3907,2857],{"class":86},[73,3909,3911,3913,3915],{"class":75,"line":3910},34,[73,3912,3047],{"class":86},[73,3914,2935],{"class":227},[73,3916,2857],{"class":86},[73,3918,3920,3922,3924],{"class":75,"line":3919},35,[73,3921,3056],{"class":86},[73,3923,25],{"class":227},[73,3925,2857],{"class":86},[73,3927,3929,3931,3933],{"class":75,"line":3928},36,[73,3930,2904],{"class":86},[73,3932,2919],{"class":227},[73,3934,2857],{"class":86},[50,3936,3937],{"start":118},[53,3938,3939,3940,3945],{},"Create a theme entry file. It should export the theme as its default export. Also, check the ",[25,3941,3944],{"href":3942,"rel":3943},"https://vitepress.dev/guide/extending-default-theme#layout-slots",[29],"Layout slots"," offered by Vitepress.",[63,3947,3949],{"className":203,"code":3948,"language":205,"meta":68,"style":68},"//.vitepress/theme/index.js\nimport { h } from 'vue'\nimport DefaultTheme from 'vitepress/theme';\nimport Hero from '../components/Hero.vue';\nimport ListArticles from '../components/ListArticles.vue';\nimport '../main.css'\n\nexport default {\n  ...DefaultTheme,\n  Layout() {\n    return h(DefaultTheme.Layout, null, {\n      'home-hero-before': () => h(Hero),\n      'home-hero-after': () => h(ListArticles),\n      'doc-after': () => h('div', {}, [\n        h(\n          'div',\n          {\n            class: 'link',\n          },\n          [\n            h(\n              'a',\n              {\n                href: '/',\n                rel: 'noopener',\n              },\n              [h('span', '\u003C Back')]\n            ),\n          ]\n        )\n      ]),\n    })\n  }\n}\n",[70,3950,3951,3956,3975,3991,4009,4027,4038,4042,4050,4060,4069,4090,4116,4141,4173,4180,4191,4196,4211,4216,4221,4228,4239,4244,4259,4275,4280,4308,4315,4320,4325,4332,4338,4342],{"__ignoreMap":68},[73,3952,3953],{"class":75,"line":76},[73,3954,3955],{"class":79},"//.vitepress/theme/index.js\n",[73,3957,3958,3960,3962,3965,3967,3969,3971,3973],{"class":75,"line":83},[73,3959,926],{"class":925},[73,3961,932],{"class":86},[73,3963,3964],{"class":246}," h",[73,3966,938],{"class":86},[73,3968,941],{"class":925},[73,3970,348],{"class":86},[73,3972,1642],{"class":109},[73,3974,353],{"class":86},[73,3976,3977,3979,3981,3983,3985,3987,3989],{"class":75,"line":90},[73,3978,926],{"class":925},[73,3980,2864],{"class":246},[73,3982,2246],{"class":925},[73,3984,348],{"class":86},[73,3986,2871],{"class":109},[73,3988,1017],{"class":86},[73,3990,1098],{"class":86},[73,3992,3993,3995,3998,4000,4002,4005,4007],{"class":75,"line":118},[73,3994,926],{"class":925},[73,3996,3997],{"class":246}," Hero ",[73,3999,2246],{"class":925},[73,4001,348],{"class":86},[73,4003,4004],{"class":109},"../components/Hero.vue",[73,4006,1017],{"class":86},[73,4008,1098],{"class":86},[73,4010,4011,4013,4016,4018,4020,4023,4025],{"class":75,"line":139},[73,4012,926],{"class":925},[73,4014,4015],{"class":246}," ListArticles ",[73,4017,2246],{"class":925},[73,4019,348],{"class":86},[73,4021,4022],{"class":109},"../components/ListArticles.vue",[73,4024,1017],{"class":86},[73,4026,1098],{"class":86},[73,4028,4029,4031,4033,4036],{"class":75,"line":154},[73,4030,926],{"class":925},[73,4032,348],{"class":86},[73,4034,4035],{"class":109},"../main.css",[73,4037,353],{"class":86},[73,4039,4040],{"class":75,"line":176},[73,4041,953],{"emptyLinePlaceholder":869},[73,4043,4044,4046,4048],{"class":75,"line":182},[73,4045,958],{"class":925},[73,4047,961],{"class":925},[73,4049,151],{"class":86},[73,4051,4052,4055,4058],{"class":75,"line":188},[73,4053,4054],{"class":86},"  ...",[73,4056,4057],{"class":246},"DefaultTheme",[73,4059,115],{"class":86},[73,4061,4062,4065,4067],{"class":75,"line":555},[73,4063,4064],{"class":227},"  Layout",[73,4066,2506],{"class":86},[73,4068,151],{"class":86},[73,4070,4071,4073,4075,4077,4079,4081,4083,4085,4088],{"class":75,"line":566},[73,4072,2544],{"class":925},[73,4074,3964],{"class":973},[73,4076,1063],{"class":227},[73,4078,4057],{"class":246},[73,4080,2313],{"class":86},[73,4082,3270],{"class":246},[73,4084,257],{"class":86},[73,4086,4087],{"class":86}," null,",[73,4089,151],{"class":86},[73,4091,4092,4095,4097,4099,4101,4103,4105,4107,4109,4112,4114],{"class":75,"line":577},[73,4093,4094],{"class":86},"      '",[73,4096,2925],{"class":227},[73,4098,1017],{"class":86},[73,4100,103],{"class":86},[73,4102,1055],{"class":86},[73,4104,989],{"class":96},[73,4106,3964],{"class":973},[73,4108,1063],{"class":227},[73,4110,4111],{"class":246},"Hero",[73,4113,986],{"class":227},[73,4115,115],{"class":86},[73,4117,4118,4120,4122,4124,4126,4128,4130,4132,4134,4137,4139],{"class":75,"line":588},[73,4119,4094],{"class":86},[73,4121,3283],{"class":227},[73,4123,1017],{"class":86},[73,4125,103],{"class":86},[73,4127,1055],{"class":86},[73,4129,989],{"class":96},[73,4131,3964],{"class":973},[73,4133,1063],{"class":227},[73,4135,4136],{"class":246},"ListArticles",[73,4138,986],{"class":227},[73,4140,115],{"class":86},[73,4142,4143,4145,4148,4150,4152,4154,4156,4158,4160,4162,4164,4166,4168,4171],{"class":75,"line":695},[73,4144,4094],{"class":86},[73,4146,4147],{"class":227},"doc-after",[73,4149,1017],{"class":86},[73,4151,103],{"class":86},[73,4153,1055],{"class":86},[73,4155,989],{"class":96},[73,4157,3964],{"class":973},[73,4159,1063],{"class":227},[73,4161,1017],{"class":86},[73,4163,2935],{"class":109},[73,4165,1017],{"class":86},[73,4167,257],{"class":86},[73,4169,4170],{"class":86}," {},",[73,4172,992],{"class":227},[73,4174,4175,4178],{"class":75,"line":705},[73,4176,4177],{"class":973},"        h",[73,4179,2355],{"class":227},[73,4181,4182,4185,4187,4189],{"class":75,"line":713},[73,4183,4184],{"class":86},"          '",[73,4186,2935],{"class":109},[73,4188,1017],{"class":86},[73,4190,115],{"class":86},[73,4192,4193],{"class":75,"line":724},[73,4194,4195],{"class":86},"          {\n",[73,4197,4198,4201,4203,4205,4207,4209],{"class":75,"line":735},[73,4199,4200],{"class":227},"            class",[73,4202,103],{"class":86},[73,4204,348],{"class":86},[73,4206,2086],{"class":109},[73,4208,1017],{"class":86},[73,4210,115],{"class":86},[73,4212,4213],{"class":75,"line":743},[73,4214,4215],{"class":86},"          },\n",[73,4217,4218],{"class":75,"line":757},[73,4219,4220],{"class":227},"          [\n",[73,4222,4223,4226],{"class":75,"line":768},[73,4224,4225],{"class":973},"            h",[73,4227,2355],{"class":227},[73,4229,4230,4233,4235,4237],{"class":75,"line":778},[73,4231,4232],{"class":86},"              '",[73,4234,25],{"class":109},[73,4236,1017],{"class":86},[73,4238,115],{"class":86},[73,4240,4241],{"class":75,"line":785},[73,4242,4243],{"class":86},"              {\n",[73,4245,4246,4249,4251,4253,4255,4257],{"class":75,"line":795},[73,4247,4248],{"class":227},"                href",[73,4250,103],{"class":86},[73,4252,348],{"class":86},[73,4254,1036],{"class":109},[73,4256,1017],{"class":86},[73,4258,115],{"class":86},[73,4260,4261,4264,4266,4268,4271,4273],{"class":75,"line":805},[73,4262,4263],{"class":227},"                rel",[73,4265,103],{"class":86},[73,4267,348],{"class":86},[73,4269,4270],{"class":109},"noopener",[73,4272,1017],{"class":86},[73,4274,115],{"class":86},[73,4276,4277],{"class":75,"line":815},[73,4278,4279],{"class":86},"              },\n",[73,4281,4282,4285,4288,4290,4292,4294,4296,4298,4300,4303,4305],{"class":75,"line":2753},[73,4283,4284],{"class":227},"              [",[73,4286,4287],{"class":973},"h",[73,4289,1063],{"class":227},[73,4291,1017],{"class":86},[73,4293,73],{"class":109},[73,4295,1017],{"class":86},[73,4297,257],{"class":86},[73,4299,348],{"class":86},[73,4301,4302],{"class":109},"\u003C Back",[73,4304,1017],{"class":86},[73,4306,4307],{"class":227},")]\n",[73,4309,4310,4313],{"class":75,"line":3443},[73,4311,4312],{"class":227},"            )",[73,4314,115],{"class":86},[73,4316,4317],{"class":75,"line":3452},[73,4318,4319],{"class":227},"          ]\n",[73,4321,4322],{"class":75,"line":3845},[73,4323,4324],{"class":227},"        )\n",[73,4326,4327,4330],{"class":75,"line":3854},[73,4328,4329],{"class":227},"      ])",[73,4331,115],{"class":86},[73,4333,4334,4336],{"class":75,"line":3892},[73,4335,2444],{"class":86},[73,4337,1073],{"class":227},[73,4339,4340],{"class":75,"line":3901},[73,4341,179],{"class":86},[73,4343,4344],{"class":75,"line":3910},[73,4345,191],{"class":86},[45,4347,4349],{"id":4348},"finally","Finally",[12,4351,4352,4353,4358],{},"Now, you can create a blog using vitePress in a very simple way. I share the ",[25,4354,4357],{"href":4355,"rel":4356},"https://github.com/edgonzalez24/blog-vitepress",[29],"repo Github"," so you can review the source code.",[12,4360,4361],{},[40,4362],{"alt":4363,"src":4364},"Demo Image","https://res.cloudinary.com/dhgcfzhm0/image/upload/v1779231243/demo_qkllvg.webp",[12,4366,857],{},[859,4368,4369],{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}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 .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":68,"searchDepth":83,"depth":83,"links":4371},[4372,4373,4374,4375],{"id":1658,"depth":83,"text":1659},{"id":2206,"depth":83,"text":2207},{"id":2826,"depth":83,"text":2827},{"id":4348,"depth":83,"text":4349},"2023-02-09T00:00:00.000Z","Learn how to build, structure, and test your frontend applications using VitePress with this step-by-step tutorial.",{},"/articles/en/effortlessly-build-and-test-your-frontend-applications-with-vitepress",{"title":1647,"description":4377},{"loc":4379},"articles/en/effortlessly-build-and-test-your-frontend-applications-with-vitepress",[4384,1642,877,878],"vitepress","https://res.cloudinary.com/dhgcfzhm0/image/upload/v1779231242/thumbmail_egtlqh.jpg","3Sk6H4ZYgcpKJD440VmcBeEEQvb_RAX9u58Ul4bPTN0",{"id":4388,"title":4389,"author":7,"body":4390,"date":4769,"description":4770,"extension":867,"meta":4771,"navigation":869,"path":4772,"seo":4773,"sitemap":4774,"stem":4775,"tags":4776,"thumbnail":4438,"__hash__":4780},"en_articles/articles/en/broken-arch-linux.md","Broken Arch Linux: Kernel Panic - failed to read configuration 'etc/mkinitcpio.conf",{"type":9,"value":4391,"toc":4764},[4392,4395,4398,4426,4433,4439,4443,4446,4455,4458,4462,4467,4470,4475,4543,4551,4564,4567,4621,4626,4639,4642,4653,4659,4664,4680,4682,4707,4710,4714,4721,4724,4736,4739,4759,4761],[12,4393,4394],{},"In this article, I will document how I resolved a critical error on Arch Linux where the system failed to generate initramfs images due to a corrupted mkinitcpio.conf file. In simpler terms, GRUB was not functioning correctly to proceed with system initialization after a faulty dependency upgrade.",[12,4396,4397],{},"The main error was:",[63,4399,4401],{"className":1670,"code":4400,"language":1672,"meta":68,"style":68},"error: fs/fshelp.c:find_file:266: file '/initramfs-linux.img' not found\n",[70,4402,4403],{"__ignoreMap":68},[73,4404,4405,4408,4411,4413,4415,4418,4420,4423],{"class":75,"line":76},[73,4406,4407],{"class":160},"error:",[73,4409,4410],{"class":109}," fs/fshelp.c:find_file:266:",[73,4412,2389],{"class":109},[73,4414,348],{"class":86},[73,4416,4417],{"class":109},"/initramfs-linux.img",[73,4419,1017],{"class":86},[73,4421,4422],{"class":109}," not",[73,4424,4425],{"class":109}," found\n",[12,4427,4428,4429,4432],{},"and then ",[2218,4430,4431],{},"KERNEL PANIC","!",[12,4434,4435],{},[40,4436],{"alt":4437,"src":4438},"Kernel panic","https://res.cloudinary.com/dhgcfzhm0/image/upload/v1779231242/kernel-panic_kwkqwr.png",[45,4440,4442],{"id":4441},"cause-of-the-problem","Cause of the problem",[12,4444,4445],{},"After attempting to upgrade dependencies, for some reason (installation interruption, package corruption, or incomplete configuration), the essential file:",[63,4447,4449],{"className":1670,"code":4448,"language":1672,"meta":68,"style":68},"/etc/mkinitcpio.conf\n",[70,4450,4451],{"__ignoreMap":68},[73,4452,4453],{"class":75,"line":76},[73,4454,4448],{"class":160},[12,4456,4457],{},"It was damaged/modified in the system, which made it impossible to generate an initramfs.",[45,4459,4461],{"id":4460},"step-by-step-solution","Step by step solution",[50,4463,4464],{},[53,4465,4466],{},"Enter the chroot correctly",[12,4468,4469],{},"First, we mount and access the system we have installed on our disk from a live iso",[57,4471,4472],{},[12,4473,4474],{},"NOTE: You must to download and access from a live ISO",[63,4476,4478],{"className":1670,"code":4477,"language":1672,"meta":68,"style":68},"mount /dev/sdXn /mnt\nmount -t proc /proc /mnt/proc\nmount --rbind /sys /mnt/sys\nmount --rbind /dev /mnt/dev\n\narch-chroot /mnt\n\n",[70,4479,4480,4491,4507,4520,4532,4536],{"__ignoreMap":68},[73,4481,4482,4485,4488],{"class":75,"line":76},[73,4483,4484],{"class":160},"mount",[73,4486,4487],{"class":109}," /dev/sdXn",[73,4489,4490],{"class":109}," /mnt\n",[73,4492,4493,4495,4498,4501,4504],{"class":75,"line":83},[73,4494,4484],{"class":160},[73,4496,4497],{"class":109}," -t",[73,4499,4500],{"class":109}," proc",[73,4502,4503],{"class":109}," /proc",[73,4505,4506],{"class":109}," /mnt/proc\n",[73,4508,4509,4511,4514,4517],{"class":75,"line":90},[73,4510,4484],{"class":160},[73,4512,4513],{"class":109}," --rbind",[73,4515,4516],{"class":109}," /sys",[73,4518,4519],{"class":109}," /mnt/sys\n",[73,4521,4522,4524,4526,4529],{"class":75,"line":118},[73,4523,4484],{"class":160},[73,4525,4513],{"class":109},[73,4527,4528],{"class":109}," /dev",[73,4530,4531],{"class":109}," /mnt/dev\n",[73,4533,4534],{"class":75,"line":139},[73,4535,953],{"emptyLinePlaceholder":869},[73,4537,4538,4541],{"class":75,"line":154},[73,4539,4540],{"class":160},"arch-chroot",[73,4542,4490],{"class":109},[50,4544,4545],{"start":83},[53,4546,4547,4548],{},"Manually create or edit  ",[70,4549,4550],{},"/etc/mkinitcpio.conf",[63,4552,4554],{"className":1670,"code":4553,"language":1672,"meta":68,"style":68},"nano /etc/mkinitcpio.conf\n",[70,4555,4556],{"__ignoreMap":68},[73,4557,4558,4561],{"class":75,"line":76},[73,4559,4560],{"class":160},"nano",[73,4562,4563],{"class":109}," /etc/mkinitcpio.conf\n",[12,4565,4566],{},"And I added this content (the official default Arch file):",[63,4568,4572],{"className":4569,"code":4570,"language":4571,"meta":68,"style":68},"language-conf shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","MODULES=()\nBINARIES=()\nFILES=()\n\nHOOKS=(base udev autodetect microcode modconf kms keyboard keymap consolefont block filesystems fsck)\n\nCOMPRESSION=\"zstd\"\nCOMPRESSION_OPTIONS=()\n\nMODULES_DECOMPRESS=\"no\"\n","conf",[70,4573,4574,4579,4584,4589,4593,4598,4602,4607,4612,4616],{"__ignoreMap":68},[73,4575,4576],{"class":75,"line":76},[73,4577,4578],{},"MODULES=()\n",[73,4580,4581],{"class":75,"line":83},[73,4582,4583],{},"BINARIES=()\n",[73,4585,4586],{"class":75,"line":90},[73,4587,4588],{},"FILES=()\n",[73,4590,4591],{"class":75,"line":118},[73,4592,953],{"emptyLinePlaceholder":869},[73,4594,4595],{"class":75,"line":139},[73,4596,4597],{},"HOOKS=(base udev autodetect microcode modconf kms keyboard keymap consolefont block filesystems fsck)\n",[73,4599,4600],{"class":75,"line":154},[73,4601,953],{"emptyLinePlaceholder":869},[73,4603,4604],{"class":75,"line":176},[73,4605,4606],{},"COMPRESSION=\"zstd\"\n",[73,4608,4609],{"class":75,"line":182},[73,4610,4611],{},"COMPRESSION_OPTIONS=()\n",[73,4613,4614],{"class":75,"line":188},[73,4615,953],{"emptyLinePlaceholder":869},[73,4617,4618],{"class":75,"line":555},[73,4619,4620],{},"MODULES_DECOMPRESS=\"no\"\n",[50,4622,4623],{"start":90},[53,4624,4625],{},"Regenerate the initramfs",[63,4627,4629],{"className":1670,"code":4628,"language":1672,"meta":68,"style":68},"mkinitcpio -P\n",[70,4630,4631],{"__ignoreMap":68},[73,4632,4633,4636],{"class":75,"line":76},[73,4634,4635],{"class":160},"mkinitcpio",[73,4637,4638],{"class":109}," -P\n",[12,4640,4641],{},"result",[63,4643,4647],{"className":4644,"code":4645,"language":4646,"meta":68,"style":68},"language-txt shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","Initcpio image generation successful\n","txt",[70,4648,4649],{"__ignoreMap":68},[73,4650,4651],{"class":75,"line":76},[73,4652,4645],{},[12,4654,4655,4656,2313],{},"This confirms that the system already has a valid ",[70,4657,4658],{},"initramfs-linux.img",[50,4660,4661],{"start":118},[53,4662,4663],{},"Regenerate GRUB",[63,4665,4667],{"className":1670,"code":4666,"language":1672,"meta":68,"style":68},"grub-mkconfig -o /boot/grub/grub.cfg\n",[70,4668,4669],{"__ignoreMap":68},[73,4670,4671,4674,4677],{"class":75,"line":76},[73,4672,4673],{"class":160},"grub-mkconfig",[73,4675,4676],{"class":109}," -o",[73,4678,4679],{"class":109}," /boot/grub/grub.cfg\n",[12,4681,4348],{},[63,4683,4685],{"className":1670,"code":4684,"language":1672,"meta":68,"style":68},"exit\numount -R /mnt\nreboot\n",[70,4686,4687,4692,4702],{"__ignoreMap":68},[73,4688,4689],{"class":75,"line":76},[73,4690,4691],{"class":973},"exit\n",[73,4693,4694,4697,4700],{"class":75,"line":83},[73,4695,4696],{"class":160},"umount",[73,4698,4699],{"class":109}," -R",[73,4701,4490],{"class":109},[73,4703,4704],{"class":75,"line":90},[73,4705,4706],{"class":160},"reboot\n",[12,4708,4709],{},"And the system started up without problems.",[45,4711,4713],{"id":4712},"conclusion","Conclusion",[12,4715,4716,4717,4720],{},"The error “failed to read configuration ",[70,4718,4719],{},"etc/mkinitcpio.conf","” usually indicates that the mkinitcpio configuration file is missing or corrupted.",[12,4722,4723],{},"The solution involves:",[4725,4726,4727,4730,4733],"ul",{},[53,4728,4729],{},"Manually creating a valid file",[53,4731,4732],{},"Regenerating the initramfs",[53,4734,4735],{},"Updating GRUB",[12,4737,4738],{},"Documenting this helped me better understand how the boot process works in Arch Linux and how to handle emergencies from a Live ISO.",[3687,4740,4741,4747,4753,4756],{},[12,4742,4743,4746],{},[2218,4744,4745],{},"GRUB"," = Bootloader.",[12,4748,4749,4752],{},[2218,4750,4751],{},"initramfs"," = Initial toolkit.",[12,4754,4755],{},"GRUB doesn't create, it only loads the initramfs.\nThe initramfs allows the kernel to find the disk and mount the actual system.",[12,4757,4758],{},"Without a proper initramfs → no boot.",[12,4760,1626],{},[859,4762,4763],{},"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 .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}",{"title":68,"searchDepth":83,"depth":83,"links":4765},[4766,4767,4768],{"id":4441,"depth":83,"text":4442},{"id":4460,"depth":83,"text":4461},{"id":4712,"depth":83,"text":4713},"2025-11-25T00:00:00.000Z","Solution to the critical error in Arch Linux - Kernel Panic - initramfs images could not be generated (GRUB).",{},"/articles/en/broken-arch-linux",{"title":4389,"description":4770},{"loc":4772},"articles/en/broken-arch-linux",[4777,4778,4779],"linux","arch-linux","opensource","kyRtTjt8r-bgD2Saw9p7ueFlG_r3qvPOPxdgzpcvcgs",{"id":4782,"title":4783,"author":7,"body":4784,"date":5146,"description":5147,"extension":867,"meta":5148,"navigation":869,"path":5149,"seo":5150,"sitemap":5151,"stem":5152,"tags":5153,"thumbnail":5156,"__hash__":5157},"en_articles/articles/en/kitbag-router-and-vue-router.md","Kitbag Router vs Vue Router: Is it worth using a new alternative?",{"type":9,"value":4785,"toc":5133},[4786,4792,4798,4805,4808,4812,4819,4824,4838,4842,4849,4868,4874,4878,4909,4913,4960,4965,4973,4984,4988,5002,5034,5038,5076,5078,5083,5094,5098],[12,4787,4788],{},[40,4789],{"alt":4790,"src":4791},"Thumbail image","https://res.cloudinary.com/dhgcfzhm0/image/upload/v1779231245/banner_bes04k.jpg",[12,4793,4794,4797],{},[2218,4795,4796],{},"Vue Router"," package has been standard for handling application routing and navigation. The community and support have been crucial and fundamental to our projects.",[12,4799,4800,4801,4804],{},"But recently, a new alternative has emerged in the community: ",[2218,4802,4803],{},"Kitbag Router",". Considered a modern router written and adapted with TypeScript, it aims to improve the developer experience by offering a typed, secure, and robust tool for applications. This alternative search to eliminate routing problems and provide a more user friendly experience (UX) and developer experience (DX).",[12,4806,4807],{},"First, let's review key differences, weak points or risks, and recommendations to understand in which situations it is best to use them depending on the type of project we are working on.",[45,4809,4811],{"id":4810},"what-is-vue-router","What is Vue Router?",[12,4813,4814,4818],{},[25,4815,4796],{"href":4816,"rel":4817},"https://router.vuejs.org/",[29]," is the official router of the Vue ecosystem. It manages static and dynamic routes, declarative navigation, scrolling behavior, history modes, and more.",[4820,4821,4823],"h3",{"id":4822},"key-advantages-of-vue-router","Key advantages of Vue Router",[4725,4825,4826,4829,4832,4835],{},[53,4827,4828],{},"Extensive documentation, examples, and a great community.",[53,4830,4831],{},"Built-in features such as scrolling, history mode, nested routing, and others.",[53,4833,4834],{},"Maturity and stability. It's the standard, backed by the core Vue team.",[53,4836,4837],{},"Compatibility with the entire traditional Vue stack and ecosystem plugins.",[45,4839,4841],{"id":4840},"what-is-kitbag-router","What is Kitbag Router?",[12,4843,4844,4848],{},[25,4845,4803],{"href":4846,"rel":4847},"https://router.kitbag.dev/",[29],"  is an alternative router built from scratch in TypeScript, with a focus on security, robustness, and predictability.",[3687,4850,4851,4856,4862],{},[12,4852,4853,4855],{},[2218,4854,4803],{}," introduces a fresh, developer-centric approach to routing in Vue.js applications.",[12,4857,4858,4859,4861],{},"At the heart of ",[2218,4860,4803],{}," lies a commitment to enhancing the developer experience. First and foremost that means type safety, but also better parameter experience, support for query, rejection handling, simple intuitive syntax, and an extensible design written with modern Typescript.",[4863,4864,4865],"blockquote",{},[12,4866,4867],{},"Kitbag router - official website",[12,4869,4870],{},[40,4871],{"alt":4872,"src":4873},"Kitbag logo","https://res.cloudinary.com/dhgcfzhm0/image/upload/v1779231245/kitbag_jufle7.webp",[4820,4875,4877],{"id":4876},"features-of-kitbag-router","Features of Kitbag router",[4725,4879,4880,4886,4892,4903],{},[53,4881,4882,4885],{},[2218,4883,4884],{},"More powerful parameters",": Not just strings you can define parameters of type Number, Boolean, Date, JSON, RegExp, or even custom types. This allows routes with IDs, dates, booleans, etc.",[53,4887,4888,4891],{},[2218,4889,4890],{},"Type safety",": Routes, parameters, and queries are strongly typed; if you wanto to change anything in the route configuration, TS will warn you in development.",[53,4893,4894,4897,4898],{},[2218,4895,4896],{},"Reduced weight and modern design",": Kitbag Router boasts a small size, with minimal dependencies. ",[25,4899,4902],{"href":4900,"rel":4901},"https://bundlephobia.com/package/@kitbag/router@0.20.9",[29],"Check bundlephobia",[53,4904,4905,4908],{},[2218,4906,4907],{},"Typed query parameters",": query parameters can be defined and validated just like route parameters",[45,4910,4912],{"id":4911},"advantages-of-using-kitbag-router-today","Advantages of using Kitbag Router today",[4725,4914,4915,4925,4934,4942,4951],{},[53,4916,4917,4918,4924],{},"🧰 ",[2218,4919,4920],{},[4921,4922,4923],"em",{},"Automatically validated and written parameters:"," ideal for complex applications where route parameters have specific types (IDs, dates, booleans, etc.).",[53,4926,4927,4928,4933],{},"🔒 ",[2218,4929,4930],{},[4921,4931,4932],{},"Fewer runtime errors due to misnamed paths or missing parameters:"," Since everything is typed, when you change paths, names, or parameters, compilation will fail if there are inconsistencies. This improves maintainability.",[53,4935,4936,4937],{},"✅ ",[2218,4938,4939],{},[4921,4940,4941],{},"Easy transition to a Typescript oriented setup + modern composition",[53,4943,4944,4945,4950],{},"🌐 ",[2218,4946,4947],{},[4921,4948,4949],{},"Queries + params + state + meta + hooks + prefetching"," and many modern features built in natively.",[53,4952,4953,4954,4959],{},"❌ ",[2218,4955,4956],{},[4921,4957,4958],{},"Rejections",": You can assign views to handle whatever rejections you need, not only 404/not found.",[12,4961,4962],{},[2218,4963,4964],{},"Some users community mention:",[3687,4966,4967],{},[12,4968,4969,4970],{},"“Type safety everywhere… amazing parameters… support for parameters in query… built in rejection handling” ",[2218,4971,4972],{},"~ Reddit ~",[32,4974,4975],{},[12,4976,4977,4978,4980,4981,4983],{},"“The new type safe ",[2218,4979,4796],{}," is definitely an excellent router,” although some still prefer the original ",[2218,4982,4796],{}," for its long term support.",[45,4985,4987],{"id":4986},"migrating-from-vue-router","Migrating from Vue Router",[12,4989,4990,4991,4993,4994,4996,4997],{},"If you are considering migrating from ",[2218,4992,4796],{}," to ",[2218,4995,4803],{},", it is important to know which features are covered or complete and what is not yet available. ",[25,4998,5001],{"href":4999,"rel":5000},"https://router.kitbag.dev/migrating-vue-router.html",[29],"You can check official documentation in more detail.",[4725,5003,5004,5007,5010,5013,5016,5019,5022,5025,5028,5031],{},[53,5005,5006],{},"✅ Nested routes mapping",[53,5008,5009],{},"✅ Dynamic Routing",[53,5011,5012],{},"✅ Modular, component-based router configuration",[53,5014,5015],{},"✅ Route params, query, wildcards",[53,5017,5018],{},"✅ View transition effects powered by Vue.js' transition system",[53,5020,5021],{},"✅ Fine-grained navigation control",[53,5023,5024],{},"✅ Links with automatic active CSS classes",[53,5026,5027],{},"✅ HTML5 history mode or hash mode",[53,5029,5030],{},"❌ Customizable Scroll Behavior",[53,5032,5033],{},"✅ Proper encoding for URLs",[45,5035,5037],{"id":5036},"weak-points-risks-or-why-it-might-not-be-suitable","Weak points, risks, or why it might not be suitable?",[4725,5039,5040,5049,5058,5067],{},[53,5041,5042,5043,5048],{},"🔄 ",[2218,5044,5045],{},[4921,5046,5047],{},"Risk of lower adoption and small community:"," This can hinder support, documentation or integration into larger projects or those with many collaborators.",[53,5050,5051,5052,5057],{},"🧑‍💻 ",[2218,5053,5054],{},[4921,5055,5056],{},"Learning curve:"," Perhaps way routes are defined is more explicit, which can feel more verbose compared to simpler definitions. Some developers in the community see this as \"more upfront work,\" especially in small projects.",[53,5059,5060,5061,5066],{},"🤔 ",[2218,5062,5063],{},[4921,5064,5065],{},"Limitations for teams that do not use TypeScript:"," It requires a solid understanding of TypeScript to truly benefit from it. In teams that work primarily with JavaScript, this can become a real obstacle.",[53,5068,5069,5070,5075],{},"🔧 ",[2218,5071,5072],{},[4921,5073,5074],{},"More explicit configuration = greater verbosity:"," This is a great advantage for TypeScript, but it can be tedious; defining routes can feel longer, or complex nested routes require more code.",[45,5077,4713],{"id":4712},[12,5079,5080,5082],{},[2218,5081,4803],{}," is a very attractive and could be an excellent alternative, especially if you want to experiment with a new approach to routing in modern projects using Vue 3 and TypeScript, where type safety and maintainability are paramount. If you're starting a new project, it might be worth exploring it thoroughly.",[12,5084,5085,5086,5088,5089],{},"However, given that it's still relatively new and doesn't have the same adoption or maturity as ",[2218,5087,4796],{},", its use should be carefully considered, along with validating compatibility requirements and the potential learning curve. I'd like to emphasize that it's an open-source project, so your input is very helpful. ",[25,5090,5093],{"href":5091,"rel":5092},"https://github.com/kitbagjs/router",[29],"If you're interested, you can check the official repository.",[45,5095,5097],{"id":5096},"sources-and-links-consulted","Sources and links consulted",[4725,5099,5100,5106,5112,5119,5126],{},[53,5101,5102],{},[25,5103,5105],{"href":4846,"rel":5104},[29],"Kitbag Router - Official documentation",[53,5107,5108],{},[25,5109,5111],{"href":4816,"rel":5110},[29],"Vue Router - Official documentation",[53,5113,5114],{},[25,5115,5118],{"href":5116,"rel":5117},"https://www.reddit.com/r/vuejs/comments/1dj7h88/kitbag_router_v040_released/",[29],"Reddit - Kitbag Router v0.4.0 Released ",[53,5120,5121],{},[25,5122,5125],{"href":5123,"rel":5124},"https://www.reddit.com/r/javascript/comments/1conv1s/new_typesafe_vue_router/?tl=es-es",[29],"Reddit –  New Typesafe Vue Router ",[53,5127,5128],{},[25,5129,5132],{"href":5130,"rel":5131},"https://medium.com/@stackoverfloweth/introducing-a-new-router-for-vue-6a912fdfcfff",[29],"Medium - Introducing a new router for Vue",{"title":68,"searchDepth":83,"depth":83,"links":5134},[5135,5138,5141,5142,5143,5144,5145],{"id":4810,"depth":83,"text":4811,"children":5136},[5137],{"id":4822,"depth":90,"text":4823},{"id":4840,"depth":83,"text":4841,"children":5139},[5140],{"id":4876,"depth":90,"text":4877},{"id":4911,"depth":83,"text":4912},{"id":4986,"depth":83,"text":4987},{"id":5036,"depth":83,"text":5037},{"id":4712,"depth":83,"text":4713},{"id":5096,"depth":83,"text":5097},"2025-12-09T00:00:00.000Z","A powerful new alternative for routing in VueJS; it's worth switching from the official router.",{},"/articles/en/kitbag-router-and-vue-router",{"title":4783,"description":5147},{"loc":5149},"articles/en/kitbag-router-and-vue-router",[5154,5155],"vuejs","frontend","https://res.cloudinary.com/dhgcfzhm0/image/upload/v1779231245/thumbnail_jqapf3.jpg","zlnqvJF9W7lb1MMrPgaOnF0GP62uA82cqv4-mxQKX4Y",{"id":5159,"title":5160,"author":7,"body":5161,"date":5529,"description":5530,"extension":867,"meta":5531,"navigation":869,"path":5532,"seo":5533,"sitemap":5534,"stem":5535,"tags":5536,"thumbnail":5540,"__hash__":5541},"en_articles/articles/en/unifying-ai-context-engineering-team.md","A single source of truth for AI: How to unify context across multiple tools",{"type":9,"value":5162,"toc":5517},[5163,5169,5173,5176,5179,5182,5186,5190,5193,5196,5199,5251,5255,5261,5264,5284,5287,5291,5294,5297,5300,5303,5318,5321,5367,5372,5376,5383,5387,5394,5398,5401,5407,5410,5416,5419,5423,5426,5432,5438,5441,5447,5450,5453,5459,5463,5466,5486,5488,5491,5494,5497,5511,5514],[12,5164,5165],{},[40,5166],{"alt":5167,"src":5168},"AI context banner","https://res.cloudinary.com/dhgcfzhm0/image/upload/v1781744192/ai-context-banner-hub_niri0c.png",[45,5170,5172],{"id":5171},"introduction","Introduction",[12,5174,5175],{},"Today we have a wide variety of artificial intelligence tools that, of course, help us work faster and more efficiently, saving us a couple of hours.\nBut when we talk about teams using different tools, whether due to personal preferences, costs, or specific needs, a less obvious problem starts to emerge.",[12,5177,5178],{},"The team's knowledge begins to drift. Commands, skills, and contexts that worked well in one tool don't always work in others, which turns into a challenge that often comes at a high cost: excessive token consumption, among other things.",[12,5180,5181],{},"In the end, little by little, each team member ends up building their own working environment, generating duplicated effort and, of course, a poor experience due to inconsistency within the same project.",[45,5183,5185],{"id":5184},"the-hidden-problem-of-working-with-multiple-ai-tools","The hidden problem of working with multiple AI tools",[4820,5187,5189],{"id":5188},"each-tool-creates-its-own-rules","Each tool creates its own rules",[12,5191,5192],{},"During the rise of AI tools, many teams adopted a primary solution to assist with development tasks. But as new features, more capable models, and different ways of working appeared, some team members began experimenting with other alternatives.",[12,5194,5195],{},"This seemed great. After all, each developer could choose the tool they felt most productive with. But that's where a problem no one had anticipated appeared.",[12,5197,5198],{},"These tools propose their own way of managing or storing contexts, instructions, or rules to help models better understand the project and provide a better developer experience.",[5200,5201,5202,5215],"table",{},[5203,5204,5205],"thead",{},[5206,5207,5208,5212],"tr",{},[5209,5210,5211],"th",{},"Tool",[5209,5213,5214],{},"Configuration",[5216,5217,5218,5227,5235,5243],"tbody",{},[5206,5219,5220,5224],{},[5221,5222,5223],"td",{},"Cursor",[5221,5225,5226],{},".cursor/rules",[5206,5228,5229,5232],{},[5221,5230,5231],{},"Claude Code",[5221,5233,5234],{},".claude/CLAUDE.md",[5206,5236,5237,5240],{},[5221,5238,5239],{},"Codex",[5221,5241,5242],{},"custom instructions",[5206,5244,5245,5248],{},[5221,5246,5247],{},"Other tools",[5221,5249,5250],{},"different formats",[4820,5252,5254],{"id":5253},"duplication-is-costly","Duplication is costly",[12,5256,5257,5258,2313],{},"This is where a problem that can initially go unnoticed starts to appear: ",[2218,5259,5260],{},"knowledge duplication",[12,5262,5263],{},"The same information ends up replicated across multiple places:",[4725,5265,5266,5269,5272,5275,5278,5281],{},[53,5267,5268],{},"Project architecture",[53,5270,5271],{},"Code conventions",[53,5273,5274],{},"Testing standards",[53,5276,5277],{},"Git workflows",[53,5279,5280],{},"Reusable commands",[53,5282,5283],{},"Business domain knowledge",[12,5285,5286],{},"And keeping this information in sync not only takes time, but also increases the risk of inconsistencies. A change made in one place can become outdated in another, generating different behaviors across tools and less predictable results for the team.",[45,5288,5290],{"id":5289},"solution-source-of-truth","Solution: Source of truth",[12,5292,5293],{},"Based on my experience, after repeatedly running into scenarios of duplicated contexts, inconsistent rules, and commands that only worked in one specific tool, I started asking myself whether I was solving the wrong problem.",[12,5295,5296],{},"At first I tried to keep Cursor and Claude rules and configurations in sync. Every time I added a new rule or improved a command, I had to replicate those changes in multiple places. This was a very manual, repetitive, and error-prone process.",[12,5298,5299],{},"The idea that ended up working was much simpler: stop thinking of the tools as the place where knowledge lives.",[12,5301,5302],{},"Instead of storing context, commands, and skills inside Cursor or Claude, I decided to centralize everything in a dedicated directory within the repository:",[63,5304,5306],{"className":1670,"code":5305,"language":1672,"meta":68,"style":68},"# root project\nai/\n",[70,5307,5308,5313],{"__ignoreMap":68},[73,5309,5310],{"class":75,"line":76},[73,5311,5312],{"class":79},"# root project\n",[73,5314,5315],{"class":75,"line":83},[73,5316,5317],{"class":160},"ai/\n",[12,5319,5320],{},"The difference matters:",[5200,5322,5323,5333],{},[5203,5324,5325],{},[5206,5326,5327,5330],{},[5209,5328,5329],{},"Before",[5209,5331,5332],{},"After",[5216,5334,5335,5343,5351,5359],{},[5206,5336,5337,5340],{},[5221,5338,5339],{},"Knowledge lives inside each tool.",[5221,5341,5342],{},"Knowledge lives in /ai.",[5206,5344,5345,5348],{},[5221,5346,5347],{},"Cursor has its own rules.",[5221,5349,5350],{},"Cursor consumes rules from /ai.",[5206,5352,5353,5356],{},[5221,5354,5355],{},"Claude has its own context.",[5221,5357,5358],{},"Claude consumes context from /ai.",[5206,5360,5361,5364],{},[5221,5362,5363],{},"Changes must be copied across tools.",[5221,5365,5366],{},"A change in /ai is reflected for all of them.",[32,5368,5369],{},[12,5370,5371],{},"The goal is not for the whole team to use the same AI. The goal is for all AIs to use the same knowledge.",[4820,5373,5375],{"id":5374},"proposed-architecture","Proposed architecture",[63,5377,5381],{"className":5378,"code":5380,"language":284,"meta":68},[5379],"language-text","/ai\n├─ context\n│  ├─ architecture.md\n│  ├─ frontend.md\n│  └─ business-domain.md\n├─ commands\n│  ├─ review.md\n│  ├─ refactor.md\n│  └─ create-component.md\n├─ skills\n│  ├─ testing.md\n│  ├─ performance.md\n│  └─ accessibility.md\n└─ agents\n   ├─ frontend-agent.md\n   └─ reviewer-agent.md\n",[70,5382,5380],{"__ignoreMap":68},[4820,5384,5386],{"id":5385},"how-does-each-tool-connect","How does each tool connect?",[12,5388,5389,5390,5393],{},"Once the project's knowledge is centralized in the ",[70,5391,5392],{},"/ai"," directory, the tools stop being the place where context is defined and become simply consumers of that knowledge.",[3787,5395,5397],{"id":5396},"integration-with-claude-code","Integration with Claude Code",[12,5399,5400],{},"Instead of maintaining a large and hard-to-update CLAUDE.md file, we can keep it small and focused solely on referencing the shared content.",[63,5402,5405],{"className":5403,"code":5404,"language":284,"meta":68},[5379],".claude/\n└── CLAUDE.md\n",[70,5406,5404],{"__ignoreMap":68},[12,5408,5409],{},"Example:",[63,5411,5414],{"className":5412,"code":5413,"language":284,"meta":68},[5379],"@ai/context/architecture.md\n@ai/context/frontend.md\n@ai/commands/review.md\n",[70,5415,5413],{"__ignoreMap":68},[12,5417,5418],{},"This way, Claude Code consumes the same centralized knowledge used by the rest of the team.",[3787,5420,5422],{"id":5421},"integration-with-cursor","Integration with Cursor",[12,5424,5425],{},"The same strategy can be applied in Cursor.",[12,5427,5428,5429,5431],{},"Instead of duplicating rules, instructions, and documentation inside ",[70,5430,5226],{},", the rules can be kept minimal and delegate knowledge to the shared directory.",[63,5433,5436],{"className":5434,"code":5435,"language":284,"meta":68},[5379],".cursor/\n└── rules/\n",[70,5437,5435],{"__ignoreMap":68},[12,5439,5440],{},"The rules can reference information coming from:",[63,5442,5445],{"className":5443,"code":5444,"language":284,"meta":68},[5379],"/ai/context\n/ai/commands\n/ai/skills\n",[70,5446,5444],{"__ignoreMap":68},[12,5448,5449],{},"This allows Cursor to work with the same architecture, conventions, commands, and business knowledge as other tools.",[12,5451,5452],{},"Here is a small reference diagram:",[63,5454,5457],{"className":5455,"code":5456,"language":284},[5379],"                                        ┌──────────┐\n                                        │ Cursor   │\n                                        └────┬─────┘\n                                             │\n                                        ┌────▼─────┐\n                                        │ Claude   │\n                                        └────┬─────┘\n                                             │\n                                        ┌────▼─────┐\n                                        │ Codex    │\n                                        └────┬─────┘\n                                             │\n                                        ┌────▼─────┐\n                                        │  /ai     │\n                                        │ Source   │\n                                        │ of Truth │\n                                        └──────────┘\n",[70,5458,5456],{"__ignoreMap":68},[3787,5460,5462],{"id":5461},"benefits","Benefits",[12,5464,5465],{},"When knowledge is centralized, adding a new tool no longer means migrating or rewriting context. The benefits are immediate:",[4725,5467,5468,5471,5474,5477,5480,5483],{},[53,5469,5470],{},"Less information duplication.",[53,5472,5473],{},"Lower maintenance cost.",[53,5475,5476],{},"A single source of truth.",[53,5478,5479],{},"Consistent context across tools.",[53,5481,5482],{},"Reusable commands and skills.",[53,5484,5485],{},"Easier onboarding of new AI tools.",[45,5487,4713],{"id":4712},[12,5489,5490],{},"The number of AI tools will keep growing. New models will appear, some platforms will evolve, others will disappear, and in a few years we'll probably be using tools that don't even exist today. Trying to standardize on a specific tool is a strategy that's hard to maintain. Sooner or later, new needs, preferences, or constraints will lead the team to explore other alternatives.",[12,5492,5493],{},"The tools will change, but the team's knowledge shouldn't have to move every time a new AI appears. That's why, instead of investing effort in replicating context across tools, it's more sustainable to build a single source of truth that any of them can consume.",[12,5495,5496],{},"When knowledge is centralized:",[4725,5498,5499,5502,5505,5508],{},[53,5500,5501],{},"Switching tools stops being a problem.",[53,5503,5504],{},"Onboarding new AIs requires less effort.",[53,5506,5507],{},"The team works with consistent rules and context.",[53,5509,5510],{},"Duplication and maintenance are reduced.",[12,5512,5513],{},"Don't standardize a tool. Standardize the knowledge.",[859,5515,5516],{},"html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}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);}",{"title":68,"searchDepth":83,"depth":83,"links":5518},[5519,5520,5524,5528],{"id":5171,"depth":83,"text":5172},{"id":5184,"depth":83,"text":5185,"children":5521},[5522,5523],{"id":5188,"depth":90,"text":5189},{"id":5253,"depth":90,"text":5254},{"id":5289,"depth":83,"text":5290,"children":5525},[5526,5527],{"id":5374,"depth":90,"text":5375},{"id":5385,"depth":90,"text":5386},{"id":4712,"depth":83,"text":4713},"2026-06-19T00:00:00.000Z","Discover how to unify AI context, commands, and skills in a single place to work consistently across Cursor, Claude, Codex, and other tools, reducing duplication and improving collaboration within your engineering team.",{},"/articles/en/unifying-ai-context-engineering-team",{"title":5160,"description":5530},{"loc":5532},"articles/en/unifying-ai-context-engineering-team",[5537,5538,5539],"AI-engineering","developer-experience","AI-tools","https://res.cloudinary.com/dhgcfzhm0/image/upload/v1781745190/ai-context-thumbnail_gqqef1.png","qRWMcRZkF8eliY6bgQUhlfR8DDmUCwnARqfSJsCjBiU",[5543,5544],{"title":4389,"path":4772,"stem":4775,"description":4770,"children":-1},{"title":885,"path":1636,"stem":1639,"description":1634,"children":-1},1781748825151]