Add getAsset function for assets permalink
This commit is contained in:
@ -60,5 +60,13 @@ export const getHomePermalink = (): string => getPermalink('/');
|
|||||||
/** */
|
/** */
|
||||||
export const getBlogPermalink = (): string => getPermalink(BLOG_BASE);
|
export const getBlogPermalink = (): string => getPermalink(BLOG_BASE);
|
||||||
|
|
||||||
|
/** */
|
||||||
|
export const getAsset = (path: string): string =>
|
||||||
|
'/' +
|
||||||
|
[BASE_PATHNAME, path]
|
||||||
|
.map((el) => trimSlash(el))
|
||||||
|
.filter((el) => !!el)
|
||||||
|
.join('/');
|
||||||
|
|
||||||
/** */
|
/** */
|
||||||
const definitivePermalink = (permalink: string): string => createPath(BASE_PATHNAME, permalink);
|
const definitivePermalink = (permalink: string): string => createPath(BASE_PATHNAME, permalink);
|
||||||
|
Reference in New Issue
Block a user