Skip to content
Merged
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
23 changes: 5 additions & 18 deletions apps/blog-platform/app/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Metadata } from "next";
import type { ComponentType } from "react";

Check warning on line 2 in apps/blog-platform/app/[slug]/page.tsx

View workflow job for this annotation

GitHub Actions / Quality & Testing

'ComponentType' is defined but never used

import Link from "next/link";
import Image from "next/image";
Expand All @@ -26,20 +26,7 @@

if (!page) notFound();

const data = page.data as unknown as {
title: string;
description: string;
author: string;
date: string;
info: {
path: string;
fullPath: string;
};
// eslint-disable-next-line @typescript-eslint/no-explicit-any
body: ComponentType<{ components: any }>;
};

const MDX = data.body;
const MDX = page.data.body;
const postUrl = `${siteConfig.url}/${params.slug}`;

return (
Expand All @@ -56,14 +43,14 @@
<ArrowLeft className="size-4" /> Back to Blog
</Link>

<PostActions title={data.title} url={postUrl} path={data.info.path} />
<PostActions title={page.data.title} url={postUrl} path={page.data.info.path} />
</nav>

<header className="relative mb-12 space-y-6 md:mb-14">
<div className="flex flex-wrap items-center gap-6 text-sm font-medium text-zinc-400">
<div className="flex items-center gap-2">
<Calendar className="size-4" />
{new Date(data.date).toLocaleDateString("en-US", {
{new Date(page.data.date).toLocaleDateString("en-US", {
month: "long",
day: "numeric",
year: "numeric",
Expand All @@ -80,11 +67,11 @@
</div>

<h1 className="text-foreground text-4xl leading-[1.1] font-bold tracking-tight sm:text-5xl md:text-6xl">
{data.title}
{page.data.title}
</h1>

<p className="text-muted max-w-3xl text-lg leading-relaxed font-medium md:text-xl">
{data.description}
{page.data.description}
</p>

<div className="flex items-center gap-4 pt-4">
Expand Down
4 changes: 2 additions & 2 deletions apps/blog-platform/app/not-found.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ const NotFound = () => {

<div className="mt-10 flex items-center justify-center gap-x-6">
<Button asChild variant="primary">
<Link href="/dashboard">Go back to Dashboard</Link>
<Link href="/">Go back to Home</Link>
</Button>

<Button asChild variant="ghost">
<Link href="/templates">View Templates</Link>
<Link href="/archive">View Blog Archives</Link>
</Button>
</div>
</Container>
Expand Down
13 changes: 1 addition & 12 deletions apps/blog-platform/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,9 @@ import { CTASection } from "../features/landing/components/CTASection";
import { FeaturedPost } from "../features/landing/components/FeaturedPost";

const BlogHome = () => {
const toBlogMeta = (data: unknown) =>
data as {
title: string;
description: string;
author: string;
date: string;
};

const allPosts = blog
.getPages()
.sort(
(a, b) =>
new Date(toBlogMeta(b.data).date).getTime() - new Date(toBlogMeta(a.data).date).getTime(),
);
.sort((a, b) => new Date(b.data.date).getTime() - new Date(a.data.date).getTime());

const featuredPost = allPosts[0];
const remainingPosts = allPosts.slice(1, 4);
Expand Down
4 changes: 0 additions & 4 deletions apps/blog-platform/collections.d.ts

This file was deleted.

6 changes: 5 additions & 1 deletion apps/blog-platform/lib/source.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import type { PageData } from "fumadocs-core/source";

import { loader } from "fumadocs-core/source";
import { toFumadocsSource } from "fumadocs-mdx/runtime/server";

import { blogPosts } from "collections/server";

type BlogPostPage = (typeof blogPosts)[number] & PageData;

export const blog = loader({
baseUrl: "/",
source: toFumadocsSource(blogPosts, []),
source: toFumadocsSource<BlogPostPage, never>(blogPosts as BlogPostPage[], []),
});
7 changes: 7 additions & 0 deletions apps/blog-platform/source.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import { z } from "zod";
import { defineCollections, defineConfig } from "fumadocs-mdx/config";

export const blogPosts = defineCollections({
type: "doc",
dir: "content/blog",
schema: z.object({
title: z.string(),
description: z.string(),
author: z.string(),
date: z.string().or(z.date()),
}),
});

export default defineConfig();
1 change: 1 addition & 0 deletions apps/docs-platform/content/docs/contributing/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ Your branch name should start with one of the following prefixes based on the wo
### Pre-commit Quality Verification

Before committing and pushing your changes, run automated scripts to ensure style guides and formats are preserved:

```bash
# Run typescript compilation and linter
npm run lint
Expand Down
4 changes: 1 addition & 3 deletions apps/studio/templates/cover-letter/professional/web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -538,9 +538,7 @@ export function buildProfessionalCoverLetterHtml(content: CoverLetterContent): s
*{box-sizing:border-box}body{margin:0;padding:32px 16px;background:#f4f4f5;color:${appearance.textColor};font-family:${fontFamily}}.page{width:794px;height:1123px;margin:0 auto 24px;overflow:hidden;background:${appearance.pageColor};color:${appearance.textColor};box-shadow:0 0 0 1px #e4e4e7;page-break-after:always}.page:last-child{page-break-after:auto}p{margin:0 0 ${appearance.paragraphSpacing}px;line-height:${appearance.lineHeight}}.label{color:${appearance.accentColor};font-size:10px;font-weight:700;letter-spacing:.22em;text-transform:uppercase}.body{margin-top:28px;font-size:15px}.body-list,.proof{background:#f4f4f5;margin:16px 0;padding:14px 18px 14px 28px;line-height:${appearance.lineHeight}}.proof li::marker{color:${appearance.accentColor}}.signature{font-weight:700}.postscript{border-top:1px solid #e4e4e7;padding-top:14px;color:#52525b}.continued{border-bottom:1px solid #dbe4f0;padding-bottom:20px;color:#64748b;font-size:10px;font-weight:700;letter-spacing:.22em;text-transform:uppercase}.professional-page{padding:${appearance.pageMargin}px}.professional-page header{display:grid;grid-template-columns:1fr 230px;gap:32px;border-bottom:2px solid #09090b;padding-bottom:28px}.professional-page h1{margin:0;font-size:34px;line-height:1.1}.professional-page .contact{text-align:right;color:#52525b}.professional-page .contact a{display:block;color:#09090b;font-weight:600;text-underline-offset:4px}.professional-page .meta{display:grid;grid-template-columns:1fr 180px;gap:32px;margin-top:36px;color:#3f3f46}.professional-page .subject{border-top:1px solid #e4e4e7;border-bottom:1px solid #e4e4e7;margin-top:32px;padding:16px 0}.professional-page h2{margin:8px 0 0;font-size:20px}@media print{body{padding:0;background:white}.page{box-shadow:none;margin:0}}</style></head><body>${pages
.map((blocks, pageIndex) => {
const first = pageIndex === 0;
const body = blocks
.map((item) => renderProfessionalHtmlItem(item))
.join("");
const body = blocks.map((item) => renderProfessionalHtmlItem(item)).join("");
return `<article class="page professional-page">${first ? `<header><div><h1>${escapeHtml(senderName)}</h1><p>${escapeHtml(senderTitle)}</p></div><div class="contact">${contact.map((item) => `<p>${escapeHtml(item)}</p>`).join("")}${renderedLinks.map((link) => `<a href="${escapeHtml(normalizeLinkHref(link.url))}">${escapeHtml(getLinkDisplayText(link, linkDisplayMode))}</a>`).join("")}</div></header><section class="meta"><div>${recipient.map((line) => `<p>${escapeHtml(line)}</p>`).join("")}</div><p>${escapeHtml(content.date)}</p></section><section class="subject"><p class="label">Re</p><h2>${subject}</h2></section>` : `<p class="continued">Cover Letter Continued</p>`}<main class="body">${body}</main></article>`;
})
.join("")}</body></html>`;
Expand Down
Loading
Loading