Skip to content
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
48 changes: 27 additions & 21 deletions apps/website/app/blog/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,33 @@ export default async function BlogIndex() {
</div>
<div>
<ul className="space-y-6">
{blogs.map((blog) => (
<li
key={blog.slug}
className="flex items-start justify-between border-b border-gray-200 pb-4 last:border-b-0"
>
<div className="w-4/5">
<Link
href={`/blog/${blog.slug}`}
className="block text-2xl font-semibold text-blue-600 hover:underline"
>
{blog.title}
</Link>
<p className="mt-2 text-sm italic text-gray-500">
{blog.date}
</p>
</div>
<div className="w-1/5 text-right text-gray-600">
by {blog.author}
</div>
</li>
))}
{blogs.length === 0 ? (
<p className="text-left text-lg text-gray-600">
No updates yet! Check back soon. 😊
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved this here because this page is still accessible directly and will likely get indexed by the search engines

</p>
) : (
blogs.map((blog) => (
<li
key={blog.slug}
className="flex items-start justify-between border-b border-gray-200 pb-4 last:border-b-0"
>
<div className="w-4/5">
<Link
href={`/blog/${blog.slug}`}
className="block text-2xl font-semibold text-blue-600 hover:underline"
>
{blog.title}
</Link>
<p className="mt-2 text-sm italic text-gray-500">
{blog.date}
</p>
</div>
<div className="w-1/5 text-right text-gray-600">
by {blog.author}
</div>
</li>
))
)}
</ul>
</div>
</div>
Expand Down
28 changes: 16 additions & 12 deletions apps/website/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { PostHogProvider } from "./providers";
import Link from "next/link";
import Image from "next/image";
import { Inter } from "next/font/google";
import { getAllBlogs } from "./blog/readBlogs";

export const metadata: Metadata = {
title: "Discourse Graphs | A Tool for Collaborative Knowledge Synthesis",
Expand All @@ -23,11 +24,12 @@ export const metadata: Metadata = {

const inter = Inter({ subsets: ["latin"] });

export default function RootLayout({
export default async function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
const hasUpdates = !!(await getAllBlogs()).length;
return (
<html lang="en">
<body className={`antialiased`}>
Expand All @@ -54,20 +56,22 @@ export default function RootLayout({
"About",
"Resources",
"Events",
"Updates",
hasUpdates && "Updates",
"Talks",
"Supporters",
"Contact",
].map((item) => (
<li key={item}>
<Link
href={`/#${item.toLowerCase()}`} // Ensures absolute path with root `/`
className="text-neutral-dark hover:text-neutral-dark/60"
>
{item}
</Link>
</li>
))}
]
.filter((item): item is string => Boolean(item))
.map((item) => (
<li key={item}>
<Link
href={`/#${item.toLowerCase()}`} // Ensures absolute path with root `/`
className="text-neutral-dark hover:text-neutral-dark/60"
>
{item}
</Link>
</li>
))}
</ul>
</nav>
</header>
Expand Down
96 changes: 43 additions & 53 deletions apps/website/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,6 @@ export default async function Home() {
Resources
</CardTitle>
</CardHeader>

{/* <h2 ></h2> */}

<CardContent>
<ul className="list-inside list-disc space-y-2">
<li className="text-neutral-dark">
Expand Down Expand Up @@ -423,58 +420,51 @@ export default async function Home() {
</CardContent>
</Card>
{/* Blog Section */}
<Card id="updates" className="rounded-xl bg-white/50 p-8 shadow-md">
<CardHeader>
<CardTitle className="mb-8 text-4xl font-bold text-primary">
Latest Updates
</CardTitle>
</CardHeader>
<CardContent>
<div className="space-y-6">
{blogs.length > 0 ? (
<>
<ul className="space-y-6">
{blogs.map((blog) => (
<li
key={blog.slug}
className="flex items-start justify-between border-b border-gray-200 pb-4 last:border-b-0"
>
<div className="w-4/5">
<Link
href={`/blog/${blog.slug}`}
className="block text-2xl font-semibold text-blue-600 hover:underline"
>
{blog.title}
</Link>
<p className="mt-2 text-sm italic text-gray-500">
{blog.date}
</p>
</div>
<div className="w-1/5 text-right text-gray-600">
by {blog.author}
</div>
</li>
))}
</ul>

<div className="mt-6 text-center">
<Link
href="/blog"
className="inline-block rounded-md bg-primary px-4 py-2 text-lg font-semibold text-white transition hover:text-white"
{blogs.length > 0 && (
<Card id="updates" className="rounded-xl bg-white/50 p-8 shadow-md">
<CardHeader>
<CardTitle className="mb-8 text-4xl font-bold text-primary">
Latest Updates
</CardTitle>
</CardHeader>
<CardContent>
<div className="space-y-6">
<ul className="space-y-6">
{blogs.map((blog) => (
<li
key={blog.slug}
className="flex items-start justify-between border-b border-gray-200 pb-4 last:border-b-0"
>
See All Updates →
</Link>
</div>
</>
) : (
<p className="text-left text-lg text-gray-600">
No updates yet! Check back soon. 😊
</p>
)}
</div>
</CardContent>
</Card>
<div className="w-4/5">
<Link
href={`/blog/${blog.slug}`}
className="block text-2xl font-semibold text-blue-600 hover:underline"
>
{blog.title}
</Link>
<p className="mt-2 text-sm italic text-gray-500">
{blog.date}
</p>
</div>
<div className="w-1/5 text-right text-gray-600">
by {blog.author}
</div>
</li>
))}
</ul>

<div className="mt-6 text-center">
<Link
href="/blog"
className="inline-block rounded-md bg-primary px-4 py-2 text-lg font-semibold text-white transition hover:text-white"
>
See All Updates →
</Link>
</div>
</div>
</CardContent>
</Card>
)}
{/* Talks */}
<Card id="talks" className="rounded-xl bg-white/50 p-8 shadow-md">
<CardHeader>
Expand Down