Skip to content

Commit

Permalink
Merge pull request halo-dev#1 from halo-dev/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Ace Gao authored Jun 8, 2019
2 parents c3c0daf + 1333b15 commit 61caec9
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
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;
Expand Down Expand Up @@ -90,6 +91,7 @@ private void loadUserConfig() throws TemplateModelException {
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");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ public PostDetailVO importMarkdown(String markdown, String filename) {
tag = tagService.create(tag);
}
tagIds.add(tag.getId());
break;
case "categories":
Category category = categoryService.getByName(ele);
if (null == category) {
Expand Down
9 changes: 6 additions & 3 deletions src/main/resources/templates/common/macro/common_macro.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@

<#-- favicon -->
<#macro favicon>
<link rel="shortcut icon" type="images/x-icon" href="${options.blog_favicon!}">
<#if options.blog_favicon?? && options.blog_favicon!=''>
<link rel="shortcut icon" type="images/x-icon" href="${options.blog_favicon!}">
</#if>
</#macro>

<#-- 站点验证代码 -->
Expand Down Expand Up @@ -46,11 +48,12 @@
</#macro>

<#macro globalHeader>
<@favicon />
<meta name="generator" content="Halo ${version!}" />
<@verification />
<@favicon />
</#macro>

<#macro globalFooter>
<@statistics />
<@footer_info />
<@statistics />
</#macro>
7 changes: 3 additions & 4 deletions src/main/resources/templates/themes/anatole/module/macro.ftl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<#include "/common/macro/common_macro.ftl">
<#import "/common/macro/common_macro.ftl" as common>
<#macro head title,keywords,description>
<!DOCTYPE html>
<html>
Expand All @@ -14,8 +14,7 @@
<meta name="author" content="${user.nickname!}" />
<meta name="keywords" content="${keywords!}"/>
<meta name="description" content="${description!}" />
<@verification />
<@favicon />
<@common.globalHeader />
<link href="${static!}/source/css/font-awesome.min.css" type="text/css" rel="stylesheet"/>
<link rel="stylesheet" href="${static!}/source/css/blog_basic.min.css?version=88107691fe">
<link href="${static!}/source/css/style.min.css" type="text/css" rel="stylesheet" />
Expand Down Expand Up @@ -77,7 +76,7 @@
xhr.send();
</#if>
</script>
<@statistics />
<@common.statistics />
</body>
</html>
</#macro>
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<a href="https://github.com/halo-dev/halo" target="_blank">Proudly published with Halo&#65281;</a>
</div>
<div class="footer_text">
<@footer_info></@footer_info>
<@common.footer_info />
</div>
</a>
</div>
Expand Down

0 comments on commit 61caec9

Please sign in to comment.