import { Head, asset } from "$fresh/runtime.ts"; import { join } from "path/posix.ts"; import { ComponentChild } from "preact"; function stairs(path: string){ if (path === ".") return []; const uplist = path.split("/"); let current = "."; const stairs = []; for (const up of uplist){ current = join(current, up); stairs.push([current, up]); } return stairs; } export default function UpList(props:{path: string}) { const data = props; const uplist = stairs(data.path); return (

Home { uplist.map(([cur, up], i) => ( <> / {up} )) }

) }