Add Phase 5: link-card fragments, oEmbed endpoints, OG meta
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 4m48s

- fetch_fragment_batch() for N+1 avoidance with per-key Redis cache
- link-card fragment handlers in blog, market, events, federation (single + batch mode)
- link_card.html templates per app with content-specific previews
- shared/infrastructure/oembed.py: build_oembed_response, build_og_meta, build_oembed_link_tag
- GET /oembed routes on blog, market, events
- og_meta + oembed_link rendering in base template <head>
- INTERNAL_URL_ARTDAG in docker-compose.yml for cross-stack fragment fetches

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
giles
2026-02-24 21:44:11 +00:00
parent 4d7f8cfea2
commit b3d853ad35
15 changed files with 601 additions and 0 deletions

View File

@@ -119,6 +119,36 @@ def create_app() -> "Quart":
obj.value = val
return {"ok": True, "key": key, "value": val}
# --- oEmbed endpoint ---
@app.get("/oembed")
async def oembed():
from urllib.parse import urlparse
from quart import jsonify
from shared.services.registry import services
from shared.infrastructure.urls import blog_url
from shared.infrastructure.oembed import build_oembed_response
url = request.args.get("url", "")
if not url:
return jsonify({"error": "url parameter required"}), 400
parsed = urlparse(url)
slug = parsed.path.strip("/").split("/")[-1] if parsed.path else ""
if not slug:
return jsonify({"error": "could not extract slug"}), 404
post = await services.blog.get_post_by_slug(g.s, slug)
if not post:
return jsonify({"error": "not found"}), 404
resp = build_oembed_response(
title=post.title,
oembed_type="link",
thumbnail_url=post.feature_image,
url=blog_url(f"/{post.slug}"),
)
return jsonify(resp)
# --- debug: url rules ---
@app.get("/__rules")
async def dump_rules():