mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-28 07:14:05 -06:00
feat: use default og image if no path exists
This commit is contained in:
parent
91a0c3e0b4
commit
b207477248
@ -131,13 +131,15 @@ export default (() => {
|
||||
const baseDir = fileData.slug === "404" ? path : pathToRoot(fileData.slug!)
|
||||
|
||||
const iconPath = joinSegments(baseDir, "static/icon.png")
|
||||
// TODO: use default image if undefined
|
||||
const useDefaultOgImage = filePath === undefined
|
||||
const ogImageDefaultPath = `https://${cfg.baseUrl}/static/og-image.png`
|
||||
const ogImagePath = `https://${cfg.baseUrl}/${imageDir.replace(
|
||||
const ogImageGeneratedPath = `https://${cfg.baseUrl}/${imageDir.replace(
|
||||
"public/",
|
||||
"",
|
||||
)}/${filePath}.${extension}`
|
||||
|
||||
const ogImagePath = useDefaultOgImage ? ogImageDefaultPath : ogImageGeneratedPath
|
||||
|
||||
return (
|
||||
<head>
|
||||
<title>{title}</title>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user