Fixed sitemap.html rendered error.

pull/167/head
ruibaby 2019-05-24 00:23:08 +08:00
parent 93f146c2c1
commit 58d5a4e6e2
9 changed files with 48 additions and 40 deletions

View File

@ -6,6 +6,8 @@ import lombok.ToString;
import run.halo.app.model.dto.base.OutputConverter; import run.halo.app.model.dto.base.OutputConverter;
import run.halo.app.model.entity.Category; import run.halo.app.model.entity.Category;
import java.util.Date;
/** /**
* Category output dto. * Category output dto.
* *
@ -26,4 +28,6 @@ public class CategoryDTO implements OutputConverter<CategoryDTO, Category> {
private String description; private String description;
private Integer parentId; private Integer parentId;
private Date createTime;
} }

View File

@ -4,6 +4,8 @@ import lombok.Data;
import run.halo.app.model.dto.base.OutputConverter; import run.halo.app.model.dto.base.OutputConverter;
import run.halo.app.model.entity.Tag; import run.halo.app.model.entity.Tag;
import java.util.Date;
/** /**
* Tag output dto. * Tag output dto.
* *
@ -18,4 +20,6 @@ public class TagDTO implements OutputConverter<TagDTO, Tag> {
private String name; private String name;
private String slugName; private String slugName;
private Date createTime;
} }

View File

@ -17,13 +17,13 @@
<a href="${url!}">查看完整内容</a> <a href="${url!}">查看完整内容</a>
</p> </p>
<p style="color: #6e6e6e;font-size:13px;line-height:24px;">欢迎再度光临 <p style="color: #6e6e6e;font-size:13px;line-height:24px;">欢迎再度光临
<a href="${options.blog_url!}">${options.blog_title!}</a> <a href="${context!}">${options.blog_title!}</a>
</p> </p>
<p style="color: #6e6e6e;font-size:13px;line-height:24px;">(此邮件由系统自动发出, 请勿回复。如有打扰,请见谅。)</p> <p style="color: #6e6e6e;font-size:13px;line-height:24px;">(此邮件由系统自动发出, 请勿回复。如有打扰,请见谅。)</p>
</div> </div>
<p style="color: #6e6e6e;font-size:13px;line-height:24px;text-align:right;padding:0 32px">邮件发自: <p style="color: #6e6e6e;font-size:13px;line-height:24px;text-align:right;padding:0 32px">邮件发自:
<a href="${options.blog_url!}" style="color:#51a0e3;text-decoration:none">${options.blog_title!}</a> <a href="${context!}" style="color:#51a0e3;text-decoration:none">${options.blog_title!}</a>
</p> </p>
</div> </div>
</div> </div>

View File

@ -8,8 +8,8 @@
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"> xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
<channel> <channel>
<title>${options.blog_title!}</title> <title>${options.blog_title!}</title>
<atom:link href="${options.blog_url!}/atom.xml" rel="self" type="application/rss+xml"/> <atom:link href="${context!}/atom.xml" rel="self" type="application/rss+xml"/>
<link>${options.blog_url!}</link> <link>${context!}</link>
<description>${user.description!}</description> <description>${user.description!}</description>
<language>zh-CN</language> <language>zh-CN</language>
<sy:updatePeriod>hourly</sy:updatePeriod> <sy:updatePeriod>hourly</sy:updatePeriod>
@ -20,8 +20,8 @@
<#list posts as post> <#list posts as post>
<item> <item>
<title><![CDATA[${post.title!}]]></title> <title><![CDATA[${post.title!}]]></title>
<link>${options.blog_url!}/archives/${post.url!}</link> <link>${context!}/archives/${post.url!}</link>
<comments>${options.blog_url!}/archives/${post.url!}#comments</comments> <comments>${context!}/archives/${post.url!}#comments</comments>
<pubDate>${post.createTime!}</pubDate> <pubDate>${post.createTime!}</pubDate>
<dc:creator><![CDATA[${user.nickname!}]]></dc:creator> <dc:creator><![CDATA[${user.nickname!}]]></dc:creator>

View File

@ -4,6 +4,6 @@ Disallow: /
<#else> <#else>
User-agent: * User-agent: *
Disallow: /admin/ Disallow: /admin/
Sitemap: ${options.blog_url!}/sitemap.xml Sitemap: ${context!}/sitemap.xml
Sitemap: ${options.blog_url!}/sitemap.html Sitemap: ${context!}/sitemap.html
</#if> </#if>

View File

@ -2,7 +2,7 @@
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0"> <rss xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
<channel> <channel>
<title>${options.blog_title!}</title> <title>${options.blog_title!}</title>
<link>${options.blog_url!}</link> <link>${context!}</link>
<#if user.description??> <#if user.description??>
<description>${user.description!}</description> <description>${user.description!}</description>
</#if> </#if>

View File

@ -124,7 +124,7 @@ see https://gitee.com/yadong.zhang/DBlog/blob/master/blog-web/src/main/java/com/
</head> </head>
<body> <body>
<h2 style="text-align: center; margin-top: 20px">${options.blog_title!} 网站地图 </h2> <h2 style="text-align: center; margin-top: 20px">${options.blog_title!} 网站地图 </h2>
<div id="nav"><a href="${options.blog_url!}"><strong>${options.blog_title!}</strong></a> &raquo; <a href="${options.blog_url!}/sitemap.html">站点地图</a></div> <div id="nav"><a href="${context!}"><strong>${options.blog_title!}</strong></a> &raquo; <a href="${context!}/sitemap.html">站点地图</a></div>
<div id="content"> <div id="content">
<h3>最新文章</h3> <h3>最新文章</h3>
<ul id="myTable"> <ul id="myTable">
@ -136,7 +136,7 @@ see https://gitee.com/yadong.zhang/DBlog/blob/master/blog-web/src/main/java/com/
</li> </li>
<div class="myClear"></div> <div class="myClear"></div>
<li> <li>
<div class="T1 pull-left"><a href="${options.blog_url!}" title="${options.blog_title!}">${options.blog_title!}</a></div> <div class="T1 pull-left"><a href="${context!}" title="${options.blog_title!}">${options.blog_title!}</a></div>
<div class="T2 pull-right">${options.blog_start!}</div> <div class="T2 pull-right">${options.blog_start!}</div>
<div class="T3 pull-right">daily</div> <div class="T3 pull-right">daily</div>
<div class="T4 pull-right">1</div> <div class="T4 pull-right">1</div>
@ -145,7 +145,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="${options.blog_url!}/archives/${post.url!}" title="${post.title!}">${post.title!} | ${options.blog_title!}</a></div> <div class="T1 pull-left"><a href="${context!}/archives/${post.url!}" title="${post.title!}">${post.title!} | ${options.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>
@ -162,7 +162,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 cate> <#list categories as cate>
<li> <li>
<div class="T1 pull-left"><a href="${options.blog_url}/categories/${cate.slugName!}" title="前端编程">${cate.name} | ${options.blog_title!}</a></div> <div class="T1 pull-left"><a href="${options.blog_url}/categories/${cate.slugName!}" title="${cate.name}">${cate.name} | ${options.blog_title!}</a></div>
<div class="T2 pull-right">${cate.createTime?string('yyyy-MM-dd')}</div> <div class="T2 pull-right">${cate.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>
@ -180,7 +180,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="${options.blog_url}/tags/${tag.slugName!}" title="前端编程">${tag.name} | ${options.blog_title!}</a></div> <div class="T1 pull-left"><a href="${options.blog_url}/tags/${tag.slugName!}" title="${tag.name}">${tag.name} | ${options.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>
@ -192,7 +192,7 @@ see https://gitee.com/yadong.zhang/DBlog/blob/master/blog-web/src/main/java/com/
</ul> </ul>
</div> </div>
<div id="footer"> <div id="footer">
该文件由<a href="${options.blog_url!}" title="${options.blog_title!}">${options.blog_title!}</a>网站自动生成。 该文件由<a href="${context!}" title="${options.blog_title!}">${options.blog_title!}</a>网站自动生成。
</div> </div>
</body> </body>
</html> </html>

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>${options.blog_url!}/archives/${post.url!}</loc> <loc>${context!}/archives/${post.url!}</loc>
<lastmod>${post.createTime?iso_local}</lastmod> <lastmod>${post.createTime?iso_local}</lastmod>
</url> </url>
</#list> </#list>

View File

@ -1,24 +1,24 @@
package run.halo.app.service.impl; //package run.halo.app.service.impl;
//
import org.junit.Assert; //import org.junit.Assert;
import org.junit.Test; //import org.junit.Test;
import org.junit.runner.RunWith; //import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; //import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles; //import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner; //import org.springframework.test.context.junit4.SpringRunner;
//
@RunWith(SpringRunner.class) //@RunWith(SpringRunner.class)
@SpringBootTest //@SpringBootTest
@ActiveProfiles("dev") //@ActiveProfiles("dev")
public class PostServiceImplTest { //public class PostServiceImplTest {
//
@Autowired // @Autowired
private PostServiceImpl postService; // private PostServiceImpl postService;
//
@Test // @Test
public void getContent(){ // public void getContent(){
String exportMarkdown = postService.exportMarkdown(18); // String exportMarkdown = postService.exportMarkdown(18);
System.out.println(exportMarkdown); // System.out.println(exportMarkdown);
} // }
} //}