From 428eb0b490c0a67e68354294fd1d47a50644a9de Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Thu, 6 Mar 2025 14:46:06 -0500 Subject: [PATCH] Add descriptions for all questions, rename some --- src/parser.js | 2 +- src/questions.js | 26 +++++++++++++++++--------- src/writer.js | 4 ++-- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/parser.js b/src/parser.js index 4086501..12e0e5e 100644 --- a/src/parser.js +++ b/src/parser.js @@ -94,7 +94,7 @@ function buildPost(data) { } function getPostDate(data) { - const date = luxon.DateTime.fromRFC2822(data.childValue('pubDate'), { zone: shared.config.customDateTimezone }); + const date = luxon.DateTime.fromRFC2822(data.childValue('pubDate'), { zone: shared.config.timezone }); return date.isValid ? date : undefined; } diff --git a/src/questions.js b/src/questions.js index 63d9b7a..f580293 100644 --- a/src/questions.js +++ b/src/questions.js @@ -38,7 +38,7 @@ export function load() { { name: 'prefix-date', type: 'boolean', - description: 'Prefix with date', + description: 'Add date prefix to posts', default: false, choices: [ { @@ -56,7 +56,7 @@ export function load() { { name: 'date-folders', type: 'choice', - description: 'Organize into folders based on date', + description: 'Organize posts into folders by date', default: 'none', choices: [ { @@ -109,41 +109,49 @@ export function load() { { name: 'frontmatter-fields', type: 'list', - default: ['title', 'date', 'categories', 'tags', 'coverImage', 'draft'] + description: 'Frontmatter fields', + default: 'title,date,categories,tags,coverImage,draft' }, { name: 'image-file-request-delay', type: 'integer', + description: 'Delay between image file requests', default: 500 }, { name: 'markdown-file-write-delay', type: 'integer', + description: 'Delay between writing markdown files', default: 10 }, + { + name: 'timezone', + type: 'string', + description: 'Timezone to apply to date', + default: 'utc' + }, { name: 'include-time-with-date', type: 'boolean', + description: 'Include time with frontmatter date', default: false }, { - name: 'custom-date-formatting', + name: 'date-format', type: 'string', + description: 'Frontmatter date format string', default: '' }, - { - name: 'custom-date-timezone', - type: 'string', - default: 'utc' - }, { name: 'quote-date', type: 'boolean', + description: 'Wrap frontmatter date in quotes', default: false }, { name: 'strict-ssl', type: 'boolean', + description: 'Use strict SSL', default: true } ]; diff --git a/src/writer.js b/src/writer.js index eea1645..c2ba37e 100644 --- a/src/writer.js +++ b/src/writer.js @@ -87,8 +87,8 @@ async function loadMarkdownFilePromise(post) { // output unquoted outputValue = value.toString(); } else if (value instanceof luxon.DateTime) { - if (shared.config.customDateFormatting) { - outputValue = value.toFormat(shared.config.customDateFormatting); + if (shared.config.dateFormat) { + outputValue = value.toFormat(shared.config.dateFormat); } else { outputValue = shared.config.includeTimeWithDate ? value.toISO() : value.toISODate(); }