owlcode.tech/templates/page/post.html.ep

29 lines
903 B
Plaintext
Raw Normal View History

% use DateTime::Format::ISO8601;
%
2022-11-09 13:31:58 +01:00
% use Mojo::DOM;
% use Mojo::Util;
%
% use BurguillosInfo::Posts;
% use BurguillosInfo::Categories;
% my $categories = BurguillosInfo::Categories->new->Retrieve;
% layout 'default', current_slug => $current_category->{slug}, categories => $categories;
% title $post->{title};
<div class="description">
<h2><%= $post->{title} %></h2>
% my $user_agent = stash 'useragent';
% if ($user_agent !~ /LinkedInBot/) {
2022-11-09 13:31:58 +01:00
<%== $post->{content} %>
% } else {
% my $content = $post->{content};
% my $dom = Mojo::DOM->new($content);
% my @images = $dom->find('img')->each;
% for my $image (@images) {
% $image->remove;
% }
<%== $dom->to_string() %>
% }
% my $date_article = DateTime::Format::ISO8601->parse_datetime($post->{date});
% $date_article->set_time_zone('Europe/Madrid');
<p>Escrito por <%= $post->{author} %> con fecha <%= $date_article %>.<p>
2022-11-09 13:31:58 +01:00
</div>