We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 48b506d + 66fa0e7 commit 3176fe0Copy full SHA for 3176fe0
lib/plugins/filter/meta_generator.js
@@ -4,13 +4,14 @@ let cheerio;
4
const hexoGeneratorTag = '<meta name="generator" content="Hexo %s" />';
5
6
function hexoMetaGeneratorInject(data) {
7
+ const { config } = this;
8
+ if (!config.meta_generator) return;
9
+
10
if (!cheerio) cheerio = require('cheerio');
11
const $ = cheerio.load(data, {decodeEntities: false});
- const { config } = this;
12
13
if (!($('meta[name="generator"]').length > 0) &&
- $('head').contents().length > 0 &&
- config.meta_generator) {
14
+ $('head').contents().length > 0) {
15
$('head').prepend(hexoGeneratorTag.replace('%s', this.version));
16
17
return $.html();
0 commit comments