This commit is contained in:
@@ -14,20 +14,20 @@
|
||||
rssContent.AppendLine($" <lastBuildDate>{Model.LastBuildDate}</lastBuildDate>");
|
||||
rssContent.AppendLine(" <ttl>60</ttl>");
|
||||
|
||||
foreach (var post in Model.Posts)
|
||||
foreach (var item in Model.Items)
|
||||
{
|
||||
var postUrl = $"https://www.taxbaik.com/blog/{Uri.EscapeDataString(post.Slug)}";
|
||||
var fullDescription = post.Content ?? string.Empty;
|
||||
var itemUrl = item.Link;
|
||||
var fullDescription = item.Description ?? string.Empty;
|
||||
var safeDescription = fullDescription.Replace("]]>", "]]]]><![CDATA[>");
|
||||
|
||||
rssContent.AppendLine(" <item>");
|
||||
rssContent.AppendLine($" <title>{System.Net.WebUtility.HtmlEncode(post.Title)}</title>");
|
||||
rssContent.AppendLine($" <link>{postUrl}</link>");
|
||||
rssContent.AppendLine($" <guid isPermaLink=\"true\">{postUrl}</guid>");
|
||||
rssContent.AppendLine($" <title>{System.Net.WebUtility.HtmlEncode(item.Title)}</title>");
|
||||
rssContent.AppendLine($" <link>{itemUrl}</link>");
|
||||
rssContent.AppendLine($" <guid isPermaLink=\"true\">{item.Guid}</guid>");
|
||||
|
||||
if (post.PublishedAt is not null)
|
||||
if (item.PublishedAt is not null)
|
||||
{
|
||||
rssContent.AppendLine($" <pubDate>{post.PublishedAt.Value.ToUniversalTime():R}</pubDate>");
|
||||
rssContent.AppendLine($" <pubDate>{item.PublishedAt.Value.ToUniversalTime():R}</pubDate>");
|
||||
}
|
||||
|
||||
rssContent.AppendLine($" <description><![CDATA[{safeDescription}]]></description>");
|
||||
|
||||
Reference in New Issue
Block a user