% my $posts = stash 'posts';

Artículos

% unless (defined $posts && @$posts) {

Parece que aun no hay artículos.

% } % for my $post (@$posts) {
<% my $date_article = DateTime::Format::ISO8601->parse_datetime($post->{date}); $date_article->set_time_zone('Europe/Madrid'); %>

<%= ''.$date_article %>

<% if (defined $post->{image}) { %>Portada de <%=$post->{title}%><% } %>

<%=$post->{title}%>

<% my $xml = Mojo::DOM->new($post->{content}); my $text = $xml->all_text; if (length($text) > 120) { $text = substr($text, 0, 100).'...'; } %>

<%=$text%>

Escrito por <%=$post->{author}%>

% }