2023-05-03 00:07:43 +02:00
|
|
|
% use Data::Dumper;
|
2022-11-11 00:05:48 +01:00
|
|
|
% use DateTime::Format::ISO8601;
|
2023-05-03 17:17:54 +02:00
|
|
|
% use Mojo::DOM;
|
2022-11-11 00:05:48 +01:00
|
|
|
%
|
2022-11-09 13:31:58 +01:00
|
|
|
% use Mojo::DOM;
|
|
|
|
% use Mojo::Util;
|
|
|
|
%
|
2023-05-09 03:20:23 +02:00
|
|
|
% use OwlcodeTech::Posts;
|
2022-11-09 13:31:58 +01:00
|
|
|
%
|
2023-05-03 17:17:54 +02:00
|
|
|
% my $description_og = '<div>'.$current_category->{description}.'</div>';
|
2023-05-17 05:00:15 +02:00
|
|
|
% my $base_url = config 'base_url';
|
2023-05-03 17:17:54 +02:00
|
|
|
% $description_og = Mojo::DOM->new($description_og)->all_text;
|
2023-05-17 05:00:15 +02:00
|
|
|
% layout 'default', current_category => $current_category, description_og => $description_og, ogimage => "$base_url/@{[$current_category->{slug}]}-preview.png";
|
2022-11-09 13:31:58 +01:00
|
|
|
% title $current_category->{title};
|
2023-05-17 07:26:46 +02:00
|
|
|
<div id="first-box" class="description margin">
|
2023-05-16 04:13:21 +02:00
|
|
|
% if (defined $current_category->{image}) {
|
2023-05-17 03:49:01 +02:00
|
|
|
<div class="title-image">
|
|
|
|
<img alt="Portada de la categoría: <%= $current_category->{title} %>" src="<%=$current_category->{image}%>"/>
|
2023-05-16 04:13:21 +02:00
|
|
|
<div class="text-title">
|
2023-05-17 03:49:01 +02:00
|
|
|
<h1><%== $current_category->{title} %></h1>
|
2023-05-16 04:13:21 +02:00
|
|
|
<%== $current_category->{description} %>
|
|
|
|
</div>
|
2023-05-17 03:49:01 +02:00
|
|
|
</div>
|
2023-05-16 04:13:21 +02:00
|
|
|
% } else {
|
2023-05-17 03:49:01 +02:00
|
|
|
<div class="padding">
|
|
|
|
<h1><%== $current_category->{title} %></h1>
|
|
|
|
<%== $current_category->{description} %>
|
|
|
|
</div>
|
2023-05-16 04:13:21 +02:00
|
|
|
% }
|
2023-05-17 03:49:01 +02:00
|
|
|
% if (defined $current_category->{extra_text}) {
|
|
|
|
<div class="padding">
|
|
|
|
<%== $current_category->{extra_text} %>
|
2023-05-16 04:13:21 +02:00
|
|
|
</div>
|
2023-05-17 03:49:01 +02:00
|
|
|
% }
|
2023-05-16 04:13:21 +02:00
|
|
|
<div class="content">
|
2023-05-03 00:07:43 +02:00
|
|
|
% my $children_categories = $current_category->{children};
|
2023-05-03 05:30:29 +02:00
|
|
|
% my $attributes = $current_category->{attributes};
|
|
|
|
% if (@$children_categories || %$attributes) {
|
2023-05-16 04:13:21 +02:00
|
|
|
<h2>Quizás te interese.</h2>
|
2023-05-03 00:07:43 +02:00
|
|
|
% for my $child_category (@$children_categories) {
|
2023-05-16 04:13:21 +02:00
|
|
|
<p><a href="/<%=$child_category->{slug}%>"><%==$child_category->{title}%></a></p>
|
2023-05-03 00:07:43 +02:00
|
|
|
% }
|
2023-05-03 05:30:29 +02:00
|
|
|
% for my $attribute_slug (keys %$attributes) {
|
|
|
|
% my $attribute = $attributes->{$attribute_slug};
|
2023-05-16 04:13:21 +02:00
|
|
|
<p><a href="<%="/$current_category->{slug}/atributo/$attribute->{identifier}"%>"><%==$attribute->{menu_text}%></a></p>
|
2023-05-03 05:30:29 +02:00
|
|
|
% }
|
2023-05-03 00:07:43 +02:00
|
|
|
% }
|
2023-05-09 03:20:23 +02:00
|
|
|
% my ($category_posts) = OwlcodeTech::Posts->new->RetrieveAllPostsForCategory($current_category->{slug});
|
2023-05-03 05:30:29 +02:00
|
|
|
%= include 'page/_list_posts', posts => $category_posts;
|
2023-05-16 04:13:21 +02:00
|
|
|
<h2>Suscribete a esta categoría.</h2>
|
2022-11-10 10:49:53 +01:00
|
|
|
|
2023-05-16 04:13:21 +02:00
|
|
|
<a class="suscribe-category-rss" href="/<%=$current_category->{slug}%>.rss">
|
|
|
|
<img src="/img/rss.svg" alt="Icono de suscripción rss"/>
|
|
|
|
</a>
|
|
|
|
</div>
|
2022-11-11 02:40:52 +01:00
|
|
|
</div>
|