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 }
10 <NAV><P><A HRef=
/>Home
</A></P><DL></DL></NAV>
12 const nav = document.body.querySelector(
"nav")
13 const dl = nav.querySelector(
"dl")
14 const parser = new DOMParser
15 fetch(`${location}.jsonld`)
18 const topic = meta.subject || meta[
"@id"].split(
"/").pop()
19 document.title = topic
20 document.body.querySelector(
"h1").textContent =
"subject" in meta
23 if (
"subject" in meta) {
25 .insertBefore(document.createElement(
"p"), dl)
26 .appendChild(document.createElement(
"a"))
28 a.textContent =
"Topics" }
29 const { first, prev, next, current, items } = meta
30 if (first && first != location && first != prev) {
32 .insertBefore(document.createElement(
"p"), dl)
33 .appendChild(document.createElement(
"a"))
35 a.textContent =
"First Page" }
38 .insertBefore(document.createElement(
"p"), dl)
39 .appendChild(document.createElement(
"a"))
41 a.textContent =
"Previous Page" }
42 let prevDate = undefined
43 for (const status of items) {
44 if (status.created != prevDate) dl.appendChild(document.createElement(
"dt")).textContent = status.created
46 .appendChild(document.createElement(
"dd"))
47 .appendChild(document.createElement(
"a"))
48 a.href = status[
"@id"]
49 const { title } = status
50 if (title) a.textContent = title.length
> 28
51 ?
"".concat(...title.slice(
0,
27),
"…")
54 const summaryText = (() =
> {
56 const d = parser.parseFromString(status.content,
"application/xhtml+xml")
57 const div = document.createElement(
"div")
58 div.appendChild(document.importNode(d.documentElement, true))
59 Object.assign(div.style,
60 { position:
"absolute"
64 , overflow:
"hidden" })
65 document.body.appendChild(div)
66 const text = div.innerText
67 document.body.removeChild(div)
70 const chars = Array.from(summaryText.trim().replaceAll(/\s+/gu,
" "))
71 a.textContent = chars.length
> 28
72 ?
"".concat(...chars.slice(
0,
27),
"…")
73 : summaryText || status.identifier } }
76 .appendChild(document.createElement(
"p"))
77 .appendChild(document.createElement(
"a"))
79 a.textContent =
"Next Page" }
80 if (current && current != location && current != next) {
82 .appendChild(document.createElement(
"p"))
83 .appendChild(document.createElement(
"a"))
85 a.textContent =
"Latest Page" } })