feat: update schema, add ProjectCard
, readme
This commit is contained in:
parent
fbeab5a744
commit
b93eddea6b
24 changed files with 373 additions and 72 deletions
|
@ -1,8 +1,12 @@
|
|||
---
|
||||
import Breadcrumbs from '@/components/Breadcrumbs.astro'
|
||||
import Container from '@components/Container.astro'
|
||||
import ProjectCard from '@components/ProjectCard.astro'
|
||||
import { SITE } from '@consts'
|
||||
import Layout from '@layouts/Layout.astro'
|
||||
import { getCollection } from 'astro:content'
|
||||
|
||||
const projects = await getCollection('projects')
|
||||
---
|
||||
|
||||
<Layout title="About" description={SITE.DESCRIPTION}>
|
||||
|
@ -12,11 +16,18 @@ import Layout from '@layouts/Layout.astro'
|
|||
<section>
|
||||
<div class="min-w-full">
|
||||
<h1 class="mb-4 text-3xl font-bold">Some more about us</h1>
|
||||
<p class="prose prose-neutral dark:prose-invert">
|
||||
<p class="prose prose-neutral dark:prose-invert mb-8">
|
||||
{SITE.TITLE} is an opinionated, no-frills static blogging template built
|
||||
with Astro.
|
||||
</p>
|
||||
|
||||
<h2 class="mb-4 text-2xl font-semibold">Our Projects</h2>
|
||||
<div class="grid gap-6 sm:grid-cols-2 lg:grid-cols-3">
|
||||
{projects.map((project) => (
|
||||
<ProjectCard project={project} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</Container>
|
||||
</Layout>
|
||||
</Layout>
|
|
@ -11,14 +11,18 @@ const authors = await getCollection('authors')
|
|||
<Layout title="Authors" description="A list of authors on this site.">
|
||||
<Container class="flex flex-col gap-y-6">
|
||||
<Breadcrumbs items={[{ label: 'Authors' }]} />
|
||||
<ul class="not-prose flex flex-col gap-4">
|
||||
{
|
||||
authors.map((author) => (
|
||||
<li>
|
||||
<AuthorCard author={author} />
|
||||
</li>
|
||||
))
|
||||
}
|
||||
</ul>
|
||||
{authors.length > 0 ? (
|
||||
<ul class="not-prose flex flex-col gap-4">
|
||||
{
|
||||
authors.map((author) => (
|
||||
<li>
|
||||
<AuthorCard author={author} />
|
||||
</li>
|
||||
))
|
||||
}
|
||||
</ul>
|
||||
) : (
|
||||
<p class="text-center text-muted-foreground">No authors found.</p>
|
||||
)}
|
||||
</Container>
|
||||
</Layout>
|
||||
|
|
|
@ -57,7 +57,7 @@ const authors = await parseAuthors(post.data.authors ?? [])
|
|||
<Layout
|
||||
title={post.data.title}
|
||||
description={post.data.description}
|
||||
image={post.data.image ?? '/static/1200x630.png'}
|
||||
image={post.data.image?.src ?? '/static/1200x630.png'}
|
||||
>
|
||||
<Container class="flex flex-col gap-y-6">
|
||||
<Breadcrumbs
|
||||
|
|
|
@ -9,13 +9,8 @@ export async function GET(context: APIContext) {
|
|||
(post) => !post.data.draft,
|
||||
)
|
||||
|
||||
// Filter posts by tag 'rss-feed'
|
||||
const filteredBlogs = blog.filter(
|
||||
(post) => post.data.tags && post.data.tags.includes('rss-feed'),
|
||||
)
|
||||
|
||||
// Sort posts by date
|
||||
const items = [...filteredBlogs].sort(
|
||||
const items = [...blog].sort(
|
||||
(a, b) =>
|
||||
new Date(b.data.date).valueOf() - new Date(a.data.date).valueOf(),
|
||||
)
|
||||
|
|
|
@ -38,12 +38,12 @@ export async function getStaticPaths() {
|
|||
>
|
||||
<Container class="flex flex-col gap-y-6">
|
||||
<Breadcrumbs items={[{ href: '/tags', label: 'Tags' }, { label: tag }]} />
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="flex items-center flex-wrap gap-2">
|
||||
<h1 class="text-3xl font-semibold">Posts tagged with</h1>
|
||||
<span
|
||||
class="flex items-center gap-x-1 rounded-full bg-secondary px-4 py-2 text-2xl font-medium"
|
||||
class="flex items-center gap-x-1 rounded-full bg-secondary px-4 py-2 text-2xl font-bold"
|
||||
>
|
||||
<Hash className="size-6" />{tag}
|
||||
<Hash className="size-6 -translate-x-0.5" strokeWidth={3} />{tag}
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex flex-col gap-y-4">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue