Skip to content

Commit c8a5cd7

Browse files
committed
fix (hopefully) major bug introduced in #7582
1 parent d42ca5a commit c8a5cd7

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

src/packages/next/pages/share/public_paths/[...id].tsx

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,26 @@ export default (props: PublicPathProps) => (
1919
<>
2020
<PublicPath {...props} />
2121
<NextHead>
22-
<meta property="og:type" content="article"/>
22+
<meta property="og:type" content="article" />
2323

24-
<meta property="og:title" content={props.path}/>
25-
<meta property="og:description" content={props.description}/>
26-
<meta property="og:url" content={props.ogUrl}/>
27-
<meta property="og:image" content={
28-
props.customize.logoSquareURL ||
29-
`${props.customize.siteURL}${ogShareLogo.src}`
30-
}/>
24+
<meta property="og:title" content={props.path} />
25+
<meta property="og:description" content={props.description} />
26+
<meta property="og:url" content={props.ogUrl} />
27+
{props.customize && (
28+
<meta
29+
property="og:image"
30+
content={
31+
props.customize.logoSquareURL ||
32+
`${props.customize.siteURL}${ogShareLogo.src}`
33+
}
34+
/>
35+
)}
3136

32-
<meta property="article:published_time" content={props.created}/>
33-
<meta property="article:modified_time" content={props.last_edited}/>
37+
<meta property="article:published_time" content={props.created} />
38+
<meta property="article:modified_time" content={props.last_edited} />
3439
</NextHead>
3540
</>
36-
)
41+
);
3742

3843
export async function getServerSideProps(context) {
3944
const id = context.params.id[0];
@@ -67,7 +72,10 @@ export async function getServerSideProps(context) {
6772

6873
// Add full URL for social media sharing
6974
//
70-
customize.props.ogUrl = `${customize.props.customize.siteURL}${shareURL(id, relativePath)}`;
75+
customize.props.ogUrl = `${customize.props.customize.siteURL}${shareURL(
76+
id,
77+
relativePath,
78+
)}`;
7179

7280
return customize;
7381
} catch (_err) {

0 commit comments

Comments
 (0)