mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-28 01:10:58 +01:00
Fixed social cards not using site name on homepage (#7608)
Use `config.site_name` instead of `page.title`.
This commit is contained in:
parent
cf2b39d1c2
commit
829d1c8db2
@ -339,9 +339,11 @@ class SocialPlugin(BasePlugin[SocialConfig]):
|
|||||||
file, _ = os.path.splitext(page.file.src_uri)
|
file, _ = os.path.splitext(page.file.src_uri)
|
||||||
|
|
||||||
# Compute page title
|
# Compute page title
|
||||||
title = page.meta.get("title", page.title)
|
if page.is_homepage:
|
||||||
if not page.is_homepage:
|
title = config.site_name
|
||||||
title = f"{title} - {config.site_name}"
|
else:
|
||||||
|
page_title = page.meta.get("title", page.title)
|
||||||
|
title = f"{page_title} - {config.site_name}"
|
||||||
|
|
||||||
# Compute page description
|
# Compute page description
|
||||||
description = config.site_description
|
description = config.site_description
|
||||||
|
@ -339,9 +339,11 @@ class SocialPlugin(BasePlugin[SocialConfig]):
|
|||||||
file, _ = os.path.splitext(page.file.src_uri)
|
file, _ = os.path.splitext(page.file.src_uri)
|
||||||
|
|
||||||
# Compute page title
|
# Compute page title
|
||||||
title = page.meta.get("title", page.title)
|
if page.is_homepage:
|
||||||
if not page.is_homepage:
|
title = config.site_name
|
||||||
title = f"{title} - {config.site_name}"
|
else:
|
||||||
|
page_title = page.meta.get("title", page.title)
|
||||||
|
title = f"{page_title} - {config.site_name}"
|
||||||
|
|
||||||
# Compute page description
|
# Compute page description
|
||||||
description = config.site_description
|
description = config.site_description
|
||||||
|
Loading…
Reference in New Issue
Block a user