Skip to content

Commit

Permalink
Merge pull request #19 from LainForge/tarun/dev
Browse files Browse the repository at this point in the history
refractored homepage
  • Loading branch information
TarunAdobe authored Nov 9, 2023
2 parents 8b67490 + eb88dbe commit 46c6ca3
Showing 1 changed file with 17 additions and 36 deletions.
53 changes: 17 additions & 36 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -34,45 +34,26 @@ const featuredProjects = sortedProjects.filter(({ data }) => data.featured);
<p>Scroll down for more ⬇️</p>
</section>

{
featuredProjects.length > 0 && (
<>
<section id="featured">
<h2>Featured Projects</h2>
<ul>
{featuredProjects.map(({ data }) => (
<ProjectCard
href={`/projects/${slugifyProject(data)}`}
<Hr />

<section id="recent-posts">
<ul>
{
sortedPosts.reduce((acc, { data }) => {
// Check if the post meets the conditions (not in the "project" category)
if (acc.length < 2 && data.category !== "project") {
acc.push(
<Card
href={`/posts/${slugify(data)}`}
frontmatter={data}
secHeading={false}
/>
))}
</ul>
</section>
<Hr />
</>
)
}

<section id="recent-posts">
<h2>Recent Posts</h2>
<ul>
{
sortedPosts.reduce((acc, { data }) => {
// Check if the post meets the conditions (not in the "project" category)
if (acc.length < 2 && data.category !== "project") {
acc.push(
<Card
href={`/posts/${slugify(data)}`}
frontmatter={data}
secHeading={false}
/>
);
);
}
return acc;
}, [])
}
return acc;
}, [])
}
</ul>
</ul>
<div class="all-posts-btn-wrapper">
<LinkButton href="/posts">
All Posts
Expand Down Expand Up @@ -116,7 +97,7 @@ const featuredProjects = sortedProjects.filter(({ data }) => data.featured);
/* ===== Featured & Recent Posts Sections ===== */
#featured,
#recent-posts {
@apply pb-6 pt-12;
@apply pb-2 pt-4;
}
#featured h2,
#recent-posts h2 {
Expand Down

0 comments on commit 46c6ca3

Please sign in to comment.