Skip to content

Commit d7c8d2f

Browse files
committed
chore: improve site style
1 parent 244c1c1 commit d7c8d2f

File tree

5 files changed

+56
-66
lines changed

5 files changed

+56
-66
lines changed

app/globals.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
--chart-3: oklch(0.398 0.07 227.392);
7979
--chart-4: oklch(0.828 0.189 84.429);
8080
--chart-5: oklch(0.769 0.188 70.08);
81-
--radius: 0.5rem;
81+
--radius: 0.3rem;
8282
--sidebar: oklch(0.985 0 0);
8383
--sidebar-foreground: oklch(0.141 0.005 285.823);
8484
--sidebar-primary: oklch(0.21 0.006 285.885);
@@ -136,7 +136,7 @@
136136
}
137137

138138
body {
139-
@apply bg-background text-foreground;
139+
@apply bg-background text-primary/80;
140140
}
141141
}
142142

app/page.tsx

Lines changed: 43 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,59 @@
11
import type { Metadata } from "next";
2+
import Link from "next/link";
3+
import { cn } from "~/lib/utils";
24
import { getPostList } from "~/utils/postData";
35

4-
const desc = [
5-
{
6-
heading: "Platform",
7-
content: [
8-
'<a class="text-link" target="_blank" rel="noopener noreferrer" href="https://github.com/json-q">Github</a>',
9-
'<a class="text-link" target="_blank" rel="noopener noreferrer" href="https://gitee.com/jsonqi">Gitee</a>',
10-
'<a class="text-link" target="_blank" rel="noopener noreferrer" href="https://www.cnblogs.com/jsonq">博客园</a>(有意义的内容会同步)',
11-
],
12-
},
13-
{
14-
heading: "Feature",
15-
content: [
16-
"Nextjs + shadcn",
17-
"markdown 编写,rehype remark 等相关插件优化展示",
18-
"简单实现 markdown 编写保存时的页面 hmr",
19-
"Github Action 自动化部署",
20-
'<a class="text-link" target="_blank" rel="noopener noreferrer" href="https://jsonq.netlify.app">镜像站点</a> 托管 netlify',
21-
"pagefind 本地检索(pagefind 仅支持 SSG)",
22-
"优秀的性能和可访问性,Lighthouse 评分 95+(文章内容大小会影响 Performance)",
23-
],
24-
},
25-
];
26-
276
export const metadata: Metadata = {
287
title: "Home | Jsonq's Blog",
298
description: "基于 Nextjs 的博客, 简约, 专注于内容",
309
};
3110

11+
const titleCls = cn("my-4 font-semibold text-xl");
12+
const ulCls = cn("ml-4 list-disc [&>li]:ml-4");
13+
14+
const platform = [
15+
{ title: "Github", url: "https://github.com/json-q" },
16+
{ title: "Gitee", url: "https://gitee.com/jsonqi" },
17+
{ title: "博客园", url: "https://www.cnblogs.com/jsonq" },
18+
];
19+
3220
export default async function Home() {
3321
const postList = await getPostList();
3422

35-
const mergedDesc = [
36-
{
37-
heading: "Recently Updated",
38-
content: postList
39-
.slice(0, 5)
40-
.map((item) => `<a class="underline hover:text-link transition-colors" href=${item.url}>${item.title}</a>`),
41-
},
42-
...desc,
43-
];
44-
4523
return (
4624
<div className="py-8">
47-
<h1 className="mb-4 text-center font-extrabold text-4xl tracking-tight will-change-auto lg:text-5xl">
48-
Jsonq&apos;s Blog
49-
</h1>
50-
{mergedDesc.map((item) => (
51-
<div key={item.heading} className="px-4 md:px-12">
52-
<h2 className="my-4 font-semibold text-3xl tracking-tight">{item.heading}</h2>
53-
<ul className="list-disc [&>li]:ml-4">
54-
{item.content.map((content) => (
55-
<li className="py-1" key={content} dangerouslySetInnerHTML={{ __html: content }} />
56-
))}
57-
</ul>
58-
</div>
59-
))}
25+
<h1 className="mb-4 text-center font-extrabold text-3xl will-change-auto lg:text-4xl">Jsonq&apos;s Blog</h1>
26+
<div className="px-4 md:px-12">
27+
<h2 className={titleCls}>介绍</h2>
28+
<p className="indent-4">
29+
基于 Nextjs 的静态博客网站,托管于
30+
<Link rel="noopener noreferrer" target="_blank" href="https://netlify.com" className="ml-2 text-link">
31+
Netlify
32+
</Link>
33+
</p>
34+
35+
<h2 className={titleCls}>最新文章</h2>
36+
<ul className={ulCls}>
37+
{postList.slice(0, 5).map((item) => (
38+
<li className="py-1" key={item.slug}>
39+
<Link className="hover:underline" href={item.url}>
40+
{item.title}
41+
</Link>
42+
</li>
43+
))}
44+
</ul>
45+
46+
<h2 className={titleCls}>写作平台</h2>
47+
<ul className={ulCls}>
48+
{platform.map((item) => (
49+
<li className="py-1" key={item.title}>
50+
<Link rel="noopener noreferrer" target="_blank" className="text-link" href={item.url}>
51+
{item.title}
52+
</Link>
53+
</li>
54+
))}
55+
</ul>
56+
</div>
6057
</div>
6158
);
6259
}

components/layouts/page-header/doc-search.tsx

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,7 @@ import { addBasePath } from "next/dist/client/add-base-path";
44
import Link from "next/link";
55
import { useCallback, useDeferredValue, useEffect, useState } from "react";
66
import { Button } from "~/components/ui/button";
7-
import {
8-
Dialog,
9-
DialogContent,
10-
DialogDescription,
11-
DialogHeader,
12-
DialogTitle,
13-
DialogTrigger,
14-
} from "~/components/ui/dialog";
7+
import { Dialog, DialogContent, DialogDescription, DialogTitle, DialogTrigger } from "~/components/ui/dialog";
158
import { Input } from "~/components/ui/input";
169
import { ScrollArea } from "~/components/ui/scroll-area";
1710
import { useIsMobile } from "~/hooks/use-mobile";
@@ -123,7 +116,7 @@ export default function DocSearch() {
123116
{isMobile === false && (
124117
<Button
125118
variant="outline"
126-
className="relative h-8 w-full cursor-pointer justify-start rounded-[0.5rem] bg-muted/50 font-normal text-muted-foreground text-sm shadow-none sm:pr-12 md:w-32 lg:w-48 xl:w-56"
119+
className="relative h-8 w-full cursor-pointer justify-start rounded bg-muted/50 font-normal text-muted-foreground text-sm shadow-none sm:pr-12 md:w-32 lg:w-48 xl:w-56"
127120
>
128121
<Search className="h-16 w-16 shrink-0 opacity-50" />
129122
<span className="inline-flex">Search...</span>
@@ -134,11 +127,11 @@ export default function DocSearch() {
134127
)}
135128
</DialogTrigger>
136129
<DialogContent className="gap-0 p-0" hideCloseIcon>
137-
{/* Header 仅仅防止报错 */}
138-
<DialogHeader>
139-
<DialogTitle className="sr-only" aria-describedby="search-mask-title" />
140-
<DialogDescription className="sr-only" aria-describedby="search-mask-description" />
141-
</DialogHeader>
130+
{/* Only fix error and warning */}
131+
{/* https://stackoverflow.com/questions/78728117/shadcn-warning-missing-description-or-aria-describedby-undefined-for-dia */}
132+
<DialogTitle className="sr-only">
133+
<DialogDescription />
134+
</DialogTitle>
142135

143136
<div className="flex items-center border-b px-3">
144137
<Search className="mr-2 size-4 shrink-0 opacity-50" />

config/siteConfig.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ const siteConfig = {
1111
],
1212
externalLink: [
1313
{ icon: Github, title: "Github", href: "https://github.com/json-q/jsonq" },
14-
{ icon: Cnblog, title: "cnblog", href: "https://www.cnblogs.com/jsonq" },
14+
{ icon: Cnblog, title: "cnblog", href: "https://cnblogs.com/jsonq" },
1515
// { icon: Gitee, title: 'Gitee', href: 'https://gitee.com/jsonqi' },
1616
],
1717
footerLink: [
1818
{ icon: NextjsIcon, title: "Nextjs", href: "https://nextjs.org" },
19-
{ icon: JsDelivrIcon, title: "jsDelivr ", href: "https://www.jsdelivr.com" },
20-
{ icon: NetlifyIcon, title: "Netlify", href: "https://app.netlify.com" },
19+
{ icon: JsDelivrIcon, title: "jsDelivr ", href: "https://jsdelivr.com" },
20+
{ icon: NetlifyIcon, title: "Netlify", href: "https://netlify.com" },
2121
],
2222
metadata: {
2323
metadataBase: new URL(process.env.NEXT_PUBLIC_SITE_HOST!),

post/react/nextjs-problem.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Nextjs 部分问题汇总
2+
title: Nextjs windows 打包部分问题汇总
33
date: 2025-08-03
44
---
55

0 commit comments

Comments
 (0)