Add News hub and wire homepage Latest news to a dated content index
New /<lang>/news/ hub aggregates real projects (title+image read from their pages), placeholder news announcements, and blog items, newest-first with type badges and a type filter. Homepage Latest news now shows the newest dated items as badged cards with a working See all to the hub; the News menu link points there too. Dates in news.js are placeholders to replace with real publish dates. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
ec794a32e6
commit
ea9acc4968
193 files changed
+1852
-428
No files matched your search
@@ -0,0 +1,19 @@
|
||||
/* News hub type filter: chips toggle which cards are shown. No dependencies. */
|
||||
(function () {
|
||||
var list = document.querySelector('.newshub-list');
|
||||
if (!list) return;
|
||||
var chips = list.querySelectorAll('.newshub-chip');
|
||||
var cards = list.querySelectorAll('.newshub-card');
|
||||
function apply(type) {
|
||||
cards.forEach(function (card) {
|
||||
card.hidden = !(type === 'all' || card.getAttribute('data-type') === type);
|
||||
});
|
||||
}
|
||||
chips.forEach(function (chip) {
|
||||
chip.addEventListener('click', function () {
|
||||
chips.forEach(function (c) { c.classList.remove('is-active'); });
|
||||
chip.classList.add('is-active');
|
||||
apply(chip.getAttribute('data-type'));
|
||||
});
|
||||
});
|
||||
})();
|
||||
Reference in new issue
Block a user