Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/components/ContentFigure.astro
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
* - width: Width of the figure (e.g., "60%", "400px") - defaults to 100%
* - border: Add a border (boolean for default style, or string for custom CSS border)
* - align: Alignment of the figure ("left", "center", "right") - defaults to "center"
* - autoplay: Whether local video files autoplay on load (boolean) - defaults to false
*/
import { Image } from 'astro:assets';

Expand All @@ -62,6 +63,7 @@ interface Props {
border?: boolean | string;
align?: 'left' | 'center' | 'right';
class?: string;
autoplay?: boolean;
}

const {
Expand All @@ -71,6 +73,7 @@ const {
border = false,
align = 'center',
class: className,
autoplay = false,
} = Astro.props;

// Check if src is already an ImageMetadata object (from glob import)
Expand Down Expand Up @@ -193,7 +196,7 @@ const hasCaption = Astro.slots.has('default');
<video
src={src as string}
controls
autoplay
autoplay={autoplay}
loop
muted
playsinline
Expand Down
Loading