Blog Posts
Posts use the summary_large_image Twitter card type. The following meta
tags are generated:
Meta Tag |
Source |
twitter:card
|
"summary_large_image"
|
twitter:title
|
page.seo_title
|
twitter:description
|
page.search_description
|
twitter:image
|
social_cover_image_url (1200x630 rendition)
|
twitter:image:alt
|
cover_alt_text
|
og:url
|
absolute_page_url
|
og:title
|
page.seo_title
|
og:description
|
page.search_description
|
og:image
|
social_cover_image_url
|
og:image:alt
|
cover_alt_text
|
og:image:width
|
social_cover_image_width (only if image exists)
|
og:image:height
|
social_cover_image_height (only if image exists)
|
og:type
|
"article"
|
og:updated_time
|
updated_timestamp
|
The seo_title and search_description fields are standard Wagtail
page fields. Set them in the Promote tab of the Wagtail editor. If
search_description is empty, some themes fall back to page.title.
Podcast Episodes
Episodes with an attached podcast_audio file override the
social_meta block to use the Twitter Player Card
type. This enables inline audio playback directly in the Twitter/X timeline.
In addition to the standard tags above, episodes add:
Meta Tag |
Source |
twitter:card
|
"player" (overrides summary_large_image)
|
twitter:player
|
player_url (the Twitter Player view URL)
|
twitter:player:stream
|
episode.podcast_audio.m4a.url
|
twitter:player:stream:content_type
|
"audio/mp4"
|
twitter:player:width
|
480
|
twitter:player:height
|
240
|
og:audio
|
episode.podcast_audio.m4a.url
|
If the episode has no audio file, the template falls back to the standard
post meta tags (summary_large_image card).
Social Media¶
Django Cast automatically generates Open Graph and Twitter Card meta tags for posts and episodes, enabling rich social previews when links are shared.
Social Cover Images¶
Cover images are the primary visual element in social previews. Django Cast uses a two-level fallback for the cover image:
The post’s or episode’s own
cover_imagefield (set in the Wagtail editor).The parent blog’s
cover_imagefield as a fallback.If neither is set, no image meta tags are emitted.
The social preview image is generated as a 1200x630 JPEG rendition using Wagtail’s focal-point-aware cropping (rendition spec:
fill-1200x630|format-jpeg|jpegquality-75). This matches the 1.91:1 aspect ratio recommended by most social platforms. The URL is always emitted as an absolute URL so social scrapers can fetch it.To customize the social preview image for a post, set the Cover image field in the Wagtail editor. Choose an image with a focal point set for best results with the fill-crop.
The
cover_alt_textfield provides alt text for the social image. Set this in the Wagtail editor alongside the cover image.Open Graph and Twitter Card Meta Tags¶
Post templates emit meta tags inside a
{% block social_meta %}block, which is nested inside{% block meta %}. Theme authors can override this block to customize social meta output.Blog Posts¶
Posts use the
summary_large_imageTwitter card type. The following meta tags are generated:Meta Tag
Source
twitter:card"summary_large_image"twitter:titlepage.seo_titletwitter:descriptionpage.search_descriptiontwitter:imagesocial_cover_image_url(1200x630 rendition)twitter:image:altcover_alt_textog:urlabsolute_page_urlog:titlepage.seo_titleog:descriptionpage.search_descriptionog:imagesocial_cover_image_urlog:image:altcover_alt_textog:image:widthsocial_cover_image_width(only if image exists)og:image:heightsocial_cover_image_height(only if image exists)og:type"article"og:updated_timeupdated_timestampThe
seo_titleandsearch_descriptionfields are standard Wagtail page fields. Set them in the Promote tab of the Wagtail editor. Ifsearch_descriptionis empty, some themes fall back topage.title.Podcast Episodes¶
Episodes with an attached
podcast_audiofile override thesocial_metablock to use the Twitter Player Card type. This enables inline audio playback directly in the Twitter/X timeline.In addition to the standard tags above, episodes add:
Meta Tag
Source
twitter:card"player"(overridessummary_large_image)twitter:playerplayer_url(the Twitter Player view URL)twitter:player:streamepisode.podcast_audio.m4a.urltwitter:player:stream:content_type"audio/mp4"twitter:player:width480twitter:player:height240og:audioepisode.podcast_audio.m4a.urlIf the episode has no audio file, the template falls back to the standard post meta tags (
summary_large_imagecard).Twitter Player View¶
The Twitter Player Card requires a URL pointing to an embeddable player page. Django Cast provides this via the
twitter_playerview at:URL name:
cast:twitter-playerThis view renders a minimal HTML page (
cast/twitter/card_player.html) containing only a Podlove Web Player play button. The page is designed to be embedded in a 480x240 iframe by Twitter/X.The player is initialized with:
The episode’s M4A audio file URL
The episode’s duration
The show title and URL from the parent blog
The
player_urlcontext variable is automatically set on episode detail pages and passed to theepisode.htmltemplate as an absolute URL.Template Customization¶
To customize the social meta tags in your theme, override the
social_metablock in yourpost.htmltemplate:For episodes, override the same block in
episode.html. Use{{ block.super }}to fall back to the post-level tags when the episode has no audio: