Skip to content

Refactor: merge videoUrl + cta.url video detection into one canonical content shape #52

@khurchla

Description

@khurchla

Surfaced by the clarity-review pass on the v0.1.0 release branch (B5). Do NOT apply for v0.1.0 — captured for post-launch.

src/lib/scrambler/video.ts:59 accepts a single URL, but src/components/ScramblerCard.svelte:172-174 has to coalesce card.videoUrl ?? card.cta?.url plus a separate inlineVideo === false opt-out. Today only pycon-talk.yaml and plotly-workshop.yaml use the explicit videoUrl; everywhere else the CTA is the video URL. Authors have to remember which field carries the embed source.

Cleaner shape: a single optional media.video field on the card with { url, inlineEmbed?: boolean }, with cta purely about the navigation target. The videoUrl ?? cta.url fallback goes away, the YAML reads obviously, and parseVideo no longer needs to scrutinise CTA URLs to decide whether to render an iframe.

Files

  • src/content/cards/*.yaml (schema migration across existing cards)
  • src/lib/scrambler/types.ts
  • src/lib/scrambler/video.ts
  • src/components/ScramblerCard.svelte (lines 78 — mediaIconKind derives from cta.url; line 172 — videoEmbed derives from the fallback chain)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions