diff --git a/src/utils/permalinks.ts b/src/utils/permalinks.ts index 0db7970..c5999a6 100644 --- a/src/utils/permalinks.ts +++ b/src/utils/permalinks.ts @@ -60,5 +60,13 @@ export const getHomePermalink = (): string => getPermalink('/'); /** */ 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);