Fix image in meta and other details

This commit is contained in:
prototypa
2022-08-25 00:46:15 -04:00
parent b9b8feac44
commit 0a7b84b816
13 changed files with 67 additions and 49 deletions

View File

@ -18,7 +18,7 @@ const {
const image =
typeof _image === "string"
? new URL(_image, Astro.site)
: typeof _image["src"] !== "undefined"
: _image && typeof _image["src"] !== "undefined"
? new URL(getRelativeUrlByFilePath(_image.src), Astro.site)
: null;
---

View File

@ -16,7 +16,7 @@ const {
let picture = null;
try {
picture = await getPicture({
picture = src && await getPicture({
src,
widths,
formats,
@ -24,7 +24,6 @@ try {
})
}
catch (e) {
console.log(e);
}
const { image = {}, sources = [] } = picture || {}