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

Discoverable generic blogposts #1520

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "NativeLink for Semiconductors"
tags: ["news", "blog"]
tags: ["news", "blog-posts"]
image: https://www.gstatic.com/webp/gallery/4.sm.webp
slug: semiconductors
pubDate: 2024-12-04
Expand Down
22 changes: 22 additions & 0 deletions web/platform/src/pages/resources/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { BackgroundVideo } from "@qwik/components/video";
const allPosts = await getCollection("posts");
const announcements = allPosts.filter(post => post.data.tags?.includes('announcements'));
const caseStudies = allPosts.filter(post => post.data.tags?.includes('case-studies'));
const blogPosts = allPosts.filter(post => post.data.tags?.includes('blog-posts'));

const pageTitle = "NativeLink Resources | Blog, Case Studies, Changelog";
---
Expand All @@ -22,6 +23,27 @@ const pageTitle = "NativeLink Resources | Blog, Case Studies, Changelog";
<LinearGradient text="Resources" class="z-10 text-thin text-5xl self-start pl-8 md:pl-48 py-8"/>
</div>

<LinearGradient text="Blog Posts" class="text-thin text-4xl self-start pl-8 md:pl-48 py-8"/>

<div id="Card" class="relative w-screen px-8 md:px-0 md:w-9/12 flex gap-4 snap-x snap-mandatory overflow-x-auto pb-16 mb-6 ">
{blogPosts
.sort((a, b) => new Date(b.data.pubDate).getTime() - new Date(a.data.pubDate).getTime())
.map((post) => (
<a
href={"/resources/blog/" + post.slug}
class="h-96 w-11/12 md:w-72 shrink-0 flex flex-col snap-always md:justify-evenly justify-start rounded-xl items-center border border-solid border-white snap-center"
>
{post.data.image && (
<img src={post.data.image} alt={post.data.title || "Blog post image"} class="w-full h-48 object-cover rounded-t-xl" />
)}
<div class="w-full h-full flex flex-col justify-between items-start p-6">
<LinearGradient text={post.data.title} class="text-lg w-full" />
<span class="text-lg">Read More</span>
</div>
</a>
))}
</div>

<LinearGradient text="Announcements" class="text-thin text-4xl self-start pl-8 md:pl-48 py-8"/>

<div id="Card" class="relative w-screen px-8 md:px-0 md:w-9/12 flex gap-4 snap-x snap-mandatory overflow-x-auto pb-16 mb-6 ">
Expand Down
Loading