Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tags to news page #1575

Open
wants to merge 2 commits into
base: src
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
9 changes: 7 additions & 2 deletions layouts/partials/sidebars/news.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,17 @@ <h4>Filter</h4>
{{ if eq .Parent.Section "news" }}
<div class="sidebar-block">
<h4>{{ i18n "news-sidebar-news-title" }}</h4>
<div id="{{ $id }}" class="news-items" data-news-count="10"
<div id="{{ $id }}" class="news-items" data-news-count="10"
{{ with $templateId }} data-template-id="{{ . }}" {{ end }}
data-publish-target="jakarta_ee">
</div>
<p><a class="btn btn-primary" href="/news">View More</a></p>
</div>
{{ end }}

<div class="sidebar-block">
<h4>Tags</h4>
<ul class="news-tags-sidebar cat-list" data-id="news-tags-sidebar" data-url="https://newsroom.eclipse.org/api/news?parameters[publish_to]=jakarta_ee"></ul>
</div>

</aside>

6 changes: 3 additions & 3 deletions less/news.less
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/*!
* Copyright (c) 2020 Eclipse Foundation, Inc.
*
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
*
* Contributors:
* Andrii Malytskyi <[email protected]>
*
*
* SPDX-License-Identifier: EPL-2.0
*/
.announcements-news-list {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"optimize_news_images": "bash ./optimize_images.sh content/news"
},
"dependencies": {
"eclipsefdn-hugo-solstice-theme": "0.0.156",
"eclipsefdn-hugo-solstice-theme": "0.0.171",
"lodash-es": "4.17.15",
"list.js": "^1.2.0"
},
Expand Down
Loading