Skip to content

Commit

Permalink
Add tag to breadcrumb
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Poirier <[email protected]>
  • Loading branch information
ericpoirier committed Nov 1, 2022
1 parent af61485 commit e768807
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 += '<li class="active" aria-current="page">' + tag + '</li>';
}

$('.testimonial-container').html(
$(".testimonial-item").sort(function(){
return .5 - Math.random()
Expand Down
2 changes: 2 additions & 0 deletions static/_redirects
Original file line number Diff line number Diff line change
Expand Up @@ -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!

0 comments on commit e768807

Please sign in to comment.