Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions app/api/revalidate/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { revalidatePath, revalidateTag } from "next/cache";
import { NextRequest, NextResponse } from "next/server";
import {revalidatePath, revalidateTag} from "next/cache";
import {NextRequest, NextResponse} from "next/server";

export const maxDuration = 30;

Expand Down Expand Up @@ -39,32 +39,32 @@ export async function POST(request: NextRequest) {
);

// Revalidate specific content type tags
revalidateTag("wordpress");
revalidateTag("wordpress", "max");

if (contentType === "post") {
revalidateTag("posts");
revalidateTag("posts", "max");
if (contentId) {
revalidateTag(`post-${contentId}`);
revalidateTag(`post-${contentId}`, "max");
}
// Clear all post pages when any post changes
revalidateTag("posts-page-1");
revalidateTag("posts-page-1", "max");
} else if (contentType === "category") {
revalidateTag("categories");
revalidateTag("categories", "max");
if (contentId) {
revalidateTag(`posts-category-${contentId}`);
revalidateTag(`category-${contentId}`);
revalidateTag(`posts-category-${contentId}`, "max");
revalidateTag(`category-${contentId}`, "max");
}
} else if (contentType === "tag") {
revalidateTag("tags");
revalidateTag("tags", "max");
if (contentId) {
revalidateTag(`posts-tag-${contentId}`);
revalidateTag(`tag-${contentId}`);
revalidateTag(`posts-tag-${contentId}`, "max");
revalidateTag(`tag-${contentId}`, "max");
}
} else if (contentType === "author" || contentType === "user") {
revalidateTag("authors");
revalidateTag("authors", "max");
if (contentId) {
revalidateTag(`posts-author-${contentId}`);
revalidateTag(`author-${contentId}`);
revalidateTag(`posts-author-${contentId}`, "max");
revalidateTag(`author-${contentId}`, "max");
}
}

Expand Down
139 changes: 75 additions & 64 deletions app/globals.css
Original file line number Diff line number Diff line change
@@ -1,69 +1,80 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
:root {
--background: 0 0% 100%;
--foreground: 0 0% 3.9%;

--card: 0 0% 100%;
--card-foreground: 0 0% 3.9%;

--popover: 0 0% 100%;
--popover-foreground: 0 0% 3.9%;

--primary: 0 0% 9%;
--primary-foreground: 0 0% 98%;

--secondary: 0 0% 96.1%;
--secondary-foreground: 0 0% 9%;

--muted: 0 0% 96.1%;
--muted-foreground: 0 0% 45.1%;

--accent: 0 0% 96.1%;
--accent-foreground: 0 0% 9%;

--destructive: 0 84.2% 60.2%;
--destructive-foreground: 0 0% 98%;

--border: 0 0% 89.8%;
--input: 0 0% 89.8%;
--ring: 0 0% 3.9%;

--radius: 0.5rem;
}

.dark {
--background: 0 0% 3.9%;
--foreground: 0 0% 98%;

--card: 0 0% 3.9%;
--card-foreground: 0 0% 98%;

--popover: 0 0% 3.9%;
--popover-foreground: 0 0% 98%;

--primary: 0 0% 98%;
--primary-foreground: 0 0% 9%;

--secondary: 0 0% 14.9%;
--secondary-foreground: 0 0% 98%;

--muted: 0 0% 14.9%;
--muted-foreground: 0 0% 63.9%;

--accent: 0 0% 14.9%;
--accent-foreground: 0 0% 98%;
@import "tailwindcss";
@import "tw-animate-css";
@plugin "@tailwindcss/typography";

@variant dark (&:is(.dark *));

@theme inline {
/* Border Radius */
--radius-sm:calc(var(--radius) - 4px);
--radius-md:calc(var(--radius) - 2px);
--radius-lg:var(--radius);

/* Color mappings */
--color-background:var(--background);
--color-foreground:var(--foreground);
--color-card:var(--card);
--color-card-foreground:var(--card-foreground);
--color-popover:var(--popover);
--color-popover-foreground:var(--popover-foreground);
--color-primary:var(--primary);
--color-primary-foreground:var(--primary-foreground);
--color-secondary:var(--secondary);
--color-secondary-foreground:var(--secondary-foreground);
--color-muted:var(--muted);
--color-muted-foreground:var(--muted-foreground);
--color-accent:var(--accent);
--color-accent-foreground:var(--accent-foreground);
--color-destructive:var(--destructive);
--color-destructive-foreground:var(--destructive-foreground);
--color-border:var(--border);
--color-input:var(--input);
--color-ring:var(--ring);
}

--destructive: 0 62.8% 30.6%;
--destructive-foreground: 0 0% 98%;
:root {
--radius:0.5rem;
--background:oklch(100% 0 0);
--foreground:oklch(9.26% 0 0);
--card:oklch(100% 0 0);
--card-foreground:oklch(9.26% 0 0);
--popover:oklch(100% 0 0);
--popover-foreground:oklch(9.26% 0 0);
--primary:oklch(15.35% 0 0);
--primary-foreground:oklch(98.78% 0 0);
--secondary:oklch(96.76% 0 0);
--secondary-foreground:oklch(15.35% 0 0);
--muted:oklch(96.76% 0 0);
--muted-foreground:oklch(52.89% 0 0);
--accent:oklch(96.76% 0 0);
--accent-foreground:oklch(15.35% 0 0);
--destructive:oklch(62.8% 0.257 29.23);
--destructive-foreground:oklch(98.78% 0 0);
--border:oklch(92.7% 0 0);
--input:oklch(92.7% 0 0);
--ring:oklch(9.26% 0 0);
}

--border: 0 0% 14.9%;
--input: 0 0% 14.9%;
--ring: 0 0% 83.1%;
}
.dark {
--background:oklch(9.26% 0 0);
--foreground:oklch(98.78% 0 0);
--card:oklch(9.26% 0 0);
--card-foreground:oklch(98.78% 0 0);
--popover:oklch(9.26% 0 0);
--popover-foreground:oklch(98.78% 0 0);
--primary:oklch(98.78% 0 0);
--primary-foreground:oklch(15.35% 0 0);
--secondary:oklch(20.27% 0 0);
--secondary-foreground:oklch(98.78% 0 0);
--muted:oklch(20.27% 0 0);
--muted-foreground:oklch(68.97% 0 0);
--accent:oklch(20.27% 0 0);
--accent-foreground:oklch(98.78% 0 0);
--destructive:oklch(38.11% 0.161 29.23);
--destructive-foreground:oklch(98.78% 0 0);
--border:oklch(20.27% 0 0);
--input:oklch(20.27% 0 0);
--ring:oklch(86.78% 0 0);
}

@layer base {
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@
"react-hook-form": "^7.58.1",
"react-wrap-balancer": "^1.1.1",
"tailwind-merge": "^2.6.0",
"tailwindcss-animate": "^1.0.7",
"use-debounce": "^10.0.5",
"zod": "^3.25.67"
},
"devDependencies": {
"@tailwindcss/postcss": "^4.1.16",
"@tailwindcss/typography": "^0.5.16",
"@types/node": "^20.19.1",
"@types/react": "^18.3.23",
"@types/react-dom": "^18.3.7",
"autoprefixer": "^10.4.21",
"eslint": "^9.29.0",
"eslint-config-next": "^15.3.4",
"postcss": "^8.5.6",
"tailwindcss": "^3.4.17",
"tailwindcss": "^4.1.16",
"tw-animate-css": "^1.4.0",
"typescript": "^5.8.3"
}
}
}
Loading