convert to use directus

This commit is contained in:
2024-08-24 01:23:12 -05:00
parent fd85557d6b
commit 0f5fc27371
21 changed files with 187 additions and 138 deletions

View File

@@ -1,16 +1,17 @@
---
import type { CollectionEntry } from 'astro:content';
import type { Post } from '../../lib/directus';
import { directus_url } from '../../lib/directus';
interface Props {
project: CollectionEntry<'projects'>;
posts: Post;
}
const { data, slug } = Astro.props.project;
const post: Post = Astro.props.posts;
---
<a class="card" href={`/projects/${slug}`}>
<span class="title">{data.title}</span>
<img src={data.img} alt={data.img_alt || ''} loading="lazy" decoding="async" />
<a class="card" href={`/projects/${post.slug}`}>
<span class="title">{post.title}</span>
<img src={`${directus_url}/assets/${post.image}?width=500`} alt={post.image_alt || ''} loading="lazy" decoding="async" />
</a>
<style>