Optimizations + minor cleanups
All checks were successful
Docker Deploy / build-and-push (push) Successful in 4m15s

This commit is contained in:
2025-12-18 00:30:01 -07:00
parent 203f83bfcb
commit 70ee8a2c42
11 changed files with 190 additions and 227 deletions

View File

@@ -6,23 +6,14 @@ export const GET: APIRoute = async () => {
const posts = await getCollection('posts');
// Get the raw content from each post
const postsWithContent = await Promise.all(
posts.map(async (post) => {
const { Content } = await post.render();
// Get the raw markdown content by reading the file
const rawContent = post.body;
return {
slug: post.slug,
title: post.data.title,
description: post.data.description,
pubDate: post.data.pubDate.toISOString().split('T')[0],
tags: post.data.tags || [],
content: rawContent
};
})
);
const postsWithContent = posts.map((post) => ({
slug: post.slug,
title: post.data.title,
description: post.data.description,
pubDate: post.data.pubDate.toISOString().split('T')[0],
tags: post.data.tags || [],
content: post.body
}));
return new Response(JSON.stringify(postsWithContent), {
status: 200,

View File

@@ -3,7 +3,6 @@ import { config } from "../../../config";
import * as TOML from "@iarna/toml";
import { renderToStream } from "@react-pdf/renderer";
import { ResumeDocument } from "../../../pdf/ResumeDocument";
import React from "react";
async function getSimpleIconPath(iconName: string): Promise<string> {
try {