Merge pull request #1 from halo-dev/dev

Dev
pull/192/head
Ace Gao 2019-06-08 10:14:03 +08:00 committed by GitHub
commit 61caec9403
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 8 deletions

View File

@ -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");
}

View File

@ -330,6 +330,7 @@ public class PostServiceImpl extends BasePostServiceImpl<Post> implements PostSe
tag = tagService.create(tag);
}
tagIds.add(tag.getId());
break;
case "categories":
Category category = categoryService.getByName(ele);
if (null == category) {

View File

@ -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>
<#-- 站点验证代码 -->
@ -46,11 +48,12 @@
</#macro>
<#macro globalHeader>
<@favicon />
<meta name="generator" content="Halo ${version!}" />
<@verification />
<@favicon />
</#macro>
<#macro globalFooter>
<@statistics />
<@footer_info />
<@statistics />
</#macro>

View File

@ -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>
@ -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" />
@ -77,7 +76,7 @@
xhr.send();
</#if>
</script>
<@statistics />
<@common.statistics />
</body>
</html>
</#macro>

View File

@ -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>