diff --git a/quartz/util/socialImage.tsx b/quartz/util/socialImage.tsx index 16315212a..81a5e3182 100644 --- a/quartz/util/socialImage.tsx +++ b/quartz/util/socialImage.tsx @@ -3,6 +3,8 @@ import { GlobalConfiguration } from "../cfg" import { SocialImageOptions, UserOpts } from "./imageHelper" import { QuartzPluginData } from "../plugins/vfile" +// This file contains the template of the default social image. + export const defaultImage: SocialImageOptions["imageStructure"] = ( cfg: GlobalConfiguration, userOpts: UserOpts, diff --git a/quartz/util/socialImage2.tsx b/quartz/util/socialImage2.tsx new file mode 100644 index 000000000..16315212a --- /dev/null +++ b/quartz/util/socialImage2.tsx @@ -0,0 +1,80 @@ +import { SatoriOptions } from "satori/wasm" +import { GlobalConfiguration } from "../cfg" +import { SocialImageOptions, UserOpts } from "./imageHelper" +import { QuartzPluginData } from "../plugins/vfile" + +export const defaultImage: SocialImageOptions["imageStructure"] = ( + cfg: GlobalConfiguration, + userOpts: UserOpts, + title: string, + description: string, + fonts: SatoriOptions["fonts"], + fileData: QuartzPluginData, +) => { + // How many characters are allowed before switching to smaller font + const fontBreakPoint = 22 + const useSmallerFont = title.length > fontBreakPoint + + const { colorScheme } = userOpts + return ( +
+
+

+ {title} +

+

+ {description} +

+
+
+
+ ) +}