diff --git a/src/main/java/run/halo/app/listener/freemarker/FreemarkerConfigAwareListener.java b/src/main/java/run/halo/app/listener/freemarker/FreemarkerConfigAwareListener.java index 146fa37ed..03688a7f1 100644 --- a/src/main/java/run/halo/app/listener/freemarker/FreemarkerConfigAwareListener.java +++ b/src/main/java/run/halo/app/listener/freemarker/FreemarkerConfigAwareListener.java @@ -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())); diff --git a/src/main/resources/templates/common/template/post_password.ftl b/src/main/resources/templates/common/template/post_password.ftl index c926ba44e..1807440ff 100644 --- a/src/main/resources/templates/common/template/post_password.ftl +++ b/src/main/resources/templates/common/template/post_password.ftl @@ -152,7 +152,7 @@
-
+
diff --git a/src/main/resources/templates/common/web/atom.ftl b/src/main/resources/templates/common/web/atom.ftl index 45d47e316..fdf599093 100644 --- a/src/main/resources/templates/common/web/atom.ftl +++ b/src/main/resources/templates/common/web/atom.ftl @@ -33,7 +33,7 @@ <#list posts as post> <![CDATA[${post.title!}]]> - + tag:${blog_url!},${post.createTime?string('yyyy-MM-dd')}:${post.slug!} ${post.createTime?iso_local} ${post.editTime?iso_local} diff --git a/src/main/resources/templates/common/web/readme.ftl b/src/main/resources/templates/common/web/readme.ftl index ee0e25c6e..01931ff8c 100644 --- a/src/main/resources/templates/common/web/readme.ftl +++ b/src/main/resources/templates/common/web/readme.ftl @@ -12,7 +12,7 @@ <#list archives as archive> ## ${archive.year?c} <#list archive.posts?sort_by("createTime")?reverse as post> -- ${post.title!} +- ${post.title!} @@ -20,13 +20,13 @@ ## 分类目录 <@categoryTag method="list"> <#list categories as category> -- ${category.name!} +- ${category.name!} ## 标签 <@tagTag method="list"> <#list tags as tag> -- ${tag.name!} +- ${tag.name!} \ No newline at end of file diff --git a/src/main/resources/templates/common/web/rss.ftl b/src/main/resources/templates/common/web/rss.ftl index ed2580312..44c85eaea 100644 --- a/src/main/resources/templates/common/web/rss.ftl +++ b/src/main/resources/templates/common/web/rss.ftl @@ -28,7 +28,7 @@ <![CDATA[${post.title!}]]> - ${post.fullPath!} + <#if !globalAbsolutePathEnabled!true>${blog_url!}${post.fullPath!} <#if (options.rss_content_type!'full') == 'full'> diff --git a/src/main/resources/templates/common/web/sitemap_html.ftl b/src/main/resources/templates/common/web/sitemap_html.ftl index 73331dff9..e4076ea4d 100644 --- a/src/main/resources/templates/common/web/sitemap_html.ftl +++ b/src/main/resources/templates/common/web/sitemap_html.ftl @@ -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>
  • - +
    ${post.createTime?string('yyyy-MM-dd')}
    daily
    0.6
    @@ -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>
  • - +
    ${category.createTime?string('yyyy-MM-dd')}
    daily
    0.6
    @@ -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>
  • - +
    ${tag.createTime?string('yyyy-MM-dd')}
    daily
    0.6
    diff --git a/src/main/resources/templates/common/web/sitemap_xml.ftl b/src/main/resources/templates/common/web/sitemap_xml.ftl index efbc60cbe..f7d17403c 100644 --- a/src/main/resources/templates/common/web/sitemap_xml.ftl +++ b/src/main/resources/templates/common/web/sitemap_xml.ftl @@ -3,7 +3,7 @@ <#if posts?? && posts?size gt 0> <#list posts as post> - ${post.fullPath!} + <#if !globalAbsolutePathEnabled!true>${blog_url!}${post.fullPath!} ${post.createTime?iso_local}