build!: upgrade to Tailwind CSS v4

This commit is contained in:
satnaing
2025-02-25 20:35:00 +07:00
committed by Sat Naing
parent 360278277d
commit 172e14b5f4
36 changed files with 7631 additions and 10633 deletions
+29 -24
View File
@@ -1,12 +1,12 @@
---
import { getCollection } from "astro:content";
import Card from "@components/Card";
import Footer from "@components/Footer.astro";
import Header from "@components/Header.astro";
import { SITE } from "@config";
import Layout from "@layouts/Layout.astro";
import Main from "@layouts/Main.astro";
import getPostsByGroupCondition from "@utils/getPostsByGroupCondition";
import Main from "@/layouts/Main.astro";
import Layout from "@/layouts/Layout.astro";
import Header from "@/components/Header.astro";
import Footer from "@/components/Footer.astro";
import Card from "@/components/Card";
import getPostsByGroupCondition from "@/utils/getPostsByGroupCondition";
import { SITE } from "@/config";
// Redirect to 404 page if `showArchives` config is false
if (!SITE.showArchives) {
@@ -15,24 +15,26 @@ if (!SITE.showArchives) {
const posts = await getCollection("blog", ({ data }) => !data.draft);
const MonthMap: Record<string, string> = {
"1": "January",
"2": "February",
"3": "March",
"4": "April",
"5": "May",
"6": "June",
"7": "July",
"8": "August",
"9": "September",
"10": "October",
"11": "November",
"12": "December",
};
const months = [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
];
const backUrl = SITE.showBackButton ? `?from=${Astro.url.pathname}` : "/";
---
<Layout title={`Archives | ${SITE.title}`}>
<Header activeNav="archives" />
<Header />
<Main pageTitle="Archives" pageDesc="All the articles I've archived.">
{
Object.entries(
@@ -55,7 +57,7 @@ const MonthMap: Record<string, string> = {
.map(([month, monthGroup]) => (
<div class="flex flex-col sm:flex-row">
<div class="mt-6 min-w-36 text-lg sm:my-6">
<span class="font-bold">{MonthMap[month]}</span>
<span class="font-bold">{months[Number(month) - 1]}</span>
<sup class="text-xs">{monthGroup.length}</sup>
</div>
<ul>
@@ -70,7 +72,10 @@ const MonthMap: Record<string, string> = {
)
)
.map(({ data, id }) => (
<Card href={`/posts/${id}`} frontmatter={data} />
<Card
href={`/posts/${id}${backUrl}`}
frontmatter={data}
/>
))}
</ul>
</div>