OOKNET                             [ /  search the index  ]  
──────────────────────────────────────────────────────────────────────────────────────
══════════════════════════════════════════════════════════════════════════════════════
OOKNET   [ /  search  ]  
────────────────────────────────────────────────
════════════════════════════════════════════════
 
 
master @ 28 LINES
 
[ HISTORY ]  [ UP ]
 

---
import Pre from "../Pre/Pre.astro";
import { len } from "../../lib/ascii";
import { FRAME_W, MOBILE_FRAME_W } from "../../lib/config";
import { CRUMB_LABEL, crumbs, layoutCrumbs, type Crumb, type Props } from "./Bread
crumbs";
import "./Breadcrumbs.scss";

const { filed } = Astro.props as Props;
const items = crumbs(filed);
const indent = " ".repeat(len(CRUMB_LABEL));

const variants: [string, Crumb[][]][] = [
  ["frame-wide", layoutCrumbs(items, FRAME_W)],
  ["frame-narrow", layoutCrumbs(items, MOBILE_FRAME_W)],
];
---
{items.length > 0 && (
  <nav class="crumbs" aria-label="Filed under">
    {variants.map(([variant, rows]) =>
      rows.map((row, i) => (
        <Pre class={variant}>{i === 0 ? CRUMB_LABEL : indent}{row.map((c) => (
          <Fragment>/<a class="crumb-link" href={c.href}>{c.label}</a></Fragment>
        ))}</Pre>
      ))
    )}
  </nav>
)}

---
import Pre from "../Pre/Pre.astro";
import { len } from "../../lib/ascii";
import { FRAME_W, MOBILE_FRAME_W } from "../
../lib/config";
import { CRUMB_LABEL, crumbs, layoutCrumbs, 
type Crumb, type Props } from "./Breadcrumbs
";
import "./Breadcrumbs.scss";

const { filed } = Astro.props as Props;
const items = crumbs(filed);
const indent = " ".repeat(len(CRUMB_LABEL));

const variants: [string, Crumb[][]][] = [
  ["frame-wide", layoutCrumbs(items, FRAME_W
)],
  ["frame-narrow", layoutCrumbs(items, MOBIL
E_FRAME_W)],
];
---
{items.length > 0 && (
  <nav class="crumbs" aria-label="Filed unde
r">
    {variants.map(([variant, rows]) =>
      rows.map((row, i) => (
        <Pre class={variant}>{i === 0 ? CRUM
B_LABEL : indent}{row.map((c) => (
          <Fragment>/<a class="crumb-link" h
ref={c.href}>{c.label}</a></Fragment>
        ))}</Pre>
      ))
    )}
  </nav>
)}
 
──────────────────────────────────────────────────────────────────────────────────────
OOKNET
────────────────────────────────────────────────
OOKNET