is this it?

This commit is contained in:
Adam Matthiesen 2024-02-10 08:42:27 -08:00
parent 1bd9364dcb
commit 5d37c79ad1
3 changed files with 28 additions and 2 deletions

View File

@ -1,7 +1,7 @@
{
"name": "@matthiesenxyz/astro-ghostcms-brutalbyelian",
"description": "ElianCodes Brutal theme modified to work with Astro-GhostCMS",
"version": "0.0.1-dev02",
"version": "0.0.1-dev03",
"homepage": "https://astro-ghostcms.xyz/",
"type": "module",
"license": "MIT",

View File

@ -1,7 +1,7 @@
---
import type { Settings, Post } from "@matthiesenxyz/astro-ghostcms/api";
import { formatDate } from "../../utils";
import FeatureImage from "../generic/Featureimage.astro";
import FeatureImage from "./FeatureImage.astro";
export type Props = {
post: Post;

View File

@ -0,0 +1,26 @@
---
import { getGhostImgPath } from "../../utils";
import type { Settings } from "@matthiesenxyz/astro-ghostcms/api";
export type Props = {
image: string;
alt?: string;
caption?: string;
settings: Settings;
transitionName?: string;
};
const { image, alt, caption = "", settings, transitionName } = Astro.props as Props;
---
<figure class="article-image">
<img
srcset={`
${getGhostImgPath(settings.url, image, 300)} 300w,
${getGhostImgPath(settings.url, image, 600)} 600w,
`}
sizes="(min-width: 300px) 600px, 92vw"
src={getGhostImgPath(settings.url, image, 2000)}
alt={alt}
transition:name={transitionName}
/>
{caption && <figcaption class="text-ctp-overlay2"><Fragment set:html={caption}></figcaption>}
</figure>