feat(seo): Phase 2 — route-level metadata service and JSON-LD structured data
CI Pipeline / backend-test (push) Successful in 5m16s
CI Pipeline / backend-test (pull_request) Successful in 5m5s
CI Pipeline / frontend-test (pull_request) Successful in 27s
CI Pipeline / frontend-build (pull_request) Failing after 29s
CI Pipeline / backend-lint (pull_request) Successful in 8s
CI Pipeline / quality-gate (push) Successful in 2s
CI Pipeline / frontend-test (push) Successful in 28s
CI Pipeline / frontend-build (push) Failing after 29s
CI Pipeline / backend-lint (push) Successful in 8s
CI Pipeline / quality-gate (pull_request) Successful in 2s

Add SeoService for dynamic metadata management:
- Per-route document titles (e.g., 'KMountain Flower Radio — About')
- Meta descriptions from station config per route
- Canonical URLs, Open Graph tags, Twitter Card tags
- Input sanitization (HTML stripping, URL validation, attribute escaping)
- noindex robots directives for /login and /admin routes
- Centralized router watcher (zero per-component boilerplate)

Add StructuredDataService + StructuredDataComponent for JSON-LD:
- Organization schema (NCBOrganization) site-wide with contact info
- WebSite schema with publisher info
- WebPage schema per-route with breadcrumbs
- Dynamic Event schema on /events page
- RadioSeason schema on /schedule page

Wire up SeoService.watchRouter() in app-root ngOnInit.
Wire up StructuredDataComponent in app-root template.
Wire up EventsComponent and ScheduleComponent to feed data to
StructuredDataService for dynamic schema injection.

Includes full test suite for SeoService (22 tests).
This commit is contained in:
robot committed 2026-08-05 10:12:55 +00:00
1 parent 2716765223
commit 58267e8f59
10 files changed
+1194 -8

No files matched your search

+13 -1
View File
@@ -1,10 +1,11 @@
import { Component, inject } from '@angular/core';
import { Component, effect, inject } from '@angular/core';
import { AsyncPipe } from '@angular/common';
import { map, Observable, startWith } from 'rxjs';
import { ShowService } from '../services/show.service';
import { Show } from '../interfaces/show';
import { StationConfigService } from '../services/station-config.service';
import { StructuredDataService } from '../services/structured-data.service';
import { SortSchedulesPipe } from '../pipes/sort-schedules.pipe';
import { resolveImageUrl } from '../services/app-config.service';
@@ -23,6 +24,7 @@ interface ScheduleState {
export class ScheduleComponent {
private showService = inject(ShowService);
readonly config = inject(StationConfigService).config;
private structuredData = inject(StructuredDataService);
/** ID of the currently expanded show card — null means none. */
expandedShowId: number | null = null;
@@ -47,4 +49,14 @@ export class ScheduleComponent {
resolveImageUrl(url: string): string {
return resolveImageUrl(url);
}
constructor() {
// Feed active shows to structured data for RadioSeason schema injection.
effect(() => {
const snapshot = this.showService.getShows();
snapshot.subscribe((shows) => {
this.structuredData.activeShows.set(shows);
});
});
}
}