Skip to content

Commit

Permalink
build: add article generator
Browse files Browse the repository at this point in the history
  • Loading branch information
anglepoised committed Jan 23, 2024
1 parent 67b0d5d commit 434c970
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
16 changes: 16 additions & 0 deletions _templates/article/new/index.ejs.t
Original file line number Diff line number Diff line change
@@ -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.

— <cite>[Author, _work_](https://example.com)</cite>
7 changes: 7 additions & 0 deletions _templates/article/new/prompt.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = [
{
type: "input",
name: "title",
message: "Article title (sentence case)?",
},
];
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 434c970

Please sign in to comment.