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

37 lines
1.4 KiB
Plaintext
Raw Normal View History

2023-05-03 00:07:43 +02:00
% use Data::Dumper;
% use DateTime::Format::ISO8601;
% use Mojo::DOM;
%
2022-11-09 13:31:58 +01:00
% use Mojo::DOM;
% use Mojo::Util;
%
% use OwlcodeTech::Posts;
2022-11-09 13:31:58 +01:00
%
% my $description_og = '<div>'.$current_category->{description}.'</div>';
% $description_og = Mojo::DOM->new($description_og)->all_text;
% layout 'default', current_category_slug => $current_category->{slug}, description_og => $description_og;
2022-11-09 13:31:58 +01:00
% title $current_category->{title};
<div class="description">
2023-05-03 01:08:41 +02:00
<h1><%= $current_category->{title} %></h1>
2022-11-09 13:31:58 +01:00
<%== $current_category->{description} %>
2023-05-03 00:07:43 +02:00
% my $children_categories = $current_category->{children};
% my $attributes = $current_category->{attributes};
% if (@$children_categories || %$attributes) {
2023-05-03 01:08:41 +02:00
<h2>Quizás te interese.</h2>
2023-05-03 00:07:43 +02:00
% for my $child_category (@$children_categories) {
<p><a href="/<%=$child_category->{slug}%>"><%==$child_category->{title}%></a></p>
% }
% for my $attribute_slug (keys %$attributes) {
% my $attribute = $attributes->{$attribute_slug};
<p><a href="<%="/$current_category->{slug}/atributo/$attribute->{identifier}"%>"><%==$attribute->{menu_text}%></a></p>
% }
2023-05-03 00:07:43 +02:00
% }
% my ($category_posts) = OwlcodeTech::Posts->new->RetrieveAllPostsForCategory($current_category->{slug});
%= include 'page/_list_posts', posts => $category_posts;
2023-05-03 01:08:41 +02:00
<h2>Suscribete a esta categoría.</h2>
2022-11-10 10:49:53 +01:00
<a class="suscribe-category-rss" href="/<%=$current_category->{slug}%>.rss">
<img src="/img/rss.svg" alt="Icono de suscripción rss"/>
</a>
</div>