directify-cli 1.1.0 → 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/README.md CHANGED
@@ -226,6 +226,55 @@ directify articles delete 789
226
226
  directify articles exists --slug "best-italian-restaurants"
227
227
  ```
228
228
 
229
+ ### Custom Pages
230
+
231
+ ```bash
232
+ # List
233
+ directify pages list
234
+ directify pages ls --json
235
+
236
+ # Get
237
+ directify pages get 12
238
+
239
+ # Create a page in the navbar
240
+ directify pages create \
241
+ --title "About Us" \
242
+ --markdown "# About Us\n\nWe are a directory of the best restaurants..." \
243
+ --placement navbar \
244
+ --seo-title "About Us" \
245
+ --seo-description "Learn about our restaurant directory"
246
+
247
+ # Create a programmatic SEO page (unlisted by default)
248
+ directify pages create \
249
+ --title "NYC vs Chicago Pizza" \
250
+ --markdown "# NYC vs Chicago Pizza\n\nA detailed comparison..." \
251
+ --seo-title "Best Pizza: NYC vs Chicago Compared" \
252
+ --seo-description "Compare pizza styles between New York and Chicago"
253
+
254
+ # Create a footer link
255
+ directify pages create \
256
+ --title "Terms of Service" \
257
+ --markdown "# Terms of Service\n\n..." \
258
+ --placement footer \
259
+ --order 1
260
+
261
+ # Create an external link in the navbar
262
+ directify pages create \
263
+ --title "Submit a Listing" \
264
+ --external-url "https://forms.google.com/your-form" \
265
+ --placement navbar \
266
+ --new-tab
267
+
268
+ # Update
269
+ directify pages update 12 --title "Updated Title" --placement footer
270
+
271
+ # Toggle published/unpublished
272
+ directify pages toggle 12
273
+
274
+ # Delete
275
+ directify pages delete 12
276
+ ```
277
+
229
278
  ## Global Options
230
279
 
231
280
  All resource commands support these options:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "directify-cli",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Official CLI tool for Directify - manage your directories, listings, categories, tags, and articles from the command line.",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -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();