mirror of
https://github.com/LukeHagar/unicorn-utterances.git
synced 2025-12-09 12:57:45 +00:00
Make useMarkdownRenderer more generic
This commit is contained in:
@@ -15,10 +15,8 @@ export const isRelativePath = (str: string) => {
|
||||
return true;
|
||||
};
|
||||
|
||||
export const getFullRelativePostImgPath = (slug: string, srcStr: string) => {
|
||||
return isRelativePath(srcStr) ? slash(join("/posts", slug, srcStr)) : srcStr;
|
||||
};
|
||||
|
||||
export const getFullRelativeAuthorImgPath = (srcStr: string) => {
|
||||
return isRelativePath(srcStr) ? slash(join("/unicorns", srcStr)) : srcStr;
|
||||
export const getFullRelativePath = (...paths: string[]) => {
|
||||
return isRelativePath(paths[paths.length - 1])
|
||||
? slash(join(...paths))
|
||||
: paths[paths.length - 1];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user