Skip to content

Commit

Permalink
Only render notes if there's a pubDate
Browse files Browse the repository at this point in the history
  • Loading branch information
puf committed Jul 8, 2024
1 parent 847b20d commit 9e6eccb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/layouts/BlogPost.astro
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import FormattedDate from '../components/FormattedDate.astro';
type Props = CollectionEntry<'blog'>['data'];
const { title, description, pubDate, updatedDate, heroImage } = Astro.props;
console.log('Astro.props', Astro.props)
---

<html lang="en">
Expand Down
4 changes: 3 additions & 1 deletion src/pages/[...slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ const pubDate = post.frontmatter.pubDate ? new Date(post.frontmatter.pubDate) :
// * [ ] Determine pubDate based on note type
---

(pubDate &&
<BlogPost {...post} pubDate={pubDate}>
<Content />
</BlogPost>
</BlogPost>
)

0 comments on commit 9e6eccb

Please sign in to comment.