Add getAsset function for assets permalink

This commit is contained in:
prototypa
2023-01-18 01:30:45 -05:00
parent ee19fb75b4
commit e85d406197

View File

@ -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);