mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-28 23:34:05 -06:00
feat: add frontmatter aliases for cover image
This commit is contained in:
parent
be5f060bc1
commit
fe282292ce
@ -120,7 +120,11 @@ export default (() => {
|
||||
let ogImagePath = useDefaultOgImage ? ogImageDefaultPath : ogImageGeneratedPath
|
||||
|
||||
// TODO: could be improved to support external images in the future
|
||||
const frontmatterImgUrl = fileData.frontmatter?.socialImage
|
||||
// Handle aliases (socialImage, image and cover are supported to ensure obsidian publish support)
|
||||
const frontmatterImgUrl =
|
||||
fileData.frontmatter?.socialImage ??
|
||||
fileData.frontmatter?.image ??
|
||||
fileData.frontmatter?.cover
|
||||
if (frontmatterImgUrl) {
|
||||
ogImagePath = `https://${cfg.baseUrl}/static/${frontmatterImgUrl}`
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user