From d30036e11bc041d6a8e9d7d7b76a722db3f83c26 Mon Sep 17 00:00:00 2001 From: Tben <52448020+BenjaminToby@users.noreply.github.com> Date: Fri, 10 Jun 2022 09:59:51 +0100 Subject: [PATCH] add blog --- layouts/general_layout/GeneralLayout.jsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/layouts/general_layout/GeneralLayout.jsx b/layouts/general_layout/GeneralLayout.jsx index e53a2d3..0103675 100644 --- a/layouts/general_layout/GeneralLayout.jsx +++ b/layouts/general_layout/GeneralLayout.jsx @@ -46,6 +46,10 @@ const GeneralLayout = ({ children, pageName }) => { if (link.dataset.href === window.location.pathname) { link.classList.add("active-page"); } + + if (window.location.pathname.match(new RegExp(`${link.dataset.href}\\/.*`))) { + link.classList.add("active-page"); + } }); gsap.to("#main-content-wrapper", {