inline scripts

This commit is contained in:
Jacky Zhao committed 2023-06-03 15:07:19 -04:00
1 parent fcd81353f8
commit 4bdc17d4a1
19 files changed
+187 -69

No files matched your search

+7 -3
View File
@@ -22,11 +22,15 @@ export function slugify(s: string): string {
// resolve /a/b/c to ../../
export function resolveToRoot(slug: string): string {
let fp = slug
if (fp.endsWith("/index")) {
fp = fp.slice(0, -"/index".length)
if (fp.endsWith("index")) {
fp = fp.slice(0, -"index".length)
}
return fp
if (fp === "") {
return "."
}
return "./" + fp
.split('/')
.filter(x => x !== '')
.map(_ => '..')