From 4d2dc5e4ac3c20dd594c971fcfb7e3b7c6b2f575 Mon Sep 17 00:00:00 2001 From: Stephen Tse Date: Sat, 3 May 2025 14:52:30 -0700 Subject: [PATCH] Applied Prettier --- docs/configuration.md | 1 + quartz/plugins/transformers/images.ts | 9 ++++----- quartz/plugins/transformers/ofm.ts | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index 419c9706d..c011af891 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -58,6 +58,7 @@ This part of the configuration concerns anything that can affect the whole site. - `highlight`: internal link background, highlighted text, [[syntax highlighting|highlighted lines of code]] - `textHighlight`: markdown highlighted text background - `optimizeImages`: whether to optimize images for web serving when building Quartz. If this is set to `true`: + - JPEG and PNG images will be stripped all metadata and converted to WebP format, and associated image links in [[wikilinks]] will be updated with the new file extension. - A resized preview image will replace every local image that have custom dimensions defined either in their [wikilink](https://help.obsidian.md/syntax#External+images) or tag. The original image (optimized or not) will still be assessable as a link on the preview image. diff --git a/quartz/plugins/transformers/images.ts b/quartz/plugins/transformers/images.ts index b836d7fb0..3ae30fa69 100644 --- a/quartz/plugins/transformers/images.ts +++ b/quartz/plugins/transformers/images.ts @@ -6,11 +6,9 @@ import { imageExtsToOptimize, previewImageMap, targetOptimizedImageExt } from ". import { FullSlug, getFileExtension, isAbsoluteURL, RelativeURL } from "../../util/path" import { parseSelector } from "hast-util-parse-selector" -export interface Options { -} +export interface Options {} -const defaultOptions: Options = { -} +const defaultOptions: Options = {} /** * File extensions of all supported image format. Files with an extension @@ -36,6 +34,7 @@ export const supportedImageExts: ReadonlySet = new Set([ * Add this plugin after all Markdown parser plugins in quartz.config. */ export const Images: QuartzTransformerPlugin> = (userOpts) => { + //@ts-ignore const opts = { ...defaultOptions, ...userOpts } return { @@ -139,4 +138,4 @@ const OptimizeImages: Plugin<[], HtmlRoot> = () => { } return transformer -} \ No newline at end of file +} diff --git a/quartz/plugins/transformers/ofm.ts b/quartz/plugins/transformers/ofm.ts index b42fdf409..7f3e4abc6 100644 --- a/quartz/plugins/transformers/ofm.ts +++ b/quartz/plugins/transformers/ofm.ts @@ -228,7 +228,7 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin> // embed cases if (value.startsWith("!")) { const ext: string = path.extname(fp).toLowerCase() - let url = slugifyFilePath(fp as FilePath) + const url = slugifyFilePath(fp as FilePath) // Handle images if (supportedImageExts.has(ext)) { @@ -250,13 +250,13 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin> }, }, } - // Handle videos + // Handle videos } else if ([".mp4", ".webm", ".ogv", ".mov", ".mkv"].includes(ext)) { return { type: "html", value: ``, } - // Handle audio + // Handle audio } else if ( [".mp3", ".webm", ".wav", ".m4a", ".ogg", ".3gp", ".flac"].includes(ext) ) { @@ -264,7 +264,7 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin> type: "html", value: ``, } - // Handle documents + // Handle documents } else if ([".pdf"].includes(ext)) { return { type: "html",