diff --git a/astro/src/layouts/PhotoLayout.astro b/astro/src/layouts/PhotoLayout.astro index fdff439..1d6c60d 100644 --- a/astro/src/layouts/PhotoLayout.astro +++ b/astro/src/layouts/PhotoLayout.astro @@ -3,6 +3,8 @@ import '@/styles/global.css'; import { getSettings } from "@/content/settings/settings"; import { getTextColor } from '@/lib/colors'; import Footer from '@/components/footer/Footer.astro'; +import { getImageSize } from '@/lib/images'; +import { getImage } from 'astro:assets'; interface Props { settings: WebpageLayoutProps; @@ -19,6 +21,21 @@ const css = { ? getTextColor(settings.website.colors.secondary) : getTextColor(settings.website.colors.primary) }; + +const searchengine = Astro.props.settings.searchEngine; + +// Changing the thumbnail here is okay, as we now have two images: a new thumbnail, and the original image. +// Might have to make it prettier down the line? +// TODO: See comment above. +const resizedThumbnail = getImageSize(searchengine.thumbnail.width, + searchengine.thumbnail.height, 0.756); + +const thumbnail = await getImage({ + src: searchengine.thumbnail.url, + width: resizedThumbnail.width, + height: resizedThumbnail.height, + format: "jpeg" +}); --- @@ -50,14 +67,14 @@ const css = { - + - +