Skip to content

Commit

Permalink
Update: Fix layout for WQHD
Browse files Browse the repository at this point in the history
  • Loading branch information
Hayao0819 committed Mar 6, 2024
1 parent f294d1b commit 2d4704a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
5 changes: 2 additions & 3 deletions src/app/(hayao)/blog/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Metadata } from "next";

import { PostList as PostListElement, PostPageSwitch } from "@/components/layouts/blog/PostPreviewList";
import CommonSpacer from "@/components/layouts/CommonSpacer";
import { POSTLIST_ONEPAGE, SUMMARY_LENGTH } from "@/lib/blog/config";
import { fetchedBlogPostListWithoutHidden } from "@/lib/blog/post";
import { PostData } from "@/lib/markdown/post";
Expand All @@ -12,7 +11,7 @@ export default async function BlogTop({ params }: { params: { slug: string } })
const postlist = getPostList(slug);

return (
<CommonSpacer className="flex flex-col">
<div className="flex flex-col">
<div className="grow">
<PostListElement posts={postlist.posts} />
</div>
Expand All @@ -21,7 +20,7 @@ export default async function BlogTop({ params }: { params: { slug: string } })
currentPage={postlist.currentPage}
linktemplate={(page) => `/blog/${page}`}
/>
</CommonSpacer>
</div>
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/(hayao)/blog/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function BlogLayout({ children }: { children: React.ReactNode })

return (
<CommonSpacer className="md:flex md:gap-2">
<div className="md:w-9/12">{children}</div>
<div className="mx-auto md:w-9/12 xl:w-1/2">{children}</div>
<div className="flex flex-col gap-12 md:w-3/12 ">
{/* Categories */}
<div className={sectionClassName}>
Expand Down
8 changes: 1 addition & 7 deletions src/lib/markdown/postlist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,7 @@ export class PostList {
//includeDraft: boolean | undefined = undefined,
//includeHidden: boolean | undefined = undefined,
) {
if (this.fetched) {
return this;
}

//if (includeDraft === undefined) {
// includeDraft = process.env.NODE_ENV === "development";
//}
if (this.fetched) return this;

const files = getMdFilesInDir(dir);
//console.log(getMdFilesInDir(process.cwd()));
Expand Down

0 comments on commit 2d4704a

Please sign in to comment.