Merge branch 'feed'

This commit is contained in:
swag 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) { $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) { $self->helper(thread => sub ($c) {

View File

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