Fixed social cards not using site name on homepage (#7608)

Use `config.site_name` instead of `page.title`.
This commit is contained in:
Pekka Klärck
2024-10-10 11:06:56 +03:00
committed by GitHub
parent cf2b39d1c2
commit 829d1c8db2
2 changed files with 10 additions and 6 deletions

View File

@@ -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