First few blogs.

This commit is contained in:
Alfred Jophy 2026-02-22 14:08:51 +05:30
commit 702469464e
19 changed files with 719 additions and 28 deletions

21
scripts/new-article.ts Normal file
View file

@ -0,0 +1,21 @@
#!/usr/bin/env bun
const ARTICLE_PATH = 'src/routes/articles';
const glob = new Bun.Glob("**/+page.svx");
const files = Array.from(glob.scanSync(ARTICLE_PATH));
const index = files.length;
const title = prompt('Title : ');
const slug = title!.replace(/\s+/g, '-').toLowerCase();
const filename = `${index.toString().padStart(4, '0')}-${slug}`;
await Bun.write(ARTICLE_PATH + '/' + `${filename}` + '/+page.svx', "");
console.log(`Created ${filename} +page.svx`);
export { };