import { asset, Head } from "$fresh/runtime.ts"; import { join } from "path/posix.ts"; import { ComponentChild } from "preact"; import { encodePath } from "../util/util.ts"; function stairs(path: string) { if (path === ".") return []; const uplist = path.split("/").filter((x) => x.length > 0); 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} ))}

); }