diff --git a/lib/plugins/filter/after_post_render/external_link.js b/lib/plugins/filter/after_post_render/external_link.js index c756a01b7b..475372af95 100644 --- a/lib/plugins/filter/after_post_render/external_link.js +++ b/lib/plugins/filter/after_post_render/external_link.js @@ -11,6 +11,7 @@ function externalLinkFilter(data) { if (typeof EXTERNAL_LINK_POST_CONFIG === 'undefined') { if (typeof config.external_link === 'undefined' || typeof config.external_link === 'object' + // Deprecated: config.external_link boolean option will be removed in future || config.external_link === true) { EXTERNAL_LINK_POST_CONFIG = Object.assign({ enable: true, diff --git a/lib/plugins/filter/after_render/external_link.js b/lib/plugins/filter/after_render/external_link.js index baa241511b..defb7dfa24 100644 --- a/lib/plugins/filter/after_render/external_link.js +++ b/lib/plugins/filter/after_render/external_link.js @@ -11,6 +11,7 @@ function externalLinkFilter(data) { if (typeof EXTERNAL_LINK_SITE_CONFIG === 'undefined') { if (typeof config.external_link === 'undefined' || typeof config.external_link === 'object' + // Deprecated: config.external_link boolean option will be removed in future || config.external_link === true) { EXTERNAL_LINK_SITE_CONFIG = Object.assign({ enable: true, diff --git a/lib/plugins/processor/asset.js b/lib/plugins/processor/asset.js index 1674903fa5..449323e05c 100644 --- a/lib/plugins/processor/asset.js +++ b/lib/plugins/processor/asset.js @@ -12,7 +12,9 @@ module.exports = ctx => { const { path } = file; const doc = Page.findOne({source: path}); const { config } = ctx; - const { timezone: timezoneCfg, use_date_for_updated, updated_option } = config; + const { timezone: timezoneCfg } = config; + // Deprecated: use_date_for_updated will be removed in future + const updated_option = config.use_date_for_updated === true ? 'date' : config.updated_option; if (file.type === 'skip' && doc) { return; @@ -48,7 +50,7 @@ module.exports = ctx => { if (data.updated) { if (timezoneCfg) data.updated = timezone(data.updated, timezoneCfg); - } else if (use_date_for_updated || updated_option === 'date') { + } else if (updated_option === 'date') { data.updated = data.date; } else if (updated_option === 'empty') { delete data.updated; diff --git a/lib/plugins/processor/post.js b/lib/plugins/processor/post.js index 2b60adc12f..6c544f68bd 100644 --- a/lib/plugins/processor/post.js +++ b/lib/plugins/processor/post.js @@ -27,7 +27,9 @@ module.exports = ctx => { const { path } = file.params; const doc = Post.findOne({source: file.path}); const { config } = ctx; - const { timezone: timezoneCfg, use_date_for_updated, updated_option } = config; + const { timezone: timezoneCfg } = config; + // Deprecated: use_date_for_updated will be removed in future + const updated_option = config.use_date_for_updated === true ? 'date' : config.updated_option; let categories, tags; if (file.type === 'skip' && doc) { @@ -85,7 +87,7 @@ module.exports = ctx => { if (data.updated) { if (timezoneCfg) data.updated = timezone(data.updated, timezoneCfg); - } else if (use_date_for_updated || updated_option === 'date') { + } else if (updated_option === 'date') { data.updated = data.date; } else if (updated_option === 'empty') { delete data.updated;