From 434c970420acdb090b4a49ae7b888772344a4957 Mon Sep 17 00:00:00 2001 From: Paul Love Date: Mon, 22 Jan 2024 21:54:27 +0000 Subject: [PATCH] build: add article generator --- _templates/article/new/index.ejs.t | 16 ++++++++++++++++ _templates/article/new/prompt.js | 7 +++++++ package.json | 2 ++ 3 files changed, 25 insertions(+) create mode 100644 _templates/article/new/index.ejs.t create mode 100644 _templates/article/new/prompt.js diff --git a/_templates/article/new/index.ejs.t b/_templates/article/new/index.ejs.t new file mode 100644 index 000000000..1ce149dd8 --- /dev/null +++ b/_templates/article/new/index.ejs.t @@ -0,0 +1,16 @@ +--- +to: src/content/articles/<%= h.changeCase.param(title) %>.md +sh: "git checkout -b content/<%= h.changeCase.param(title) %>" +--- +--- +title: <%= title %> +description: "Spacial Harajuku lens Russian advanced magnetic pachinko" +source: astro +tags: ["tag"] +pubDate: <%= new Date().toISOString(); %> +updatedDate: <%= new Date().toISOString(); %> +--- + +> Spacial Harajuku lens Russian advanced magnetic pachinko hologram jockey black electronic Tokyo cowboy simstim. Biological pixel origami rain-stained précis dermatrode hypnagogic origami razorgirl simstim military. ROM cryptic pyrolitic implant code techno-criminal bedslab spacial techno-criminal prosthesis deficiency television. + +— [Author, _work_](https://example.com) diff --git a/_templates/article/new/prompt.js b/_templates/article/new/prompt.js new file mode 100644 index 000000000..ce85810b7 --- /dev/null +++ b/_templates/article/new/prompt.js @@ -0,0 +1,7 @@ +module.exports = [ + { + type: "input", + name: "title", + message: "Article title (sentence case)?", + }, +]; diff --git a/package.json b/package.json index 521947636..4a0558732 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,8 @@ "lint": "npm-run-all lint:*", "lint:commits": "./node_modules/.bin/commitlint --from=origin/main", "lint:format": "yarn prettier --list-different \"./*.{astro,js,json,md,mdx}\" \"./**/*.{astro,js,json,md,mdx}\"", + "?new:article": "Generate a new article scaffold", + "new:article": "hygen article new", "?new:bookmark": "Generate a new bookmark scaffold", "new:bookmark": "hygen bookmark new", "?new:post": "Generate a new post scaffold",