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