mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-27 17:00:54 +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)
|
||||
|
||||
# Compute page title
|
||||
title = page.meta.get("title", page.title)
|
||||
if not page.is_homepage:
|
||||
title = f"{title} - {config.site_name}"
|
||||
if page.is_homepage:
|
||||
title = config.site_name
|
||||
else:
|
||||
page_title = page.meta.get("title", page.title)
|
||||
title = f"{page_title} - {config.site_name}"
|
||||
|
||||
# Compute page description
|
||||
description = config.site_description
|
||||
|
@ -339,9 +339,11 @@ class SocialPlugin(BasePlugin[SocialConfig]):
|
||||
file, _ = os.path.splitext(page.file.src_uri)
|
||||
|
||||
# Compute page title
|
||||
title = page.meta.get("title", page.title)
|
||||
if not page.is_homepage:
|
||||
title = f"{title} - {config.site_name}"
|
||||
if page.is_homepage:
|
||||
title = config.site_name
|
||||
else:
|
||||
page_title = page.meta.get("title", page.title)
|
||||
title = f"{page_title} - {config.site_name}"
|
||||
|
||||
# Compute page description
|
||||
description = config.site_description
|
||||
|
Loading…
Reference in New Issue
Block a user