@backgold/template-kit 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (349) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +12 -2
  3. package/dist/chunk-RJAVFRC6.js +67 -0
  4. package/dist/constants-BAIo_Q5U.d-lQbj1e1-.d.ts +48 -0
  5. package/dist/content-api-Cox1-wz5.d.ts +1096 -0
  6. package/dist/contract/content-api-examples.d.ts +72 -0
  7. package/dist/contract/content-api-examples.js +926 -0
  8. package/dist/contract/content-api.d.ts +2 -0
  9. package/dist/contract/content-api.js +1 -0
  10. package/dist/contract/site-templates.d.ts +253 -0
  11. package/dist/contract/site-templates.js +185 -0
  12. package/package.json +70 -3
  13. package/src/components/EntryCard.astro +35 -0
  14. package/src/components/EventMap.astro +118 -0
  15. package/src/components/EventPage.astro +194 -0
  16. package/src/components/FieldValue.astro +41 -0
  17. package/src/components/LeadingHero.astro +21 -0
  18. package/src/components/NotFound.astro +20 -0
  19. package/src/components/PageSections.astro +47 -0
  20. package/src/components/Prose.astro +18 -0
  21. package/src/components/chrome/Brand.astro +61 -0
  22. package/src/components/chrome/ClosingCall.astro +94 -0
  23. package/src/components/chrome/DonateStrip.astro +61 -0
  24. package/src/components/chrome/FooterColumns.astro +32 -0
  25. package/src/components/chrome/FooterContact.astro +28 -0
  26. package/src/components/chrome/MenuList.astro +45 -0
  27. package/src/components/chrome/ModeToggle.astro +125 -0
  28. package/src/components/chrome/SignedInNotice.astro +53 -0
  29. package/src/components/chrome/SignupBand.astro +12 -0
  30. package/src/components/chrome/TakeoverBanner.astro +56 -0
  31. package/src/components/chrome/VisitorAccount.astro +82 -0
  32. package/src/components/entries/AuthorBox.astro +47 -0
  33. package/src/components/entries/EntryFields.astro +29 -0
  34. package/src/components/entries/EntryHeader.astro +77 -0
  35. package/src/components/entries/ListFrame.astro +126 -0
  36. package/src/components/entries/ListSearch.astro +24 -0
  37. package/src/components/entries/Share.astro +24 -0
  38. package/src/components/entries/course/classroom.astro +26 -0
  39. package/src/components/entries/course/lesson.astro +18 -0
  40. package/src/components/entries/course/section.ts +20 -0
  41. package/src/components/entries/course/syllabus.astro +15 -0
  42. package/src/components/entries/index.ts +77 -0
  43. package/src/components/entries/newsletter/issue.astro +41 -0
  44. package/src/components/entries/newsletter/list.astro +26 -0
  45. package/src/components/entries/podcast/episode.astro +42 -0
  46. package/src/components/entries/podcast/list.astro +36 -0
  47. package/src/components/entries/post/article.astro +31 -0
  48. package/src/components/entries/post/list.astro +85 -0
  49. package/src/components/entries/props.ts +61 -0
  50. package/src/components/entries/video/cards.astro +39 -0
  51. package/src/components/entries/video/grid.astro +15 -0
  52. package/src/components/entries/video/watch.astro +41 -0
  53. package/src/components/live/LivePage.astro +215 -0
  54. package/src/components/live/LocalTime.astro +29 -0
  55. package/src/components/sections/About/books.astro +188 -0
  56. package/src/components/sections/About/credentials.ts +80 -0
  57. package/src/components/sections/About/index.astro +60 -0
  58. package/src/components/sections/About/left.astro +57 -0
  59. package/src/components/sections/About/letter.astro +111 -0
  60. package/src/components/sections/About/portrait.astro +308 -0
  61. package/src/components/sections/Advocacy/compact.astro +14 -0
  62. package/src/components/sections/Advocacy/index.astro +14 -0
  63. package/src/components/sections/Band.astro +39 -0
  64. package/src/components/sections/Blog/feature.astro +176 -0
  65. package/src/components/sections/Blog/index.astro +37 -0
  66. package/src/components/sections/Blog/latest.ts +80 -0
  67. package/src/components/sections/Blog/list.astro +186 -0
  68. package/src/components/sections/Booking/index.astro +139 -0
  69. package/src/components/sections/Booking/list.astro +144 -0
  70. package/src/components/sections/Booking/types.ts +60 -0
  71. package/src/components/sections/Calendar/agenda.astro +14 -0
  72. package/src/components/sections/Calendar/index.astro +14 -0
  73. package/src/components/sections/CandidateRoster/ballot.astro +394 -0
  74. package/src/components/sections/CandidateRoster/candidates.ts +69 -0
  75. package/src/components/sections/CandidateRoster/compact.astro +115 -0
  76. package/src/components/sections/CandidateRoster/index.astro +57 -0
  77. package/src/components/sections/CaseStudies/beforeafter.astro +222 -0
  78. package/src/components/sections/CaseStudies/cases.ts +111 -0
  79. package/src/components/sections/CaseStudies/grid.astro +261 -0
  80. package/src/components/sections/CaseStudies/index.astro +333 -0
  81. package/src/components/sections/Classroom/CourseCard.astro +181 -0
  82. package/src/components/sections/Classroom/Courses.astro +88 -0
  83. package/src/components/sections/Classroom/classroom.ts +141 -0
  84. package/src/components/sections/Classroom/index.astro +20 -0
  85. package/src/components/sections/Classroom/list.astro +15 -0
  86. package/src/components/sections/Collection/compact.astro +7 -0
  87. package/src/components/sections/Collection/entries.ts +62 -0
  88. package/src/components/sections/Collection/feature.astro +180 -0
  89. package/src/components/sections/Collection/index.astro +46 -0
  90. package/src/components/sections/Collection/library.astro +271 -0
  91. package/src/components/sections/Collection/list.astro +7 -0
  92. package/src/components/sections/Collection/outline.astro +134 -0
  93. package/src/components/sections/Collection/shelves.astro +191 -0
  94. package/src/components/sections/Comparison/Unlisted.astro +6 -0
  95. package/src/components/sections/Comparison/cards.astro +171 -0
  96. package/src/components/sections/Comparison/index.astro +191 -0
  97. package/src/components/sections/Comparison/sides.ts +98 -0
  98. package/src/components/sections/Comparison/spectrum.astro +261 -0
  99. package/src/components/sections/ContentPost/banner.astro +152 -0
  100. package/src/components/sections/ContentPost/index.astro +35 -0
  101. package/src/components/sections/ContentPost/lesson.ts +126 -0
  102. package/src/components/sections/ContentPost/player.astro +254 -0
  103. package/src/components/sections/ContentPost/prose.astro +80 -0
  104. package/src/components/sections/ContentPost/theater.astro +329 -0
  105. package/src/components/sections/Countdown/index.astro +53 -0
  106. package/src/components/sections/Course/Bar.astro +46 -0
  107. package/src/components/sections/Course/CourseHead.astro +123 -0
  108. package/src/components/sections/Course/Crumbs.astro +44 -0
  109. package/src/components/sections/Course/Icon.astro +29 -0
  110. package/src/components/sections/Course/Ring.astro +62 -0
  111. package/src/components/sections/Course/Syllabus.astro +146 -0
  112. package/src/components/sections/Course/course.ts +146 -0
  113. package/src/components/sections/Course/index.astro +143 -0
  114. package/src/components/sections/Course/outline.astro +39 -0
  115. package/src/components/sections/Cta/banner.astro +64 -0
  116. package/src/components/sections/Cta/card.astro +88 -0
  117. package/src/components/sections/Cta/index.astro +31 -0
  118. package/src/components/sections/Cta/photo.astro +114 -0
  119. package/src/components/sections/Cta/strip.astro +91 -0
  120. package/src/components/sections/Donate/index.astro +136 -0
  121. package/src/components/sections/Donate/story.astro +7 -0
  122. package/src/components/sections/Event/card.astro +14 -0
  123. package/src/components/sections/Event/index.astro +14 -0
  124. package/src/components/sections/EventsList/AgendaMonths.astro +105 -0
  125. package/src/components/sections/EventsList/CalendarLine.astro +23 -0
  126. package/src/components/sections/EventsList/EventRows.astro +196 -0
  127. package/src/components/sections/EventsList/LiveCounts.astro +75 -0
  128. package/src/components/sections/EventsList/TypeTabs.astro +53 -0
  129. package/src/components/sections/EventsList/agenda.astro +55 -0
  130. package/src/components/sections/EventsList/calendar.astro +392 -0
  131. package/src/components/sections/EventsList/cards.astro +186 -0
  132. package/src/components/sections/EventsList/cohorts.astro +205 -0
  133. package/src/components/sections/EventsList/compact.astro +163 -0
  134. package/src/components/sections/EventsList/events.ts +168 -0
  135. package/src/components/sections/EventsList/index.astro +46 -0
  136. package/src/components/sections/EventsList/map.astro +436 -0
  137. package/src/components/sections/EventsList/shifts.astro +355 -0
  138. package/src/components/sections/EventsList/week.astro +361 -0
  139. package/src/components/sections/Faq/Contact.astro +63 -0
  140. package/src/components/sections/Faq/Questions.astro +98 -0
  141. package/src/components/sections/Faq/cards.astro +74 -0
  142. package/src/components/sections/Faq/faq.ts +101 -0
  143. package/src/components/sections/Faq/index.astro +49 -0
  144. package/src/components/sections/Faq/topics.astro +178 -0
  145. package/src/components/sections/Financials/Foot.astro +38 -0
  146. package/src/components/sections/Financials/Head.astro +47 -0
  147. package/src/components/sections/Financials/donut.astro +197 -0
  148. package/src/components/sections/Financials/financials.ts +52 -0
  149. package/src/components/sections/Financials/index.astro +148 -0
  150. package/src/components/sections/Financials/table.astro +157 -0
  151. package/src/components/sections/FormBlock/index.astro +33 -0
  152. package/src/components/sections/FormBlock/wide.astro +7 -0
  153. package/src/components/sections/Hero/cover.astro +176 -0
  154. package/src/components/sections/Hero/donate.astro +209 -0
  155. package/src/components/sections/Hero/field.astro +390 -0
  156. package/src/components/sections/Hero/index.astro +52 -0
  157. package/src/components/sections/Hero/overlap.astro +151 -0
  158. package/src/components/sections/Hero/rotating.astro +30 -0
  159. package/src/components/sections/Hero/split.astro +99 -0
  160. package/src/components/sections/Hero/statement.astro +55 -0
  161. package/src/components/sections/Hero/video.astro +399 -0
  162. package/src/components/sections/Issues/checklist.astro +204 -0
  163. package/src/components/sections/Issues/drawer.astro +237 -0
  164. package/src/components/sections/Issues/index.astro +115 -0
  165. package/src/components/sections/Issues/issues.ts +37 -0
  166. package/src/components/sections/Issues/numbered.astro +79 -0
  167. package/src/components/sections/Issues/rows.astro +137 -0
  168. package/src/components/sections/Issues/steps.astro +81 -0
  169. package/src/components/sections/Issues/tabs.astro +322 -0
  170. package/src/components/sections/Leaderboard/index.astro +29 -0
  171. package/src/components/sections/Lesson/Door.astro +121 -0
  172. package/src/components/sections/Lesson/LessonBody.astro +416 -0
  173. package/src/components/sections/Lesson/Rail.astro +182 -0
  174. package/src/components/sections/Lesson/Tracker.astro +137 -0
  175. package/src/components/sections/Lesson/index.astro +27 -0
  176. package/src/components/sections/Lesson/lesson.ts +233 -0
  177. package/src/components/sections/Lesson/reading.astro +21 -0
  178. package/src/components/sections/Map/CoverageLine.astro +19 -0
  179. package/src/components/sections/Map/RegionMap.astro +109 -0
  180. package/src/components/sections/Map/bar.astro +160 -0
  181. package/src/components/sections/Map/index.astro +192 -0
  182. package/src/components/sections/Map/map.astro +275 -0
  183. package/src/components/sections/MediaKit/BioCard.astro +108 -0
  184. package/src/components/sections/MediaKit/Downloads.astro +88 -0
  185. package/src/components/sections/MediaKit/index.astro +183 -0
  186. package/src/components/sections/MediaKit/kit.ts +140 -0
  187. package/src/components/sections/MediaKit/press.astro +189 -0
  188. package/src/components/sections/MediaKit/speaker.astro +205 -0
  189. package/src/components/sections/Membership/Benefits.astro +42 -0
  190. package/src/components/sections/Membership/Check.astro +12 -0
  191. package/src/components/sections/Membership/Price.astro +61 -0
  192. package/src/components/sections/Membership/compare.astro +312 -0
  193. package/src/components/sections/Membership/index.astro +281 -0
  194. package/src/components/sections/Membership/offers.ts +169 -0
  195. package/src/components/sections/Membership/tiers.astro +217 -0
  196. package/src/components/sections/MovementMap/index.astro +50 -0
  197. package/src/components/sections/MovementTicker/index.astro +43 -0
  198. package/src/components/sections/Pathways/Doors.astro +147 -0
  199. package/src/components/sections/Pathways/Head.astro +37 -0
  200. package/src/components/sections/Pathways/index.astro +27 -0
  201. package/src/components/sections/Pathways/pathways.ts +100 -0
  202. package/src/components/sections/Pathways/quiz.astro +286 -0
  203. package/src/components/sections/Pathways/tabs.astro +271 -0
  204. package/src/components/sections/PdfEmbed/card.astro +99 -0
  205. package/src/components/sections/PdfEmbed/index.astro +26 -0
  206. package/src/components/sections/PdfEmbed/medium.astro +7 -0
  207. package/src/components/sections/PdfEmbed/tall.astro +7 -0
  208. package/src/components/sections/Petition/coverage.astro +14 -0
  209. package/src/components/sections/Petition/image.astro +14 -0
  210. package/src/components/sections/Petition/index.astro +14 -0
  211. package/src/components/sections/Petition/map.astro +14 -0
  212. package/src/components/sections/PlatformPlanks/anchors.ts +66 -0
  213. package/src/components/sections/PlatformPlanks/columns.astro +171 -0
  214. package/src/components/sections/PlatformPlanks/index.astro +56 -0
  215. package/src/components/sections/PlatformPlanks/longread.astro +250 -0
  216. package/src/components/sections/PollBlock/index.astro +30 -0
  217. package/src/components/sections/Portfolio/featured.astro +343 -0
  218. package/src/components/sections/Portfolio/index.astro +571 -0
  219. package/src/components/sections/Portfolio/strip.astro +173 -0
  220. package/src/components/sections/Portfolio/work.ts +100 -0
  221. package/src/components/sections/Progress/MatchClock.astro +166 -0
  222. package/src/components/sections/Progress/compact.astro +150 -0
  223. package/src/components/sections/Progress/index.astro +32 -0
  224. package/src/components/sections/Progress/match.astro +126 -0
  225. package/src/components/sections/Progress/ring.astro +179 -0
  226. package/src/components/sections/QuickDonate/DonateCard.astro +149 -0
  227. package/src/components/sections/QuickDonate/Picker.astro +95 -0
  228. package/src/components/sections/QuickDonate/band.astro +164 -0
  229. package/src/components/sections/QuickDonate/bar.astro +208 -0
  230. package/src/components/sections/QuickDonate/donate.ts +126 -0
  231. package/src/components/sections/QuickDonate/hero.astro +143 -0
  232. package/src/components/sections/QuickDonate/index.astro +73 -0
  233. package/src/components/sections/QuickDonate/jar.astro +225 -0
  234. package/src/components/sections/QuickDonate/ladder.astro +248 -0
  235. package/src/components/sections/QuoteStrip/carousel.astro +340 -0
  236. package/src/components/sections/QuoteStrip/index.astro +58 -0
  237. package/src/components/sections/QuoteStrip/logos.astro +226 -0
  238. package/src/components/sections/QuoteStrip/quotes.ts +61 -0
  239. package/src/components/sections/QuoteStrip/single.astro +92 -0
  240. package/src/components/sections/QuoteStrip/ticker.astro +319 -0
  241. package/src/components/sections/QuoteStrip/wall.astro +113 -0
  242. package/src/components/sections/Resources/band.astro +93 -0
  243. package/src/components/sections/Resources/featured.astro +239 -0
  244. package/src/components/sections/Resources/index.astro +225 -0
  245. package/src/components/sections/Resources/resources.ts +92 -0
  246. package/src/components/sections/SampleBallot/Position.astro +39 -0
  247. package/src/components/sections/SampleBallot/ballot.ts +92 -0
  248. package/src/components/sections/SampleBallot/cards.astro +299 -0
  249. package/src/components/sections/SampleBallot/index.astro +326 -0
  250. package/src/components/sections/SampleBallot/measures.astro +172 -0
  251. package/src/components/sections/Scorecard/grades.astro +141 -0
  252. package/src/components/sections/Scorecard/index.astro +294 -0
  253. package/src/components/sections/Scorecard/promise.astro +167 -0
  254. package/src/components/sections/Scorecard/votes.ts +83 -0
  255. package/src/components/sections/SectionHead.astro +31 -0
  256. package/src/components/sections/Services/Button.astro +24 -0
  257. package/src/components/sections/Services/Check.astro +12 -0
  258. package/src/components/sections/Services/Includes.astro +42 -0
  259. package/src/components/sections/Services/compare.astro +328 -0
  260. package/src/components/sections/Services/index.astro +187 -0
  261. package/src/components/sections/Services/list.astro +181 -0
  262. package/src/components/sections/Services/services.ts +80 -0
  263. package/src/components/sections/ShareKit/Actions.astro +71 -0
  264. package/src/components/sections/ShareKit/Buttons.astro +62 -0
  265. package/src/components/sections/ShareKit/compact.astro +123 -0
  266. package/src/components/sections/ShareKit/index.astro +160 -0
  267. package/src/components/sections/ShareKit/share.ts +60 -0
  268. package/src/components/sections/ShareKit/strip.astro +173 -0
  269. package/src/components/sections/SignupCapture/band.astro +7 -0
  270. package/src/components/sections/SignupCapture/index.astro +103 -0
  271. package/src/components/sections/SignupCapture/inline.astro +7 -0
  272. package/src/components/sections/SocialFeed/index.astro +34 -0
  273. package/src/components/sections/StatCards/feature.astro +143 -0
  274. package/src/components/sections/StatCards/index.astro +51 -0
  275. package/src/components/sections/StatCards/ribbon.astro +113 -0
  276. package/src/components/sections/StatCards/wall.astro +177 -0
  277. package/src/components/sections/Store/featured.astro +14 -0
  278. package/src/components/sections/Store/index.astro +14 -0
  279. package/src/components/sections/Stories/Status.astro +42 -0
  280. package/src/components/sections/Stories/StoryCards.astro +171 -0
  281. package/src/components/sections/Stories/cards.astro +42 -0
  282. package/src/components/sections/Stories/index.astro +238 -0
  283. package/src/components/sections/Stories/stories.ts +97 -0
  284. package/src/components/sections/Stories/timeline.astro +135 -0
  285. package/src/components/sections/TeamGrid/board.astro +280 -0
  286. package/src/components/sections/TeamGrid/index.astro +71 -0
  287. package/src/components/sections/TeamGrid/list.astro +306 -0
  288. package/src/components/sections/TeamGrid/people.ts +178 -0
  289. package/src/components/sections/VideoEmbed/index.astro +52 -0
  290. package/src/components/sections/VideoEmbed/landscape.astro +7 -0
  291. package/src/components/sections/VideoEmbed/portrait.astro +7 -0
  292. package/src/components/sections/VideoEmbed/square.astro +7 -0
  293. package/src/components/sections/VoterTools/DaysLeft.astro +33 -0
  294. package/src/components/sections/VoterTools/Lookup.astro +43 -0
  295. package/src/components/sections/VoterTools/dates.astro +153 -0
  296. package/src/components/sections/VoterTools/index.astro +231 -0
  297. package/src/components/sections/VoterTools/polling.astro +144 -0
  298. package/src/components/sections/VoterTools/voter-tools.ts +71 -0
  299. package/src/components/sections/index.ts +373 -0
  300. package/src/components/sections/modules/Headed.astro +39 -0
  301. package/src/components/sections/modules/ModuleFrame.astro +181 -0
  302. package/src/components/store/CollectionPage.astro +40 -0
  303. package/src/components/store/ProductCard.astro +32 -0
  304. package/src/components/store/ProductGrid.astro +16 -0
  305. package/src/components/store/ProductPage.astro +146 -0
  306. package/src/components/store/StorePage.astro +137 -0
  307. package/src/components/store/StoreScript.astro +572 -0
  308. package/src/components/volunteer/ShiftLive.astro +90 -0
  309. package/src/components/volunteer/detail.astro +247 -0
  310. package/src/components/volunteer/list.astro +298 -0
  311. package/src/components/volunteer/props.ts +21 -0
  312. package/src/env.d.ts +22 -0
  313. package/src/index.d.ts +10 -0
  314. package/src/index.js +63 -0
  315. package/src/layouts/Site.astro +387 -0
  316. package/src/lib/academy.ts +146 -0
  317. package/src/lib/brand.ts +534 -0
  318. package/src/lib/chrome.ts +121 -0
  319. package/src/lib/donate-frame.ts +104 -0
  320. package/src/lib/entries.ts +190 -0
  321. package/src/lib/env.ts +34 -0
  322. package/src/lib/event-map-draw.ts +91 -0
  323. package/src/lib/events.ts +476 -0
  324. package/src/lib/fonts.ts +116 -0
  325. package/src/lib/footer.ts +24 -0
  326. package/src/lib/format.ts +160 -0
  327. package/src/lib/geo.ts +131 -0
  328. package/src/lib/live.ts +55 -0
  329. package/src/lib/menu.ts +48 -0
  330. package/src/lib/petition-text.ts +29 -0
  331. package/src/lib/reading.ts +17 -0
  332. package/src/lib/regions.ts +215 -0
  333. package/src/lib/section.ts +105 -0
  334. package/src/lib/shifts.ts +187 -0
  335. package/src/lib/store.ts +521 -0
  336. package/src/lib/stream-time.ts +20 -0
  337. package/src/lib/stream.ts +141 -0
  338. package/src/lib/visitor.ts +54 -0
  339. package/src/routes/catch-all.astro +435 -0
  340. package/src/routes/form.astro +30 -0
  341. package/src/routes/live.astro +49 -0
  342. package/src/routes/not-found.astro +18 -0
  343. package/src/routes/preview.astro +60 -0
  344. package/src/routes/setup.astro +62 -0
  345. package/src/routes/volunteer-shift.astro +61 -0
  346. package/src/styles/entries.css +784 -0
  347. package/src/styles/site.css +1910 -0
  348. package/src/styles/store.css +634 -0
  349. package/src/template.ts +182 -0
@@ -0,0 +1,125 @@
1
+ ---
2
+ // The header's light and dark switch, for a site whose appearance is auto
3
+ // (src/lib/brand.ts). The page follows the visitor's system until they press
4
+ // it; then it shows the other set and keeps the choice in this browser
5
+ // (`gg-mode`, as `data-gg-mode` on <html>). src/layouts/Site.astro applies a
6
+ // kept choice in the <head>, before the page paints, so a dark page never
7
+ // flashes light. BackGold's module frames on the page follow along: the
8
+ // page's mode is sent to each (`backgold:mode`) when it loads, when it reports
9
+ // its height, and on every press.
10
+ // Without scripts the button stays hidden and the system decides.
11
+ ---
12
+ <button class="mode-toggle" type="button" data-mode-toggle aria-pressed="false" hidden>
13
+ <span class="visually-hidden">Dark mode</span>
14
+ <svg class="mode-icon mode-icon-moon" viewBox="0 0 24 24" aria-hidden="true"><path d="M20 14.5A8 8 0 0 1 9.5 4a8 8 0 1 0 10.5 10.5z" /></svg>
15
+ <svg class="mode-icon mode-icon-sun" viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="4" /><path d="M12 2v2M12 20v2M2 12h2M20 12h2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4" /></svg>
16
+ </button>
17
+
18
+ <script is:inline>
19
+ ;(function () {
20
+ var button = document.querySelector('[data-mode-toggle]')
21
+ if (!button) return
22
+ var root = document.documentElement
23
+ var system = window.matchMedia ? window.matchMedia('(prefers-color-scheme: dark)') : null
24
+ function current() {
25
+ var chosen = root.getAttribute('data-gg-mode')
26
+ if (chosen === 'dark' || chosen === 'light') return chosen
27
+ return system && system.matches ? 'dark' : 'light'
28
+ }
29
+ function show() {
30
+ button.setAttribute('aria-pressed', current() === 'dark' ? 'true' : 'false')
31
+ }
32
+ function tell(frame) {
33
+ var origin
34
+ try {
35
+ origin = new URL(frame.src).origin
36
+ } catch (e) {
37
+ return
38
+ }
39
+ if (frame.contentWindow) frame.contentWindow.postMessage({ type: 'backgold:mode', mode: current() }, origin)
40
+ }
41
+ function frames() {
42
+ return document.querySelectorAll('iframe[data-bg-embed]')
43
+ }
44
+ // A frame is told the page's mode when it loads (the frames are further
45
+ // down the page than this script, and load does not bubble: capture), and
46
+ // again each time it reports its height, since a module that draws itself
47
+ // after its document loads is only listening by then.
48
+ document.addEventListener(
49
+ 'load',
50
+ function (e) {
51
+ var t = e.target
52
+ if (t && t.tagName === 'IFRAME' && t.hasAttribute('data-bg-embed')) tell(t)
53
+ },
54
+ true,
55
+ )
56
+ addEventListener('message', function (e) {
57
+ var sent = e.data
58
+ if (!sent || sent.type !== 'givegold:resize') return
59
+ var all = frames()
60
+ for (var i = 0; i < all.length; i++) if (all[i].contentWindow === e.source) tell(all[i])
61
+ })
62
+ button.hidden = false
63
+ show()
64
+ if (system && system.addEventListener) {
65
+ system.addEventListener('change', function () {
66
+ show()
67
+ var all = frames()
68
+ for (var k = 0; k < all.length; k++) tell(all[k])
69
+ })
70
+ }
71
+ button.addEventListener('click', function () {
72
+ var next = current() === 'dark' ? 'light' : 'dark'
73
+ root.setAttribute('data-gg-mode', next)
74
+ try {
75
+ localStorage.setItem('gg-mode', next)
76
+ } catch (e) {}
77
+ show()
78
+ var all = frames()
79
+ for (var j = 0; j < all.length; j++) tell(all[j])
80
+ })
81
+ })()
82
+ </script>
83
+
84
+ <style>
85
+ .mode-toggle {
86
+ flex-shrink: 0;
87
+ display: inline-grid;
88
+ place-items: center;
89
+ width: 2.375rem;
90
+ height: 2.375rem;
91
+ padding: 0;
92
+ border: 1.5px solid var(--line-strong);
93
+ border-radius: var(--pill);
94
+ background: transparent;
95
+ color: var(--ink);
96
+ cursor: pointer;
97
+ }
98
+ .mode-toggle[hidden] {
99
+ display: none;
100
+ }
101
+ .mode-toggle:hover {
102
+ border-color: var(--ink);
103
+ }
104
+ .mode-toggle:focus-visible {
105
+ outline: 2px solid var(--link);
106
+ outline-offset: 2px;
107
+ }
108
+ .mode-icon {
109
+ width: 1.125rem;
110
+ height: 1.125rem;
111
+ fill: none;
112
+ stroke: currentColor;
113
+ stroke-width: 2;
114
+ stroke-linecap: round;
115
+ stroke-linejoin: round;
116
+ }
117
+ /* The icon names what a press switches to: the moon while light, the sun while dark. */
118
+ .mode-icon-sun,
119
+ .mode-toggle[aria-pressed='true'] .mode-icon-moon {
120
+ display: none;
121
+ }
122
+ .mode-toggle[aria-pressed='true'] .mode-icon-sun {
123
+ display: block;
124
+ }
125
+ </style>
@@ -0,0 +1,53 @@
1
+ ---
2
+ // The one-time notice after a sign-in (board D4, "Back on the site"): the
3
+ // portal's return leg lands on the page with `#signed-in`, which shows it
4
+ // (`:target`, no script). Close is a link to the page's main region, which
5
+ // takes the fragment away and the notice with it. Drawn only for a signed-in
6
+ // visitor, whose page is theirs alone.
7
+ import type { Visitor } from '@backgold/content'
8
+
9
+ interface Props {
10
+ visitor: Visitor
11
+ /** The host the visitor is on. */
12
+ domain: string
13
+ }
14
+
15
+ const { visitor, domain } = Astro.props
16
+ ---
17
+ <div class="signed-in-notice" id="signed-in" role="status">
18
+ <div class="signed-in-notice-inner">
19
+ <span>You are signed in as <b>{visitor.email}</b> on {domain}.</span>
20
+ <a class="signed-in-notice-close" href="#main">Close</a>
21
+ </div>
22
+ </div>
23
+
24
+ <style>
25
+ .signed-in-notice {
26
+ display: none;
27
+ background: var(--band-tint);
28
+ color: var(--band-tint-ink);
29
+ border-bottom: 1px solid var(--line);
30
+ font-size: var(--text-sm);
31
+ }
32
+ .signed-in-notice:target {
33
+ display: block;
34
+ }
35
+ .signed-in-notice-inner {
36
+ max-width: calc(var(--content) + 2 * var(--gutter));
37
+ margin: 0 auto;
38
+ padding: 0.75rem var(--gutter);
39
+ display: flex;
40
+ align-items: center;
41
+ justify-content: space-between;
42
+ gap: 1rem;
43
+ }
44
+ .signed-in-notice-close {
45
+ flex-shrink: 0;
46
+ color: inherit;
47
+ font-weight: 700;
48
+ }
49
+ .signed-in-notice-close:focus-visible {
50
+ outline: 2px solid var(--link);
51
+ outline-offset: 2px;
52
+ }
53
+ </style>
@@ -0,0 +1,12 @@
1
+ ---
2
+ // An email sign-up placed Above the footer (board A1, "Area · Above the
3
+ // footer · Email signup · Band"): whatever layout it was stored with, it is
4
+ // drawn in the Band layout there, the kicker and heading beside BackGold's
5
+ // form. Site.astro passes this component for SignupCapture in the Above the
6
+ // footer area only; anywhere else the section draws its own layout.
7
+ import type { ComponentProps } from 'astro/types'
8
+ import SignupCapture from '../sections/SignupCapture/index.astro'
9
+
10
+ type Props = ComponentProps<typeof SignupCapture>
11
+ ---
12
+ <SignupCapture {...Astro.props} variant="band" />
@@ -0,0 +1,56 @@
1
+ ---
2
+ // TakeoverBanner (board A12, "Takeover banner · Takeover"): a full-screen ask
3
+ // before the page, until its end date. The headline large and the line of
4
+ // pitch under it, centred, on the band chosen in BackGold, filling the first
5
+ // screen; the page follows below it, so a visitor reads the ask first and
6
+ // scrolls on to the page (no script, nothing to dismiss). It is site chrome,
7
+ // not a page section: it arrives only inside an area (most often Top banner,
8
+ // which Site.astro draws first, above the header), and sections/index.ts
9
+ // registers it so <Area> can draw it; an end date in the area item hides it
10
+ // on time. The headline is an <h2>: the page's <h1> is its own.
11
+ import type { Section } from '@backgold/content'
12
+ import Band from '../sections/Band.astro'
13
+ import { text } from '../../lib/format'
14
+
15
+ interface Props {
16
+ section: Section
17
+ variant?: string
18
+ }
19
+
20
+ const { section } = Astro.props
21
+ const headline = text(section.copy.headline)
22
+ const pitch = text(section.copy.pitch)
23
+ ---
24
+ {(headline || pitch) && (
25
+ <Band section={section} class="takeover">
26
+ {headline && <h2 class="takeover-headline">{headline}</h2>}
27
+ {pitch && <p class="takeover-pitch">{pitch}</p>}
28
+ </Band>
29
+ )}
30
+
31
+ <style>
32
+ :global(.bg-section.takeover) {
33
+ display: grid;
34
+ align-content: center;
35
+ min-height: 100vh;
36
+ min-height: 100svh;
37
+ text-align: center;
38
+ }
39
+ /* A contained takeover is still the first screen: it keeps its corners and margins inside it. */
40
+ :global(.bg-section.takeover.bg-bleed-contained) {
41
+ min-height: calc(100vh - 2 * var(--gutter));
42
+ min-height: calc(100svh - 2 * var(--gutter));
43
+ }
44
+ .takeover-headline {
45
+ max-width: 14em;
46
+ margin: 0 auto;
47
+ font-size: clamp(2.5rem, 1.5rem + 4vw, 4.5rem);
48
+ line-height: 1;
49
+ }
50
+ .takeover-pitch {
51
+ max-width: 34em;
52
+ margin: 1.25rem auto 0;
53
+ color: var(--muted);
54
+ font-size: var(--text-lg);
55
+ }
56
+ </style>
@@ -0,0 +1,82 @@
1
+ ---
2
+ // The header's account links (board D1): signed in, the visitor's first name
3
+ // (else the part of their email before the @) and Sign out; signed out, Sign
4
+ // in. Both are quiet links beside the light and dark switch, each taking the
5
+ // visitor back to this page; Sign in names the page's lesson or course to the
6
+ // portal's door when the page has one (`signInTitle`). On a phone with a menu sheet the name stays in
7
+ // the bar and Sign out moves into the sheet (`mode="sheet"` draws it there).
8
+ // Signed in or not, it is drawn only on a page answered to one person or to
9
+ // everyone alike: a visitor's page is private (the middleware), and the
10
+ // signed-out links name no one.
11
+ import { signInHref, signOutHref } from '@backgold/astro/server'
12
+ import type { Visitor } from '@backgold/content'
13
+
14
+ interface Props {
15
+ visitor: Visitor | null
16
+ mode: 'bar' | 'sheet'
17
+ /** What Sign in names to the portal's door: the page's lesson or course; none elsewhere. */
18
+ signInTitle?: string | null
19
+ }
20
+
21
+ const { visitor, mode, signInTitle = null } = Astro.props
22
+ const here = `${Astro.url.pathname}${Astro.url.search}`
23
+ const name = visitor ? (visitor.first_name?.trim() || visitor.email.split('@')[0] || visitor.email) : null
24
+ ---
25
+ {mode === 'bar' ? (
26
+ <div class="header-account">
27
+ {visitor ? (
28
+ <>
29
+ <span class="header-account-name">{name}</span>
30
+ <a class="header-account-link header-account-out" href={signOutHref(here)}>Sign out</a>
31
+ </>
32
+ ) : (
33
+ <a class="header-account-link" href={signInHref(here, signInTitle)}>Sign in</a>
34
+ )}
35
+ </div>
36
+ ) : (
37
+ visitor && (
38
+ <p class="header-sheet-account">
39
+ <a class="header-account-link" href={signOutHref(here)}>Sign out</a>
40
+ </p>
41
+ )
42
+ )}
43
+
44
+ <style>
45
+ .header-account {
46
+ flex-shrink: 0;
47
+ display: inline-flex;
48
+ align-items: center;
49
+ gap: 0.75rem;
50
+ font-size: var(--text-sm);
51
+ font-weight: 600;
52
+ white-space: nowrap;
53
+ }
54
+ .header-account-name {
55
+ color: var(--ink);
56
+ }
57
+ .header-account-out {
58
+ padding-left: 0.75rem;
59
+ border-left: 1px solid var(--line);
60
+ }
61
+ .header-account-link {
62
+ border-radius: 0.25rem;
63
+ }
64
+ .header-account-link:hover {
65
+ text-decoration: underline;
66
+ }
67
+ .header-account-link:focus-visible {
68
+ outline: 2px solid var(--link);
69
+ outline-offset: 2px;
70
+ }
71
+ .header-sheet-account {
72
+ margin: 1.25rem 0 0;
73
+ text-align: center;
74
+ font-weight: 600;
75
+ }
76
+ /* Under the bar width, with a sheet to hold it, Sign out moves into the sheet. */
77
+ @media (max-width: 55.99rem) {
78
+ :global(.site-header:has(.header-sheet)) .header-account-out {
79
+ display: none;
80
+ }
81
+ }
82
+ </style>
@@ -0,0 +1,47 @@
1
+ ---
2
+ // Who wrote it, at the end of an entry (board C11): for each writer a box on
3
+ // the tint with their picture (or their initials on the brand's disc), their
4
+ // role as a kicker ("Written by", "Interview by"), their name as a heading
5
+ // that links to their page, and the bio from their author record. Editors
6
+ // and photographers stay in the byline only.
7
+ import type { EntryAuthor } from '@backgold/content'
8
+ import { relFor, safeHref, safeSrc } from '@backgold/astro/server'
9
+ import Prose from '../Prose.astro'
10
+ import { initials, writers } from '../../lib/entries'
11
+
12
+ interface Props {
13
+ authors: EntryAuthor[]
14
+ }
15
+
16
+ const people = writers(Astro.props.authors).slice(0, 3)
17
+ const bg = Astro.locals.backgold
18
+ const records = bg.setup === null ? await Promise.all(people.map((p) => bg.client.author(p.slug).catch(() => null))) : []
19
+ const boxes = people.map((person, i) => {
20
+ const record = records[i]?.author ?? null
21
+ const link = safeHref(record?.link_url ?? person.link_url)
22
+ return {
23
+ name: record?.display_name ?? person.display_name,
24
+ role: person.role,
25
+ href: `/authors/${encodeURIComponent(person.slug)}`,
26
+ avatar: safeSrc(record?.avatar_url ?? person.avatar_url),
27
+ bio: record?.bio ?? null,
28
+ link,
29
+ rel: link ? relFor(link) : undefined,
30
+ }
31
+ })
32
+ ---
33
+ {boxes.length > 0 && (
34
+ <section class="author-boxes" aria-label={boxes.length === 1 ? 'About the author' : 'About the authors'}>
35
+ {boxes.map((box) => (
36
+ <div class="author-box">
37
+ {box.avatar ? <img class="author-box-avatar" src={box.avatar} alt="" width="56" height="56" loading="lazy" /> : <span class="author-box-avatar" aria-hidden="true">{initials(box.name)}</span>}
38
+ <div>
39
+ <p class="kicker author-box-role">{box.role}</p>
40
+ <p class="author-box-name"><a href={box.href}>{box.name}</a></p>
41
+ {box.bio ? <Prose value={box.bio} class="author-box-bio" /> : <p class="muted">More from {box.name} is on their page.</p>}
42
+ {box.link && <p class="author-box-link"><a href={box.link} rel={box.rel}>Their website</a></p>}
43
+ </div>
44
+ </div>
45
+ ))}
46
+ </section>
47
+ )}
@@ -0,0 +1,29 @@
1
+ ---
2
+ // An entry's own fields (those its type declares in BackGold), each drawn by
3
+ // its kind through FieldValue, after the body. A type the organization adds
4
+ // renders with no change here. `omit` leaves out fields a layout already
5
+ // shows in its own place (the newsletter's issue line).
6
+ import type { ContentTypeSummary, EntryDetail } from '@backgold/content'
7
+ import FieldValue from '../FieldValue.astro'
8
+
9
+ interface Props {
10
+ entry: EntryDetail
11
+ type: ContentTypeSummary | undefined
12
+ omit?: string[]
13
+ }
14
+
15
+ const { entry, type, omit = [] } = Astro.props
16
+ const isEmpty = (value: unknown) =>
17
+ value === null || value === undefined || (typeof value === 'string' && value.trim() === '') || (Array.isArray(value) && value.length === 0)
18
+ const fields = (type?.fields ?? []).filter((field) => !omit.includes(field.key) && !isEmpty(entry.fields?.[field.key]))
19
+ ---
20
+ {fields.length > 0 && (
21
+ <dl class="fields">
22
+ {fields.map((field) => (
23
+ <div class="field">
24
+ <dt>{field.label}</dt>
25
+ <dd><FieldValue field={field} value={entry.fields[field.key]} /></dd>
26
+ </div>
27
+ ))}
28
+ </dl>
29
+ )}
@@ -0,0 +1,77 @@
1
+ ---
2
+ // The top of an entry's page, shared by every entry layout (board C11): the
3
+ // breadcrumb (its list as a link, then its category, the entry itself named
4
+ // for screen readers as the current page), the entry's terms as chips over
5
+ // the title, each a link to the term's list (categories first, on the wash,
6
+ // then tags), or the layout's own words in their place, the title as the
7
+ // page's one <h1>, the summary, and the byline: the lead writer's picture or
8
+ // initials, the writers' names (the role said only for editors, photographers
9
+ // and the rest), the date and the reading time when the layout passes one.
10
+ import type { ContentTypeSummary, EntryDetail } from '@backgold/content'
11
+ import { safeSrc } from '@backgold/astro/server'
12
+ import { formatDay } from '../../lib/format'
13
+ import { bylineGroups, initials, listOf, termPath } from '../../lib/entries'
14
+
15
+ interface Props {
16
+ entry: EntryDetail
17
+ type: ContentTypeSummary | undefined
18
+ /** Words over the title instead of the entry's terms ("Episode", an issue's line). */
19
+ kicker?: string | null
20
+ minutes?: number | null
21
+ /** The list's name in the breadcrumb in place of the one its address gives: a template's own words for it. */
22
+ listLabel?: string | null
23
+ }
24
+
25
+ const { entry, type, kicker = null, minutes = null, listLabel = null } = Astro.props
26
+ const listed = listOf(type)
27
+ const list = listed && listLabel ? { ...listed, name: listLabel } : listed
28
+ const base = list?.path ?? null
29
+ const day = formatDay(entry.publish_at)
30
+ const groups = bylineGroups(entry.authors)
31
+ const lead = entry.authors[0]
32
+ const avatar = lead ? safeSrc(lead.avatar_url) : null
33
+ const crumbTerm = entry.terms.find((t) => t.taxonomy === 'category') ?? null
34
+ const chips = [...entry.terms].sort((a, b) => Number(b.taxonomy === 'category') - Number(a.taxonomy === 'category'))
35
+ ---
36
+ <header class="entry-header">
37
+ {list && (
38
+ <nav class="crumbs" aria-label="Breadcrumb">
39
+ <a href={list.path}>{list.name}</a>
40
+ {crumbTerm && <><span class="crumbs-sep" aria-hidden="true">›</span><span>{crumbTerm.label}</span></>}
41
+ <span class="visually-hidden" aria-current="page">{entry.title}</span>
42
+ </nav>
43
+ )}
44
+ {kicker ? (
45
+ <p class="kicker">{kicker}</p>
46
+ ) : (
47
+ base && chips.length > 0 && (
48
+ <ul class="entry-terms" role="list">
49
+ {chips.map((term) => <li><a class:list={['chip', term.taxonomy === 'category' && 'chip-wash']} href={termPath(base, term.taxonomy, term.slug)}>{term.label}</a></li>)}
50
+ </ul>
51
+ )
52
+ )}
53
+ <h1>{entry.title}</h1>
54
+ {entry.summary && <p class="lede">{entry.summary}</p>}
55
+ {(groups.length > 0 || day) && (
56
+ <div class="byline">
57
+ {lead && (avatar ? <img class="byline-avatar" src={avatar} alt="" width="30" height="30" /> : <span class="byline-avatar" aria-hidden="true">{initials(lead.display_name)}</span>)}
58
+ <p>
59
+ {groups.map(({ role, people }, i) => (
60
+ <>
61
+ {i > 0 && ' · '}
62
+ {role !== 'Written by' && <>{role}{' '}</>}
63
+ {people.map((person, j) => (
64
+ <>
65
+ {j > 0 && (j === people.length - 1 ? ' and ' : ', ')}
66
+ <a href={person.href}>{person.display_name}</a>
67
+ </>
68
+ ))}
69
+ </>
70
+ ))}
71
+ {groups.length > 0 && day && ' · '}
72
+ {day && entry.publish_at && <time datetime={entry.publish_at}>{day}</time>}
73
+ {minutes !== null && <> · {minutes} min read</>}
74
+ </p>
75
+ </div>
76
+ )}
77
+ </header>
@@ -0,0 +1,126 @@
1
+ ---
2
+ // Around every list layout: the list's head, its filter, the rows the layout
3
+ // draws in the slot and the pager under them (board C10).
4
+ //
5
+ // The head is the list's name as the page's one <h1> (on a term's list, the
6
+ // term, under the list's name), or on the whole news list its intro when it
7
+ // has one: the page at the list's address, its opening (its leading Hero,
8
+ // the headline the <h1>) drawn as the head and its other sections after it,
9
+ // as a page draws them.
10
+ //
11
+ // The filter row: All, then each term a listed entry carries, in the
12
+ // organization's order, the current one marked; after them, past a short
13
+ // rule, the link to the featured category's list ("Press releases →",
14
+ // lib/entries.ts listTermsOf) when the organization has that category. On
15
+ // the news list the search box (ListSearch) ends the filter row (board A4),
16
+ // or, for a template whose `newsSearch` is `head`, sits beside the head on
17
+ // its last line (board C10). A term's list pages the same way at its own
18
+ // address.
19
+ //
20
+ // Under the rows the pager: "Older" on to the next page when there is one,
21
+ // and "Newest" back to the first from any later page. A search's results say
22
+ // how many matched ("2 results for ‘levy’"), or that nothing did, and have no
23
+ // pager; All stays unmarked, since they are not the whole list. A list with
24
+ // nothing in it, or a term with nothing under it yet, is an invitation: what
25
+ // will show here, a button to the sign-up Above the footer when the page
26
+ // carries one, and, on a term's list, the way back to the whole list.
27
+ import { areaEntriesOf } from '@backgold/astro/server'
28
+ import PageSections from '../PageSections.astro'
29
+ import ListSearch from './ListSearch.astro'
30
+ import type { ListLayoutProps } from './props'
31
+ import { basePath, listName, listTermsOf, termPath } from '../../lib/entries'
32
+ import { leadsWithHero } from '../../lib/section'
33
+ import '../../styles/entries.css'
34
+
35
+ interface Props extends ListLayoutProps {
36
+ /** The plural the empty sentence and the pager's label use: "posts", "episodes", "videos", "issues". */
37
+ noun: string
38
+ /** The list's name in place of the one its address gives ("News"): a template's own words for it (the menu's "Stories"). A list with an intro page keeps the intro's. */
39
+ name?: string | null
40
+ class?: string
41
+ }
42
+
43
+ const { template, type, base: address, entries, pager, filter, term, search, intro = null, areas = null, noun, name: named = null, class: className } = Astro.props
44
+ const base = basePath(address)
45
+ const name = (intro?.page.title?.trim() ? null : named) || listName(type, address, intro)
46
+ const searchLabel = named && name === named ? `Search ${named.toLowerCase()}` : undefined
47
+ const current = term ? `${term.taxonomy.key}/${term.term.slug}` : null
48
+ const q = search?.q ?? null
49
+ const results = (n: number) => (n === 1 ? '1 result' : `${n} results`)
50
+ const signupBelow = areaEntriesOf(areas, 'above_footer').some(
51
+ ({ item, needsWindow }) => !needsWindow && item.sections.some((section) => section.type === 'SignupCapture'),
52
+ )
53
+ const opening = intro && !term ? intro : null
54
+ const openingRest = opening ? opening.sections.length - (leadsWithHero(opening.sections) ? 1 : 0) > 0 : false
55
+ const bg = Astro.locals.backgold
56
+ const searchInHead = template.newsSearch === 'head'
57
+ const { chips, featured } = bg.setup === null ? await listTermsOf(bg.client, base, filter) : { chips: filter?.terms ?? [], featured: null }
58
+ ---
59
+ <div class:list={['listing', className]}>
60
+ <div class="list-head">
61
+ <div class="list-head-words">
62
+ {opening ? (
63
+ <PageSections template={template} page={opening} siteName={name} only="lead" />
64
+ ) : (
65
+ <header class="page-header list-header">
66
+ {term && <p class="kicker"><a href={base}>{name}</a> · {term.taxonomy.label}</p>}
67
+ <h1>{term ? term.term.label : name}</h1>
68
+ </header>
69
+ )}
70
+ </div>
71
+ {search && searchInHead && <ListSearch search={search} label={searchLabel} />}
72
+ </div>
73
+ {opening && openingRest && <div class="list-intro"><PageSections template={template} page={opening} siteName={name} only="rest" /></div>}
74
+ {(chips.length > 0 || featured || (search && !searchInHead)) && (
75
+ <div class="list-bar">
76
+ {(chips.length > 0 || featured) && (
77
+ <nav class="list-filter" aria-label={`Narrow the ${name.toLowerCase()}`}>
78
+ {chips.length > 0 && filter && (
79
+ <ul>
80
+ <li><a href={base} aria-current={current === null && q === null ? 'page' : undefined}>All</a></li>
81
+ {chips.map((t) => {
82
+ const key = `${filter.taxonomy}/${t.slug}`
83
+ return <li><a href={termPath(base, filter.taxonomy, t.slug)} aria-current={current === key ? 'page' : undefined}>{t.label}</a></li>
84
+ })}
85
+ </ul>
86
+ )}
87
+ {featured && (
88
+ <a class="list-featured" href={featured.href} aria-current={current === featured.key ? 'page' : undefined}>
89
+ {featured.label}
90
+ <svg viewBox="0 0 24 24" width="14" height="14" aria-hidden="true" focusable="false"><path d="M5 12h14M13 6l6 6-6 6" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"></path></svg>
91
+ </a>
92
+ )}
93
+ </nav>
94
+ )}
95
+ {search && !searchInHead && <ListSearch search={search} label={searchLabel} />}
96
+ </div>
97
+ )}
98
+ {q !== null && entries.length > 0 && <p class="list-results" role="status">{results(entries.length)} for ‘{q}’</p>}
99
+ {entries.length > 0 ? (
100
+ <slot />
101
+ ) : q !== null ? (
102
+ <p class="empty" role="status">Nothing matches ‘{q}’.</p>
103
+ ) : (
104
+ <div class="list-empty">
105
+ <span class="list-empty-mark" aria-hidden="true">
106
+ <svg viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="5" width="18" height="14" rx="2" /><path d="M7 9h5M7 13h10M7 16h10M15 9h2" /></svg>
107
+ </span>
108
+ <div>
109
+ <h2 class="list-empty-heading">{term ? `Nothing under ${term.term.label} yet.` : `No ${noun} yet.`}</h2>
110
+ <p>New {noun} show up here as soon as they are published.</p>
111
+ {(signupBelow || term) && (
112
+ <p class="actions">
113
+ {signupBelow && <a class="button" href="#above-the-footer">Get them by email</a>}
114
+ {term && <a class:list={['button', signupBelow && 'button-quiet']} href={base}>All {noun}</a>}
115
+ </p>
116
+ )}
117
+ </div>
118
+ </div>
119
+ )}
120
+ {(pager.newest || pager.older) && (
121
+ <nav class="pager" aria-label={`Pages of ${noun}`}>
122
+ {pager.newest && <a href={pager.newest}>Newest</a>}
123
+ {pager.older && <a href={pager.older} rel="next">Older</a>}
124
+ </nav>
125
+ )}
126
+ </div>
@@ -0,0 +1,24 @@
1
+ ---
2
+ // The news list's search box ("Search news", or the label a template's
3
+ // name for the list gives it): a GET form that sends `?q=` to
4
+ // the news list, its field first and its button after it, the magnifier drawn
5
+ // at the pill's start. ListFrame places it where the template asks
6
+ // (TemplateConfig `newsSearch`).
7
+ import type { ListSearch } from './props'
8
+
9
+ interface Props {
10
+ search: ListSearch
11
+ /** The box's words, when the list goes by a name of the template's ("Search stories"). */
12
+ label?: string
13
+ }
14
+
15
+ const { search, label = 'Search news' } = Astro.props
16
+ ---
17
+ <form class="list-search" role="search" method="get" action={search.action}>
18
+ <label class="visually-hidden" for="list-search-q">{label}</label>
19
+ <input id="list-search-q" type="search" name="q" value={search.q ?? undefined} placeholder={label} minlength="2" maxlength="80" required />
20
+ <button class="list-search-go" type="submit">
21
+ <svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true" focusable="false"><circle cx="11" cy="11" r="6.5" fill="none" stroke="currentColor" stroke-width="2"></circle><path d="M16 16l4.5 4.5" stroke="currentColor" stroke-width="2" stroke-linecap="round"></path></svg>
22
+ <span class="visually-hidden">{label}</span>
23
+ </button>
24
+ </form>
@@ -0,0 +1,24 @@
1
+ ---
2
+ // Share, under an entry: plain links that open an email, a post on X, or a
3
+ // post on Facebook with the entry's title and address. No counts, no
4
+ // script: an entry page loads none of its own.
5
+ interface Props {
6
+ title: string
7
+ /** The entry's path on this site. */
8
+ path: string
9
+ }
10
+
11
+ const { title, path } = Astro.props
12
+ const bg = Astro.locals.backgold
13
+ const origin = bg.setup === null ? bg.siteUrl : Astro.url.origin
14
+ const url = new URL(path, origin).href
15
+ const links = [
16
+ { label: 'Email', href: `mailto:?subject=${encodeURIComponent(title)}&body=${encodeURIComponent(url)}` },
17
+ { label: 'X', href: `https://x.com/intent/post?text=${encodeURIComponent(title)}&url=${encodeURIComponent(url)}` },
18
+ { label: 'Facebook', href: `https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(url)}` },
19
+ ]
20
+ ---
21
+ <div class="share" role="group" aria-label="Share">
22
+ <span class="share-label">Share</span>
23
+ {links.map((link) => <a class="share-link" href={link.href} rel={link.href.startsWith('https:') ? 'noopener' : undefined}>{link.label}</a>)}
24
+ </div>