Skip to content

Commit f57d8d4

Browse files
himself65Copilot
andauthored
Update apps/site/next-data/providers/blogData.ts
Co-authored-by: Copilot <[email protected]> Signed-off-by: Alex Yang <[email protected]>
1 parent bd68979 commit f57d8d4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/site/next-data/providers/blogData.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ const blogPosts = cache(() =>
1010
);
1111

1212
const extractVersionFromTitle = (title: string): string | null => {
13-
const match = title.match(/v(\d+\.\d+\.\d+)/);
14-
return match ? match[1] : null;
13+
const versionMatch = title.match(/v?(\d+\.\d+\.\d+(-[\w.-]+)?(\+[\w.-]+)?)/);
14+
return versionMatch && semver.valid(versionMatch[0]) ? versionMatch[0] : null;
1515
};
1616

1717
export const provideBlogPosts = cache(

0 commit comments

Comments
 (0)