pull/864/head
Ryan Wang 2020-05-16 19:21:42 +08:00 committed by GitHub
parent c3f777fba3
commit f383cd4aa3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 11 additions and 10 deletions

View File

@ -107,6 +107,7 @@ public class FreemarkerConfigAwareListener {
configuration.setSharedVariable("context", context); configuration.setSharedVariable("context", context);
configuration.setSharedVariable("version", HaloConst.HALO_VERSION); configuration.setSharedVariable("version", HaloConst.HALO_VERSION);
configuration.setSharedVariable("globalAbsolutePathEnabled", optionService.isEnabledAbsolutePath());
configuration.setSharedVariable("blog_title", optionService.getBlogTitle()); configuration.setSharedVariable("blog_title", optionService.getBlogTitle());
configuration.setSharedVariable("blog_url", optionService.getBlogBaseUrl()); configuration.setSharedVariable("blog_url", optionService.getBlogBaseUrl());
configuration.setSharedVariable("blog_logo", optionService.getByPropertyOrDefault(BlogProperties.BLOG_LOGO, String.class, BlogProperties.BLOG_LOGO.defaultValue())); configuration.setSharedVariable("blog_logo", optionService.getByPropertyOrDefault(BlogProperties.BLOG_LOGO, String.class, BlogProperties.BLOG_LOGO.defaultValue()));

View File

@ -152,7 +152,7 @@
</head> </head>
<body> <body>
<div class="container"> <div class="container">
<form method="post" action="${context!}/archives/${slug!}/password"> <form method="post" action="${blog_url!}/archives/${slug!}/password">
<div class="password-input"> <div class="password-input">
<input type="password" name="password" placeholder="请输入文章访问密码"> <input type="password" name="password" placeholder="请输入文章访问密码">
<span class="bottom"></span> <span class="bottom"></span>

View File

@ -33,7 +33,7 @@
<#list posts as post> <#list posts as post>
<entry> <entry>
<title><![CDATA[${post.title!}]]></title> <title><![CDATA[${post.title!}]]></title>
<link rel="alternate" type="text/html" href="${post.fullPath!}" /> <link rel="alternate" type="text/html" href="<#if !globalAbsolutePathEnabled!true>${blog_url!}</#if>${post.fullPath!}" />
<id>tag:${blog_url!},${post.createTime?string('yyyy-MM-dd')}:${post.slug!}</id> <id>tag:${blog_url!},${post.createTime?string('yyyy-MM-dd')}:${post.slug!}</id>
<published>${post.createTime?iso_local}</published> <published>${post.createTime?iso_local}</published>
<updated>${post.editTime?iso_local}</updated> <updated>${post.editTime?iso_local}</updated>

View File

@ -12,7 +12,7 @@
<#list archives as archive> <#list archives as archive>
## ${archive.year?c} ## ${archive.year?c}
<#list archive.posts?sort_by("createTime")?reverse as post> <#list archive.posts?sort_by("createTime")?reverse as post>
- <a href="${post.fullPath!}" title="${post.title!}" target="_blank">${post.title!}</a> - <a href="<#if !globalAbsolutePathEnabled!true>${blog_url!}</#if>${post.fullPath!}" title="${post.title!}" target="_blank">${post.title!}</a>
</#list> </#list>
</#list> </#list>
</@postTag> </@postTag>
@ -20,13 +20,13 @@
## 分类目录 ## 分类目录
<@categoryTag method="list"> <@categoryTag method="list">
<#list categories as category> <#list categories as category>
- <a href="${category.fullPath!}" target="_blank">${category.name!}</a> - <a href="<#if !globalAbsolutePathEnabled!true>${blog_url!}</#if>${category.fullPath!}" target="_blank">${category.name!}</a>
</#list> </#list>
</@categoryTag> </@categoryTag>
## 标签 ## 标签
<@tagTag method="list"> <@tagTag method="list">
<#list tags as tag> <#list tags as tag>
- <a href="${tag.fullPath!}" target="_blank">${tag.name!}</a> - <a href="<#if !globalAbsolutePathEnabled!true>${blog_url!}</#if>${tag.fullPath!}" target="_blank">${tag.name!}</a>
</#list> </#list>
</@tagTag> </@tagTag>

View File

@ -28,7 +28,7 @@
<title> <title>
<![CDATA[${post.title!}]]> <![CDATA[${post.title!}]]>
</title> </title>
<link>${post.fullPath!}</link> <link><#if !globalAbsolutePathEnabled!true>${blog_url!}</#if>${post.fullPath!}</link>
<description> <description>
<#if (options.rss_content_type!'full') == 'full'> <#if (options.rss_content_type!'full') == 'full'>
<![CDATA[${post.formatContent!}]]> <![CDATA[${post.formatContent!}]]>

View File

@ -141,7 +141,7 @@ see https://gitee.com/yadong.zhang/DBlog/blob/master/blog-web/src/main/java/com/
<#if posts?? && posts?size gt 0> <#if posts?? && posts?size gt 0>
<#list posts as post> <#list posts as post>
<li> <li>
<div class="T1 pull-left"><a href="${post.fullPath!}" title="${post.title!}">${post.title!} | ${blog_title!}</a></div> <div class="T1 pull-left"><a href="<#if !globalAbsolutePathEnabled!true>${blog_url!}</#if>${post.fullPath!}" title="${post.title!}">${post.title!} | ${blog_title!}</a></div>
<div class="T2 pull-right">${post.createTime?string('yyyy-MM-dd')}</div> <div class="T2 pull-right">${post.createTime?string('yyyy-MM-dd')}</div>
<div class="T3 pull-right">daily</div> <div class="T3 pull-right">daily</div>
<div class="T4 pull-right">0.6</div> <div class="T4 pull-right">0.6</div>
@ -158,7 +158,7 @@ see https://gitee.com/yadong.zhang/DBlog/blob/master/blog-web/src/main/java/com/
<#if categories?? && categories?size gt 0> <#if categories?? && categories?size gt 0>
<#list categories as category> <#list categories as category>
<li> <li>
<div class="T1 pull-left"><a href="${category.fullPath!}" title="${category.name}">${category.name} | ${blog_title!}</a></div> <div class="T1 pull-left"><a href="<#if !globalAbsolutePathEnabled!true>${blog_url!}</#if>${category.fullPath!}" title="${category.name}">${category.name} | ${blog_title!}</a></div>
<div class="T2 pull-right">${category.createTime?string('yyyy-MM-dd')}</div> <div class="T2 pull-right">${category.createTime?string('yyyy-MM-dd')}</div>
<div class="T3 pull-right">daily</div> <div class="T3 pull-right">daily</div>
<div class="T4 pull-right">0.6</div> <div class="T4 pull-right">0.6</div>
@ -176,7 +176,7 @@ see https://gitee.com/yadong.zhang/DBlog/blob/master/blog-web/src/main/java/com/
<#if tags?? && tags?size gt 0> <#if tags?? && tags?size gt 0>
<#list tags as tag> <#list tags as tag>
<li> <li>
<div class="T1 pull-left"><a href="${tag.fullPath!}" title="${tag.name}">${tag.name} | ${blog_title!}</a></div> <div class="T1 pull-left"><a href="<#if !globalAbsolutePathEnabled!true>${blog_url!}</#if>${tag.fullPath!}" title="${tag.name}">${tag.name} | ${blog_title!}</a></div>
<div class="T2 pull-right">${tag.createTime?string('yyyy-MM-dd')}</div> <div class="T2 pull-right">${tag.createTime?string('yyyy-MM-dd')}</div>
<div class="T3 pull-right">daily</div> <div class="T3 pull-right">daily</div>
<div class="T4 pull-right">0.6</div> <div class="T4 pull-right">0.6</div>

View File

@ -3,7 +3,7 @@
<#if posts?? && posts?size gt 0> <#if posts?? && posts?size gt 0>
<#list posts as post> <#list posts as post>
<url> <url>
<loc>${post.fullPath!}</loc> <loc><#if !globalAbsolutePathEnabled!true>${blog_url!}</#if>${post.fullPath!}</loc>
<lastmod>${post.createTime?iso_local}</lastmod> <lastmod>${post.createTime?iso_local}</lastmod>
</url> </url>
</#list> </#list>