|
2211 | 2211 | handled.add("articleBody"); handled.add("author"); handled.add("datePublished"); handled.add("url"); |
2212 | 2212 | } |
2213 | 2213 |
|
| 2214 | + // ── QUOTATION (typographic quote poster) ── |
| 2215 | + if (cfg.type === "Quotation") { |
| 2216 | + const card = document.querySelector(".card"); |
| 2217 | + if (card) card.classList.add("quote-poster"); |
| 2218 | + |
| 2219 | + // Hide normal header |
| 2220 | + const hd = document.querySelector(".hd"); |
| 2221 | + if (hd) hd.classList.add("hidden"); |
| 2222 | + |
| 2223 | + // Remove generic hero if present |
| 2224 | + const heroMount = document.getElementById("hero-mount"); |
| 2225 | + if (heroMount) heroMount.querySelector(".hero")?.remove(); |
| 2226 | + |
| 2227 | + // Huge opening quotation mark |
| 2228 | + const mark = document.createElement("div"); mark.className = "quote-mark"; |
| 2229 | + mark.textContent = "\u201C"; |
| 2230 | + view.appendChild(mark); |
| 2231 | + |
| 2232 | + // The quotation text — large serif italic |
| 2233 | + const text = data["text"]; |
| 2234 | + if (text) { |
| 2235 | + const q = document.createElement("blockquote"); q.className = "quote-text"; |
| 2236 | + q.textContent = text; |
| 2237 | + view.appendChild(q); |
| 2238 | + } |
| 2239 | + |
| 2240 | + // Attribution line: em-dash + author in small-caps |
| 2241 | + const authorRaw = data["author"]; |
| 2242 | + const authorName = (typeof authorRaw === "object" && authorRaw !== null) ? (authorRaw.name || "") : (authorRaw || ""); |
| 2243 | + if (authorName) { |
| 2244 | + const attr = document.createElement("div"); attr.className = "quote-attribution"; |
| 2245 | + attr.textContent = "\u2014 " + authorName; |
| 2246 | + view.appendChild(attr); |
| 2247 | + } |
| 2248 | + |
| 2249 | + // Subtle date below attribution |
| 2250 | + const dateCreated = data["dateCreated"]; |
| 2251 | + if (dateCreated) { |
| 2252 | + const d = new Date(dateCreated); |
| 2253 | + const year = isNaN(d.getTime()) ? dateCreated : d.getFullYear().toString(); |
| 2254 | + const dateEl = document.createElement("div"); dateEl.className = "quote-date"; |
| 2255 | + dateEl.textContent = year; |
| 2256 | + view.appendChild(dateEl); |
| 2257 | + } |
| 2258 | + |
| 2259 | + // Description as a small footnote |
| 2260 | + const desc = data["description"]; |
| 2261 | + if (desc) { |
| 2262 | + const fn = document.createElement("p"); fn.className = "quote-footnote"; |
| 2263 | + fn.textContent = desc; |
| 2264 | + view.appendChild(fn); |
| 2265 | + } |
| 2266 | + |
| 2267 | + handled.add("name"); handled.add("image"); handled.add("description"); |
| 2268 | + handled.add("text"); handled.add("author"); handled.add("dateCreated"); |
| 2269 | + } |
| 2270 | + |
2214 | 2271 | return handled; |
2215 | 2272 | } |
2216 | 2273 |
|
|
0 commit comments