From 83522f6a81206234dee82de31eff12326a8ec683 Mon Sep 17 00:00:00 2001 From: ruibaby Date: Sat, 8 Jun 2019 02:14:20 +0800 Subject: [PATCH 1/2] Update anatole theme. --- .../event/freemarker/FreemarkerConfigAwareListener.java | 2 ++ .../resources/templates/common/macro/common_macro.ftl | 9 ++++++--- .../resources/templates/themes/anatole/module/macro.ftl | 7 +++---- .../templates/themes/anatole/module/sidebar.ftl | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) 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! From 41806bef984de00821db6dfe9ce17798b28f51c6 Mon Sep 17 00:00:00 2001 From: wuzhi1234 Date: Sat, 8 Jun 2019 03:38:04 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E5=AE=8C=E6=B2=A1=E6=9C=89=E5=8A=A0break=EF=BC=8C=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E6=A0=87=E7=AD=BE=E4=BC=9A=E7=BB=A7=E7=BB=AD=E8=B5=B0?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/run/halo/app/service/impl/PostServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/run/halo/app/service/impl/PostServiceImpl.java b/src/main/java/run/halo/app/service/impl/PostServiceImpl.java index 96666b825..ec3008ff2 100644 --- a/src/main/java/run/halo/app/service/impl/PostServiceImpl.java +++ b/src/main/java/run/halo/app/service/impl/PostServiceImpl.java @@ -330,6 +330,7 @@ public class PostServiceImpl extends BasePostServiceImpl implements PostSe tag = tagService.create(tag); } tagIds.add(tag.getId()); + break; case "categories": Category category = categoryService.getByName(ele); if (null == category) {