feat(resources): link to resources home from intro

This commit is contained in:
Jean-Philippe Sirois
2019-12-15 19:48:02 -05:00
parent 4003ae0b7c
commit b40d6aeb58
3 changed files with 15 additions and 4 deletions
+7
View File
@@ -26,6 +26,13 @@ export function humanize(str: string): string {
return pipe(dashToSpace, specificWordsToUpper, removeDotMD)(str)
}
export function getPath({ path, title }: IFileOrFolder) {
const depth = path.replace("/resources", "").split("/").length - 2
const isLanguageIntro = depth === 1 && title.includes("intro")
return isLanguageIntro ? path.replace("intro.md", "") : path
}
export function traversePaths(
[head, ...tail]: string[],
basePath: string