This repository was archived by the owner on Mar 11, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplopfile.js
More file actions
47 lines (47 loc) · 1.59 KB
/
Copy pathplopfile.js
File metadata and controls
47 lines (47 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
module.exports = (
/** @type {import('plop').NodePlopAPI} */
plop
) => {
plop.setGenerator("article",{
prompts: [{
type: "input",
name: "Title",
message: "Article Title: ",
},{
type: "input",
name: "Id",
message: "Article Id:"
},{
type: "list",
name: "Emoji",
message: "Select Emoji",
choices: ["🐡","📖","📰","🙌","✨","💻"]
},{
type: "list",
name: "Type",
message: "ArticleType",
choices: ["tech","idea"]
},{
type: "checkbox",
name: "Topics",
message: "Check Topics",
choices: ["react","typescript","nextjs","storybook","plop","rust","webassembly"]
}],
actions: (data) => {
const tags = data.Topics.map(item => item)
return [{
type: "add",
path: `./articles/${data.Id.replace(" ","-").toLowerCase()}.md`,
templateFile: "./article.md.hbs"
},{
type: "append",
path: `./articles/${data.Id.replace(" ","-").toLowerCase()}.md`,
template: `topics: [${tags}]\npublished: false\n---\n`
},{
type: "append",
path: `./articles/${data.Id.replace(" ","-").toLowerCase()}.md`,
template: "## はじめに\n\n### やったこと\n\n### 経緯\n\n### 何を実現したか\n\n### 実際のコード\n\n### 参考情報"
}]
}
})
}