mirror of https://github.com/halo-dev/halo
parent
c3f777fba3
commit
f383cd4aa3
|
@ -107,6 +107,7 @@ public class FreemarkerConfigAwareListener {
|
|||
configuration.setSharedVariable("context", context);
|
||||
configuration.setSharedVariable("version", HaloConst.HALO_VERSION);
|
||||
|
||||
configuration.setSharedVariable("globalAbsolutePathEnabled", optionService.isEnabledAbsolutePath());
|
||||
configuration.setSharedVariable("blog_title", optionService.getBlogTitle());
|
||||
configuration.setSharedVariable("blog_url", optionService.getBlogBaseUrl());
|
||||
configuration.setSharedVariable("blog_logo", optionService.getByPropertyOrDefault(BlogProperties.BLOG_LOGO, String.class, BlogProperties.BLOG_LOGO.defaultValue()));
|
||||
|
|
|
@ -152,7 +152,7 @@
|
|||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<form method="post" action="${context!}/archives/${slug!}/password">
|
||||
<form method="post" action="${blog_url!}/archives/${slug!}/password">
|
||||
<div class="password-input">
|
||||
<input type="password" name="password" placeholder="请输入文章访问密码">
|
||||
<span class="bottom"></span>
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
<#list posts as post>
|
||||
<entry>
|
||||
<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>
|
||||
<published>${post.createTime?iso_local}</published>
|
||||
<updated>${post.editTime?iso_local}</updated>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<#list archives as archive>
|
||||
## ${archive.year?c}
|
||||
<#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>
|
||||
</@postTag>
|
||||
|
@ -20,13 +20,13 @@
|
|||
## 分类目录
|
||||
<@categoryTag method="list">
|
||||
<#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>
|
||||
</@categoryTag>
|
||||
|
||||
## 标签
|
||||
<@tagTag method="list">
|
||||
<#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>
|
||||
</@tagTag>
|
|
@ -28,7 +28,7 @@
|
|||
<title>
|
||||
<![CDATA[${post.title!}]]>
|
||||
</title>
|
||||
<link>${post.fullPath!}</link>
|
||||
<link><#if !globalAbsolutePathEnabled!true>${blog_url!}</#if>${post.fullPath!}</link>
|
||||
<description>
|
||||
<#if (options.rss_content_type!'full') == 'full'>
|
||||
<![CDATA[${post.formatContent!}]]>
|
||||
|
|
|
@ -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>
|
||||
<#list posts as post>
|
||||
<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="T3 pull-right">daily</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>
|
||||
<#list categories as category>
|
||||
<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="T3 pull-right">daily</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>
|
||||
<#list tags as tag>
|
||||
<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="T3 pull-right">daily</div>
|
||||
<div class="T4 pull-right">0.6</div>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<#if posts?? && posts?size gt 0>
|
||||
<#list posts as post>
|
||||
<url>
|
||||
<loc>${post.fullPath!}</loc>
|
||||
<loc><#if !globalAbsolutePathEnabled!true>${blog_url!}</#if>${post.fullPath!}</loc>
|
||||
<lastmod>${post.createTime?iso_local}</lastmod>
|
||||
</url>
|
||||
</#list>
|
||||
|
|
Loading…
Reference in New Issue