Skip to content

Commit

Permalink
优化排版
Browse files Browse the repository at this point in the history
  • Loading branch information
white0dew committed Sep 30, 2024
1 parent 77c1f46 commit 98b83a0
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 49 deletions.
17 changes: 8 additions & 9 deletions app/s/[...slug]/components/ArticleSlide.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ChapterList, ElogCacheData } from "@/lib/elog";
import { mylog } from "@/lib/utils";
import { ElogChapter } from "@/types/elog";

// 假定 chapters 是整个章节树的根节点数组
Expand Down Expand Up @@ -53,40 +54,38 @@ function findChapters(
// 假定您的UI组件
export function ArticleSlideLinks({ path }: { path: string }) {
const { prev, next } = findChapters(ChapterList, path);

mylog(process.env.NODE_ENV);
return (
<div
className="flex flex-row justify-between
px-auto
rounded-sm
bg-slate-100 p-8 dark:bg-slate-800
bg-slate-50 p-8 dark:bg-slate-800
text-center
lg:text-xl"
>
{prev ? (
<div
className=" self-start min-w-8 py-6 px-2 bg-gray-200 dark:bg-gray-800 rounded-md hover:bg-gray-400
className=" self-start min-w-8 py-6 px-2 bg-gray-100 dark:bg-gray-800 rounded-md hover:bg-gray-200
hover:dark:bg-gray-400"
>
{" "}
<span>{"< "}</span>
<a href={prev.url}>{prev.title}</a>
<span>👈</span>
</div>
) : (
<span />
)}

{next ? (
<div
className=" self-end min-w-8 py-6 px-2 bg-gray-200 dark:bg-gray-800 rounded-md hover:bg-gray-400
className=" self-end min-w-8 py-6 px-2 bg-gray-100 dark:bg-gray-800 rounded-md hover:bg-gray-200
hover:dark:bg-gray-400"
>
{" "}
<span>👉</span>{" "}
<a href={next.url} className="">
{next.title}
</a>
</a>{" "}
<span>{">"}</span>{" "}
</div>
) : (
<span />
Expand Down
2 changes: 1 addition & 1 deletion app/s/[...slug]/components/SideChapterList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function SidebarItem({ chapter }: { chapter: ElogChapter }) {
</CollapsibleTrigger>

{chapter.children && (
<CollapsibleContent className="ml-2 space-y-1 line-clamp-2">
<CollapsibleContent className="ml-2 space-y-1 line-clamp-2 border-l-2 border-blue-900">
{chapter.children.map((child) => (
<SidebarItem key={child.urlname} chapter={child} />
))}
Expand Down
60 changes: 30 additions & 30 deletions assets/css/toc.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions components/nav/WebNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
import Link from "next/link";
import { cn } from "@/lib/utils";
import { useParams, usePathname } from "next/navigation";
import { Badge } from "../ui/badge";

// 假设这是从哪里获取的章节数据
const chapters: ElogChapter[] = [
Expand All @@ -29,7 +28,7 @@ export default function Navigation({ chapters }: { chapters: ElogChapter[] }) {
return (
<NavigationMenu
delayDuration={200}
className="hidden md:flex text-lg mr-10 md:mr-64"
className="hidden md:flex mr-10 md:mr-32 xl:mr-64"
>
<NavigationMenuList className=" space-x-3 ">
{/* 有子目录的情况 */}
Expand All @@ -42,9 +41,9 @@ export default function Navigation({ chapters }: { chapters: ElogChapter[] }) {
<NavigationMenuTrigger
className={cn(
`${path.includes(chapter.url) ? "bg-slate-300" : ""}`,
"px-2 py-5 text-md",
"px-2 py-2 text-md",
"shadow-lg",
" border-2"
"border-2"
)}
>
{chapter.title}
Expand All @@ -64,7 +63,7 @@ export default function Navigation({ chapters }: { chapters: ElogChapter[] }) {
<NavigationMenuLink
className={cn(
navigationMenuTriggerStyle(),
"h-full text-sm w-full font-semibold border-solid border-b-2 border-sky-500"
"h-full text-sm w-full font-semibold rounded-b-none border-solid border-b-2 border-sky-800"
)}
>
{child.title}
Expand Down
6 changes: 3 additions & 3 deletions public/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,7 @@
<loc>https://offernow.cn/s/language/vue3/ebxce1ws74y0t8tq</loc>
<changefreq>weekly</changefreq>
<priority>0.5</priority>
<lastmod>2024-09-28T14:14:13.929Z</lastmod>
<lastmod>2024-09-30T07:10:17.986Z</lastmod>
</url>
<url>
<loc>https://offernow.cn/s/language/vue3/ecpzrwpgo9ugf2bb</loc>
Expand Down Expand Up @@ -1774,7 +1774,7 @@
<loc>https://offernow.cn/s/cs_base/os/hand_os/vpcarog0vdzlbgx3</loc>
<changefreq>weekly</changefreq>
<priority>0.5</priority>
<lastmod>2024-09-28T14:14:13.933Z</lastmod>
<lastmod>2024-09-30T07:10:17.988Z</lastmod>
</url>
<url>
<loc>https://offernow.cn/s/cs_base/os/hand_os/ho88cbpxgbc2gpnf</loc>
Expand Down Expand Up @@ -2710,7 +2710,7 @@
<loc>https://offernow.cn/s/interview/chat_view/20244/lgawhfx8pq2slyko</loc>
<changefreq>weekly</changefreq>
<priority>0.5</priority>
<lastmod>2024-09-28T14:14:13.937Z</lastmod>
<lastmod>2024-09-30T07:10:17.991Z</lastmod>
</url>
<url>
<loc>https://offernow.cn/s/interview/chat_view/20244/iv993phgec0ybt41</loc>
Expand Down
2 changes: 1 addition & 1 deletion tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const config = {
},
debugScreens: {
position: ["bottom", "right"],
ignore: ["dark"],
// ignore: ["dark"],
},
container: {
center: true,
Expand Down

0 comments on commit 98b83a0

Please sign in to comment.