Skip to content

Commit

Permalink
Merge pull request #708 from genedna/main
Browse files Browse the repository at this point in the history
Refactor blog of website module
  • Loading branch information
genedna authored Nov 30, 2024
2 parents a0f59e6 + 7ef898d commit 587953b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 188 deletions.
5 changes: 3 additions & 2 deletions aria/app/blog/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ import { notFound } from "next/navigation";
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
import { formatDate } from "@/lib/utils";
import Image from "next/image";
import type { Metadata } from 'next';

type PageProps = {
params: Promise<{ slug: string }>;
};

export async function generateMetadata(props: PageProps) {
export async function generateMetadata(props: PageProps): Promise<Metadata | null> {
const params = await props.params;

const {
Expand Down Expand Up @@ -69,7 +70,7 @@ export default async function BlogPage(props: PageProps) {
<div className="!w-full">
<div className="w-full mb-7">
<Image
src={res.frontmatter.cover}
src={`/contents/blogs/${slug}/cover.jpeg`}
alt="cover"
width={700}
height={400}
Expand Down
7 changes: 3 additions & 4 deletions aria/app/blog/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import Image from "next/image";
import Link from "next/link";

export const metadata: Metadata = {
title: "AriaDocs - Blog",
title: "Mega - Blog",
};

export default async function BlogIndexPage() {
const blogs = (await getAllBlogs()).sort(
(a, b) => stringToDate(b.date).getTime() - stringToDate(a.date).getTime()
(a, b) => stringToDate(b.date).getTime() - stringToDate(a.date).getTime(),
);
return (
<div className="w-full mx-auto flex flex-col gap-1 sm:min-h-[91vh] min-h-[88vh] pt-2">
Expand All @@ -37,7 +37,6 @@ function BlogCard({
title,
description,
slug,
cover,
authors,
}: BlogMdxFrontmatter & { slug: string }) {
return (
Expand All @@ -48,7 +47,7 @@ function BlogCard({
<h3 className="text-md font-semibold -mt-1 pr-7">{title}</h3>
<div className="w-full">
<Image
src={cover}
src={`/contents/blogs/${slug}/cover.jpeg`}
alt={title}
width={400}
height={150}
Expand Down
170 changes: 0 additions & 170 deletions aria/contents/blogs/file-rec.mdx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
---
title: "Using React Server Components and Server Actions in Next.js"
description: "Explore how to leverage React Server Components and Server Actions in Next.js to build modern, efficient web applications. Learn how these features enhance performance and simplify server-side logic."
date: 05-09-2024
title: "Why Rewrite Git Host Service with Rust Language"
description: ""
date: 24-12-2024
authors:
- avatar: "https://ui.shadcn.com/avatars/02.png"
handle: reactdev
username: React Dev
handleUrl: "https://github.com/reactdev"
- avatar: "https://ui.shadcn.com/avatars/01.png"
handle: nextjsguru
username: Next.js Guru
handleUrl: "https://github.com/nextjsguru"
cover: "https://img.freepik.com/premium-vector/many-monsters-various-colors-doodle-come-bless-birthday-happy_577083-85.jpg?w=826"
- avatar: "https://avatars.githubusercontent.com/u/76467?v=4&size=64"
handle: genedna
username: Quanyi Ma
handleUrl: "https://github.com/genedna"
cover: "contents/blogs/why-rewrite-git-host-service-with-rust-language/cover.jpg"
---

## Introduction: Enhancing Next.js with React Server Components
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

1 comment on commit 587953b

@vercel
Copy link

@vercel vercel bot commented on 587953b Nov 30, 2024

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

mega – ./

mega-gitmono.vercel.app
mega-git-main-gitmono.vercel.app
gitmega.dev
www.gitmega.dev

Please sign in to comment.