From d54ab89ea2e48f206a6f1793c40b258fbcb9baa7 Mon Sep 17 00:00:00 2001 From: Mimi <1119186082@qq.com> Date: Sun, 2 Aug 2026 23:57:30 +0800 Subject: [PATCH] Deprecate lazyload option --- _config.yml | 5 ----- scripts/events/lib/config.js | 7 ++++++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/_config.yml b/_config.yml index 033fb08..1f60469 100644 --- a/_config.yml +++ b/_config.yml @@ -88,7 +88,6 @@ open_graph: #twitter_id: #twitter_site: #twitter_image: - #google_plus: #fb_admins: #fb_app_id: @@ -600,10 +599,6 @@ fancybox: false # For more information: https://medium-zoom.francoischalifour.com mediumzoom: false -# Vanilla JavaScript plugin for lazyloading images. -# For more information: https://apoorv.pro/lozad.js/demo/ -lazyload: false - # Automatically insert whitespace between CJK and half-width characters. # For more information: https://github.com/vinta/pangu.js # Server-side plugin: https://github.com/next-theme/hexo-pangu diff --git a/scripts/events/lib/config.js b/scripts/events/lib/config.js index 5527726..a22d09f 100644 --- a/scripts/events/lib/config.js +++ b/scripts/events/lib/config.js @@ -10,7 +10,7 @@ module.exports = hexo => { hexo.log.warn('Documentation: https://theme-next.js.org/docs/getting-started/configuration.html'); } - const { cache, changyan, growingio_analytics, language_switcher, leancloud_visitors } = hexo.theme.config; + const { cache, changyan, growingio_analytics, language_switcher, lazyload, leancloud_visitors } = hexo.theme.config; const warning = function(...args) { hexo.log.warn(`Since ${args[0]} is turned on, the ${args[1]} is disabled to avoid potential hazards.`); }; @@ -29,6 +29,11 @@ module.exports = hexo => { if (growingio_analytics) { hexo.log.warn('growingio_analytics is deprecated. Please migrate to another analytics provider.'); } + if (lazyload) { + hexo.log.warn('The `lazyload` theme option is deprecated and will be removed in the next version.'); + hexo.log.warn('Use `marked.lazyload: true` in Hexo `_config.yml` instead. hexo-renderer-marked will add `loading="lazy"` to images.'); + hexo.log.warn('Documentation: https://github.com/hexojs/hexo-renderer-marked#options'); + } if (leancloud_visitors?.enable) { hexo.log.warn('LeanCloud will stop public services on 2027-01-12. Please migrate your data as soon as possible.'); hexo.log.warn('Announcement: https://docs.leancloud.app/sdk/announcements/sunset-announcement/');