mirror of
https://github.com/saicaca/fuwari.git
synced 2026-01-11 23:02:53 +01:00
feat: add license block
This commit is contained in:
@@ -1,9 +1,16 @@
|
||||
import {siteConfig} from "../config.ts";
|
||||
|
||||
export function pathsEqual(path1: string, path2: string) {
|
||||
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');
|
||||
}
|
||||
|
||||
export function getPostUrlBySlug(slug: string): string | null {
|
||||
if (!slug)
|
||||
return null;
|
||||
@@ -16,3 +23,6 @@ export function getCategoryUrl(category: string): string | null {
|
||||
return `/archive/category/${category}`;
|
||||
}
|
||||
|
||||
export function getFullUrl(path: string): string {
|
||||
return joinUrl(siteConfig.url, path);
|
||||
}
|
||||
Reference in New Issue
Block a user