File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed
Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -378,12 +378,21 @@ def get_social_card_url_for_page(
378378 if mkdocs_site_url is None and self .mkdocs_site_url :
379379 mkdocs_site_url = self .mkdocs_site_url
380380
381- # As of mkdocs-material 9.6.5, social cards are always stored in the
382- # matching src path in the build folder, regardless of the page type.
383- page_social_card = (
384- f"{ mkdocs_site_url } { self .social_cards_dir } /"
385- f"{ Path (mkdocs_page .src_uri ).with_suffix ('.png' )} "
386- )
381+ # if page is a blog post
382+ if (
383+ self .integration_material_blog .IS_BLOG_PLUGIN_ENABLED
384+ and self .integration_material_blog .is_page_a_blog_post (mkdocs_page )
385+ ):
386+ page_social_card = (
387+ f"{ mkdocs_site_url } assets/images/social/"
388+ f"{ Path (mkdocs_page .dest_uri ).with_suffix ('.png' )} "
389+ )
390+ else :
391+ page_social_card = (
392+ f"{ mkdocs_site_url } { self .social_cards_dir } /"
393+ f"{ Path (mkdocs_page .src_uri ).with_suffix ('.png' )} "
394+ )
395+
387396 logger .debug (f"Use social card url: { page_social_card } " )
388397
389398 return page_social_card
You can’t perform that action at this time.
0 commit comments