directify-cli 1.1.1 → 1.2.0
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/package.json
CHANGED
|
@@ -63,6 +63,7 @@ categories
|
|
|
63
63
|
.option('--icon <icon>', 'Icon (emoji or URL)')
|
|
64
64
|
.option('--parent-id <id>', 'Parent category ID')
|
|
65
65
|
.option('--order <n>', 'Sort order', parseInt)
|
|
66
|
+
.option('--head-html <html>', 'Custom HTML for the <head> of the category page (e.g. hreflang tags)')
|
|
66
67
|
.option('--inactive', 'Create as inactive')
|
|
67
68
|
.option('-d, --directory <id>', 'Directory ID')
|
|
68
69
|
.action(async (opts) => {
|
|
@@ -77,6 +78,7 @@ categories
|
|
|
77
78
|
...(opts.icon && { icon: opts.icon }),
|
|
78
79
|
...(opts.parentId && { parent_id: parseInt(opts.parentId) }),
|
|
79
80
|
...(opts.order !== undefined && { order: opts.order }),
|
|
81
|
+
...(opts.headHtml && { head_html: opts.headHtml }),
|
|
80
82
|
is_active: !opts.inactive,
|
|
81
83
|
};
|
|
82
84
|
const data = await api.post(`/directories/${dir}/categories`, body);
|
|
@@ -100,6 +102,7 @@ categories
|
|
|
100
102
|
.option('--parent-id <id>', 'Parent category ID')
|
|
101
103
|
.option('--order <n>', 'Sort order', parseInt)
|
|
102
104
|
.option('--active <bool>', 'Active status (true/false)')
|
|
105
|
+
.option('--head-html <html>', 'Custom HTML for the <head> of the category page (e.g. hreflang tags)')
|
|
103
106
|
.option('-d, --directory <id>', 'Directory ID')
|
|
104
107
|
.action(async (id, opts) => {
|
|
105
108
|
const spinner = ora('Updating category...').start();
|
|
@@ -114,6 +117,7 @@ categories
|
|
|
114
117
|
if (opts.parentId) body.parent_id = parseInt(opts.parentId);
|
|
115
118
|
if (opts.order !== undefined) body.order = opts.order;
|
|
116
119
|
if (opts.active !== undefined) body.is_active = opts.active === 'true';
|
|
120
|
+
if (opts.headHtml) body.head_html = opts.headHtml;
|
|
117
121
|
|
|
118
122
|
const data = await api.put(`/directories/${dir}/categories/${id}`, body);
|
|
119
123
|
spinner.stop();
|