diff --git a/README.md b/README.md index e215bc4..ee36585 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,20 @@ -This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). +# How to post news -## Getting Started +1. Create a new markdown file in the `news` directory, name it chronologically like `2025-04-16-
- {description} -
-- written by {authors.join(", ")} -
+{description}
+written by {authors.join(", ")}
{news.description}
{news.date}
+
The best open source Minecraft client
diff --git a/src/lib/news.ts b/src/lib/news.ts index ece6a12..3121270 100644 --- a/src/lib/news.ts +++ b/src/lib/news.ts @@ -1,4 +1,5 @@ import { readdirSync, readFileSync } from "fs"; +import smartSplit from "./smartSplit"; export interface News { authors: string[]; @@ -22,7 +23,7 @@ export function parseNews(news: string, id: string): News { }; content.split("\n").forEach((v) => { - const [key, value] = v.split(":").map((v) => v.trim()); + const [key, value] = smartSplit(v, ":", 2).map((v) => v.trim()); if (key === "authors") { params.authors = value.split(",").map((v) => v.trim()); } else if (