hexo/node_modules/hexo-generator-baidu-sitemap/baidusitemap.ejs

19 lines
556 B
Plaintext

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<%
var baiduUrl = config.url
if (config.baidusitemap.url) {
baiduUrl = config.baidusitemap.url
}
var url = baiduUrl + config.root;
posts.forEach(function(post){
if(post.categories){ -%>
<url>
<loc><%- encodeURI(url + post.path) %></loc>
<lastmod><%= post.updated.toDate().toISOString().replace(/T.*$/i, "") || post.date.toDate().toISOString().replace(/T.*$/i, "") %></lastmod>
</url>
<%}}) -%>
</urlset> -%>