import fs from 'fs'; import path, { resolve } from 'path'; import { readdirSync, lstatSync } from 'fs'; import handlebars from 'handlebars'; handlebars.registerHelper('capitalize', function (str) { return str.charAt(0).toUpperCase() + str.slice(1); }); const args = process.argv; const dir = args[2]; const title = args[3]; const category = args[4]; const publicPath = args[5]; if (args.length < 6) { console.error('Usage: generate-image-story.mjs