Skip to content

Commit

Permalink
Merge pull request #18 from johnwu1114/master
Browse files Browse the repository at this point in the history
Remove <data />
  • Loading branch information
vic committed Oct 19, 2017
2 parents 0c7a054 + 4add17c commit d57527b
Showing 1 changed file with 7 additions and 23 deletions.
30 changes: 7 additions & 23 deletions baidusitemap.ejs
Original file line number Diff line number Diff line change
@@ -1,27 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<% var url = config.url + config.root %>
<% posts.forEach(function(post){ %>
<% if(post.categories){%>
<url>
<%
var url = config.url + config.root;
posts.forEach(function(post){
if(post.categories){
%> <url>
<loc><%- encodeURI(url + post.path) %></loc>
<lastmod><%= post.updated.toDate().toISOString() || post.date.toDate().toISOString() %></lastmod>
<data>
<display>
<title><%-: post.title %></title>
<pubTime><%= post.date.toDate().toISOString() %></pubTime>
<%if(post.tags){ post.tags.toArray().forEach(function(tag){ %>
<tag><%= tag.name %></tag>
<% })}/*%>
<content><%-: post.content%></content>
<% */%>
<%if(post.tags && post.categories){ %>
<% post.categories.toArray().forEach(function(category,index){ %>
<% if(index < 3){ %>
<breadCrumb title="<%= category.name %>" url="<%- encodeURI(url + category.path) %>"/>
<%}})} %>
</display>
</data>
</url>
<%}}) %>
</urlset>
</url><%}}) %>
</urlset>

0 comments on commit d57527b

Please sign in to comment.