1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2026-07-01 00:45:58 -04:00

properly import and optimize/cache images in markdown files

This commit is contained in:
2025-03-03 15:56:57 -05:00
parent 36faa6c234
commit ba10742c9b
71 changed files with 685 additions and 1100 deletions
+3 -3
View File
@@ -10,14 +10,14 @@ export type VideoProps = Omit<Partial<ComponentPropsWithoutRef<"video">>, "src">
mp4?: string;
// optional:
vtt?: string;
image?: string;
};
poster?: string;
autoplay?: boolean;
responsive?: boolean;
className?: string;
};
const Video = ({ src, autoplay = false, responsive = true, className, ...rest }: VideoProps) => {
const Video = ({ src, poster, autoplay = false, responsive = true, className, ...rest }: VideoProps) => {
if (!src || (!src.mp4 && !src.webm)) {
throw new Error("'src' prop must include either 'mp4' or 'webm' URL.");
}
@@ -34,7 +34,7 @@ const Video = ({ src, autoplay = false, responsive = true, className, ...rest }:
playsInline={autoplay} // safari autoplay workaround
loop={autoplay || undefined}
muted={autoplay || undefined}
poster={src.image}
poster={poster}
{...rest}
>
{src.webm && <source key={src.webm} src={src.webm} type="video/webm" />}