import os import re base_dir = "dist" seo_templates = { "architecture": { "title": "Our Architecture — Vyla", "description": "How Vyla Home, SDK, and Stream API relate, and where each responsibility belongs.", "keywords": "Vyla architecture, Vyla Home, Vyla SDK, Stream API, system design, media stack, deployment patterns, self-hosted media", "canonical": "architecture.html", "image": "thumbnail.png" }, "go": { "title": "Vyla Go — Vyla", "description": "The Android control center for running the Vyla media stack locally.", "keywords": "Vyla Go, Android media player, mobile streaming, self-hosted media, Android app, media streaming", "canonical": "go.html", "image": "android-preview.png" }, "player": { "title": "Build a player — Vyla", "description": "Design a resilient Vyla playback experience around your own product and infrastructure.", "keywords": "Vyla player, media player, custom player, playback experience, HLS player, MP4 player, streaming player", "canonical": "player.html", "image": "thumbnail.png" }, "sdk-quickstart": { "title": "SDK quickstart — Vyla", "description": "Install Vyla SDK, resolve a source, and build a safe server-side integration.", "keywords": "Vyla SDK, SDK quickstart, Node.js SDK, server-side integration, stream resolution, API integration", "canonical": "sdk-quickstart.html", "image": "thumbnail.png" }, "self-hosting": { "title": "Self-host Stream API — Vyla", "description": "Deploy the optional Stream API when your clients need an HTTP/SSE layer.", "keywords": "self-hosting, Stream API deployment, Node.js deployment, HTTP API, SSE, server setup, infrastructure", "canonical": "self-hosting.html", "image": "thumbnail.png" }, "tv": { "title": "Vyla TV — Vyla", "description": "The Android TV application for running the Vyla media experience on your television.", "keywords": "Vyla TV, Android TV, TV streaming, smart TV, television app, media streaming, Android TV app", "canonical": "tv.html", "image": "android-tv-preview.png" }, "stream-api/overview": { "title": "Stream API — Vyla", "description": "An optional self-hosted HTTP and SSE layer built on top of Vyla SDK.", "keywords": "Stream API, HTTP API, SSE, Server-Sent Events, streaming API, self-hosted API, Node.js API", "canonical": "stream-api/overview.html", "image": "thumbnail.png" }, "stream-api/paths": { "title": "Paths and playback events — Vyla", "description": "The complete Stream API playback contract, unified for movies and TV episodes.", "keywords": "Stream API paths, playback events, SSE events, API endpoints, movie API, TV API, streaming endpoints", "canonical": "stream-api/paths.html", "image": "thumbnail.png" }, "stream-api/media-data": { "title": "Subtitles and downloads — Vyla", "description": "Unified media-data paths for movies and TV episodes.", "keywords": "subtitles, downloads, media data, subtitle tracks, download links, VTT, SRT, subtitle API", "canonical": "stream-api/media-data.html", "image": "thumbnail.png" }, "stream-api/operations": { "title": "Health, testing, and safe operations — Vyla", "description": "Observe SDK providers and diagnose a Stream API deployment without making debug data public.", "keywords": "health check, API testing, operations, debugging, provider health, API monitoring, deployment", "canonical": "stream-api/operations.html", "image": "thumbnail.png" }, "concepts/providers": { "title": "Providers — Vyla", "description": "How Vyla SDK sources are configured, selected, and verified.", "keywords": "providers, source configuration, stream sources, provider verification, SDK providers, source selection", "canonical": "concepts/providers.html", "image": "thumbnail.png" }, "guides/integrations": { "title": "Stream API client integration — Vyla", "description": "Build an optional Stream API player client with HLS/MP4 handling, SSE sources, subtitles, and fallbacks.", "keywords": "client integration, player integration, HLS.js, React, Vue, iOS, Android, SSE client, streaming client", "canonical": "guides/integrations.html", "image": "thumbnail.png" }, "guides/error-handling": { "title": "Stream API error handling — Vyla", "description": "Handle SSE failures, source fallbacks, and edge cases in an optional Stream API client.", "keywords": "error handling, fallbacks, SSE errors, streaming errors, retry logic, error boundary, source fallback", "canonical": "guides/error-handling.html", "image": "thumbnail.png" }, "misc/credit": { "title": "Credit — Vyla", "description": "Credits and inspiration behind the Vyla API ecosystem.", "keywords": "credits, attribution, open source, inspiration, P-Stream, CinePro, Movieslay, acknowledgments", "canonical": "misc/credit.html", "image": "thumbnail.png" }, "misc/dmca": { "title": "DMCA & Copyright — Vyla", "description": "Content sources used by Vyla API and how rights holders can request removal.", "keywords": "DMCA, copyright, takedown, legal, content sources, rights holders, copyright policy, takedown request", "canonical": "misc/dmca.html", "image": "thumbnail.png" } } def generate_seo_head(template): name = template["title"].replace(" — Vyla", "") json_ld = " \n " return " \n \n " + template["title"] + "\n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n\n \n \n \n \n\n" + json_ld + "\n\n