mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-30 08:14:05 -06:00
feat: add frontmatter alias for obsidian publish
This commit is contained in:
parent
fe282292ce
commit
0289fd67f8
@ -72,8 +72,11 @@ export default (() => {
|
|||||||
if (fdDescription) {
|
if (fdDescription) {
|
||||||
description = unescapeHTML(fdDescription)
|
description = unescapeHTML(fdDescription)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fileData.frontmatter?.socialDescription) {
|
if (fileData.frontmatter?.socialDescription) {
|
||||||
description = fileData.frontmatter.socialDescription
|
description = fileData.frontmatter.socialDescription
|
||||||
|
} else if (fileData.frontmatter?.description) {
|
||||||
|
description = fileData.frontmatter?.description
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cfg.generateSocialImages) {
|
if (cfg.generateSocialImages) {
|
||||||
|
|||||||
@ -74,13 +74,15 @@ export type SocialImageOptions = {
|
|||||||
*/
|
*/
|
||||||
imageStructure: (
|
imageStructure: (
|
||||||
cfg: GlobalConfiguration,
|
cfg: GlobalConfiguration,
|
||||||
userOpts: SocialImageOptions,
|
userOpts: UserOpts,
|
||||||
title: string,
|
title: string,
|
||||||
description: string,
|
description: string,
|
||||||
fonts: SatoriOptions["fonts"],
|
fonts: SatoriOptions["fonts"],
|
||||||
) => JSXInternal.Element
|
) => JSXInternal.Element
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type UserOpts = Omit<SocialImageOptions, "imageStructure">
|
||||||
|
|
||||||
export type ImageOptions = {
|
export type ImageOptions = {
|
||||||
/**
|
/**
|
||||||
* what title to use as header in image
|
* what title to use as header in image
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
import { SatoriOptions } from "satori/wasm"
|
import { SatoriOptions } from "satori/wasm"
|
||||||
import { GlobalConfiguration } from "../cfg"
|
import { GlobalConfiguration } from "../cfg"
|
||||||
import { SocialImageOptions } from "./imageHelper"
|
import { SocialImageOptions, UserOpts } from "./imageHelper"
|
||||||
|
|
||||||
export const defaultImage: SocialImageOptions["imageStructure"] = (
|
export const defaultImage: SocialImageOptions["imageStructure"] = (
|
||||||
cfg: GlobalConfiguration,
|
cfg: GlobalConfiguration,
|
||||||
userOpts: SocialImageOptions,
|
userOpts: UserOpts,
|
||||||
title: string,
|
title: string,
|
||||||
description: string,
|
description: string,
|
||||||
fonts: SatoriOptions["fonts"],
|
fonts: SatoriOptions["fonts"],
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user