{% extends "base.html" %} {% block title %}{{ page_title or "Papers" }}{% endblock %} {% block body_class %}{{ body_class or "" }}{% endblock %} {# @feat breadcrumbs: "home / [icon] Papers / " in the header bar. The leading segment reuses Datasette's own crumb_items() so the home link keeps its view-instance permission gate; routes pass `crumb_current` (doc name / #tag); the doc page updates the span text live on rename via frontend/src/lib/crumbs.ts, keyed off its id. #} {% block crumbs %}

{% if crumb_items is defined %}{% for item in crumb_items(request=request) %}{{ item.label }} / {% endfor %}{% endif %} {{ paper_icon_svg | safe }}Papers {% if crumb_current %}/ {% if crumb_doc_id %} {# Doc pages: the segment self-links (GitHub-style) and gets the paper-switcher mount point, hydrated by pages/doc/main.ts. #} {{ crumb_current }} {% else %} {{ crumb_current }} {% endif %} {% endif %}

{% endblock %} {% block extra_head %} {# @feat pwa: the tags (manifest link, apple + theme-color meta) that make every paper page installable/standalone. theme-color is a single meta defaulting to light #ffffff (matching the manifest's theme_color in routes/docs.py:paper_manifest — keep them in lock-step); the resolver script below rewrites its content to the resolved theme's bg (#0d1117 when dark) before first paint, and theme.ts applyTheme() does the same at runtime. #} {# @feat dark-mode: the FOUC-free resolver — runs before first paint, reads localStorage.paperTheme (whitelist light/dark/system, else "light" — paper defaults to light regardless of OS, matching Datasette; dark/system are explicit opt-ins) and stamps so the --pp-* palette resolves on the first frame. Also rewrites the theme-color meta above to the resolved bg. theme.ts mirrors this key + whitelist + fallback for the runtime toggle. #} {{ datasette_paper_vite_entry(entrypoint) | safe }} {% endblock %} {% block content %}
{% endblock %}