From 63150f5153ff568d136b338bddd4f81603402bd1 Mon Sep 17 00:00:00 2001 From: curben <2809763-curben@users.noreply.gitlab.com> Date: Sun, 11 Aug 2019 11:11:01 +0930 Subject: [PATCH] feat: use meta_generator helper instead of filter https://github.com/hexojs/hexo/pull/3669 --- _config.yml | 2 ++ themes/typing/layout/_partial/head.ejs | 1 + themes/typing/scripts/meta_generator.js | 7 +++++++ 3 files changed, 10 insertions(+) create mode 100644 themes/typing/scripts/meta_generator.js diff --git a/_config.yml b/_config.yml index fc7e271..c97b62e 100644 --- a/_config.yml +++ b/_config.yml @@ -86,6 +86,8 @@ neat_svg: deploy: type: +meta_generator: false + # theme config theme_config: # Lang diff --git a/themes/typing/layout/_partial/head.ejs b/themes/typing/layout/_partial/head.ejs index cc3fd0c..141ae1f 100644 --- a/themes/typing/layout/_partial/head.ejs +++ b/themes/typing/layout/_partial/head.ejs @@ -1,5 +1,6 @@
+ <%- meta_generator() %> <% let title = page.title diff --git a/themes/typing/scripts/meta_generator.js b/themes/typing/scripts/meta_generator.js new file mode 100644 index 0000000..f7826d6 --- /dev/null +++ b/themes/typing/scripts/meta_generator.js @@ -0,0 +1,7 @@ +'use strict' + +function metaGeneratorHelper () { + return ''.replace('%s', this.env.version) +} + +hexo.extend.helper.register('meta_generator', metaGeneratorHelper)