mirror of https://github.com/halo-dev/halo
Fixed sitemap.html rendered error.
parent
93f146c2c1
commit
58d5a4e6e2
|
@ -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<CategoryDTO, Category> {
|
|||
private String description;
|
||||
|
||||
private Integer parentId;
|
||||
|
||||
private Date createTime;
|
||||
}
|
||||
|
|
|
@ -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<TagDTO, Tag> {
|
|||
private String name;
|
||||
|
||||
private String slugName;
|
||||
|
||||
private Date createTime;
|
||||
}
|
||||
|
|
|
@ -17,13 +17,13 @@
|
|||
<a href="${url!}">查看完整内容</a>
|
||||
</p>
|
||||
<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 style="color: #6e6e6e;font-size:13px;line-height:24px;">(此邮件由系统自动发出, 请勿回复。如有打扰,请见谅。)</p>
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
|
||||
<channel>
|
||||
<title>${options.blog_title!}</title>
|
||||
<atom:link href="${options.blog_url!}/atom.xml" rel="self" type="application/rss+xml"/>
|
||||
<link>${options.blog_url!}</link>
|
||||
<atom:link href="${context!}/atom.xml" rel="self" type="application/rss+xml"/>
|
||||
<link>${context!}</link>
|
||||
<description>${user.description!}</description>
|
||||
<language>zh-CN</language>
|
||||
<sy:updatePeriod>hourly</sy:updatePeriod>
|
||||
|
@ -20,8 +20,8 @@
|
|||
<#list posts as post>
|
||||
<item>
|
||||
<title><![CDATA[${post.title!}]]></title>
|
||||
<link>${options.blog_url!}/archives/${post.url!}</link>
|
||||
<comments>${options.blog_url!}/archives/${post.url!}#comments</comments>
|
||||
<link>${context!}/archives/${post.url!}</link>
|
||||
<comments>${context!}/archives/${post.url!}#comments</comments>
|
||||
<pubDate>${post.createTime!}</pubDate>
|
||||
<dc:creator><![CDATA[${user.nickname!}]]></dc:creator>
|
||||
|
||||
|
|
|
@ -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
|
||||
</#if>
|
|
@ -2,7 +2,7 @@
|
|||
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
|
||||
<channel>
|
||||
<title>${options.blog_title!}</title>
|
||||
<link>${options.blog_url!}</link>
|
||||
<link>${context!}</link>
|
||||
<#if user.description??>
|
||||
<description>${user.description!}</description>
|
||||
</#if>
|
||||
|
|
|
@ -124,7 +124,7 @@ see https://gitee.com/yadong.zhang/DBlog/blob/master/blog-web/src/main/java/com/
|
|||
</head>
|
||||
<body>
|
||||
<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> » <a href="${options.blog_url!}/sitemap.html">站点地图</a></div>
|
||||
<div id="nav"><a href="${context!}"><strong>${options.blog_title!}</strong></a> » <a href="${context!}/sitemap.html">站点地图</a></div>
|
||||
<div id="content">
|
||||
<h3>最新文章</h3>
|
||||
<ul id="myTable">
|
||||
|
@ -136,7 +136,7 @@ see https://gitee.com/yadong.zhang/DBlog/blob/master/blog-web/src/main/java/com/
|
|||
</li>
|
||||
<div class="myClear"></div>
|
||||
<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="T3 pull-right">daily</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>
|
||||
<#list posts as post>
|
||||
<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="T3 pull-right">daily</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>
|
||||
<#list categories as cate>
|
||||
<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="T3 pull-right">daily</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>
|
||||
<#list tags as tag>
|
||||
<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="T3 pull-right">daily</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>
|
||||
</div>
|
||||
<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>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<#if posts?? && posts?size gt 0>
|
||||
<#list posts as post>
|
||||
<url>
|
||||
<loc>${options.blog_url!}/archives/${post.url!}</loc>
|
||||
<loc>${context!}/archives/${post.url!}</loc>
|
||||
<lastmod>${post.createTime?iso_local}</lastmod>
|
||||
</url>
|
||||
</#list>
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
//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);
|
||||
// }
|
||||
//}
|
Loading…
Reference in New Issue