master @ 28 LINES
[ HISTORY ] [ UP ]
┌─ ASTRO ────────────────────────────────────────────────────────────────────┐
│ --- │
│ import Pre from "../Pre/Pre.astro"; │
│ import { FRAME_W, MOBILE_FRAME_W } from "../../lib/config"; │
│ import type { Backlink } from "../../lib/wikilinks"; │
│ import { BACKLINKS_LABEL, BACKLINKS_INDENT, layoutBacklinks, type Props } from "./ │
│ ArticleBacklinks"; │
│ import "./ArticleBacklinks.scss"; │
│ │
│ const { refs } = Astro.props as Props; │
│ const indent = " ".repeat(BACKLINKS_INDENT); │
│ │
│ const variants: [string, Backlink[]][] = [ │
│ ["frame-wide", layoutBacklinks(refs, FRAME_W)], │
│ ["frame-narrow", layoutBacklinks(refs, MOBILE_FRAME_W)], │
│ ]; │
│ --- │
│ {refs.length > 0 && ( │
│ <nav class="backlinks" aria-label="Referenced by"> │
│ {variants.map(([variant, rows]) => ( │
│ <Fragment> │
│ <Pre class={variant}>{BACKLINKS_LABEL}</Pre> │
│ {rows.map((r) => ( │
│ <Pre class={variant}>{indent}<a class="backlink-link" href={r.url}>{r.la │
│ bel}</a></Pre> │
│ ))} │
│ </Fragment> │
│ ))} │
│ </nav> │
│ )} │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ ASTRO ──────────────────────────────┐
│ --- │
│ import Pre from "../Pre/Pre.astro"; │
│ import { FRAME_W, MOBILE_FRAME_W } from "../ │
│ ../lib/config"; │
│ import type { Backlink } from "../../lib/wik │
│ ilinks"; │
│ import { BACKLINKS_LABEL, BACKLINKS_INDENT, │
│ layoutBacklinks, type Props } from "./Articl │
│ eBacklinks"; │
│ import "./ArticleBacklinks.scss"; │
│ │
│ const { refs } = Astro.props as Props; │
│ const indent = " ".repeat(BACKLINKS_INDENT); │
│ │
│ const variants: [string, Backlink[]][] = [ │
│ ["frame-wide", layoutBacklinks(refs, FRAME │
│ _W)], │
│ ["frame-narrow", layoutBacklinks(refs, MOB │
│ ILE_FRAME_W)], │
│ ]; │
│ --- │
│ {refs.length > 0 && ( │
│ <nav class="backlinks" aria-label="Referen │
│ ced by"> │
│ {variants.map(([variant, rows]) => ( │
│ <Fragment> │
│ <Pre class={variant}>{BACKLINKS_LABE │
│ L}</Pre> │
│ {rows.map((r) => ( │
│ <Pre class={variant}>{indent}<a cl │
│ ass="backlink-link" href={r.url}>{r.label}</ │
│ a></Pre> │
│ ))} │
│ </Fragment> │
│ ))} │
│ </nav> │
│ )} │
└──────────────────────────────────────────────┘
──────────────────────────────────────────────────────────────────────────────────────
OOKNET
────────────────────────────────────────────────
OOKNET