diff --git a/src/main/java/run/halo/app/event/freemarker/FreemarkerConfigAwareListener.java b/src/main/java/run/halo/app/event/freemarker/FreemarkerConfigAwareListener.java index f1b8bbe5d..003ddf25c 100644 --- a/src/main/java/run/halo/app/event/freemarker/FreemarkerConfigAwareListener.java +++ b/src/main/java/run/halo/app/event/freemarker/FreemarkerConfigAwareListener.java @@ -12,6 +12,7 @@ import run.halo.app.event.options.OptionUpdatedEvent; import run.halo.app.event.theme.ThemeActivatedEvent; import run.halo.app.event.user.UserUpdatedEvent; import run.halo.app.handler.theme.config.support.ThemeProperty; +import run.halo.app.model.support.HaloConst; import run.halo.app.service.OptionService; import run.halo.app.service.ThemeService; import run.halo.app.service.ThemeSettingService; @@ -90,6 +91,7 @@ public class FreemarkerConfigAwareListener { private void loadOptionsConfig() throws TemplateModelException { configuration.setSharedVariable("options", optionService.listOptions()); configuration.setSharedVariable("context", optionService.getBlogBaseUrl()); + configuration.setSharedVariable("version", HaloConst.HALO_VERSION); log.debug("Loaded options"); } diff --git a/src/main/resources/templates/common/macro/common_macro.ftl b/src/main/resources/templates/common/macro/common_macro.ftl index 1df74279b..914e91931 100644 --- a/src/main/resources/templates/common/macro/common_macro.ftl +++ b/src/main/resources/templates/common/macro/common_macro.ftl @@ -12,7 +12,9 @@ <#-- favicon --> <#macro favicon> - + <#if options.blog_favicon?? && options.blog_favicon!=''> + + <#-- 站点验证代码 --> @@ -46,11 +48,12 @@ <#macro globalHeader> - <@favicon /> + <@verification /> + <@favicon /> <#macro globalFooter> - <@statistics /> <@footer_info /> + <@statistics /> \ No newline at end of file diff --git a/src/main/resources/templates/themes/anatole/module/macro.ftl b/src/main/resources/templates/themes/anatole/module/macro.ftl index 6d864f8ec..d91175955 100644 --- a/src/main/resources/templates/themes/anatole/module/macro.ftl +++ b/src/main/resources/templates/themes/anatole/module/macro.ftl @@ -1,4 +1,4 @@ -<#include "/common/macro/common_macro.ftl"> +<#import "/common/macro/common_macro.ftl" as common> <#macro head title,keywords,description> @@ -14,8 +14,7 @@ - <@verification /> - <@favicon /> + <@common.globalHeader /> @@ -77,7 +76,7 @@ xhr.send(); -<@statistics /> +<@common.statistics /> diff --git a/src/main/resources/templates/themes/anatole/module/sidebar.ftl b/src/main/resources/templates/themes/anatole/module/sidebar.ftl index fbd5a799d..91362ce1b 100644 --- a/src/main/resources/templates/themes/anatole/module/sidebar.ftl +++ b/src/main/resources/templates/themes/anatole/module/sidebar.ftl @@ -24,7 +24,7 @@ Proudly published with Halo!