diff --git a/src/main/java/run/halo/app/model/dto/CategoryDTO.java b/src/main/java/run/halo/app/model/dto/CategoryDTO.java index 1ea27fd42..2f835c05c 100644 --- a/src/main/java/run/halo/app/model/dto/CategoryDTO.java +++ b/src/main/java/run/halo/app/model/dto/CategoryDTO.java @@ -6,6 +6,8 @@ import lombok.ToString; import run.halo.app.model.dto.base.OutputConverter; import run.halo.app.model.entity.Category; +import java.util.Date; + /** * Category output dto. * @@ -26,4 +28,6 @@ public class CategoryDTO implements OutputConverter { private String description; private Integer parentId; + + private Date createTime; } diff --git a/src/main/java/run/halo/app/model/dto/TagDTO.java b/src/main/java/run/halo/app/model/dto/TagDTO.java index 405807c58..2e871c7f8 100644 --- a/src/main/java/run/halo/app/model/dto/TagDTO.java +++ b/src/main/java/run/halo/app/model/dto/TagDTO.java @@ -4,6 +4,8 @@ import lombok.Data; import run.halo.app.model.dto.base.OutputConverter; import run.halo.app.model.entity.Tag; +import java.util.Date; + /** * Tag output dto. * @@ -18,4 +20,6 @@ public class TagDTO implements OutputConverter { private String name; private String slugName; + + private Date createTime; } diff --git a/src/main/resources/templates/common/mail_template/mail_reply.ftl b/src/main/resources/templates/common/mail_template/mail_reply.ftl index a54f94e2d..145751bcb 100644 --- a/src/main/resources/templates/common/mail_template/mail_reply.ftl +++ b/src/main/resources/templates/common/mail_template/mail_reply.ftl @@ -17,13 +17,13 @@ 查看完整内容

欢迎再度光临 - ${options.blog_title!} + ${options.blog_title!}

(此邮件由系统自动发出, 请勿回复。如有打扰,请见谅。)

邮件发自: - ${options.blog_title!} + ${options.blog_title!}

diff --git a/src/main/resources/templates/common/web/atom.ftl b/src/main/resources/templates/common/web/atom.ftl index 26bde721b..e837b966e 100644 --- a/src/main/resources/templates/common/web/atom.ftl +++ b/src/main/resources/templates/common/web/atom.ftl @@ -8,8 +8,8 @@ xmlns:slash="http://purl.org/rss/1.0/modules/slash/"> ${options.blog_title!} - - ${options.blog_url!} + + ${context!} ${user.description!} zh-CN hourly @@ -20,8 +20,8 @@ <#list posts as post> <![CDATA[${post.title!}]]> - ${options.blog_url!}/archives/${post.url!} - ${options.blog_url!}/archives/${post.url!}#comments + ${context!}/archives/${post.url!} + ${context!}/archives/${post.url!}#comments ${post.createTime!} diff --git a/src/main/resources/templates/common/web/robots.ftl b/src/main/resources/templates/common/web/robots.ftl index 94b03cac5..ab6c3206b 100644 --- a/src/main/resources/templates/common/web/robots.ftl +++ b/src/main/resources/templates/common/web/robots.ftl @@ -4,6 +4,6 @@ Disallow: / <#else> User-agent: * Disallow: /admin/ -Sitemap: ${options.blog_url!}/sitemap.xml -Sitemap: ${options.blog_url!}/sitemap.html +Sitemap: ${context!}/sitemap.xml +Sitemap: ${context!}/sitemap.html \ 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 afe6b4232..b8e799141 100644 --- a/src/main/resources/templates/common/web/rss.ftl +++ b/src/main/resources/templates/common/web/rss.ftl @@ -2,7 +2,7 @@ ${options.blog_title!} - ${options.blog_url!} + ${context!} <#if user.description??> ${user.description!} diff --git a/src/main/resources/templates/common/web/sitemap_html.ftl b/src/main/resources/templates/common/web/sitemap_html.ftl index 81b35404c..2d25a4782 100644 --- a/src/main/resources/templates/common/web/sitemap_html.ftl +++ b/src/main/resources/templates/common/web/sitemap_html.ftl @@ -124,7 +124,7 @@ see https://gitee.com/yadong.zhang/DBlog/blob/master/blog-web/src/main/java/com/

${options.blog_title!} 网站地图

- +

最新文章

diff --git a/src/main/resources/templates/common/web/sitemap_xml.ftl b/src/main/resources/templates/common/web/sitemap_xml.ftl index c02df6e20..f564334b0 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> - ${options.blog_url!}/archives/${post.url!} + ${context!}/archives/${post.url!} ${post.createTime?iso_local} diff --git a/src/test/java/run/halo/app/service/impl/PostServiceImplTest.java b/src/test/java/run/halo/app/service/impl/PostServiceImplTest.java index 4c7fcc551..5e1ca863c 100644 --- a/src/test/java/run/halo/app/service/impl/PostServiceImplTest.java +++ b/src/test/java/run/halo/app/service/impl/PostServiceImplTest.java @@ -1,24 +1,24 @@ -package run.halo.app.service.impl; - -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest -@ActiveProfiles("dev") -public class PostServiceImplTest { - - @Autowired - private PostServiceImpl postService; - - @Test - public void getContent(){ - String exportMarkdown = postService.exportMarkdown(18); - System.out.println(exportMarkdown); - } -} \ No newline at end of file +//package run.halo.app.service.impl; +// +//import org.junit.Assert; +//import org.junit.Test; +//import org.junit.runner.RunWith; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.boot.test.context.SpringBootTest; +//import org.springframework.test.context.ActiveProfiles; +//import org.springframework.test.context.junit4.SpringRunner; +// +//@RunWith(SpringRunner.class) +//@SpringBootTest +//@ActiveProfiles("dev") +//public class PostServiceImplTest { +// +// @Autowired +// private PostServiceImpl postService; +// +// @Test +// public void getContent(){ +// String exportMarkdown = postService.exportMarkdown(18); +// System.out.println(exportMarkdown); +// } +//} \ No newline at end of file