feat: use relative paths for cover images

This commit is contained in:
saicaca committed 2024-01-21 16:34:37 +08:00
1 parent 197d524b53
commit 3fcb566a54
4 files changed
+17 -5

No files matched your search

+8
View File
@@ -18,3 +18,11 @@ export function getCategoryUrl(category: string): string | null {
if (!category) return null
return `/archive/category/${category}`
}
export function getDir(path: string): string {
const lastSlashIndex = path.lastIndexOf('/')
if (lastSlashIndex < 0) {
return '/'
}
return path.substring(0, lastSlashIndex + 1)
}