mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-28 07:14:05 -06:00
fix: clean url for use in metadata
This commit is contained in:
parent
35ed47db35
commit
e64f2e7e0a
@ -136,6 +136,10 @@ export default (() => {
|
||||
ogImagePath = `https://${cfg.baseUrl}/static/${frontmatterImgUrl}`
|
||||
}
|
||||
|
||||
// Url of current page
|
||||
const socialUrl =
|
||||
fileData.slug === "404" ? url.toString() : joinSegments(url.toString(), fileData.slug!)
|
||||
|
||||
return (
|
||||
<head>
|
||||
<title>{title}</title>
|
||||
@ -172,8 +176,8 @@ export default (() => {
|
||||
<meta name="twitter:image" content={ogImagePath} />
|
||||
<meta property="og:image" content={ogImagePath} />
|
||||
<meta property="twitter:domain" content={cfg.baseUrl}></meta>
|
||||
<meta property="og:url" content={`https://${cfg.baseUrl}/${fileData.slug}`}></meta>
|
||||
<meta property="twitter:url" content={`https://${cfg.baseUrl}/${fileData.slug}`}></meta>
|
||||
<meta property="og:url" content={socialUrl}></meta>
|
||||
<meta property="twitter:url" content={socialUrl}></meta>
|
||||
</>
|
||||
)}
|
||||
<link rel="icon" href={iconPath} />
|
||||
|
||||
Loading…
Reference in New Issue
Block a user