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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
| // https://code.visualstudio.com/docs/editor/tasks-appendix
{
"version": "2.0.0",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "new",
"showReuseMessage": true,
"clear": true
},
"options": {
"cwd": "${workspaceFolder}",//默认进入到 hugo项目根目录
},
"problemMatcher": [],
"tasks": [
{//
"type": "shell",
"label": "1.hugo serve(本地构建测试)",
"command": "hugo serve -D -e production --gc",
"isBackground": true,
"group": {
"kind": "build",
"isDefault": true
}
},
{//
"label": "2.open browser(打开本地浏览器)",
"type": "shell",
"windows":{
"command": "start http://localhost:1313/CTGU-Hugo-Blog.io/",
},
"linux":{
"command": "xdg-open http://localhost:1313/CTGU-Hugo-Blog.io/",
},
"osx":{
"command": "open http://localhost:1313/CTGU-Hugo-Blog.io/",
},
},
{//
"label": "hugo new file(新建博客文件)",
"type": "shell",
"command":"hugo new ./content/posts/${input:newFileName}"
},
{
"label": "3.open Document folder(打开./content/posts文件夹)",
"type": "shell",
"command": "code --goto ${workspaceFolder}/content/posts",
}
],
"inputs": [
{
"id": "newFileName",
"type": "promptString",
"default": "*.md",
"description": "输入要创建的文件名"
}
],
}
|