rss in ejs
This commit is contained in:
20
views/syndication/rss.ejs
Normal file
20
views/syndication/rss.ejs
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="<%= config.charset %>" ?>
|
||||
<rss version="2.0">
|
||||
<channel>
|
||||
<title><%= config.site_name %></title>
|
||||
<link><%= config.site_url %></title>
|
||||
<description><%= config.site_description %></description>
|
||||
<% for (let postID = posts.length-1; postID >= 0; postID--) { %>
|
||||
<item>
|
||||
<title><%= posts[postID]["title"] %></title>
|
||||
<link><%= config.site_url %>/post/<%= postID %></link>
|
||||
<description><![CDATA[<%= converter.makeHtml(posts[postID]["content"]) %>]]></description>
|
||||
<guid isPermaLink="true"><%= config.site_url %>/post/<%= postID %></guid>
|
||||
<pubDate><%= func.unix_time_to_rss_date(posts[postID]['pubdate']) %></pubDate>
|
||||
<% for (let tag_index = 0; tag_index < posts[postID]['tags'].length; tag_index++) { %>
|
||||
<category><![CDATA[<%= posts[postID]['tags'][tag_index] %>]]></category>
|
||||
<% } %>
|
||||
</item>
|
||||
<% } %>
|
||||
</channel>
|
||||
</rss>
|
Reference in New Issue
Block a user