From 6b7faa105f43201f62872b0333515622e20fefad Mon Sep 17 00:00:00 2001 From: Alessandro Jean <14254807+alessandrojean@users.noreply.github.com> Date: Sun, 10 Sep 2023 18:23:49 -0300 Subject: [PATCH] Remove title header from the `news.json` file content (#56) * Remove title header from the `news.json` file content. * Fix regex to match only `h1`. --- website/src/.vitepress/config/hooks/generateFeed.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/website/src/.vitepress/config/hooks/generateFeed.ts b/website/src/.vitepress/config/hooks/generateFeed.ts index a3412ede..5491bb84 100644 --- a/website/src/.vitepress/config/hooks/generateFeed.ts +++ b/website/src/.vitepress/config/hooks/generateFeed.ts @@ -38,6 +38,7 @@ async function generateFeed(config: SiteConfig, hostname: string) { const markdown = (src ?? "") .replace(/^---.*---/s, "") .replace(/]\((\/.*?)\)/g, `](${hostname}$1)`) + .replace(/^# .*$/m, "") .trim() const post = {