From 3dbb7dea44f9cc8d8eb72d93a65fe6e18ddbd7be Mon Sep 17 00:00:00 2001 From: sergiotarxz Date: Wed, 3 May 2023 01:59:10 +0200 Subject: [PATCH] Refactoring the default layout and adding highlight of the parent category of posts/categories in desktop. --- templates/404.html.ep | 2 +- templates/layouts/default.html.ep | 39 +++------------------------- templates/page/_desktop_menu.html.ep | 24 +++++++++++++++++ templates/page/_mobile_menu.html.ep | 24 +++++++++++++++++ templates/page/index.html.ep | 2 +- templates/page/post.html.ep | 2 +- 6 files changed, 55 insertions(+), 38 deletions(-) create mode 100644 templates/page/_desktop_menu.html.ep create mode 100644 templates/page/_mobile_menu.html.ep diff --git a/templates/404.html.ep b/templates/404.html.ep index 1281806..f507043 100644 --- a/templates/404.html.ep +++ b/templates/404.html.ep @@ -1,6 +1,6 @@ % use Mojo::Util; % use BurguillosInfo::Categories; -% layout 'default', current_slug => undef, categories => BurguillosInfo::Categories->new->Retrieve; +% layout 'default', current_category_slug => undef, categories => BurguillosInfo::Categories->new->Retrieve;

Esta página no existe.

Si un enlace te ha llevado aquí, reporta el error a los administradores.

diff --git a/templates/layouts/default.html.ep b/templates/layouts/default.html.ep index 36491a3..933a05e 100644 --- a/templates/layouts/default.html.ep +++ b/templates/layouts/default.html.ep @@ -1,4 +1,6 @@ +% my $categories = stash 'categories'; +% my $current_category_slug = stash 'current_category_slug'; @@ -21,41 +23,8 @@
- - - - +%= include 'page/_desktop_menu', categories => $categories, current_category_slug => $current_category_slug +%= include 'page/_mobile_menu', categories => $categories <%= content %>