Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add list of snippets on homepage #5

Merged
merged 2 commits into from
Aug 9, 2023
Merged

Conversation

sweep-ai[bot]
Copy link
Contributor

@sweep-ai sweep-ai bot commented Aug 9, 2023

Description

This PR adds a list of snippets on the homepage of the website. Currently, only articles are being displayed on the homepage. With this change, snippets will also be included, providing more content for users to explore.

Summary of Changes

  • Modified the app/page.tsx file to import allSnippets from 'contentlayer/generated'.
  • Created a new constant snippets that sorts allSnippets by date and slices the array to get the top 3 snippets.
  • Added a snippets.map function call after the articles.map function call to render each snippet using a new Snippet component.
  • Created a new Snippet component that is similar to the Article component, but renders the snippet's title and links to the snippet's page.

This change enhances the homepage by including snippets, providing users with more content to engage with. It also improves the overall user experience by showcasing a wider range of content on the homepage.

Fixes #4.


To checkout this PR branch, run the following command in your terminal:

git checkout sweep/add-snippets-on-homepage

To get Sweep to edit this pull request, leave a comment below or in the code. Leaving a comment in the code will only modify the file but commenting below can change the entire PR.

@sweep-ai sweep-ai bot added the sweep Assigns Sweep to an issue or pull request. label Aug 9, 2023
@vercel
Copy link

vercel bot commented Aug 9, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
raviatluriin ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 9, 2023 1:01pm

@sonnes
Copy link
Owner

sonnes commented Aug 9, 2023

sweep: fix Type error: 'Snippet' refers to a value, but is being used as a type here. Did you mean 'typeof Snippet'?

@sonnes sonnes force-pushed the sweep/add-snippets-on-homepage branch from 9cab53b to d86e483 Compare August 9, 2023 13:00
@sonnes sonnes merged commit 1c335ef into main Aug 9, 2023
@sonnes sonnes deleted the sweep/add-snippets-on-homepage branch August 9, 2023 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sweep Assigns Sweep to an issue or pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sweep: Add list of snippets on homepage
1 participant