mirror of
https://github.com/theoludwig/theoludwig.git
synced 2026-10-25 18:10:44 +01:00
chore: migrate from ESLint/Prettier to Oxc
This commit is contained in:
83 files changed
+2567
-4340
No files matched your search
@@ -4,14 +4,7 @@ import path from "node:path"
|
||||
import matter from "gray-matter"
|
||||
import type { BlogPost, FrontMatter } from "./BlogPost.tsx"
|
||||
|
||||
export const BLOG_POSTS_PATH = path.join(
|
||||
process.cwd(),
|
||||
"..",
|
||||
"..",
|
||||
"packages",
|
||||
"blog",
|
||||
"posts",
|
||||
)
|
||||
export const BLOG_POSTS_PATH = path.join(process.cwd(), "..", "..", "packages", "blog", "posts")
|
||||
|
||||
export const getBlogPosts = async (): Promise<BlogPost[]> => {
|
||||
const blogPosts = await fs.promises.readdir(BLOG_POSTS_PATH)
|
||||
@@ -48,9 +41,7 @@ export const getBlogPosts = async (): Promise<BlogPost[]> => {
|
||||
return blogPostsSortedByPublicationDate
|
||||
}
|
||||
|
||||
export const getBlogPostBySlug = async (
|
||||
slug: string,
|
||||
): Promise<BlogPost | undefined> => {
|
||||
export const getBlogPostBySlug = async (slug: string): Promise<BlogPost | undefined> => {
|
||||
const blogPosts = await getBlogPosts()
|
||||
const blogPost = blogPosts.find((blogPost) => {
|
||||
return blogPost.slug === slug
|
||||
|
||||
Reference in new issue
Block a user