mirror of
https://github.com/JuLi0n21/homepage.git
synced 2026-04-19 23:30:06 +00:00
reorderd stuff, added homepage
This commit is contained in:
@@ -3,7 +3,10 @@ import { SITE_TITLE } from '../consts';
|
||||
import HeaderLink from './HeaderLink.astro';
|
||||
import { getCollection } from 'astro:content';
|
||||
|
||||
const posts = (await getCollection('blog')).sort(
|
||||
const personalPosts = (await getCollection('personal')).sort(
|
||||
(a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf(),
|
||||
);
|
||||
const uniPosts = (await getCollection('uni')).sort(
|
||||
(a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf(),
|
||||
);
|
||||
---
|
||||
@@ -12,10 +15,21 @@ const posts = (await getCollection('blog')).sort(
|
||||
<nav>
|
||||
<h2><a href="/">{SITE_TITLE}</a></h2>
|
||||
<ul>
|
||||
<h4>Personal</h4>
|
||||
{
|
||||
posts.map((post) => (
|
||||
personalPosts.map((post) => (
|
||||
<li>
|
||||
<HeaderLink href={`/blog/${post.id}/`}>{post.data.title}</HeaderLink>
|
||||
<HeaderLink href={`/blog/personal/${post.id}/`}>{post.data.title}</HeaderLink>
|
||||
</li>
|
||||
))
|
||||
}
|
||||
<hr>
|
||||
<h4>University</h4>
|
||||
<h6>(Group Projects)</h6>
|
||||
{
|
||||
uniPosts.map((post) => (
|
||||
<li>
|
||||
<HeaderLink href={`/blog/university/${post.id}/`}>{post.data.title}</HeaderLink>
|
||||
</li>
|
||||
))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user