From e76880769d5a2648f5d5674a88b38347ff3873f5 Mon Sep 17 00:00:00 2001 From: Eric Poirier Date: Tue, 1 Nov 2022 13:41:12 -0400 Subject: [PATCH] Add tag to breadcrumb Signed-off-by: Eric Poirier --- js/main.js | 12 ++++++++++++ static/_redirects | 2 ++ 2 files changed, 14 insertions(+) diff --git a/js/main.js b/js/main.js index 878238b63..1299a5fd4 100644 --- a/js/main.js +++ b/js/main.js @@ -71,6 +71,18 @@ document.addEventListener("DOMContentLoaded", function(event) { }); $(document).ready(function() { + + const queryString = window.location.search; + const urlParams = new URLSearchParams(queryString); + const tag = urlParams.get('news_tags'); + if (tag !== null) { + const collection = document.querySelector('.breadcrumb'); + let activeBreadcrumb = collection.querySelector('.active'); + activeBreadcrumb.removeAttribute("class"); + activeBreadcrumb.removeAttribute("aria-current"); + collection.innerHTML += '
  • ' + tag + '
  • '; + } + $('.testimonial-container').html( $(".testimonial-item").sort(function(){ return .5 - Math.random() diff --git a/static/_redirects b/static/_redirects index 67323e18e..f389a1e30 100644 --- a/static/_redirects +++ b/static/_redirects @@ -25,3 +25,5 @@ http://mail.jakarta.ee/* https://eclipse-ee4j.github.io/mail/:splat 200! # redirect events page from old to new location /events /community/events 301! +# redirect old news urls +/news/* /news?news_tags=:splat 301!