mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-05 23:43:37 +02:00
feat(resources): link to resources home from intro
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user