Commit 959a3d6

HPCesia <me@hpcesia.com>
2025-01-24 11:05:07
feat: improve layout
place the heading of categories and tags pages in the center of the page, and add a heading for each tag page.
1 parent efefab3
Changed files (3)
src
pages
archives
src/pages/archives/categories/index.astro
@@ -21,8 +21,8 @@ const uncategorizedPosts = allPosts.filter((post) => !post.data.category).slice(
 ---
 
 <MainLayout title={i18n(I18nKey.categories)}>
-  <div class="mx-auto max-w-screen-xl">
-    <h1 class="mb-8 text-3xl font-bold">{i18n(I18nKey.categories)}</h1>
+  <div class="mx-auto flex max-w-screen-xl flex-col items-center">
+    <h1 class="my-8 text-3xl font-bold">{i18n(I18nKey.categories)}</h1>
     <div class="relative flex flex-col">
       <div
         class="timeline absolute left-4 top-0 h-full w-0.5 bg-gradient-to-b from-blue-500 to-purple-500"
src/pages/archives/tags/[tag]/[page].astro
@@ -36,6 +36,9 @@ const { tag } = Astro.params;
 ---
 
 <GridLayout title={tag}>
+  <div class="mx-auto flex max-w-screen-xl flex-col items-center">
+    <h1 class="my-8 text-3xl font-bold">{tag}</h1>
+  </div>
   <PostPage posts={posts} currentPage={currentPage} baseUrl={`/archives/tags/${tag}`} />
   <Fragment slot="aside-fixed">
     <ProfileCard />
src/pages/archives/tags/index.astro
@@ -23,8 +23,8 @@ const untaggedPosts = allPosts
 ---
 
 <MainLayout title={i18n(I18nKey.tags)}>
-  <div class="mx-auto max-w-screen-xl">
-    <h1 class="mb-8 text-3xl font-bold">{i18n(I18nKey.tags)}</h1>
+  <div class="mx-auto flex max-w-screen-xl flex-col items-center">
+    <h1 class="my-8 text-3xl font-bold">{i18n(I18nKey.tags)}</h1>
     <div class="relative flex flex-col">
       <div
         class="timeline absolute left-4 top-0 h-full w-0.5 bg-gradient-to-b from-blue-500 to-purple-500"