chore: remove legacy mdx artifacts and dependencies
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 7s
Build & Deploy / 🧪 QA (push) Failing after 55s
Build & Deploy / 🏗️ Build (push) Has been skipped
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / ⚡ Performance & Accessibility (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 7s
Build & Deploy / 🧪 QA (push) Failing after 55s
Build & Deploy / 🏗️ Build (push) Has been skipped
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / ⚡ Performance & Accessibility (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
This commit is contained in:
12
lib/blog.ts
12
lib/blog.ts
@@ -38,7 +38,7 @@ export interface PostFrontmatter {
|
||||
public?: boolean;
|
||||
}
|
||||
|
||||
export interface PostMdx {
|
||||
export interface PostData {
|
||||
slug: string;
|
||||
frontmatter: PostFrontmatter;
|
||||
content: any; // Mapped to Lexical SerializedEditorState
|
||||
@@ -55,7 +55,7 @@ export function isPostVisible(post: { frontmatter: { date: string; public?: bool
|
||||
return !(postDate > now && config.isProduction);
|
||||
}
|
||||
|
||||
export async function getPostBySlug(slug: string, locale: string): Promise<PostMdx | null> {
|
||||
export async function getPostBySlug(slug: string, locale: string): Promise<PostData | null> {
|
||||
try {
|
||||
const payload = await getPayload({ config: configPromise });
|
||||
|
||||
@@ -104,7 +104,7 @@ export async function getPostBySlug(slug: string, locale: string): Promise<PostM
|
||||
}
|
||||
}
|
||||
|
||||
export async function getAllPosts(locale: string): Promise<PostMdx[]> {
|
||||
export async function getAllPosts(locale: string): Promise<PostData[]> {
|
||||
try {
|
||||
const payload = await getPayload({ config: configPromise });
|
||||
const isDev = process.env.NODE_ENV === 'development';
|
||||
@@ -155,7 +155,7 @@ export async function getAllPosts(locale: string): Promise<PostMdx[]> {
|
||||
}
|
||||
}
|
||||
|
||||
export async function getAllPostsMetadata(locale: string): Promise<Partial<PostMdx>[]> {
|
||||
export async function getAllPostsMetadata(locale: string): Promise<Partial<PostData>[]> {
|
||||
const posts = await getAllPosts(locale);
|
||||
return posts.map((p) => ({
|
||||
slug: p.slug,
|
||||
@@ -167,8 +167,8 @@ export async function getAdjacentPosts(
|
||||
slug: string,
|
||||
locale: string,
|
||||
): Promise<{
|
||||
prev: PostMdx | null;
|
||||
next: PostMdx | null;
|
||||
prev: PostData | null;
|
||||
next: PostData | null;
|
||||
isPrevRandom?: boolean;
|
||||
isNextRandom?: boolean;
|
||||
}> {
|
||||
|
||||
10
lib/pages.ts
10
lib/pages.ts
@@ -11,13 +11,13 @@ export interface PageFrontmatter {
|
||||
public?: boolean;
|
||||
}
|
||||
|
||||
export interface PageMdx {
|
||||
export interface PageData {
|
||||
slug: string;
|
||||
frontmatter: PageFrontmatter;
|
||||
content: any; // Lexical AST Document
|
||||
}
|
||||
|
||||
function mapDoc(doc: any): PageMdx {
|
||||
function mapDoc(doc: any): PageData {
|
||||
return {
|
||||
slug: doc.slug,
|
||||
frontmatter: {
|
||||
@@ -41,7 +41,7 @@ function mapDoc(doc: any): PageMdx {
|
||||
};
|
||||
}
|
||||
|
||||
export async function getPageBySlug(slug: string, locale: string): Promise<PageMdx | null> {
|
||||
export async function getPageBySlug(slug: string, locale: string): Promise<PageData | null> {
|
||||
try {
|
||||
const payload = await getPayload({ config: configPromise });
|
||||
|
||||
@@ -63,7 +63,7 @@ export async function getPageBySlug(slug: string, locale: string): Promise<PageM
|
||||
}
|
||||
}
|
||||
|
||||
export async function getAllPages(locale: string): Promise<PageMdx[]> {
|
||||
export async function getAllPages(locale: string): Promise<PageData[]> {
|
||||
try {
|
||||
const payload = await getPayload({ config: configPromise });
|
||||
|
||||
@@ -80,7 +80,7 @@ export async function getAllPages(locale: string): Promise<PageMdx[]> {
|
||||
}
|
||||
}
|
||||
|
||||
export async function getAllPagesMetadata(locale: string): Promise<Partial<PageMdx>[]> {
|
||||
export async function getAllPagesMetadata(locale: string): Promise<Partial<PageData>[]> {
|
||||
try {
|
||||
const payload = await getPayload({ config: configPromise });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user