3 <TITLE>Topic Feed
</TITLE>
5 html{ Color: #E3E3E3; Background: #
700020; Font-Family: UI-Rounded, 'Hiragino Maru Gothic ProN', Quicksand, Comfortaa, Manjari, 'Arial Rounded MT', 'Arial Rounded MT Bold', Calibri, Sans-Serif; Line-Height:
1.5; Text-Shadow: Calc(
1EM /
12) Calc(
1EM /
12) #
000000 }
6 body{ Display: Grid; Box-Sizing: Border-Box; Margin: Auto; Padding-Inline:
1CH; Min-Block-Size:
100VH; Inline-Size:
100%; Max-Inline-Size:
48REM; Align-Content: Center; Justify-Content: Stretch }
7 :Any-Link{ Color: #
87E6DD }
8 dd :Any-Link{ Display: Block; Border: Thin Solid; Padding-Inline:
.5REM; Border-Radius:
.5REM; Min-Inline-Size: Max-Content; Inline-Size:
28CH; Color: #D6B7BF; Background: #
1A1A1A; Text-Shadow: None }
11 <NAV><P><A HRef=
/>Home
</A></P><DL></DL></NAV>
13 const nav = document.body.querySelector(
"nav")
14 const dl = nav.querySelector(
"dl")
15 const parser = new DOMParser
16 fetch(`${location}.jsonld`)
19 const topic = meta.subject || meta[
"@id"].split(
"/").pop()
20 document.title = topic
21 document.body.querySelector(
"h1").textContent =
"subject" in meta
24 if (
"subject" in meta) {
26 .insertBefore(document.createElement(
"p"), dl)
27 .appendChild(document.createElement(
"a"))
29 a.textContent =
"Topics" }
30 const { first, prev, next, current, items } = meta
31 if (first && first != location && first != prev) {
33 .insertBefore(document.createElement(
"p"), dl)
34 .appendChild(document.createElement(
"a"))
36 a.textContent =
"First Page" }
39 .insertBefore(document.createElement(
"p"), dl)
40 .appendChild(document.createElement(
"a"))
42 a.textContent =
"Previous Page" }
43 let prevDate = undefined
44 for (const status of items) {
45 if (status.created != prevDate) dl.appendChild(document.createElement(
"dt")).textContent = status.created
47 .appendChild(document.createElement(
"dd"))
48 .appendChild(document.createElement(
"a"))
49 a.href = status[
"@id"]
50 const { title } = status
51 if (title) a.textContent = title.length
> 28
52 ?
"".concat(...title.slice(
0,
27),
"…")
55 const summaryText = (() =
> {
57 const d = parser.parseFromString(status.content,
"application/xhtml+xml")
58 const div = document.createElement(
"div")
59 div.appendChild(document.importNode(d.documentElement, true))
60 Object.assign(div.style,
61 { position:
"absolute"
65 , overflow:
"hidden" })
66 document.body.appendChild(div)
67 const text = div.innerText
68 document.body.removeChild(div)
71 const chars = Array.from(summaryText.trim().replaceAll(/\s+/gu,
" "))
72 a.textContent = chars.length
> 28
73 ?
"".concat(...chars.slice(
0,
27),
"…")
74 : summaryText || status.identifier } }
77 .appendChild(document.createElement(
"p"))
78 .appendChild(document.createElement(
"a"))
80 a.textContent =
"Next Page" }
81 if (current && current != location && current != next) {
83 .appendChild(document.createElement(
"p"))
84 .appendChild(document.createElement(
"a"))
86 a.textContent =
"Latest Page" } })