Skip to content

Commit 47fb0af

Browse files
committed
use og:site_name
1 parent 030e9d3 commit 47fb0af

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/components/Seo/Seo.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ const Seo = ({ data, title, description, keywords, cover, location }) => {
3838
}
3939

4040
const imageUrl = getImageUrl({ data, cover });
41-
const url = config.siteUrl + "/" + config.pathPrefix + pageSlug;
41+
// Fix URL construction to avoid double slashes
42+
const cleanSlug = pageSlug.startsWith('/') ? pageSlug : `/${pageSlug}`;
43+
const url = config.pathPrefix
44+
? `${config.siteUrl}/${config.pathPrefix}${cleanSlug}`
45+
: `${config.siteUrl}${cleanSlug}`;
4246

4347
const pageKeywords = keywords || config.defaultKeywords;
4448
return (
@@ -65,6 +69,7 @@ const Seo = ({ data, title, description, keywords, cover, location }) => {
6569
<meta property="og:description" content={pageDescription} />
6670
<meta property="og:image" content={imageUrl} />
6771
<meta property="og:type" content="website" />
72+
<meta property="og:site_name" content={config.shortSiteTitle} />
6873
{/* Twitter Card tags */}
6974
<meta name="twitter:card" content="summary_large_image" />
7075
<meta

0 commit comments

Comments
 (0)