[obsidian] vault backup: 2025-11-01 14:38:51[
Some checks failed
Build / build (push) Failing after 14m54s

This commit is contained in:
2025-11-01 14:38:51 -04:00
parent 1849b8dea8
commit efa18ac7f2
20 changed files with 213 additions and 16 deletions

View File

@@ -1,7 +1,7 @@
import { QuartzEmitterPlugin } from "../types"
import { i18n } from "../../i18n"
import { unescapeHTML } from "../../util/escape"
import { FullSlug, getFileExtension, isAbsoluteURL, joinSegments, QUARTZ } from "../../util/path"
import { FilePath, FullSlug, getFileExtension, isAbsoluteURL, joinSegments, QUARTZ } from "../../util/path"
import { ImageOptions, SocialImageOptions, defaultImage, getSatoriFonts } from "../../util/og"
import sharp from "sharp"
import satori, { SatoriOptions } from "satori"
@@ -109,18 +109,21 @@ export const CustomOgImages: QuartzEmitterPlugin<Partial<SocialImageOptions>> =
getQuartzComponents() {
return []
},
async *emit(ctx, content, _resources) {
async emit(ctx, content, _resources): Promise<FilePath[]> {
const cfg = ctx.cfg.configuration
const headerFont = cfg.theme.typography.header
const bodyFont = cfg.theme.typography.body
const fonts = await getSatoriFonts(headerFont, bodyFont)
Promise.all(
content.map(([_tree, vfile]) => {
if (vfile.data.frontmatter?.socialImage !== undefined) {
processOgImage(ctx, vfile.data, fonts, fullOptions)
}
}),
)
return Promise.all(
content
.filter(
([_tree, vfile]) =>
vfile.data.frontmatter?.socialImage !== undefined &&
vfile.data.filePath !== undefined,
)
.map(([_tree, vfile]) => processOgImage(ctx, vfile.data, fonts, fullOptions)),
);
},
async *partialEmit(ctx, _content, _resources, changeEvents) {
const cfg = ctx.cfg.configuration