summaryrefslogtreecommitdiff
path: root/src/components/Citations.astro
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/Citations.astro')
-rw-r--r--src/components/Citations.astro15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/components/Citations.astro b/src/components/Citations.astro
index ff42ad4..7ae6b26 100644
--- a/src/components/Citations.astro
+++ b/src/components/Citations.astro
@@ -1,9 +1,8 @@
---
-import type { CollectionEntry } from "astro:content";
-import { getEntries } from "astro:content";
+import type { BlogPosting } from "@lib/collection/types";
-type Props = { citations: CollectionEntry<"blog">["data"]["relatedPosts"] };
-const citations = await getEntries(Astro.props.citations ?? []);
+type Props = { citations: BlogPosting[] };
+const { citations } = Astro.props;
---
{
citations.length > 0 &&
@@ -12,15 +11,15 @@ const citations = await getEntries(Astro.props.citations ?? []);
<p>O autor recomenda ler também:</p>
<ul>
{
- citations.map(({ collection, id, data }) => (
+ citations.map(({ "@id": id, headline }) => (
<li
itemprop="citation"
itemscope
itemtype="http://schema.org/BlogPosting"
- itemid={Astro.url.href.replace(/[^\/]*\/?$/, id)}
+ itemid={id}
>
- <a href={`/${collection}/read/${id}`}>
- <cite itemprop="headline">{data.title}</cite>
+ <a href={`/blog/read/${id}`}>
+ <cite itemprop="headline">{headline}</cite>
</a>
</li>
))