feat: allow collapsing widget content, add categories widget

(cherry picked from commit 9a4ca8f6163d5e1375aa7c612e1338cce5a8c0b5)
This commit is contained in:
saicaca
2023-10-11 22:29:23 +08:00
parent 83b765a398
commit f4dc88e982
16 changed files with 174 additions and 33 deletions

View File

@@ -3,3 +3,16 @@ export function pathsEqual(path1: string, path2: string) {
const normalizedPath2 = path2.replace(/^\/|\/$/g, '').toLowerCase();
return normalizedPath1 === normalizedPath2;
}
export function getPostUrlBySlug(slug: string): string | null {
if (!slug)
return null;
return `/posts/${slug}`;
}
export function getCategoryUrl(category: string): string | null {
if (!category)
return null;
return `/archive/category/${category}`;
}