feat: add FrontMatter CMS, biome, translation, etc.

* add Frontmatter CMS

* add biome

* update

* update

* fixed & add docs

* fix translation.ts

* fix translation
This commit is contained in:
L4Ph authored and GitHub committed 2024-01-21 12:54:41 +08:00
1 parent f9a78b3e3b
commit 197d524b53
42 files changed
+2714 -12795

No files matched your search

+9 -13
View File
@@ -1,24 +1,20 @@
export function pathsEqual(path1: string, path2: string) {
const normalizedPath1 = path1.replace(/^\/|\/$/g, '').toLowerCase();
const normalizedPath2 = path2.replace(/^\/|\/$/g, '').toLowerCase();
return normalizedPath1 === normalizedPath2;
const normalizedPath1 = path1.replace(/^\/|\/$/g, '').toLowerCase()
const normalizedPath2 = path2.replace(/^\/|\/$/g, '').toLowerCase()
return normalizedPath1 === normalizedPath2
}
function joinUrl(...parts: string[]): string {
const joined = parts.join('/');
return joined.replace(/([^:]\/)\/+/g, '$1');
const joined = parts.join('/')
return joined.replace(/([^:]\/)\/+/g, '$1')
}
export function getPostUrlBySlug(slug: string): string | null {
if (!slug)
return null;
return `/posts/${slug}`;
if (!slug) return null
return `/posts/${slug}`
}
export function getCategoryUrl(category: string): string | null {
if (!category)
return null;
return `/archive/category/${category}`;
if (!category) return null
return `/archive/category/${category}`
}