From 27053ad40121adcf08603c7d7c9c3f48af5246f5 Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Thu, 12 Jun 2025 22:25:57 +0200 Subject: Initial page works --- src/pages/blog/[slug].astro | 67 ------------------- src/pages/blog/index.astro | 48 ------------- src/pages/index.astro | 160 +++++++++++++++++++++++++------------------- 3 files changed, 90 insertions(+), 185 deletions(-) delete mode 100644 src/pages/blog/[slug].astro delete mode 100644 src/pages/blog/index.astro (limited to 'src/pages') diff --git a/src/pages/blog/[slug].astro b/src/pages/blog/[slug].astro deleted file mode 100644 index f42f5c9..0000000 --- a/src/pages/blog/[slug].astro +++ /dev/null @@ -1,67 +0,0 @@ ---- -import { getCollection, getEntry } from 'astro:content'; -import StandardLayout from '../../layouts/StandardLayout.astro'; - -// Define the props type -export async function getStaticPaths() { - const blogEntries = await getCollection('blog'); - return blogEntries.map(entry => ({ - params: { slug: entry.slug }, - props: { entry }, - })); -} - -// Get the blog post data -const { entry } = Astro.props; -const { Content } = await entry.render(); - -// Format the publication date -const formattedDate = new Date(entry.data.pubDate).toLocaleDateString('en-US', { - year: 'numeric', - month: 'long', - day: 'numeric' -}); ---- - - -
- - - {entry.data.image && ( - {entry.data.title} - )} - -

{entry.data.title}

- -
- By {entry.data.author} - - -
- - {entry.data.tags && entry.data.tags.length > 0 && ( -
- {entry.data.tags.map(tag => ( - - {tag} - - ))} -
- )} - -
- -
-
-
diff --git a/src/pages/blog/index.astro b/src/pages/blog/index.astro deleted file mode 100644 index 76b9f57..0000000 --- a/src/pages/blog/index.astro +++ /dev/null @@ -1,48 +0,0 @@ ---- -import StandardLayout from '../../layouts/StandardLayout.astro'; -import { getCollection } from 'astro:content'; - -// Get all blog posts sorted by publication date -const posts = await getCollection('blog'); -posts.sort((a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf()); ---- - - -
-

Blog

- - - - {posts.length === 0 && ( -
-

No blog posts found. Check back soon!

-
- )} -
-
diff --git a/src/pages/index.astro b/src/pages/index.astro index a88712c..1981ec1 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,78 +1,98 @@ --- -import Counter from "../components/Counter"; -import StandardLayout from "../layouts/StandardLayout.astro"; import { getCollection } from "astro:content"; -// Get the latest 3 blog posts -const latestPosts = await getCollection("blog"); -latestPosts.sort((a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf()); -const featuredPosts = latestPosts.slice(0, 3); +import "../styles/global.css"; + +// Get all names from the collection +const allNames = await getCollection("names"); +const members = allNames.filter(name => name.data.candidate !== true); +const candidates = allNames.filter(name => name.data.candidate === true); --- - -
-
-

- Welcome to Astro -

-

- A modern framework for building fast, content-focused websites. -

-
- -
-
-
+ + + + + Domain Name Hack Club + + + + + + + + + + +

Doma.in Na.me + Ha.ck Cl.ub

+

An exclusive club of geeks that serve their personal homepage from the domain hack to their name. Are you + one of us? Join the club by opening a pull + request on Github or send us an + email at join@namehack.club.

-
-
-
-

- Latest Blog Posts -

- View all posts → -
+

💎 Members

+
    + {members.map((name) => { + const nameParts = name.data.name.toLowerCase().split(" "); + const domain = name.data.domain.replace(".", ""); + const url = name.data.url || `https://${name.data.domain}`; + + return ( +
  • +
    + {nameParts.map((part, index) => ( + <> + {index > 0 && " "} + {part === domain ? ( + + {name.data.domain} + + ) : ( + {part} + )} + + ))} +
    +
    {name.data.title}
    +
  • + ); + })} +
-
- { - featuredPosts.map((post) => ( -
- - {post.data.image && ( - {post.data.title} +

⭐ Candidates

+
- )) - } -
-
-
-
+ + ))} + + + ); + })} + + +
+ + + -- cgit v1.3.1