@chriswiegman/hugo-tools 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
6
6
  and is generated by [Changie](https://github.com/miniscruff/changie).
7
7
 
8
+ ## 0.1.2 - 2026-05-04
9
+
10
+ ### Features
11
+
12
+ * VS Code command also does initial tag extraction.
13
+
14
+ ### Bug Fixes
15
+
16
+ * Ensure VS Code tasks run on appropriate JS targets
17
+
18
+ ## 0.1.1 - 2026-05-04
19
+
20
+ ### Features
21
+
22
+ * Initial release
23
+
8
24
  ## 0.1.0 - 2026-05-04
9
25
 
10
26
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chriswiegman/hugo-tools",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "A set of tools to make blogging easier with Hugo.",
5
5
  "keywords": [
6
6
  "hugo",
@@ -22,6 +22,9 @@
22
22
  "engines": {
23
23
  "node": ">=18"
24
24
  },
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
25
28
  "files": [
26
29
  "src/",
27
30
  "CHANGELOG.md"
@@ -231,4 +231,4 @@ if (require.main === module) {
231
231
  main();
232
232
  }
233
233
 
234
- module.exports = { extractFrontmatter, parseListItems, generatePrefixes };
234
+ module.exports = { extractFrontmatter, parseListItems, generatePrefixes, main };
package/src/vscode.js CHANGED
@@ -7,7 +7,7 @@
7
7
  * vscode
8
8
  *
9
9
  * Writes to <vscodeDir>/ (default .vscode/):
10
- * tasks.json — tasks for draft, add-tags, publish, pick-image
10
+ * tasks.json — tasks for draft, extract-tags, add-tags, publish, pick-image
11
11
  * extensions.json — recommended extensions
12
12
  * settings.json — markdown editor settings
13
13
  *
@@ -17,42 +17,44 @@
17
17
  const fs = require('fs');
18
18
  const path = require('path');
19
19
  const { requireHugoSite, vscodeDir } = require('./config');
20
+ const { main: extractTags } = require('./extract-tags');
20
21
 
21
22
  const TASKS = {
22
- version: '2.0.0',
23
- tasks: [
23
+ "version": "2.0.0",
24
+ "tasks": [
24
25
  {
25
- label: 'Create Draft',
26
- type: 'shell',
27
- command: 'draft',
28
- problemMatcher: [],
26
+ "label": "Create Draft",
27
+ "type": "shell",
28
+ "command": "npx draft",
29
+ "problemMatcher": []
29
30
  },
30
31
  {
31
- label: 'Add Tags',
32
- type: 'shell',
33
- command: 'add-tags',
34
- problemMatcher: [],
32
+ "label": "Add Tags",
33
+ "type": "shell",
34
+ "command": "npx add-tags",
35
+ "problemMatcher": []
35
36
  },
36
37
  {
37
- label: 'Publish Draft (now)',
38
- type: 'shell',
39
- // publish prints "Published:\n <path>" grep extracts the path and opens it
40
- command: 'output=$(publish "${relativeFile}" now); echo "$output"; newFile=$(echo "$output" | grep -oE \'content/[^ ]+\\.md\'); [ -n "$newFile" ] && code -r "${workspaceFolder}/$newFile"',
41
- problemMatcher: [],
38
+ "label": "Publish Draft (now)",
39
+ "type": "shell",
40
+ "command": "output=$(npx publish \"${relativeFile}\" now); echo \"$output\"; newFile=$(echo \"$output\" | grep -oE 'content/[^ ]+\\.md'); [ -n \"$newFile\" ] && code -r \"${workspaceFolder}/$newFile\"",
41
+ "problemMatcher": []
42
42
  },
43
43
  {
44
- label: 'Publish Draft (later)',
45
- type: 'shell',
46
- command: 'read -p "Publish date (YYYY-MM-DD): " d; output=$(publish "${relativeFile}" later "$d"); echo "$output"; newFile=$(echo "$output" | grep -oE \'content/[^ ]+\\.md\'); [ -n "$newFile" ] && code -r "${workspaceFolder}/$newFile"',
47
- problemMatcher: [],
44
+ "label": "Publish Draft (later)",
45
+ "type": "shell",
46
+ "command": "read -p \"Publish date (YYYY-MM-DD): \" d; output=$(npx publish \"${relativeFile}\" later \"$d\"); echo \"$output\"; newFile=$(echo \"$output\" | grep -oE 'content/[^ ]+\\.md'); [ -n \"$newFile\" ] && code -r \"${workspaceFolder}/$newFile\"",
47
+ "problemMatcher": []
48
48
  },
49
49
  {
50
- label: 'Pick Image',
51
- type: 'shell',
52
- command: 'pick-image',
53
- problemMatcher: [],
54
- presentation: { focus: true },
55
- },
50
+ "label": "Pick Image",
51
+ "type": "shell",
52
+ "command": "npx pick-image",
53
+ "problemMatcher": [],
54
+ "presentation": {
55
+ "focus": true
56
+ }
57
+ }
56
58
  ],
57
59
  };
58
60
 
@@ -93,9 +95,11 @@ function main() {
93
95
  const dir = path.join(process.cwd(), vscodeDir);
94
96
  fs.mkdirSync(dir, { recursive: true });
95
97
 
96
- writeIfAbsent(path.join(dir, 'tasks.json'), JSON.stringify(TASKS, null, 2) + '\n');
98
+ writeIfAbsent(path.join(dir, 'tasks.json'), JSON.stringify(TASKS, null, 2) + '\n');
97
99
  writeIfAbsent(path.join(dir, 'extensions.json'), JSON.stringify(EXTENSIONS, null, 2) + '\n');
98
- writeIfAbsent(path.join(dir, 'settings.json'), JSON.stringify(SETTINGS, null, 2) + '\n');
100
+ writeIfAbsent(path.join(dir, 'settings.json'), JSON.stringify(SETTINGS, null, 2) + '\n');
101
+
102
+ extractTags();
99
103
  }
100
104
 
101
105
  main();