Finally! Using an Astro API Route to handle all the queries which works like a dream. Also created a custom function to get the relative path for image files, fixing any external access issues. Co-authored-by: june <self@breadone.net> Co-committed-by: june <self@breadone.net>
This commit was merged in pull request #7.
This commit is contained in:
@@ -5,7 +5,7 @@ import TagRow from "./TagRow.astro"
|
||||
const { recipe } = Astro.props;
|
||||
|
||||
const headerImage = await client.collection("images").getOne(recipe.images[0])
|
||||
const image = await client.files.getURL(headerImage, headerImage.image)
|
||||
const image = await client.files.getRelativeURL(headerImage, headerImage.image)
|
||||
---
|
||||
|
||||
<div class="relative z-0 flex h-50">
|
||||
|
||||
Reference in New Issue
Block a user