fixed article links in sitemap

This commit is contained in:
Mia Rose Winter 2024-03-07 11:27:29 +01:00
parent 4bc822d993
commit b1abe1c0f8
Signed by: miawinter
GPG key ID: 4B6F6A83178F595E

View file

@ -3,6 +3,7 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Options;
using Wave.Data;
using Wave.Utilities;
namespace Wave.Controllers;
@ -66,8 +67,7 @@ public class RssController(IOptions<Customization> customizations, ApplicationDb
var item = new SyndicationItem(
article.Title,
new TextSyndicationContent(article.BodyHtml, TextSyndicationContentKind.Html),
new Uri(host,
$"/{article.PublishDate.Year}/{article.PublishDate.Month:D2}/{article.PublishDate.Day:D2}/{Uri.EscapeDataString(article.Title.ToLowerInvariant()).Replace("-", "+").Replace("%20", "-")}"),
new Uri(ArticleUtilities.GenerateArticleLink(article, host)),
new Uri(host, "article/" + article.Id).AbsoluteUri,
article.PublishDate) {
Authors = {