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