[{"data":1,"prerenderedAt":284},["ShallowReactive",2],{"\u002Fwritings\u002Fwhy-i-made-nuch":3},{"id":4,"title":5,"body":6,"date":272,"description":273,"extension":274,"meta":275,"navigation":277,"path":278,"seo":279,"stem":280,"tag":281,"ttr":282,"__hash__":283},"writing\u002Fwritings\u002Fwhy-i-made-nuch.md","I turned a small script into an app",{"type":7,"value":8,"toc":260},"minimark",[9,14,32,35,38,42,48,51,68,71,74,77,84,87,91,94,109,115,118,121,125,128,139,142,145,148,151,155,158,161,168,175,178,185,189,196,199,206,217,233,237,240,243,257],[10,11,13],"h2",{"id":12},"a-small-recap","A small recap",[15,16,17,18,23,24,28,29],"p",{},"I've ",[19,20,22],"a",{"href":21},"\u002Fwritings\u002Froad-to-here","already"," talked about how I struggled with choosing the right stack for this site. I know, I know — it ",[25,26,27],"em",{},"really"," shouldn’t be that hard. But I’m a difficult man. And I’m also a firm believer in the idea that ",[25,30,31],{},"“a little over‑engineering is good for your soul.”",[15,33,34],{},"Still, life doesn’t always allow for that luxury. Sometimes, you just have to take the high road.",[15,36,37],{},"In this case, that high road turned out to be Nuxt Content.",[10,39,41],{"id":40},"getting-started-with-content","Getting started with Content",[43,44,45],"blockquote",{},[15,46,47],{},"“Nuxt Content is a module for Nuxt that provides a simple way to manage content for your application. It allows developers to write their content in Markdown, YAML, or JSON files and then query and display it in their application.”",[15,49,50],{},"That’s their official description, and I didn’t want to butcher it.",[15,52,53,54,57,58,57,64,67],{},"My first thought was something along the lines of: ",[25,55,56],{},"“I’m a Nuxt developer, I"," ",[25,59,60],{},[61,62,63],"strong",{},"usually",[25,65,66],{},"like simple solutions… and wait, Markdown?”"," — yeah, that was basically a no‑brainer.",[15,69,70],{},"So I got to work.",[15,72,73],{},"I added the module, set up the config file and collections, and started testing.",[15,75,76],{},"It was an absolute breeze. It picked up the files instantly and rendered them beautifully. With a few small tweaks and customizations, it started to look exactly the way I wanted.",[15,78,79,80,83],{},"It was ",[25,81,82],{},"almost"," everything I needed.",[15,85,86],{},"Almost.",[10,88,90],{"id":89},"the-new-kinda-dilemma","The new (kinda) dilemma",[15,92,93],{},"From what I could tell, there are two main ways to add files to Nuxt Content collections:",[95,96,97,106],"ol",{},[98,99,100,101,105],"li",{},"Manually placing files inside the ",[102,103,104],"code",{},"content"," directory",[98,107,108],{},"Linking an external repository to a collection",[15,110,111,112],{},"Naturally, my brain went: ",[25,113,114],{},"“Alright… where’s the challenge?”",[15,116,117],{},"I didn’t want to use an external repository — I already have my own archives, and GitHub just isn’t where I keep this kind of stuff. Manually moving files every time also felt tedious and error‑prone.",[15,119,120],{},"So, once again, I got to work.",[10,122,124],{"id":123},"the-script","The script",[15,126,127],{},"When it comes to simple automation, scripts are usually the first thing that comes to mind. So I wrote one that handled the basics:",[95,129,130,133,136],{},[98,131,132],{},"Copy the given file into the correct collection directory",[98,134,135],{},"Copy any corresponding images",[98,137,138],{},"Stage the changes, commit them, and push the site’s repository to trigger a new build",[15,140,141],{},"It worked. It did exactly what it was supposed to do.",[15,143,144],{},"But it was fragile.",[15,146,147],{},"The destination paths were hard‑coded. Adding or editing a collection meant editing the script itself. There were no safety checks, no proper error handling — if something went wrong halfway through, manual cleanup was the only option.",[15,149,150],{},"I liked the simplicity, but I didn’t trust it. It felt like something that could (and eventually would) break at the worst possible moment.",[10,152,154],{"id":153},"the-app","The app",[15,156,157],{},"That’s when I decided to turn the script into a proper CLI tool.",[15,159,160],{},"Doing so would make it easier to extend, safer to use, and far more pleasant to maintain. More importantly, it would allow me to handle errors properly — and even roll back changes when necessary.",[15,162,163,167],{},[19,164,166],{"href":165},"\u002Fwritings\u002Fmy-aoc-experience","Unsurprisingly",", I chose Rust.",[15,169,170,171,174],{},"There were a few reasons for that. First, I genuinely wanted to ",[25,172,173],{},"work"," with Rust — not just toy examples, but something real. Second, I’d already solved a bunch of problems with it during Advent of Code, and I actually enjoyed the experience. Sure, it has its quirks, but those quirks force you to think more deliberately — and I like that.",[15,176,177],{},"Funny enough, I initially tried building this in Go. But after Advent of Code, something shifted. Despite all the time I’ve spent with Go, my brain just… stopped thinking in it.",[15,179,180,181,184],{},"Rust didn’t just help my thinking — it ",[25,182,183],{},"changed"," it.",[10,186,188],{"id":187},"and-so-nuch-was-born","And so… NUCH was born",[15,190,191,192,195],{},"NUCH (short for ",[61,193,194],{},"NUxt Content Handler",") is what came out the other side.",[15,197,198],{},"It’s a simple, interactive CLI tool that does everything I needed — and then some.",[15,200,201,202,205],{},"It relies on a straightforward ",[102,203,204],{},"toml"," configuration file to understand where things live and where they should go. From there, you just tell it what you want.",[15,207,208,209,212,213,216],{},"Right now, it supports two commands: ",[102,210,211],{},"publish"," and ",[102,214,215],{},"delete",". Maybe more will come in the future — we’ll see.",[15,218,219,220,226,227,232],{},"I won’t dive into the internal details here. Those are covered properly in the ",[19,221,225],{"href":222,"rel":223},"https:\u002F\u002Fnuch.vercel.app",[224],"nofollow","documentation",". The source code is also available on ",[19,228,231],{"href":229,"rel":230},"https:\u002F\u002Fgithub.com\u002Frivethorn\u002Fnuch",[224],"GitHub",", and contributions are more than welcome.",[10,234,236],{"id":235},"epilogue","Epilogue",[15,238,239],{},"Like most tools, this one exists simply to make my life a little easier.",[15,241,242],{},"If it manages to do the same for you, then it’s already done its job.",[15,244,245,246,251,252,256],{},"If you’re a Nuxt developer — or just curious — I’d love to hear your ",[19,247,250],{"href":248,"rel":249},"https:\u002F\u002Fgithub.com\u002Frivethorn\u002Fnuch\u002Fissues\u002Fnew",[224],"suggestions"," or ",[19,253,255],{"href":254},"mailto:hassanak813@outlook.com","general thoughts"," about NUCH.",[15,258,259],{},"Merry Christmas, and happy holidays 🎄",{"title":261,"searchDepth":262,"depth":263,"links":264},"",2,3,[265,266,267,268,269,270,271],{"id":12,"depth":262,"text":13},{"id":40,"depth":262,"text":41},{"id":89,"depth":262,"text":90},{"id":123,"depth":262,"text":124},{"id":153,"depth":262,"text":154},{"id":187,"depth":262,"text":188},{"id":235,"depth":262,"text":236},"2025-12-28","A small automation script slowly grew into a proper CLI app, and it ended up becoming NUCH — a Nuxt Content helper I actually enjoy using.","md",{"author":276},"Hassan Qasemi",true,"\u002Fwritings\u002Fwhy-i-made-nuch",{"title":5,"description":273},"writings\u002Fwhy-i-made-nuch","Development","5 min read","-TeJB80c3UvmgoheLNXHdhSzGBRUjEcE2lgFSrdFJNo",1789387127287]