From 8c941c20542c65e7db5d81a3244232620b3c9809 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Sat, 15 Nov 2025 19:14:34 -0500 Subject: Add Open Graph and metadata tags to episode pages - Add page_title and meta_tags parameters to PageLayout - Generate episode-specific page titles: ' - PodcastItLater' - Add Open Graph meta tags for better link previews: - og:title, og:type, og:url - og:description with duration and author - og:audio with MP3 URL - og:site_name - Add Twitter Card tags for Twitter sharing - Include article:author when available This improves how episode links appear when shared in messaging apps, social media, and other platforms that support Open Graph protocol. Amp-Thread-ID: https://ampcode.com/threads/T-cc5d29f0-454e-4864-8d7e-1ad69a42afa9 Co-authored-by: Amp --- Biz/PodcastItLater/UI.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Biz/PodcastItLater/UI.py') diff --git a/Biz/PodcastItLater/UI.py b/Biz/PodcastItLater/UI.py index 8959d4e..57d0f33 100644 --- a/Biz/PodcastItLater/UI.py +++ b/Biz/PodcastItLater/UI.py @@ -143,6 +143,8 @@ class PageLayoutAttrs(Attrs): user: dict[str, typing.Any] | None current_page: str error: str | None + page_title: str | None + meta_tags: list[html.meta] | None class PageLayout(Component[AnyChildren, PageLayoutAttrs]): @@ -289,6 +291,8 @@ class PageLayout(Component[AnyChildren, PageLayoutAttrs]): user = self.attrs.get("user") current_page = self.attrs.get("current_page", "") error = self.attrs.get("error") + page_title = self.attrs.get("page_title") or "PodcastItLater" + meta_tags = self.attrs.get("meta_tags") or [] return html.html( html.head( @@ -301,7 +305,8 @@ class PageLayout(Component[AnyChildren, PageLayoutAttrs]): name="color-scheme", content="light dark", ), - html.title("PodcastItLater"), + html.title(page_title), + *meta_tags, create_htmx_script(), ), html.body( -- cgit v1.2.3