from __future__ import annotations import json from .html_utils import SafeHtml, attr, escape, trusted from .icons import _svg_icon def _top_nav(label: str | None = None, links: SafeHtml | None = None) -> SafeHtml: account_html = "" if label: account_html = f'' if links is None: links = trusted('API') theme_toggle = f""" """ return trusted( f""" Skip to content """ ) def _site_footer() -> SafeHtml: return trusted( f""" """ ) def _page( title: str, body: SafeHtml, extra_styles: SafeHtml | None = None, extra_scripts: SafeHtml | None = None, description: str = "KarlDNS is a small self-hosted Dynamic DNS service for FRITZ!Box routers, Linux cron jobs, and home networks.", preload_logo: bool = False, canonical_url: str | None = None, image_url: str | None = None, image_alt: str | None = None, structured_data: dict[str, object] | None = None, ) -> str: if not isinstance(body, SafeHtml): raise TypeError("body must be a SafeHtml fragment built by a template helper") extra_styles_html = extra_styles or trusted("") extra_scripts_html = extra_scripts or trusted("") preload_logo_html = trusted('') if preload_logo else trusted("") canonical_html = trusted(f'') if canonical_url else trusted("") social_url = canonical_url or "" social_image = image_url or "" social_html = trusted("") if social_url: social_card = "summary_large_image" if social_image else "summary" social_image_alt = image_alt or title social_image_html = f""" """ if social_image else "" social_html = trusted(f""" {social_image_html} """) structured_data_html = trusted("") if structured_data: structured_data_html = trusted( '" ) return f"""
{canonical_html} {social_html}