Skip to content

feat: implement podcast:image tag for Phase 8#4

Draft
nathangathright wants to merge 2 commits intomainfrom
feature/podcast-image-tag
Draft

feat: implement podcast:image tag for Phase 8#4
nathangathright wants to merge 2 commits intomainfrom
feature/podcast-image-tag

Conversation

@nathangathright
Copy link

Overview

This PR implements the new podcast:image tag as part of Phase 8 of the podcast namespace specification. This tag allows for delivering images of various sizes and use cases, expanding beyond the traditional square channel or episode art.

Changes Made

🏗️ Core Implementation

  • Phase8PodcastImage type with all required attributes:

    • href (required): Image URL
    • alt (recommended): Accessibility text
    • aspect-ratio (recommended): CSS aspect ratio syntax (e.g., "1/1", "16/9", "4/1")
    • width (recommended): Width in pixels
    • height (optional): Height in pixels
    • type (optional): MIME type (supports video/mp4, image/jpeg, etc.)
    • purpose (optional): Space-separated tokens for use cases
  • Parser implementation in phase-8.ts with proper validation

  • Type definitions updated in types.ts for both FeedObject and Episode interfaces

  • Phase registration for both feed and item processing

🧪 Testing

  • Comprehensive test coverage (10 test cases) covering:
    • Basic usage with only href
    • All attributes together
    • Individual attribute extraction (alt, aspect-ratio, purpose)
    • Video content with type="video/mp4"
    • Accessibility features
  • Example fixture demonstrating real-world usage

📋 Specification Compliance

  • Multiple images per channel/item (as specified)
  • Purpose tokens for indicating intended use cases
  • Aspect ratio support with CSS syntax
  • Video content support via type attribute
  • Accessibility via alt attribute
  • Platform targeting via custom purpose tokens

Usage Examples

Basic square artwork:

<podcast:image href="https://example.com/artwork.jpg" />

Social media optimized:

<podcast:image 
  href="https://example.com/banner.jpg" 
  alt="Podcast banner for social sharing"
  aspect-ratio="16/9" 
  width="1920" 
  height="1080" 
  purpose="artwork social"/>

Video content:

<podcast:image 
  href="https://example.com/animated.mp4" 
  type="video/mp4" 
  aspect-ratio="9/16" 
  purpose="artwork canvas"/>

Testing

All tests pass including the new Phase 8 tests:

  • ✅ 10 new test cases for podcast:image
  • ✅ All existing tests continue to pass
  • ✅ No linting errors

Related

  • Implements Phase 8 specification for podcast:image tag
  • Replaces the deprecated podcast:images tag functionality
  • Cross-compatible with existing itunes:image tags

Checklist

  • TypeScript types defined
  • Parser implementation complete
  • Phase registration added
  • Tests written and passing
  • Example fixture created
  • All attributes supported per spec
  • Documentation updated
  • No breaking changes

- Create phase-8.ts module with placeholder structure
- Add Phase 8 section to phase index with placeholder comment
- Prepare infrastructure for future Phase 8 tag implementations
- No specific tags implemented yet - ready for development
- Add Phase8PodcastImage type with all required attributes:
  - href (required): Image URL
  - alt (recommended): Accessibility text
  - aspect-ratio (recommended): CSS aspect ratio syntax
  - width (recommended): Width in pixels
  - height (optional): Height in pixels
  - type (optional): MIME type (supports video/mp4, image/jpeg, etc.)
  - purpose (optional): Space-separated tokens for use cases

- Implement podcast:image parser in phase-8.ts with proper validation
- Add podcastImage field to FeedObject and Episode interfaces
- Register tag in phase system for both feed and item processing
- Add comprehensive test coverage (10 test cases)
- Create example fixture demonstrating real-world usage
- Support multiple images per channel/item as per spec
- Support purpose tokens for indicating intended use cases
- Support video content via type attribute
- Support accessibility via alt attribute

Closes: Phase 8 podcast:image implementation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant