deno-astro-adapter icon indicating copy to clipboard operation
deno-astro-adapter copied to clipboard

Astro content collections not working

Open jueewo opened this issue 1 year ago • 0 comments

I'm trying to get content collections running using SSR with Deno. Using the deno-astro-template Astro works, but the collections is empty:

  • File: src/pages/blog/index.astro
---
import Layout from "../../layouts/Layout.astro" //"../../layouts/main.astro";
import { getCollection, getEntry } from "astro:content";

const blog_carddata = (await getCollection("blog"));
---

<Layout>
<div>CARDDATA: {blog_carddata}</div>
</Layout>
  • blog dir and mdx files are existing in: src/content/blog/xx.mdx

  • config.ts with

import { defineCollection, z } from "astro:content";
const blogCollection = defineCollection({..});
export const collections = {
  blog: blogCollection,
}

jueewo avatar Nov 11 '23 09:11 jueewo