Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 | 39x 39x 39x 39x 33x 33x 7x 39x 13x 13x 1386x 13x 13x 13x 13x 13x 13x 13x 13x 13x 1x 12x 1x 11x 11x 13x 6x 1x 5x 5x 6x 6x 6x 6x 5x 3x 1x 2x 2x 9x 8x 8x 9x 9x 9x 9x 8x 8x 6x 6x 6x 6x 9x 9x 9x 6x 9x 8x 8x 9x 9x 9x 9x 9x 9x 8x 170x 170x 170x 170x 170x 149x 176x 2464x 2464x 2464x 2464x 2464x 2464x 176x 176x 176x 176x 176x 176x 176x 176x 176x 176x 176x 176x 176x 176x 176x 176x 176x 176x 176x 176x 176x 176x 176x 176x 176x 176x 176x | // SPDX-FileCopyrightText: 2024-2026 Hack23 AB
// SPDX-License-Identifier: Apache-2.0
/**
* @module Templates/SectionBuilders
* @description Reusable section builder utilities for article template architecture.
* Provides quality scoring, table of contents generation, quality badge rendering,
* timeline sections, comparison tables, and key figures bars.
*/
import { escapeHTML } from '../utils/file-utils.js';
import type { ArticleQualityScore, TOCEntry, LanguageCode } from '../types/index.js';
import {
ALL_LANGUAGES,
LANGUAGE_FLAGS,
LANGUAGE_NAMES,
getLocalizedString,
TOC_ARIA_LABELS,
TIMELINE_HEADINGS,
COMPARISON_BEFORE_LABELS,
COMPARISON_AFTER_LABELS,
KEY_FIGURES_HEADINGS,
FOOTER_ABOUT_HEADING_LABELS,
FOOTER_ABOUT_TEXT_LABELS,
FOOTER_QUICK_LINKS_LABELS,
FOOTER_BUILT_BY_LABELS,
FOOTER_LANGUAGES_LABELS,
FOOTER_HOME_LABELS,
FOOTER_SITEMAP_LABELS,
FOOTER_RSS_LABELS,
FOOTER_GITHUB_REPO_LABELS,
FOOTER_LICENSE_LABELS,
FOOTER_EUROPARL_LABELS,
FOOTER_LINKEDIN_LABELS,
FOOTER_SECURITY_POLICY_LABELS,
FOOTER_CONTACT_LABELS,
FOOTER_DISCLAIMER_LABELS,
FOOTER_REPORT_ISSUES_LABELS,
FOOTER_ARTICLES_AVAILABLE_LABELS,
FOOTER_POLITICAL_INTELLIGENCE_LABELS,
HEADER_SUBTITLE_LABELS,
THEME_TOGGLE_LABELS,
} from '../constants/languages.js';
import { APP_VERSION, createThemeToggleButton } from '../constants/config.js';
import { stripScriptBlocks, stripHtmlTags } from '../utils/html-sanitize.js';
// ─── New section builder interfaces ─────────────────────────────────────────
/**
* A single item in a legislative or procedural timeline.
*/
export interface TimelineItem {
/** Date label (e.g. "2026-03-15" or human-readable) */
date: string;
/** Short event label */
label: string;
/** Optional extended description */
description?: string | undefined;
}
/**
* A numeric highlight figure for a key-figures bar.
*/
export interface KeyFigure {
/** Descriptive label for the figure */
label: string;
/** Formatted value string (e.g. "42", "78%") */
value: string;
/** Optional unit suffix (e.g. "votes", "days", "%") */
unit?: string | undefined;
/** Optional longer description for screen readers / tooltips */
description?: string | undefined;
}
/**
* Count occurrences of a regex pattern in a string.
*
* @param content - String to search.
* @param pattern - Global regex pattern to match.
* @returns Number of matches found.
*/
function countMatches(content: string, pattern: RegExp): number {
const matches = content.match(pattern);
return matches !== null ? matches.length : 0;
}
/**
* Count elements whose `class` attribute contains a given CSS class token.
*
* Extracts every `class="…"` attribute, splits the value into tokens, and
* checks for an exact match — so `"dashboard"` will NOT match nested
* classes like `"dashboard-grid"` or `"dashboard-panel"`.
*
* @param content - HTML string to search.
* @param token - Exact CSS class name to look for.
* @returns Number of elements that have the given class token.
*/
function countClassToken(content: string, token: string): number {
let count = 0;
for (const m of content.matchAll(/class="([^"]*)"/g)) {
const value = m[1] ?? '';
if (value.split(/\s+/).includes(token)) {
count += 1;
}
}
return count;
}
// stripScriptBlocks is imported from html-sanitize.ts
/**
* Compute an article quality score by analysing the rendered HTML content.
*
* @param content - Full HTML content string of the article body.
* @returns {@link ArticleQualityScore} with word count, section counts, and overall rating.
*/
export function computeArticleQualityScore(content: string): ArticleQualityScore {
// Remove script blocks before tag-stripping to avoid inflating word count.
// Uses iterative scanning instead of regex to avoid CodeQL js/bad-tag-filter.
const noScripts = stripScriptBlocks(content);
// Strip HTML tags to get plain text, then count words
const plainText = stripHtmlTags(noScripts).replace(/\s+/g, ' ').trim();
const wordCount =
plainText.length > 0 ? plainText.split(' ').filter((w) => w.length > 0).length : 0;
// All further counting uses script-stripped HTML to avoid false positives
// from embedded JSON-LD or interactive script blocks.
const totalSections = countMatches(noScripts, /<section\b/g);
// Count data visualizations using exact class-token matching.
// countClassToken splits the class attribute value into tokens, so nested
// classes like "dashboard-grid" or "dashboard-panel" are NOT counted.
const chartCount = countMatches(noScripts, /data-chart-config/g);
const dashboardCount = countClassToken(noScripts, 'dashboard');
const mindmapCount = countClassToken(noScripts, 'mindmap-section');
const swotCount = countClassToken(noScripts, 'swot-analysis');
const visualizationCount = chartCount + dashboardCount + mindmapCount + swotCount;
// Exclude visualization sections from analysis section count
const analysisSections = totalSections - dashboardCount - mindmapCount - swotCount;
// Count EP document links (with a real path, not just the bare homepage).
// This excludes the generic footer link `https://www.europarl.europa.eu/`
// while counting links to specific EP resources like /doceo/, /plenary/, etc.
const evidenceReferences = countMatches(
noScripts,
/href="https:\/\/www\.europarl\.europa\.eu\/\w[^"]*"/g
);
// Determine overall quality score
let overallScore: ArticleQualityScore['overallScore'];
if (wordCount >= 800 && analysisSections >= 3 && visualizationCount >= 2) {
overallScore = 'excellent';
} else if (wordCount >= 500 && analysisSections >= 2) {
overallScore = 'good';
} else Iif (wordCount >= 200 && analysisSections >= 1) {
overallScore = 'adequate';
} else {
overallScore = 'needs-improvement';
}
return { wordCount, analysisSections, visualizationCount, evidenceReferences, overallScore };
}
/**
* Build an HTML table of contents navigation element from a list of entries.
*
* @param entries - Ordered list of {@link TOCEntry} items to render.
* @param lang - Language code used for the localised aria-label.
* @returns HTML string for the TOC `<nav>` element, or empty string when entries is empty.
*/
export function buildTableOfContents(entries: TOCEntry[], lang: LanguageCode): string {
if (entries.length === 0) {
return '';
}
const ariaLabel = escapeHTML(getLocalizedString(TOC_ARIA_LABELS, lang));
const items = entries
.map((entry) => {
const safeLabel = escapeHTML(entry.label);
// Strip leading # to prevent href="##foo"
const safeId = escapeHTML(entry.id.replace(/^#/, ''));
const classAttr = entry.level === 2 ? ' class="toc-sub"' : '';
return `<li${classAttr}><a href="#${safeId}">${safeLabel}</a></li>`;
})
.join('\n ');
return `<nav class="article-toc" aria-label="${ariaLabel}">
<ol>
${items}
</ol>
</nav>`;
}
/**
* Build an HTML quality score badge element for an article.
*
* The badge is `aria-hidden` since it conveys metadata, not primary content.
* Returns an empty string for articles with a 'needs-improvement' score to avoid
* surfacing poor-quality signals to readers.
*
* @param score - {@link ArticleQualityScore} to render.
* @returns HTML string for the badge `<div>`, or empty string for needs-improvement.
*/
export function buildQualityScoreBadge(score: ArticleQualityScore): string {
if (score.overallScore === 'needs-improvement') {
return '';
}
const safeScore = escapeHTML(score.overallScore);
return `<div class="article-quality-score" data-score="${safeScore}" aria-hidden="true">
<span class="qs-words">${score.wordCount}</span>
<span class="qs-sections">${score.analysisSections}</span>
<span class="qs-visuals">${score.visualizationCount}</span>
<span class="qs-evidence">${score.evidenceReferences}</span>
</div>`;
}
// ─── New section builders ────────────────────────────────────────────────────
/**
* Build an HTML timeline section for legislative or procedural events.
*
* Renders an ordered list of dated events. Each item includes a date badge
* and a label. An optional description is included as visible text when
* provided. Empty items array returns an empty string.
*
* @param items - Ordered list of {@link TimelineItem} events to render.
* @param lang - Language code used for the section heading.
* @returns HTML string for the timeline `<section>`, or empty string when items is empty.
*/
export function buildTimelineSection(
items: ReadonlyArray<TimelineItem>,
lang: LanguageCode
): string {
if (items.length === 0) return '';
const heading = escapeHTML(getLocalizedString(TIMELINE_HEADINGS, lang));
const listItems = items
.map((item) => {
const safeDate = escapeHTML(item.date);
const safeLabel = escapeHTML(item.label);
const descPart = item.description
? `<span class="timeline-description">${escapeHTML(item.description)}</span>`
: '';
return (
`<li class="timeline-item">` +
`<span class="timeline-date">${safeDate}</span>` +
`<span class="timeline-label">${safeLabel}</span>` +
descPart +
`</li>`
);
})
.join('\n ');
return `<section class="timeline-section" aria-label="${heading}">
<h2>${heading}</h2>
<ol class="timeline-list" role="list">
${listItems}
</ol>
</section>`;
}
/**
* Build an HTML before/after comparison table for legislative changes.
*
* Renders a two-column table comparing the state of something before and after
* a legislative action. When the input arrays have different lengths, the
* table uses the longer length and renders missing cells as empty strings.
* Returns an empty string when either array is empty.
*
* @param before - Array of "before" state descriptions for the first column.
* @param after - Array of "after" state descriptions for the second column.
* @param lang - Language code used for column headings.
* @returns HTML string for the comparison `<table>`, or empty string when either array is empty.
*/
export function buildComparisonTable(
before: ReadonlyArray<string>,
after: ReadonlyArray<string>,
lang: LanguageCode
): string {
if (before.length === 0 || after.length === 0) return '';
const beforeLabel = escapeHTML(getLocalizedString(COMPARISON_BEFORE_LABELS, lang));
const afterLabel = escapeHTML(getLocalizedString(COMPARISON_AFTER_LABELS, lang));
const maxRows = Math.max(before.length, after.length);
const rows = Array.from({ length: maxRows }, (_, i) => {
const beforeCell = escapeHTML(before[i] ?? '');
const afterCell = escapeHTML(after[i] ?? '');
return (
`<tr>` +
`<td class="comparison-before">${beforeCell}</td>` +
`<td class="comparison-after">${afterCell}</td>` +
`</tr>`
);
}).join('\n ');
return `<div class="comparison-table-wrapper" role="region" aria-label="${beforeLabel} / ${afterLabel}">
<table class="comparison-table">
<caption class="sr-only">${beforeLabel} / ${afterLabel}</caption>
<thead>
<tr>
<th scope="col">${beforeLabel}</th>
<th scope="col">${afterLabel}</th>
</tr>
</thead>
<tbody>
${rows}
</tbody>
</table>
</div>`;
}
/**
* Build an HTML key figures bar for quick-scan numeric highlights.
*
* Renders a horizontal strip of numeric summary cards. Each card shows a
* value (with optional unit), a label, and an optional screen-reader-only
* description. Empty figures array returns an empty string.
*
* @param figures - Array of {@link KeyFigure} items to render.
* @param lang - Language code used for the section heading.
* @returns HTML string for the key figures `<section>`, or empty string when figures is empty.
*/
export function buildKeyFiguresBar(figures: ReadonlyArray<KeyFigure>, lang: LanguageCode): string {
if (figures.length === 0) return '';
const heading = escapeHTML(getLocalizedString(KEY_FIGURES_HEADINGS, lang));
const cards = figures
.map((fig) => {
const safeLabel = escapeHTML(fig.label);
const safeValue = escapeHTML(fig.value);
const safeUnit = fig.unit ? escapeHTML(fig.unit) : '';
const unitSpan = safeUnit
? ` <span class="kf-unit" aria-hidden="true">${safeUnit}</span>`
: '';
const descriptionPart = fig.description
? `<span class="sr-only">${escapeHTML(fig.description)}</span>`
: '';
return (
`<div class="key-figure-card" role="listitem" aria-label="${safeLabel}: ${safeValue}${safeUnit ? ' ' + safeUnit : ''}">` +
`<span class="kf-value">${safeValue}${unitSpan}</span>` +
`<span class="kf-label">${safeLabel}</span>` +
descriptionPart +
`</div>`
);
})
.join('\n ');
return `<section class="key-figures-bar" aria-label="${heading}">
<h2 class="sr-only">${heading}</h2>
<div class="key-figures-grid" role="list">
${cards}
</div>
</section>`;
}
/* ─── Shared site header/footer builders ─────────────────────────── */
/**
* Options for building the shared site header.
*/
export interface SiteHeaderOptions {
/** Language code used for localization. */
lang: LanguageCode;
/**
* URL path prefix prepended to relative asset and page links.
* Use `''` for root pages and `'../'` for pages inside `news/`.
*/
pathPrefix: string;
/** Link target for the brand/logo. */
homeHref: string;
/** Accessible site title and visible brand title. */
siteTitle: string;
/** Pre-rendered language switcher links for the current page family. */
languageSwitcherHtml: string;
}
/**
* Build the shared responsive site header used by every generated page family.
*
* @param options - {@link SiteHeaderOptions} controlling language, assets, and language links.
* @returns HTML string for `<header class="site-header">…</header>`.
*/
export function buildSiteHeader(options: SiteHeaderOptions): string {
const { lang, pathPrefix, homeHref, siteTitle, languageSwitcherHtml } = options;
const headerSubtitle = escapeHTML(getLocalizedString(HEADER_SUBTITLE_LABELS, lang));
const themeToggleLabel = escapeHTML(getLocalizedString(THEME_TOGGLE_LABELS, lang));
const safeTitle = escapeHTML(siteTitle);
return `<header class="site-header" role="banner">
<div class="site-header__inner site-header__inner--stacked">
<a href="${escapeHTML(homeHref)}" class="site-header__brand" aria-label="${safeTitle}">
<picture class="site-header__logo-picture">
<source srcset="${pathPrefix}images/banner.webp" type="image/webp">
<img class="site-header__logo site-header__logo--banner" src="${pathPrefix}images/banner.jpg" alt="${safeTitle}" width="240" height="80" loading="eager">
</picture>
<span class="site-header__brand-text">
<span class="site-header__title">${safeTitle}</span>
<span class="site-header__subtitle">${headerSubtitle}</span>
</span>
</a>
<div class="site-header__actions">
<a class="site-header__cta site-header__cta--sponsor" href="https://github.com/sponsors/Hack23">💖 Sponsor Hack23</a>
<a class="site-header__cta" href="https://www.hack23.com">Become a sponsor</a>
<a class="site-header__cta site-header__cta--security" href="https://github.com/Hack23/euparliamentmonitor/blob/main/SECURITY.md">🔐 Commitment to Transparency and Security</a>
${createThemeToggleButton(themeToggleLabel)}
</div>
<nav class="site-header__langs" role="navigation" aria-label="Language selection">
${languageSwitcherHtml}
</nav>
</div>
</header>`;
}
/**
* Build the full-width page banner shown below the sticky site header on every page.
*
* The banner image (`banner.webp` / `banner.jpg`) is 1200×400. CSS renders it with
* `object-fit: cover; object-position: center` so the middle 80% of the image is
* always visible and the uninteresting top/bottom 10% may be cropped.
*
* @param pathPrefix - Asset path prefix: `''` for root pages, `'../'` for `news/` pages.
* @returns HTML string for the `.page-banner` element.
*/
export function buildPageBanner(pathPrefix: string): string {
return `<div class="page-banner" role="img" aria-label="EU Parliament Monitor">
<picture>
<source srcset="${pathPrefix}images/banner.webp" type="image/webp">
<img class="page-banner__img" src="${pathPrefix}images/banner.jpg" alt="" aria-hidden="true" width="1200" height="400" loading="eager">
</picture>
</div>`;
}
/**
* Options for building the shared site footer.
*/
export interface SiteFooterOptions {
/** Language code used for localization. */
lang: LanguageCode;
/**
* URL path prefix prepended to relative links.
* Use `''` for root (index) pages and `'../'` for pages inside `news/`.
*/
pathPrefix: string;
/**
* Optional article count shown in the About section.
* When omitted the articles-available line is hidden.
*/
articleCount?: number | undefined;
}
/**
* Build the language grid links used inside the footer Languages section.
*
* @param currentLang - The currently active language code.
* @param pathPrefix - Path prefix for index page hrefs ('' or '../').
* @returns HTML string of anchor elements.
*/
function buildFooterLangGrid(currentLang: LanguageCode, pathPrefix: string): string {
return ALL_LANGUAGES.map((code) => {
const flag = getLocalizedString(LANGUAGE_FLAGS, code);
const safeName = escapeHTML(getLocalizedString(LANGUAGE_NAMES, code));
const href = code === 'en' ? `${pathPrefix}index.html` : `${pathPrefix}index-${code}.html`;
const active = code === currentLang ? ' class="active"' : '';
const current = code === currentLang ? ' aria-current="page"' : '';
return `<a href="${escapeHTML(href)}"${active} hreflang="${code}" lang="${code}" title="${safeName}" aria-label="${safeName}"${current}>${flag} ${code.toUpperCase()}</a>`;
}).join('\n ');
}
/**
* Build the shared site footer HTML used by both article pages and index pages.
*
* Renders four sections (About, Quick Links, Built by Hack23, Languages) plus a
* footer-bottom bar with copyright, version, and a localized disclaimer.
*
* @param options - {@link SiteFooterOptions} controlling lang, pathPrefix, and articleCount.
* @returns HTML string for `<footer class="site-footer">…</footer>`.
*/
export function buildSiteFooter(options: SiteFooterOptions): string {
const { lang, pathPrefix, articleCount } = options;
const year = new Date().getFullYear();
const aboutHeading = escapeHTML(getLocalizedString(FOOTER_ABOUT_HEADING_LABELS, lang));
const aboutText = escapeHTML(getLocalizedString(FOOTER_ABOUT_TEXT_LABELS, lang));
const quickLinksHeading = escapeHTML(getLocalizedString(FOOTER_QUICK_LINKS_LABELS, lang));
const builtByHeading = escapeHTML(getLocalizedString(FOOTER_BUILT_BY_LABELS, lang));
const languagesHeading = escapeHTML(getLocalizedString(FOOTER_LANGUAGES_LABELS, lang));
const homeLabel = escapeHTML(getLocalizedString(FOOTER_HOME_LABELS, lang));
const sitemapLabel = escapeHTML(getLocalizedString(FOOTER_SITEMAP_LABELS, lang));
const rssLabel = escapeHTML(getLocalizedString(FOOTER_RSS_LABELS, lang));
const politicalIntelligenceLabel = escapeHTML(
getLocalizedString(FOOTER_POLITICAL_INTELLIGENCE_LABELS, lang)
);
const githubLabel = escapeHTML(getLocalizedString(FOOTER_GITHUB_REPO_LABELS, lang));
const licenseLabel = escapeHTML(getLocalizedString(FOOTER_LICENSE_LABELS, lang));
const europarlLabel = escapeHTML(getLocalizedString(FOOTER_EUROPARL_LABELS, lang));
const linkedinLabel = escapeHTML(getLocalizedString(FOOTER_LINKEDIN_LABELS, lang));
// Security & Privacy Policy label already contains safe & entities — do not double-escape
const securityLabel = getLocalizedString(FOOTER_SECURITY_POLICY_LABELS, lang);
const contactLabel = escapeHTML(getLocalizedString(FOOTER_CONTACT_LABELS, lang));
const disclaimerText = escapeHTML(getLocalizedString(FOOTER_DISCLAIMER_LABELS, lang));
const reportIssuesLabel = escapeHTML(getLocalizedString(FOOTER_REPORT_ISSUES_LABELS, lang));
const homeHref = `${pathPrefix}${lang === 'en' ? 'index.html' : `index-${lang}.html`}`;
const sitemapHref = `${pathPrefix}${lang === 'en' ? 'sitemap.html' : `sitemap_${lang}.html`}`;
const politicalIntelligenceHref = `${pathPrefix}${lang === 'en' ? 'political-intelligence.html' : `political-intelligence_${lang}.html`}`;
const apiDocsHref = `${pathPrefix}docs/api/`;
const analysisDocsHref = `${pathPrefix}docs/`;
const articlesLine =
typeof articleCount === 'number'
? `\n <p class="footer-stats">${escapeHTML(getLocalizedString(FOOTER_ARTICLES_AVAILABLE_LABELS, lang).replace('{count}', String(articleCount)))}</p>`
: '';
const langGrid = buildFooterLangGrid(lang, pathPrefix);
return `<footer class="site-footer" role="contentinfo">
<div class="footer-content">
<div class="footer-section">
<h3>${aboutHeading}</h3>
<p>${aboutText}</p>${articlesLine}
<p class="footer-company-summary">Swedish cybersecurity consultancy specializing in political transparency and open-source intelligence.</p>
</div>
<div class="footer-section">
<h3>${quickLinksHeading}</h3>
<ul>
<li><a href="${homeHref}">${homeLabel}</a></li>
<li><a href="${homeHref}#main">News</a></li>
<li><a href="${analysisDocsHref}">📊 Analysis & Reports</a></li>
<li><a href="${pathPrefix}docs/index.html">Dashboard</a></li>
<li><a href="${politicalIntelligenceHref}">🧠 ${politicalIntelligenceLabel}</a></li>
<li><a href="${sitemapHref}">🗺️ ${sitemapLabel}</a></li>
<li><a href="${apiDocsHref}">📚 API Documentation (TypeDoc)</a></li>
<li><a href="${pathPrefix}rss.xml">${rssLabel}</a></li>
<li><a href="https://hack23.com/euparliamentmonitor.html">EU Parliament Monitor by Hack23</a></li>
<li><a href="https://hack23.com/euparliamentmonitor-features.html">EU Parliament Monitor Features</a></li>
<li><a href="https://hack23.com/cia-features.html">CIA Platform</a></li>
<li><a href="https://www.riksdagen.se/">Sveriges Riksdag</a></li>
<li><a href="https://github.com/Hack23/euparliamentmonitor">${githubLabel}</a></li>
<li><a href="https://github.com/Hack23/euparliamentmonitor/issues">${reportIssuesLabel}</a></li>
<li><a href="https://github.com/Hack23/euparliamentmonitor/blob/main/LICENSE">${licenseLabel}</a></li>
<li><a href="https://www.europarl.europa.eu/">${europarlLabel}</a></li>
</ul>
</div>
<div class="footer-section">
<h3>${builtByHeading}</h3>
<div class="footer-badges" aria-label="Project trust badges">
<a href="https://www.npmjs.com/package/euparliamentmonitor" aria-label="npm package version"><img src="https://img.shields.io/npm/v/euparliamentmonitor.svg" alt="npm package version"></a>
<a href="https://scorecard.dev/viewer/?uri=github.com/Hack23/euparliamentmonitor" aria-label="OpenSSF Scorecard"><img src="https://api.securityscorecards.dev/projects/github.com/Hack23/euparliamentmonitor/badge" alt="OpenSSF Scorecard"></a>
<a href="https://www.bestpractices.dev/projects/12068" aria-label="OpenSSF Best Practices"><img src="https://www.bestpractices.dev/projects/12068/badge" alt="OpenSSF Best Practices"></a>
<a href="https://github.com/Hack23/euparliamentmonitor/attestations" aria-label="SLSA Level 3"><img src="https://slsa.dev/images/gh-badge-level3.svg" alt="SLSA Level 3"></a>
</div>
<ul>
<li><a href="https://hack23.com">Hack23.com</a></li>
<li><a href="https://github.com/sponsors/Hack23">Sponsor Hack23 on GitHub</a></li>
<li><a href="https://www.linkedin.com/company/hack23">${linkedinLabel}</a></li>
<li><a href="https://github.com/Hack23/ISMS-PUBLIC">Public ISMS</a></li>
<li><a href="https://github.com/Hack23/ISMS-PUBLIC/blob/main/Information_Security_Policy.md">${securityLabel}</a></li>
<li><a href="https://github.com/Hack23/ISMS-PUBLIC/blob/main/Secure_Development_Policy.md">Secure Development Policy</a></li>
<li><a href="https://github.com/Hack23/ISMS-PUBLIC/blob/main/Open_Source_Policy.md">Open Source Policy</a></li>
<li><a href="https://github.com/Hack23/ISMS-PUBLIC/blob/main/AI_Policy.md">AI Policy</a></li>
<li><a href="https://github.com/Hack23/ISMS-PUBLIC/blob/main/Access_Control_Policy.md">Access Control Policy</a></li>
<li><a href="https://github.com/Hack23/ISMS-PUBLIC/blob/main/Cryptography_Policy.md">Cryptography Policy</a></li>
<li><a href="https://github.com/Hack23/euparliamentmonitor/blob/main/SECURITY.md">Security Policy</a></li>
<li><a href="https://hack23.com/privacy.html">Privacy Policy</a></li>
<li><a href="mailto:james@hack23.com">Contact Us / ${contactLabel}</a></li>
</ul>
</div>
<div class="footer-section">
<h3>${languagesHeading}</h3>
<div class="language-grid">
${langGrid}
</div>
</div>
</div>
<div class="footer-bottom">
<p>© 2008-${year} <a href="https://hack23.com">Hack23 AB</a> (Org.nr 5595347807) | Gothenburg, Sweden | v${escapeHTML(APP_VERSION)}</p>
<p class="footer-disclaimer"><span aria-hidden="true">⚠️</span> ${disclaimerText} <a href="https://github.com/Hack23/euparliamentmonitor/issues">${reportIssuesLabel}</a>.</p>
</div>
</footer>`;
}
|