Skip to content

Commit

Permalink
feat: friend page with md added #13
Browse files Browse the repository at this point in the history
  • Loading branch information
ZL-Asica committed Oct 20, 2024
1 parent 0ccd041 commit b626aec
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/app/friends/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from 'react';
import type { Metadata } from 'next';
import { getConfig } from '@/services/getConfig';

const config = getConfig();

export const metadata: Metadata = {
title: `Friends - ${config.title}`,
description: `Friends page of ${config.title} - ${config.description}`,
openGraph: {
title: `Friends - ${config.title}`,
description: `Friends page of ${config.title} - ${config.description}`,
type: 'website',
locale: config.lang,
},
};

export default function FriendsLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return <>{children}</>;
}
11 changes: 11 additions & 0 deletions src/app/friends/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { getPostData } from '@/services/posts';
import { PostData } from '@/types';
import PostLayout from '@/components/layout/PostLayout';
import { getConfig } from '@/services/getConfig';

export default async function FriendsPage() {
const post: PostData = await getPostData('Friends', 'Friends');
const config = getConfig();

return <PostLayout post={post} showThumbnail={config.thumbnailFriends} />;
}
2 changes: 2 additions & 0 deletions src/components/common/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
FaRegNewspaper,
FaBars,
FaAngleUp,
FaPeopleGroup,
} from 'react-icons/fa6';
import { useState, useRef, useEffect } from 'react';

Expand All @@ -29,6 +30,7 @@ export default function Header({ siteTitle }: { siteTitle: string }) {
const menuItems = [
{ href: '/', label: 'Home', icon: <FaHouse /> },
{ href: '/posts', label: 'Posts', icon: <FaRegNewspaper /> },
{ href: '/friends', label: 'Friends', icon: <FaPeopleGroup /> },
{ href: '/about', label: 'About', icon: <FaInfo /> },
];

Expand Down
29 changes: 29 additions & 0 deletions src/posts/_pages/Friends.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: ''
thumbnail: '' # (Optional) You can put your personal about thumbnail
showComments: false # Set whether you want have comment for this page
---

## 我的项目

## 友情链接

> 下面全是大佬!!!同样也都是朋友~~~
## 添加友链

可以直接在下面评论区,使用如下格式留言,方便我复制粘贴。
只要我在你的页面中看到了我的链接且你的链接没有问题,我会第一时间添加!

```json
{
"title": "ZLA小站",
"link": "https://www.zla.pub/",
"img": "https://cdn.v2ex.com/gravatar/cba8b28739dd6225f6fe961762bdb0b71b858d68c83d946a37cee3b0e0daece5?size=512",
"des": "不要哭,不要笑,不要恨,要理解。"
}
```

需要更新头像或者链接请留言,有时间会处理的。若没有及时处理请给我发邮件催一下,邮箱是zl at zla dot moe。

</br></br></br></br>
1 change: 1 addition & 0 deletions src/services/getConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export type Config = {
rss: string;
};
thumbnailAbout: boolean;
thumbnailFriends: boolean;
disqusShortname: string;
scriptSlotHeader: string[];
scriptSlotFooter: string[];
Expand Down

0 comments on commit b626aec

Please sign in to comment.