From d737534236e6def4b95c9f309a8db430176ce51d Mon Sep 17 00:00:00 2001 From: Ljcbaby <46277145+ljcbaby@users.noreply.github.com> Date: Wed, 26 Jan 2022 00:54:17 +0800 Subject: [PATCH] Enable meta_generator (#449) --- layout/_partials/head/head.njk | 4 +++- scripts/events/lib/config.js | 1 - scripts/filters/locals.js | 3 +-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/layout/_partials/head/head.njk b/layout/_partials/head/head.njk index 1dad674f0..e85686bb8 100644 --- a/layout/_partials/head/head.njk +++ b/layout/_partials/head/head.njk @@ -6,7 +6,9 @@ {%- else %} {%- endif %} - +{%- if config.meta_generator %} + {{- meta_generator() }} +{%- endif %} {{ next_pre() }} diff --git a/scripts/events/lib/config.js b/scripts/events/lib/config.js index 17aeb4c1e..263776de1 100644 --- a/scripts/events/lib/config.js +++ b/scripts/events/lib/config.js @@ -23,7 +23,6 @@ module.exports = hexo => { warning('caching', '`relative_link` option in Hexo `_config.yml`'); hexo.config.relative_link = false; } - hexo.config.meta_generator = false; // Custom languages support. Introduced in NexT v6.3.0. if (data.languages) { diff --git a/scripts/filters/locals.js b/scripts/filters/locals.js index 1c500b540..4b3d184a6 100644 --- a/scripts/filters/locals.js +++ b/scripts/filters/locals.js @@ -5,11 +5,10 @@ const keys = ['toc', 'reward_settings', 'quicklink']; hexo.extend.filter.register('template_locals', locals => { - const { version, config } = hexo; + const { config } = hexo; const { __, theme, page } = locals; const { i18n } = hexo.theme; // Hexo & NexT version - locals.hexo_version = version; locals.next_version = require('../../package.json').version; // Language & Config locals.title = __('title') !== 'title' ? __('title') : config.title;