blog slug fixes
This commit is contained in:
@@ -7,15 +7,18 @@ import BlogHeader from "../../components/BlogHeader.astro";
|
||||
|
||||
const { slug } = Astro.params;
|
||||
|
||||
console.log(`SLUG: ${slug}`);
|
||||
|
||||
const response = await fetch(
|
||||
`https://api.cosmicjs.com/v2/buckets/${
|
||||
import.meta.env.BUCKET_SLUG
|
||||
}/objects?pretty=true&query=%7B%22type%22%3A%22blog-posts%22%7D&read_key=${
|
||||
import.meta.env.BUCKET_READ_KEY
|
||||
}&limit=20&slug=${slug}`
|
||||
}&limit=5&query=%7B%22slug%22%3A%7B%22%24eq%22%3A%22${slug}%22%7D%7D`
|
||||
);
|
||||
|
||||
const posts = await response.json();
|
||||
|
||||
const post = posts.objects[0];
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user