Merge branch 'feed'

This commit is contained in:
swagg boi 2023-05-06 00:31:55 -04:00
commit 832a739eba
3 changed files with 10 additions and 6 deletions

BIN
.feed.xml.swp Normal file

Binary file not shown.

View file

@ -31,7 +31,10 @@ sub startup($self) {
});
$self->helper(hr => sub ($c) {
state $hr = HTML::Restrict->new(strip_enclosed_content => [])
state $hr = HTML::Restrict->new(
filter_text => 0,
strip_enclosed_content => []
)
});
$self->helper(thread => sub ($c) {

View file

@ -105,15 +105,16 @@ sub feed($self) {
);
for my $thread (@{$threads}) {
my $item_link =
$self->url_for(
single_thread => {thread_id => $thread->{'id'}}
)->to_abs;
my $description =
$self->markdown($self->truncate_text($thread->{'body'}));
my $item_link = $self->url_for(
single_thread => {thread_id => $thread->{'id'}}
)->to_abs;
$rss->add_item(
title => $thread->{'title'},
link => $item_link,
description => $self->truncate_text($thread->{'body'}),
description => $description,
author => $thread->{'author'},
guid => $thread->{'id'},
pubDate => $thread->{'date'}