fix: catch undefined article
This commit is contained in:
parent
19010d2d72
commit
79279e4ab1
1 changed files with 3 additions and 5 deletions
|
@ -1,14 +1,12 @@
|
||||||
---
|
---
|
||||||
import { ArticleData } from "@extractus/article-extractor";
|
import { ArticleData } from "@extractus/article-extractor";
|
||||||
import CSS from "./post.module.scss";
|
|
||||||
|
|
||||||
const article = Astro.props.article;
|
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
article: ArticleData;
|
article: ArticleData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const article = Astro.props.article;
|
||||||
const datePublished =
|
const datePublished =
|
||||||
article.published && new Date(article.published).toDateString();
|
article?.published && new Date(article.published).toDateString();
|
||||||
---
|
---
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue