💄 Better UX
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
.zoomist-wrapper {
|
||||
background: transparent !important;
|
||||
}
|
||||
|
@@ -29,6 +29,14 @@ const INFO_DIRECTORY: { [id: string]: InfoMeta } = {
|
||||
}
|
||||
};
|
||||
|
||||
export async function generateMetadata({ params }: { params: { id: string } }) {
|
||||
const info = INFO_DIRECTORY[params.id];
|
||||
|
||||
return {
|
||||
title: info?.title,
|
||||
}
|
||||
}
|
||||
|
||||
export default function InfoPage({ params }: { params: { id: string } }) {
|
||||
const info = INFO_DIRECTORY[params.id];
|
||||
|
||||
|
@@ -3,6 +3,18 @@ import { client } from "@/sanity/lib/client";
|
||||
import PostContent from "@/components/posts/PostContent";
|
||||
import Image from "next/image";
|
||||
|
||||
export async function generateMetadata({ params }: { params: { id: string } }) {
|
||||
const post = await client.fetch<any>(`*[_type == "post" && slug.current == $slug][0] {
|
||||
title, description
|
||||
}`, { slug: params.id });
|
||||
|
||||
|
||||
return {
|
||||
title: post.title,
|
||||
description: post.description
|
||||
};
|
||||
}
|
||||
|
||||
export default async function PostDetailPage({ params }: { params: { id: string } }) {
|
||||
const post = await client.fetch<any>(`*[_type == "post" && slug.current == $slug][0] {
|
||||
title, description, slug, body, author, publishedAt,
|
||||
|
@@ -3,6 +3,10 @@ import { client } from "@/sanity/lib/client";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
|
||||
export const metadata = {
|
||||
title: "博客"
|
||||
}
|
||||
|
||||
export default async function PostList() {
|
||||
const posts = await client.fetch<any[]>(`*[_type == "post"] {
|
||||
title, description, slug, author, publishedAt,
|
||||
|
Reference in New Issue
Block a user