From 13ac49f60d76615280f1c8eda72a61e72021d9bb Mon Sep 17 00:00:00 2001 From: OLIMINATOR Date: Sat, 7 Jan 2023 13:42:24 +0100 Subject: [PATCH] fix: og image --- src/components/HeadSEO.astro | 16 ++++++++++++++-- src/config.ts | 5 +++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/components/HeadSEO.astro b/src/components/HeadSEO.astro index 4a6ced3..fe37675 100644 --- a/src/components/HeadSEO.astro +++ b/src/components/HeadSEO.astro @@ -1,5 +1,17 @@ --- +import { getImage } from '@astrojs/image'; import { SITE, OPEN_GRAPH } from '../config'; + +const defaultImage = OPEN_GRAPH.image.src + ? ( + await getImage({ + src: OPEN_GRAPH.image.src, + alt: OPEN_GRAPH.image.alt, + width: 640, + height: 320, + }) + ).src + : ''; --- @@ -13,7 +25,7 @@ import { SITE, OPEN_GRAPH } from '../config'; - + @@ -22,7 +34,7 @@ import { SITE, OPEN_GRAPH } from '../config'; - + diff --git a/src/config.ts b/src/config.ts index 5e43cf1..e204ed4 100644 --- a/src/config.ts +++ b/src/config.ts @@ -7,7 +7,7 @@ export const SITE = { export const OPEN_GRAPH = { image: { - src: './src/assets/images/og-image.png', + src: '../src/assets/images/og-image.png', alt: 'Odkazy text s tlačítkami', }, twitter: 'oliminator34', @@ -19,6 +19,7 @@ export const BUTTONS = [ background: 'bg-youtube hover:bg-youtube/80', href: '/', }, + /* { name: 'Instagram', background: 'bg-instagram hover:bg-instagram/80', @@ -48,5 +49,5 @@ export const BUTTONS = [ name: 'Twitter', background: 'bg-twitter hover:bg-twitter/80', href: '/', - }, + },*/ ];