Merge branch 'feed'
This commit is contained in:
commit
832a739eba
BIN
.feed.xml.swp
Normal file
BIN
.feed.xml.swp
Normal file
Binary file not shown.
|
@ -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) {
|
||||||
|
|
|
@ -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'}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user