From 1337d35f0c31d4c506c03aa74cf2a0a8a159d872 Mon Sep 17 00:00:00 2001 From: swag Date: Fri, 12 May 2023 14:42:45 -0400 Subject: [PATCH] Add atom namespace for validator warnings --- lib/PostText/Controller/Thread.pm | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/PostText/Controller/Thread.pm b/lib/PostText/Controller/Thread.pm index 586670c..15b356a 100644 --- a/lib/PostText/Controller/Thread.pm +++ b/lib/PostText/Controller/Thread.pm @@ -95,13 +95,25 @@ sub by_page($self) { sub feed($self) { my $threads = $self->thread->feed; my $rss = XML::RSS->new(version => '2.0'); - my $chan_link = $self->url_for(threads_list => {list_page => 1})->to_abs; + my $chan_link = $self->url_for(threads_list => {list_page => 1} )->to_abs; + my $rss_link = $self->url_for(threads_feed => {format => 'rss'})->to_abs; + + $rss->add_module( + prefix => 'atom', + uri => 'http://www.w3.org/2005/Atom' + ); $rss->channel( title => 'Post::Text', description => 'In UTF-8 we trust. 🫡', link => $chan_link, - lastBuildDate => time2str('%a, %d %b %Y %X %z', time) + lastBuildDate => time2str('%a, %d %b %Y %X %z', time), + atom => { + link => { + href => $rss_link, + rel => 'self' + } + } ); for my $thread (@{$threads}) {