mirror of
https://github.com/YouHaveTrouble/youhavetrouble.github.io.git
synced 2026-05-11 22:06:56 +00:00
properly pass description to blog article component
This commit is contained in:
@@ -14,23 +14,23 @@ export async function getStaticPaths() {
|
|||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
title: p.data.title,
|
title: p.data.title,
|
||||||
|
description: p.data.description,
|
||||||
publishDate: p.data.publishDate,
|
publishDate: p.data.publishDate,
|
||||||
slug: p.slug,
|
slug: p.slug,
|
||||||
tags: p.data.tags,
|
tags: p.data.tags,
|
||||||
content: marked.parse(p.body),
|
content: marked.parse(p.body),
|
||||||
readingTime: readingTime(p.body).text,
|
readTime: readingTime(p.body).text,
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
const { slug, title, description, publishDate, tags, content, readingTime } = Astro.props;
|
const { slug, title, description, publishDate, tags, content, readTime } = Astro.props;
|
||||||
const props = Astro.props;
|
const permalink = `${Astro?.site?.href}blog/${slug}`;
|
||||||
const permalink = `${Astro.site.href}blog/${slug}`;
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<BaseLayout title={title} description={description} permalink={permalink} current="blog">
|
<BaseLayout title={title} description={description} permalink={permalink} current="blog">
|
||||||
<header>
|
<header>
|
||||||
<p>{publishDate} ~ {readingTime}</p>
|
<p>{publishDate} ~ {readTime}</p>
|
||||||
<h1>{title}</h1>
|
<h1>{title}</h1>
|
||||||
<div class="tags" style="justify-content: center">
|
<div class="tags" style="justify-content: center">
|
||||||
{tags.map(item => (
|
{tags.map(item => (
|
||||||
|
|||||||
Reference in New Issue
Block a user