@backgold/template-kit 0.0.0-stage → 0.1.0
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.
- package/LICENSE +21 -0
- package/README.md +12 -2
- package/dist/chunk-KOB36GSF.js +62 -0
- package/dist/constants-DvTNj4JI.d-Batjcj3Z.d.ts +38 -0
- package/dist/content-api-CYeY0vU8.d.ts +849 -0
- package/dist/contract/content-api-examples.d.ts +58 -0
- package/dist/contract/content-api-examples.js +783 -0
- package/dist/contract/content-api.d.ts +2 -0
- package/dist/contract/content-api.js +1 -0
- package/dist/contract/site-templates.d.ts +252 -0
- package/dist/contract/site-templates.js +185 -0
- package/package.json +70 -3
- package/src/components/EntryCard.astro +35 -0
- package/src/components/EventMap.astro +118 -0
- package/src/components/EventPage.astro +194 -0
- package/src/components/FieldValue.astro +41 -0
- package/src/components/LeadingHero.astro +21 -0
- package/src/components/NotFound.astro +20 -0
- package/src/components/PageSections.astro +47 -0
- package/src/components/Prose.astro +18 -0
- package/src/components/chrome/Brand.astro +54 -0
- package/src/components/chrome/ClosingCall.astro +94 -0
- package/src/components/chrome/DonateStrip.astro +61 -0
- package/src/components/chrome/FooterColumns.astro +32 -0
- package/src/components/chrome/FooterContact.astro +28 -0
- package/src/components/chrome/MenuList.astro +45 -0
- package/src/components/chrome/ModeToggle.astro +125 -0
- package/src/components/chrome/SignedInNotice.astro +53 -0
- package/src/components/chrome/SignupBand.astro +12 -0
- package/src/components/chrome/TakeoverBanner.astro +56 -0
- package/src/components/chrome/VisitorAccount.astro +82 -0
- package/src/components/entries/AuthorBox.astro +47 -0
- package/src/components/entries/EntryFields.astro +29 -0
- package/src/components/entries/EntryHeader.astro +77 -0
- package/src/components/entries/ListFrame.astro +126 -0
- package/src/components/entries/ListSearch.astro +24 -0
- package/src/components/entries/Share.astro +24 -0
- package/src/components/entries/course/classroom.astro +26 -0
- package/src/components/entries/course/lesson.astro +18 -0
- package/src/components/entries/course/section.ts +20 -0
- package/src/components/entries/course/syllabus.astro +15 -0
- package/src/components/entries/index.ts +77 -0
- package/src/components/entries/newsletter/issue.astro +41 -0
- package/src/components/entries/newsletter/list.astro +26 -0
- package/src/components/entries/podcast/episode.astro +42 -0
- package/src/components/entries/podcast/list.astro +36 -0
- package/src/components/entries/post/article.astro +31 -0
- package/src/components/entries/post/list.astro +85 -0
- package/src/components/entries/props.ts +61 -0
- package/src/components/entries/video/cards.astro +39 -0
- package/src/components/entries/video/grid.astro +15 -0
- package/src/components/entries/video/watch.astro +41 -0
- package/src/components/live/LivePage.astro +215 -0
- package/src/components/live/LocalTime.astro +29 -0
- package/src/components/sections/About/books.astro +188 -0
- package/src/components/sections/About/credentials.ts +90 -0
- package/src/components/sections/About/index.astro +57 -0
- package/src/components/sections/About/left.astro +54 -0
- package/src/components/sections/About/letter.astro +108 -0
- package/src/components/sections/About/portrait.astro +308 -0
- package/src/components/sections/Advocacy/compact.astro +14 -0
- package/src/components/sections/Advocacy/index.astro +14 -0
- package/src/components/sections/Band.astro +39 -0
- package/src/components/sections/Blog/feature.astro +176 -0
- package/src/components/sections/Blog/index.astro +37 -0
- package/src/components/sections/Blog/latest.ts +80 -0
- package/src/components/sections/Blog/list.astro +186 -0
- package/src/components/sections/Booking/index.astro +139 -0
- package/src/components/sections/Booking/list.astro +144 -0
- package/src/components/sections/Booking/types.ts +60 -0
- package/src/components/sections/Calendar/agenda.astro +14 -0
- package/src/components/sections/Calendar/index.astro +14 -0
- package/src/components/sections/CandidateRoster/ballot.astro +394 -0
- package/src/components/sections/CandidateRoster/candidates.ts +69 -0
- package/src/components/sections/CandidateRoster/compact.astro +115 -0
- package/src/components/sections/CandidateRoster/index.astro +57 -0
- package/src/components/sections/CaseStudies/beforeafter.astro +222 -0
- package/src/components/sections/CaseStudies/cases.ts +111 -0
- package/src/components/sections/CaseStudies/grid.astro +261 -0
- package/src/components/sections/CaseStudies/index.astro +333 -0
- package/src/components/sections/Classroom/CourseCard.astro +181 -0
- package/src/components/sections/Classroom/Courses.astro +88 -0
- package/src/components/sections/Classroom/classroom.ts +141 -0
- package/src/components/sections/Classroom/index.astro +20 -0
- package/src/components/sections/Classroom/list.astro +15 -0
- package/src/components/sections/Collection/compact.astro +7 -0
- package/src/components/sections/Collection/entries.ts +62 -0
- package/src/components/sections/Collection/feature.astro +180 -0
- package/src/components/sections/Collection/index.astro +46 -0
- package/src/components/sections/Collection/library.astro +271 -0
- package/src/components/sections/Collection/list.astro +7 -0
- package/src/components/sections/Collection/outline.astro +134 -0
- package/src/components/sections/Collection/shelves.astro +191 -0
- package/src/components/sections/Comparison/Unlisted.astro +6 -0
- package/src/components/sections/Comparison/cards.astro +171 -0
- package/src/components/sections/Comparison/index.astro +191 -0
- package/src/components/sections/Comparison/sides.ts +98 -0
- package/src/components/sections/Comparison/spectrum.astro +261 -0
- package/src/components/sections/ContentPost/banner.astro +152 -0
- package/src/components/sections/ContentPost/index.astro +35 -0
- package/src/components/sections/ContentPost/lesson.ts +119 -0
- package/src/components/sections/ContentPost/player.astro +254 -0
- package/src/components/sections/ContentPost/theater.astro +329 -0
- package/src/components/sections/Countdown/index.astro +53 -0
- package/src/components/sections/Course/Bar.astro +46 -0
- package/src/components/sections/Course/CourseHead.astro +123 -0
- package/src/components/sections/Course/Crumbs.astro +44 -0
- package/src/components/sections/Course/Icon.astro +29 -0
- package/src/components/sections/Course/Ring.astro +62 -0
- package/src/components/sections/Course/Syllabus.astro +146 -0
- package/src/components/sections/Course/course.ts +146 -0
- package/src/components/sections/Course/index.astro +143 -0
- package/src/components/sections/Course/outline.astro +39 -0
- package/src/components/sections/Cta/banner.astro +64 -0
- package/src/components/sections/Cta/card.astro +88 -0
- package/src/components/sections/Cta/index.astro +31 -0
- package/src/components/sections/Cta/photo.astro +114 -0
- package/src/components/sections/Cta/strip.astro +91 -0
- package/src/components/sections/Donate/index.astro +136 -0
- package/src/components/sections/Donate/story.astro +7 -0
- package/src/components/sections/Event/card.astro +14 -0
- package/src/components/sections/Event/index.astro +14 -0
- package/src/components/sections/EventsList/AgendaMonths.astro +105 -0
- package/src/components/sections/EventsList/CalendarLine.astro +23 -0
- package/src/components/sections/EventsList/EventRows.astro +196 -0
- package/src/components/sections/EventsList/LiveCounts.astro +75 -0
- package/src/components/sections/EventsList/TypeTabs.astro +53 -0
- package/src/components/sections/EventsList/agenda.astro +55 -0
- package/src/components/sections/EventsList/calendar.astro +392 -0
- package/src/components/sections/EventsList/cards.astro +186 -0
- package/src/components/sections/EventsList/cohorts.astro +205 -0
- package/src/components/sections/EventsList/compact.astro +163 -0
- package/src/components/sections/EventsList/events.ts +168 -0
- package/src/components/sections/EventsList/index.astro +46 -0
- package/src/components/sections/EventsList/map.astro +436 -0
- package/src/components/sections/EventsList/shifts.astro +355 -0
- package/src/components/sections/EventsList/week.astro +361 -0
- package/src/components/sections/Faq/Contact.astro +63 -0
- package/src/components/sections/Faq/Questions.astro +98 -0
- package/src/components/sections/Faq/cards.astro +74 -0
- package/src/components/sections/Faq/faq.ts +101 -0
- package/src/components/sections/Faq/index.astro +49 -0
- package/src/components/sections/Faq/topics.astro +178 -0
- package/src/components/sections/Financials/Foot.astro +38 -0
- package/src/components/sections/Financials/Head.astro +47 -0
- package/src/components/sections/Financials/donut.astro +197 -0
- package/src/components/sections/Financials/financials.ts +52 -0
- package/src/components/sections/Financials/index.astro +148 -0
- package/src/components/sections/Financials/table.astro +157 -0
- package/src/components/sections/FormBlock/index.astro +33 -0
- package/src/components/sections/FormBlock/wide.astro +7 -0
- package/src/components/sections/Hero/cover.astro +170 -0
- package/src/components/sections/Hero/donate.astro +209 -0
- package/src/components/sections/Hero/field.astro +390 -0
- package/src/components/sections/Hero/index.astro +52 -0
- package/src/components/sections/Hero/overlap.astro +151 -0
- package/src/components/sections/Hero/rotating.astro +30 -0
- package/src/components/sections/Hero/split.astro +96 -0
- package/src/components/sections/Hero/statement.astro +55 -0
- package/src/components/sections/Hero/video.astro +399 -0
- package/src/components/sections/Issues/checklist.astro +204 -0
- package/src/components/sections/Issues/drawer.astro +237 -0
- package/src/components/sections/Issues/index.astro +115 -0
- package/src/components/sections/Issues/issues.ts +37 -0
- package/src/components/sections/Issues/numbered.astro +79 -0
- package/src/components/sections/Issues/rows.astro +137 -0
- package/src/components/sections/Issues/steps.astro +81 -0
- package/src/components/sections/Issues/tabs.astro +322 -0
- package/src/components/sections/Leaderboard/index.astro +29 -0
- package/src/components/sections/Lesson/Door.astro +121 -0
- package/src/components/sections/Lesson/LessonBody.astro +416 -0
- package/src/components/sections/Lesson/Rail.astro +182 -0
- package/src/components/sections/Lesson/Tracker.astro +137 -0
- package/src/components/sections/Lesson/index.astro +27 -0
- package/src/components/sections/Lesson/lesson.ts +233 -0
- package/src/components/sections/Lesson/reading.astro +21 -0
- package/src/components/sections/Map/CoverageLine.astro +19 -0
- package/src/components/sections/Map/RegionMap.astro +109 -0
- package/src/components/sections/Map/bar.astro +160 -0
- package/src/components/sections/Map/index.astro +192 -0
- package/src/components/sections/Map/map.astro +275 -0
- package/src/components/sections/MediaKit/BioCard.astro +108 -0
- package/src/components/sections/MediaKit/Downloads.astro +88 -0
- package/src/components/sections/MediaKit/index.astro +183 -0
- package/src/components/sections/MediaKit/kit.ts +140 -0
- package/src/components/sections/MediaKit/press.astro +189 -0
- package/src/components/sections/MediaKit/speaker.astro +205 -0
- package/src/components/sections/Membership/Benefits.astro +42 -0
- package/src/components/sections/Membership/Check.astro +12 -0
- package/src/components/sections/Membership/Price.astro +61 -0
- package/src/components/sections/Membership/compare.astro +312 -0
- package/src/components/sections/Membership/index.astro +281 -0
- package/src/components/sections/Membership/offers.ts +169 -0
- package/src/components/sections/Membership/tiers.astro +217 -0
- package/src/components/sections/MovementMap/index.astro +50 -0
- package/src/components/sections/MovementTicker/index.astro +43 -0
- package/src/components/sections/Pathways/Doors.astro +147 -0
- package/src/components/sections/Pathways/Head.astro +37 -0
- package/src/components/sections/Pathways/index.astro +27 -0
- package/src/components/sections/Pathways/pathways.ts +100 -0
- package/src/components/sections/Pathways/quiz.astro +286 -0
- package/src/components/sections/Pathways/tabs.astro +271 -0
- package/src/components/sections/PdfEmbed/card.astro +99 -0
- package/src/components/sections/PdfEmbed/index.astro +26 -0
- package/src/components/sections/PdfEmbed/medium.astro +7 -0
- package/src/components/sections/PdfEmbed/tall.astro +7 -0
- package/src/components/sections/Petition/coverage.astro +14 -0
- package/src/components/sections/Petition/image.astro +14 -0
- package/src/components/sections/Petition/index.astro +14 -0
- package/src/components/sections/Petition/map.astro +14 -0
- package/src/components/sections/PlatformPlanks/anchors.ts +66 -0
- package/src/components/sections/PlatformPlanks/columns.astro +171 -0
- package/src/components/sections/PlatformPlanks/index.astro +56 -0
- package/src/components/sections/PlatformPlanks/longread.astro +250 -0
- package/src/components/sections/PollBlock/index.astro +30 -0
- package/src/components/sections/Portfolio/featured.astro +343 -0
- package/src/components/sections/Portfolio/index.astro +571 -0
- package/src/components/sections/Portfolio/strip.astro +173 -0
- package/src/components/sections/Portfolio/work.ts +100 -0
- package/src/components/sections/Progress/MatchClock.astro +166 -0
- package/src/components/sections/Progress/compact.astro +150 -0
- package/src/components/sections/Progress/index.astro +32 -0
- package/src/components/sections/Progress/match.astro +126 -0
- package/src/components/sections/Progress/ring.astro +179 -0
- package/src/components/sections/QuickDonate/DonateCard.astro +149 -0
- package/src/components/sections/QuickDonate/Picker.astro +95 -0
- package/src/components/sections/QuickDonate/band.astro +164 -0
- package/src/components/sections/QuickDonate/bar.astro +208 -0
- package/src/components/sections/QuickDonate/donate.ts +126 -0
- package/src/components/sections/QuickDonate/hero.astro +143 -0
- package/src/components/sections/QuickDonate/index.astro +73 -0
- package/src/components/sections/QuickDonate/jar.astro +225 -0
- package/src/components/sections/QuickDonate/ladder.astro +248 -0
- package/src/components/sections/QuoteStrip/carousel.astro +340 -0
- package/src/components/sections/QuoteStrip/index.astro +58 -0
- package/src/components/sections/QuoteStrip/logos.astro +226 -0
- package/src/components/sections/QuoteStrip/quotes.ts +61 -0
- package/src/components/sections/QuoteStrip/single.astro +92 -0
- package/src/components/sections/QuoteStrip/ticker.astro +319 -0
- package/src/components/sections/QuoteStrip/wall.astro +113 -0
- package/src/components/sections/Resources/band.astro +93 -0
- package/src/components/sections/Resources/featured.astro +239 -0
- package/src/components/sections/Resources/index.astro +225 -0
- package/src/components/sections/Resources/resources.ts +92 -0
- package/src/components/sections/SampleBallot/Position.astro +39 -0
- package/src/components/sections/SampleBallot/ballot.ts +92 -0
- package/src/components/sections/SampleBallot/cards.astro +299 -0
- package/src/components/sections/SampleBallot/index.astro +326 -0
- package/src/components/sections/SampleBallot/measures.astro +172 -0
- package/src/components/sections/Scorecard/grades.astro +141 -0
- package/src/components/sections/Scorecard/index.astro +294 -0
- package/src/components/sections/Scorecard/promise.astro +167 -0
- package/src/components/sections/Scorecard/votes.ts +83 -0
- package/src/components/sections/SectionHead.astro +31 -0
- package/src/components/sections/Services/Button.astro +24 -0
- package/src/components/sections/Services/Check.astro +12 -0
- package/src/components/sections/Services/Includes.astro +42 -0
- package/src/components/sections/Services/compare.astro +328 -0
- package/src/components/sections/Services/index.astro +187 -0
- package/src/components/sections/Services/list.astro +181 -0
- package/src/components/sections/Services/services.ts +80 -0
- package/src/components/sections/ShareKit/Actions.astro +71 -0
- package/src/components/sections/ShareKit/Buttons.astro +62 -0
- package/src/components/sections/ShareKit/compact.astro +123 -0
- package/src/components/sections/ShareKit/index.astro +160 -0
- package/src/components/sections/ShareKit/share.ts +60 -0
- package/src/components/sections/ShareKit/strip.astro +173 -0
- package/src/components/sections/SignupCapture/band.astro +7 -0
- package/src/components/sections/SignupCapture/index.astro +103 -0
- package/src/components/sections/SignupCapture/inline.astro +7 -0
- package/src/components/sections/SocialFeed/index.astro +34 -0
- package/src/components/sections/StatCards/feature.astro +143 -0
- package/src/components/sections/StatCards/index.astro +51 -0
- package/src/components/sections/StatCards/ribbon.astro +113 -0
- package/src/components/sections/StatCards/wall.astro +177 -0
- package/src/components/sections/Store/featured.astro +14 -0
- package/src/components/sections/Store/index.astro +14 -0
- package/src/components/sections/Stories/Status.astro +42 -0
- package/src/components/sections/Stories/StoryCards.astro +171 -0
- package/src/components/sections/Stories/cards.astro +42 -0
- package/src/components/sections/Stories/index.astro +238 -0
- package/src/components/sections/Stories/stories.ts +97 -0
- package/src/components/sections/Stories/timeline.astro +135 -0
- package/src/components/sections/TeamGrid/board.astro +280 -0
- package/src/components/sections/TeamGrid/index.astro +71 -0
- package/src/components/sections/TeamGrid/list.astro +306 -0
- package/src/components/sections/TeamGrid/people.ts +178 -0
- package/src/components/sections/VideoEmbed/index.astro +52 -0
- package/src/components/sections/VideoEmbed/landscape.astro +7 -0
- package/src/components/sections/VideoEmbed/portrait.astro +7 -0
- package/src/components/sections/VideoEmbed/square.astro +7 -0
- package/src/components/sections/VoterTools/DaysLeft.astro +33 -0
- package/src/components/sections/VoterTools/dates.astro +149 -0
- package/src/components/sections/VoterTools/index.astro +228 -0
- package/src/components/sections/VoterTools/polling.astro +141 -0
- package/src/components/sections/VoterTools/voter-tools.ts +70 -0
- package/src/components/sections/index.ts +370 -0
- package/src/components/sections/modules/Headed.astro +39 -0
- package/src/components/sections/modules/ModuleFrame.astro +179 -0
- package/src/components/volunteer/ShiftLive.astro +90 -0
- package/src/components/volunteer/detail.astro +247 -0
- package/src/components/volunteer/list.astro +298 -0
- package/src/components/volunteer/props.ts +21 -0
- package/src/env.d.ts +22 -0
- package/src/index.d.ts +10 -0
- package/src/index.js +64 -0
- package/src/layouts/Site.astro +371 -0
- package/src/lib/academy.ts +146 -0
- package/src/lib/brand.ts +534 -0
- package/src/lib/chrome.ts +119 -0
- package/src/lib/donate-frame.ts +64 -0
- package/src/lib/entries.ts +190 -0
- package/src/lib/env.ts +34 -0
- package/src/lib/event-map-draw.ts +91 -0
- package/src/lib/events.ts +476 -0
- package/src/lib/fonts.ts +116 -0
- package/src/lib/footer.ts +24 -0
- package/src/lib/format.ts +160 -0
- package/src/lib/geo.ts +131 -0
- package/src/lib/live.ts +54 -0
- package/src/lib/menu.ts +48 -0
- package/src/lib/petition-text.ts +29 -0
- package/src/lib/reading.ts +17 -0
- package/src/lib/regions.ts +215 -0
- package/src/lib/section.ts +94 -0
- package/src/lib/shifts.ts +186 -0
- package/src/lib/stream-time.ts +20 -0
- package/src/lib/stream.ts +141 -0
- package/src/lib/visitor.ts +54 -0
- package/src/routes/catch-all.astro +286 -0
- package/src/routes/form.astro +30 -0
- package/src/routes/live.astro +49 -0
- package/src/routes/not-found.astro +18 -0
- package/src/routes/preview.astro +60 -0
- package/src/routes/setup.astro +62 -0
- package/src/routes/volunteer-shift.astro +61 -0
- package/src/routes/volunteer.astro +37 -0
- package/src/styles/entries.css +784 -0
- package/src/styles/site.css +1839 -0
- package/src/template.ts +182 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
---
|
|
2
|
+
// One event's page at /events/<slug> (board A7, One event · Full). At the
|
|
3
|
+
// left, the event as the site draws it: a breadcrumb back to Events and the
|
|
4
|
+
// event's month, its type and place as chips, the title as the page's one
|
|
5
|
+
// <h1>, its description, its facts (the day and the time in the event's own
|
|
6
|
+
// zone, named as a reader knows it, "6:30 PM to 8:00 PM Mountain Time", with
|
|
7
|
+
// Add to calendar, which is the event's .ics file on this site; the venue and
|
|
8
|
+
// address with Get directions; the live "going" and "seats left"), and, when
|
|
9
|
+
// the event has coordinates, the kit's map of the venue across the column
|
|
10
|
+
// (EventMap, board C6). At the
|
|
11
|
+
// right (under it on a phone), BackGold's RSVP and tickets on a raised card
|
|
12
|
+
// (ModuleFrame, layout `detail`), whose fields, limits, receipts and consent
|
|
13
|
+
// stay BackGold's.
|
|
14
|
+
import ModuleFrame from './sections/modules/ModuleFrame.astro'
|
|
15
|
+
import LiveCounts from './sections/EventsList/LiveCounts.astro'
|
|
16
|
+
import Prose from './Prose.astro'
|
|
17
|
+
import EventMap from './EventMap.astro'
|
|
18
|
+
import { typeLabel } from './sections/EventsList/events'
|
|
19
|
+
import { EVENTS_PATH, eventCalendarPath, type EventDetail } from '../lib/events'
|
|
20
|
+
import { formatWhen, zoneName } from '../lib/format'
|
|
21
|
+
|
|
22
|
+
interface Props {
|
|
23
|
+
event: EventDetail
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const { event } = Astro.props
|
|
27
|
+
|
|
28
|
+
/** "November", in the event's own zone (UTC without one); null for a start that does not parse. */
|
|
29
|
+
function monthOf(startsAt: string, timeZone: string | null): string | null {
|
|
30
|
+
const date = new Date(startsAt)
|
|
31
|
+
if (Number.isNaN(date.getTime())) return null
|
|
32
|
+
try {
|
|
33
|
+
return new Intl.DateTimeFormat('en-US', { month: 'long', timeZone: timeZone ?? 'UTC' }).format(date)
|
|
34
|
+
} catch {
|
|
35
|
+
return new Intl.DateTimeFormat('en-US', { month: 'long', timeZone: 'UTC' }).format(date)
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// The zone as a name ("Mountain Time"), said once after the times; without
|
|
40
|
+
// one each time carries what formatWhen writes for it.
|
|
41
|
+
const zone = zoneName(event.timezone)
|
|
42
|
+
|
|
43
|
+
/** formatWhen's "Saturday, November 1, 2026 at 6:30 PM" as its day and its time ("6:30 PM MDT" without a zone name). */
|
|
44
|
+
function split(value: string | null): { day: string; time: string | null } | null {
|
|
45
|
+
const full = formatWhen(value, event.timezone, zone === null)
|
|
46
|
+
if (!full) return null
|
|
47
|
+
const at = full.lastIndexOf(' at ')
|
|
48
|
+
return at < 0 ? { day: full, time: null } : { day: full.slice(0, at), time: full.slice(at + 4) }
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const month = monthOf(event.starts_at, event.timezone)
|
|
52
|
+
const start = split(event.starts_at)
|
|
53
|
+
const end = split(event.ends_at)
|
|
54
|
+
// "6:30 PM to 9:00 PM Mountain Time" on one day; the end's own day when it ends on another.
|
|
55
|
+
const span =
|
|
56
|
+
start?.time && end?.time
|
|
57
|
+
? end.day === start.day
|
|
58
|
+
? `${zone ? start.time : start.time.replace(/ [A-Z]{2,5}$/, '')} to ${end.time}`
|
|
59
|
+
: `${start.time} to ${end.day}, ${end.time}`
|
|
60
|
+
: (start?.time ?? null)
|
|
61
|
+
const time = span && zone ? `${span} ${zone}` : span
|
|
62
|
+
const type = typeLabel(event.type)
|
|
63
|
+
const place = event.is_virtual && !event.venue && !event.location ? 'Online' : (event.venue ?? event.location)
|
|
64
|
+
const where = event.venue ? event.address : null
|
|
65
|
+
/** The venue's coordinates for the map; null for an online event or without usable ones. */
|
|
66
|
+
const pinned =
|
|
67
|
+
!event.is_virtual && event.lat !== null && event.lng !== null && Math.abs(event.lat) <= 90 && Math.abs(event.lng) <= 180
|
|
68
|
+
? { lat: event.lat, lng: event.lng }
|
|
69
|
+
: null
|
|
70
|
+
const chips = [event.sells_tickets ? 'Ticketed' : type, event.is_virtual ? 'Online' : null].filter((c): c is string => !!c)
|
|
71
|
+
---
|
|
72
|
+
<div class="event-page">
|
|
73
|
+
<nav class="crumbs" aria-label="Breadcrumb">
|
|
74
|
+
<a href={EVENTS_PATH}>Events</a>
|
|
75
|
+
{month && <><span aria-hidden="true"> › </span><span>{month}</span></>}
|
|
76
|
+
</nav>
|
|
77
|
+
<div class="event-grid">
|
|
78
|
+
<div class="event-words">
|
|
79
|
+
{chips.length > 0 && (
|
|
80
|
+
<p class="event-chips">{chips.map((chip, i) => <span class:list={['chip', i === 0 ? 'chip-accent' : 'chip-wash']}>{chip}</span>)}</p>
|
|
81
|
+
)}
|
|
82
|
+
<h1>{event.title}</h1>
|
|
83
|
+
<Prose value={event.description} class="lede" />
|
|
84
|
+
<ul class="event-facts" role="list">
|
|
85
|
+
{start && (
|
|
86
|
+
<li>
|
|
87
|
+
<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="3" y="5" width="18" height="16" rx="2" /><path d="M3 10h18M8 3v4M16 3v4" /></svg>
|
|
88
|
+
<div>
|
|
89
|
+
<time datetime={event.starts_at}><b>{start.day}</b></time>
|
|
90
|
+
<span>
|
|
91
|
+
{time && <>{time} · </>}
|
|
92
|
+
<a href={eventCalendarPath(event.slug)}>Add to calendar</a>
|
|
93
|
+
</span>
|
|
94
|
+
</div>
|
|
95
|
+
</li>
|
|
96
|
+
)}
|
|
97
|
+
{place && (
|
|
98
|
+
<li>
|
|
99
|
+
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 21s-7-6.2-7-11.5a7 7 0 0 1 14 0C19 14.8 12 21 12 21z" /><circle cx="12" cy="9.5" r="2.5" /></svg>
|
|
100
|
+
<div>
|
|
101
|
+
<b>{place}</b>
|
|
102
|
+
{(where || event.directions_url) && (
|
|
103
|
+
<span>
|
|
104
|
+
{where}
|
|
105
|
+
{where && event.directions_url && ' · '}
|
|
106
|
+
{event.directions_url && <a href={event.directions_url} rel="noopener">Get directions</a>}
|
|
107
|
+
</span>
|
|
108
|
+
)}
|
|
109
|
+
</div>
|
|
110
|
+
</li>
|
|
111
|
+
)}
|
|
112
|
+
<li class="event-live-row">
|
|
113
|
+
<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="9" cy="8" r="3.5" /><path d="M2.5 20a6.5 6.5 0 0 1 13 0M16 4.5a3.5 3.5 0 0 1 0 7M18 14a6 6 0 0 1 3.5 6" /></svg>
|
|
114
|
+
<div><span class="event-live" data-bg-live={event.id}></span></div>
|
|
115
|
+
</li>
|
|
116
|
+
</ul>
|
|
117
|
+
{pinned && <EventMap lat={pinned.lat} lng={pinned.lng} place={place} address={where} title={event.title} />}
|
|
118
|
+
</div>
|
|
119
|
+
<ModuleFrame embed={event.embed} band="plain" type="Event" layout="detail" card title={`RSVP and tickets: ${event.title}`} height="44rem" />
|
|
120
|
+
</div>
|
|
121
|
+
<LiveCounts />
|
|
122
|
+
</div>
|
|
123
|
+
|
|
124
|
+
<style>
|
|
125
|
+
.event-page {
|
|
126
|
+
max-width: var(--content);
|
|
127
|
+
margin: 0 auto;
|
|
128
|
+
padding: clamp(1.25rem, 1rem + 1.5vw, 2.25rem) var(--gutter) var(--space);
|
|
129
|
+
}
|
|
130
|
+
.event-page .crumbs {
|
|
131
|
+
margin-bottom: 1.125rem;
|
|
132
|
+
}
|
|
133
|
+
.event-grid {
|
|
134
|
+
display: grid;
|
|
135
|
+
gap: 1.75rem;
|
|
136
|
+
align-items: start;
|
|
137
|
+
}
|
|
138
|
+
.event-chips {
|
|
139
|
+
display: flex;
|
|
140
|
+
flex-wrap: wrap;
|
|
141
|
+
gap: 0.5rem;
|
|
142
|
+
margin: 0;
|
|
143
|
+
}
|
|
144
|
+
.event-words h1 {
|
|
145
|
+
margin: 0.875rem 0 1rem;
|
|
146
|
+
font-size: clamp(2.375rem, 1.6rem + 2.4vw, 3.375rem);
|
|
147
|
+
line-height: 1.02;
|
|
148
|
+
font-weight: 800;
|
|
149
|
+
}
|
|
150
|
+
.event-facts {
|
|
151
|
+
display: grid;
|
|
152
|
+
gap: 0.875rem;
|
|
153
|
+
margin: 1.375rem 0 0;
|
|
154
|
+
padding: 0;
|
|
155
|
+
list-style: none;
|
|
156
|
+
}
|
|
157
|
+
.event-facts li {
|
|
158
|
+
display: grid;
|
|
159
|
+
grid-template-columns: 1.75rem 1fr;
|
|
160
|
+
gap: 0.625rem;
|
|
161
|
+
}
|
|
162
|
+
.event-facts svg {
|
|
163
|
+
width: 1.25rem;
|
|
164
|
+
height: 1.25rem;
|
|
165
|
+
fill: none;
|
|
166
|
+
stroke: var(--accent);
|
|
167
|
+
stroke-width: 1.9;
|
|
168
|
+
stroke-linecap: round;
|
|
169
|
+
stroke-linejoin: round;
|
|
170
|
+
}
|
|
171
|
+
.event-facts b {
|
|
172
|
+
display: block;
|
|
173
|
+
}
|
|
174
|
+
.event-facts span {
|
|
175
|
+
color: var(--muted);
|
|
176
|
+
font-size: var(--text-sm);
|
|
177
|
+
}
|
|
178
|
+
.event-facts a {
|
|
179
|
+
color: var(--link);
|
|
180
|
+
font-weight: 700;
|
|
181
|
+
text-decoration: underline;
|
|
182
|
+
text-underline-offset: 3px;
|
|
183
|
+
}
|
|
184
|
+
/* The live counts are empty with scripts off, or for an event no one has joined yet. */
|
|
185
|
+
.event-live-row:has(.event-live:empty) {
|
|
186
|
+
display: none;
|
|
187
|
+
}
|
|
188
|
+
@media (min-width: 56rem) {
|
|
189
|
+
.event-grid {
|
|
190
|
+
grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
|
|
191
|
+
gap: 3rem;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
</style>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
// One custom field of an entry, rendered by its kind from GET /types. A type
|
|
3
|
+
// the organization adds in BackGold renders with no change here; to give a
|
|
4
|
+
// field its own design, switch on `field.key` in
|
|
5
|
+
// src/components/entries/EntryFields.astro.
|
|
6
|
+
import type { ContentTypeField } from '@backgold/content'
|
|
7
|
+
import { relFor, safeHref, safeSrc, sanitizeRichText } from '@backgold/astro/server'
|
|
8
|
+
import Prose from './Prose.astro'
|
|
9
|
+
import { formatBytes, formatDay, formatWhen, text } from '../lib/format'
|
|
10
|
+
|
|
11
|
+
interface Props {
|
|
12
|
+
field: ContentTypeField
|
|
13
|
+
value: unknown
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const { field, value } = Astro.props
|
|
17
|
+
const record = value && typeof value === 'object' && !Array.isArray(value) ? (value as Record<string, unknown>) : null
|
|
18
|
+
const strings = Array.isArray(value) ? value.filter((v): v is string => typeof v === 'string' && v.trim() !== '') : []
|
|
19
|
+
const str = text(value)
|
|
20
|
+
|
|
21
|
+
const image = field.kind === 'image' && record ? safeSrc(record.url) : null
|
|
22
|
+
const pdf = field.kind === 'pdf' && record ? safeHref(record.url) : null
|
|
23
|
+
const pdfName = text(record?.file_name) ?? 'Download the PDF'
|
|
24
|
+
const pdfSize = formatBytes(record?.size_bytes)
|
|
25
|
+
const link = field.kind === 'link' ? safeHref(value) : null
|
|
26
|
+
const referenceUrl = field.kind === 'reference' && record ? safeHref(record.url) : null
|
|
27
|
+
const referenceLabel = text(record?.label)
|
|
28
|
+
const day = field.kind === 'date' ? formatDay(value) : field.kind === 'datetime' ? formatWhen(value) : null
|
|
29
|
+
---
|
|
30
|
+
{field.kind === 'short_text' && str && <p>{str}</p>}
|
|
31
|
+
{field.kind === 'long_text' && <Prose value={value} />}
|
|
32
|
+
{field.kind === 'rich_text' && str && <div class="prose" set:html={sanitizeRichText(str)} />}
|
|
33
|
+
{image && <img src={image} alt="" loading="lazy" decoding="async" />}
|
|
34
|
+
{pdf && <a href={pdf} rel={relFor(pdf)}>{pdfName}{pdfSize && <span class="muted"> (PDF, {pdfSize})</span>}</a>}
|
|
35
|
+
{link && <a href={link} rel={relFor(link)}>{link.replace(/^(https?:\/\/|mailto:|tel:)/, '')}</a>}
|
|
36
|
+
{day && str && <time datetime={str}>{day}</time>}
|
|
37
|
+
{field.kind === 'boolean' && typeof value === 'boolean' && <span>{value ? 'Yes' : 'No'}</span>}
|
|
38
|
+
{field.kind === 'choice' && str && <span>{str}</span>}
|
|
39
|
+
{field.kind === 'choices' && strings.length > 0 && <span>{strings.join(', ')}</span>}
|
|
40
|
+
{field.kind === 'list' && strings.length > 0 && <ul>{strings.map((item) => <li>{item}</li>)}</ul>}
|
|
41
|
+
{field.kind === 'reference' && referenceLabel && (referenceUrl ? <a href={referenceUrl} rel={relFor(referenceUrl)}>{referenceLabel}</a> : <span>{referenceLabel}</span>)}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
// The Hero a page opens with, its headline the page's <h1>. PageSections
|
|
3
|
+
// draws it through <Section> so it gets the same preview marker as every
|
|
4
|
+
// other section, which passes it only the section and its layout, so it
|
|
5
|
+
// reads the template's sections map from `Astro.locals.template`, which
|
|
6
|
+
// PageSections sets. The layout's own component comes from that map
|
|
7
|
+
// ('Hero:<layout>', else 'Hero'), as for any other Hero, with `level={1}`.
|
|
8
|
+
import type { Section } from '@backgold/content'
|
|
9
|
+
import DefaultHero from './sections/Hero/index.astro'
|
|
10
|
+
|
|
11
|
+
interface Props {
|
|
12
|
+
section: Section
|
|
13
|
+
variant?: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const { section, variant } = Astro.props
|
|
17
|
+
const byKey = Astro.locals.template?.sections ?? {}
|
|
18
|
+
const own = (key: string) => (Object.hasOwn(byKey, key) ? byKey[key] : undefined)
|
|
19
|
+
const Hero = (variant ? own(`Hero:${variant}`) : undefined) ?? own('Hero') ?? DefaultHero
|
|
20
|
+
---
|
|
21
|
+
<Hero section={section} variant={variant} level={1} />
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
// The 404 page's content, used by src/routes/not-found.astro and by the catch-all
|
|
3
|
+
// page for an address the site does not have: one <h1>, what happened, and
|
|
4
|
+
// the way back (home, and the news when the site has any). The legal line is
|
|
5
|
+
// the footer's, as on every page.
|
|
6
|
+
import { blogBaseOf } from '@backgold/astro/server'
|
|
7
|
+
import { basePath } from '../lib/entries'
|
|
8
|
+
|
|
9
|
+
const bg = Astro.locals.backgold
|
|
10
|
+
const news = bg.setup === null ? blogBaseOf((await bg.client.types()).types) : null
|
|
11
|
+
---
|
|
12
|
+
<div class="page-header not-found">
|
|
13
|
+
<p class="kicker">Page not found</p>
|
|
14
|
+
<h1>That page is not here.</h1>
|
|
15
|
+
<p class="lede">It may have moved, or the link may have a typo in it. Everything we publish starts from the home page.</p>
|
|
16
|
+
<p class="actions">
|
|
17
|
+
<a class="button" href="/">Go to the home page</a>
|
|
18
|
+
{news && <a class="button button-quiet" href={basePath(news)}>Read the news</a>}
|
|
19
|
+
</p>
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
// A page's sections, in BackGold's order. A page has one <h1>: when it opens
|
|
3
|
+
// with a Hero that has a headline (lib/section.ts leadsWithHero), that
|
|
4
|
+
// headline is it; otherwise the page's title (the site's name on the home
|
|
5
|
+
// page) is the <h1> above the sections, shown on screen unless the page
|
|
6
|
+
// opens with a module or a card that leads with words of its own (a donate
|
|
7
|
+
// form's story, a petition's header, a membership's offer, a call to action's
|
|
8
|
+
// card), as boards A8, A10 and C8 draw them with no title band above. Every section, the leading
|
|
9
|
+
// Hero included, goes through <Section>, which writes the preview marker the
|
|
10
|
+
// BackGold editor scrolls to, through the template's sections map
|
|
11
|
+
// (`Astro.locals.template` carries it to LeadingHero, which <Section> passes
|
|
12
|
+
// nothing else).
|
|
13
|
+
//
|
|
14
|
+
// `only` splits the page for a route that puts its opening Hero over a
|
|
15
|
+
// two-column layout (the Sidebar starts under the Hero, board C5): 'lead'
|
|
16
|
+
// draws the opening alone, 'rest' every section after it. Left out, the
|
|
17
|
+
// whole page is drawn.
|
|
18
|
+
import type { PageResponse } from '@backgold/content'
|
|
19
|
+
import { Section } from '@backgold/astro/components'
|
|
20
|
+
import LeadingHero from './LeadingHero.astro'
|
|
21
|
+
import { text } from '../lib/format'
|
|
22
|
+
import { leadsWithHero } from '../lib/section'
|
|
23
|
+
import type { TemplateConfig } from '../template'
|
|
24
|
+
|
|
25
|
+
interface Props {
|
|
26
|
+
template: TemplateConfig
|
|
27
|
+
page: PageResponse
|
|
28
|
+
siteName: string
|
|
29
|
+
only?: 'lead' | 'rest'
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const { template, page, siteName, only } = Astro.props
|
|
33
|
+
const { sections } = template
|
|
34
|
+
Astro.locals.template = template
|
|
35
|
+
const [first, ...rest] = page.sections
|
|
36
|
+
const heroLeads = leadsWithHero(page.sections)
|
|
37
|
+
const title = (page.page.is_home ? siteName : text(page.page.title)) ?? siteName
|
|
38
|
+
const quietTitle = first?.type === 'Donate' || first?.type === 'Petition' || first?.type === 'Membership' || (first?.type === 'Cta' && first.variant === 'card')
|
|
39
|
+
---
|
|
40
|
+
{only !== 'rest' && (heroLeads && first ? <Section section={first} components={{ Hero: LeadingHero }} /> : (
|
|
41
|
+
quietTitle ? <h1 class="visually-hidden">{title}</h1> : (
|
|
42
|
+
<header class="page-header">
|
|
43
|
+
<h1>{title}</h1>
|
|
44
|
+
</header>
|
|
45
|
+
)
|
|
46
|
+
))}
|
|
47
|
+
{only !== 'lead' && (heroLeads ? rest : page.sections).map((section) => <Section section={section} components={sections} />)}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
// A copy value from BackGold: sanitized rich text, or plain paragraphs.
|
|
3
|
+
import { prose } from '../lib/format'
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
value: unknown
|
|
7
|
+
class?: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const { value, class: className } = Astro.props
|
|
11
|
+
const body = prose(value)
|
|
12
|
+
---
|
|
13
|
+
{body && 'html' in body && <div class:list={['prose', className]} set:html={body.html} />}
|
|
14
|
+
{body && 'paragraphs' in body && (
|
|
15
|
+
<div class:list={['prose', className]}>
|
|
16
|
+
{body.paragraphs.map((p) => <p>{p}</p>)}
|
|
17
|
+
</div>
|
|
18
|
+
)}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
// The site's brand as boards A1 and A13 draw it in the header and footer: a
|
|
3
|
+
// link home holding the organization's logo when BackGold has one, else the
|
|
4
|
+
// template's mark (a sun over mountains in a ring, in the brand's primary,
|
|
5
|
+
// secondary and accent colours) beside a two-line wordmark: the name's first
|
|
6
|
+
// word large, the rest of it in small capitals under it ("Westmark" /
|
|
7
|
+
// "Liberty Party"). A one-word name is one line.
|
|
8
|
+
import { safeSrc } from '@backgold/astro/server'
|
|
9
|
+
|
|
10
|
+
interface Props {
|
|
11
|
+
name: string
|
|
12
|
+
logoUrl: string | null
|
|
13
|
+
class?: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const { name, logoUrl, class: className } = Astro.props
|
|
17
|
+
const logo = safeSrc(logoUrl)
|
|
18
|
+
const [first = name, ...rest] = name.trim().split(/\s+/)
|
|
19
|
+
const second = rest.join(' ')
|
|
20
|
+
---
|
|
21
|
+
<a class:list={['brand', className]} href="/">
|
|
22
|
+
{logo ? (
|
|
23
|
+
<img src={logo} alt={name} class="brand-logo" />
|
|
24
|
+
) : (
|
|
25
|
+
<>
|
|
26
|
+
<svg class="brand-mark" viewBox="0 0 48 48" aria-hidden="true">
|
|
27
|
+
<circle class="brand-mark-ring" cx="24" cy="24" r="23" stroke-width="2" />
|
|
28
|
+
<circle class="brand-mark-sun" cx="31" cy="20" r="7" />
|
|
29
|
+
<path class="brand-mark-land" d="M5 33l10-11 6 6 8-10 14 15v2a23 23 0 01-38 0z" />
|
|
30
|
+
<path class="brand-mark-snow" d="M15 22l3 3.4M29 18l3.6 4" stroke-width="1.6" fill="none" />
|
|
31
|
+
</svg>
|
|
32
|
+
<span class="brand-words">
|
|
33
|
+
<span class="brand-name">{first}</span>
|
|
34
|
+
{second && <span class="brand-rest">{second}</span>}
|
|
35
|
+
</span>
|
|
36
|
+
</>
|
|
37
|
+
)}
|
|
38
|
+
</a>
|
|
39
|
+
|
|
40
|
+
<style>
|
|
41
|
+
.brand-mark-ring {
|
|
42
|
+
fill: var(--bg-brand-primary);
|
|
43
|
+
stroke: var(--bg-brand-secondary);
|
|
44
|
+
}
|
|
45
|
+
.brand-mark-sun {
|
|
46
|
+
fill: var(--bg-brand-accent);
|
|
47
|
+
}
|
|
48
|
+
.brand-mark-land {
|
|
49
|
+
fill: var(--bg-brand-secondary);
|
|
50
|
+
}
|
|
51
|
+
.brand-mark-snow {
|
|
52
|
+
stroke: var(--bg-brand-primary);
|
|
53
|
+
}
|
|
54
|
+
</style>
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
// The footer's closing call (`/site` chrome.footer.closing, drawn on the
|
|
3
|
+
// footer's `closing` layout): a band across the top of the footer with the
|
|
4
|
+
// headline, the line under it, an italic tagline in the accent and up to two
|
|
5
|
+
// buttons (the first the main call, the second an outline). With a photo the
|
|
6
|
+
// band wears it under the template's scrim and the photo band's inks; without
|
|
7
|
+
// one it sits on the footer's brand ground over a hairline.
|
|
8
|
+
import type { ClosingCall } from '../../lib/chrome'
|
|
9
|
+
|
|
10
|
+
interface Props {
|
|
11
|
+
call: ClosingCall
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const { call } = Astro.props
|
|
15
|
+
---
|
|
16
|
+
<div class:list={['closing-call', call.imageUrl && 'closing-call-photo on-photo']} style={call.imageUrl ? `background-image:url("${call.imageUrl}")` : undefined}>
|
|
17
|
+
<div class="closing-call-inner">
|
|
18
|
+
<div class="closing-call-words">
|
|
19
|
+
<h2 class="closing-call-headline">{call.headline}</h2>
|
|
20
|
+
{call.body && <p class="closing-call-body">{call.body}</p>}
|
|
21
|
+
{call.tagline && <p class="closing-call-tagline">{call.tagline}</p>}
|
|
22
|
+
</div>
|
|
23
|
+
{call.buttons.length > 0 && (
|
|
24
|
+
<p class="closing-call-actions">
|
|
25
|
+
{call.buttons.map((link, i) => <a class:list={['button', i > 0 && 'button-quiet']} href={link.href} rel={link.rel}>{link.label}</a>)}
|
|
26
|
+
</p>
|
|
27
|
+
)}
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<style>
|
|
32
|
+
.closing-call {
|
|
33
|
+
position: relative;
|
|
34
|
+
border-bottom: 1px solid var(--line);
|
|
35
|
+
}
|
|
36
|
+
.closing-call-photo {
|
|
37
|
+
background-position: center;
|
|
38
|
+
background-size: cover;
|
|
39
|
+
border-bottom: 0;
|
|
40
|
+
}
|
|
41
|
+
/* The scrim the template lays over a photo, so the words read on any picture. */
|
|
42
|
+
.closing-call-photo::before {
|
|
43
|
+
content: '';
|
|
44
|
+
position: absolute;
|
|
45
|
+
inset: 0;
|
|
46
|
+
background: color-mix(in srgb, var(--band-photo) 62%, transparent);
|
|
47
|
+
}
|
|
48
|
+
.closing-call-inner {
|
|
49
|
+
position: relative;
|
|
50
|
+
display: grid;
|
|
51
|
+
gap: 1.5rem 3rem;
|
|
52
|
+
max-width: calc(var(--content) + 2 * var(--gutter));
|
|
53
|
+
margin: 0 auto;
|
|
54
|
+
padding: clamp(2.75rem, 2rem + 2.5vw, 4.5rem) var(--gutter);
|
|
55
|
+
}
|
|
56
|
+
.closing-call-headline {
|
|
57
|
+
margin: 0;
|
|
58
|
+
font-family: var(--font-display);
|
|
59
|
+
font-size: var(--h2);
|
|
60
|
+
font-weight: 700;
|
|
61
|
+
line-height: 1.1;
|
|
62
|
+
letter-spacing: -0.01em;
|
|
63
|
+
}
|
|
64
|
+
.closing-call-body {
|
|
65
|
+
max-width: var(--measure);
|
|
66
|
+
margin: 0.875rem 0 0;
|
|
67
|
+
font-size: var(--text-lg);
|
|
68
|
+
line-height: 1.55;
|
|
69
|
+
color: var(--muted);
|
|
70
|
+
}
|
|
71
|
+
.closing-call-tagline {
|
|
72
|
+
margin: 0.875rem 0 0;
|
|
73
|
+
font-family: var(--font-display);
|
|
74
|
+
font-style: italic;
|
|
75
|
+
font-size: var(--text-lg);
|
|
76
|
+
color: var(--accent);
|
|
77
|
+
}
|
|
78
|
+
.closing-call-actions {
|
|
79
|
+
display: flex;
|
|
80
|
+
flex-wrap: wrap;
|
|
81
|
+
gap: 0.75rem;
|
|
82
|
+
margin: 0;
|
|
83
|
+
}
|
|
84
|
+
@media (min-width: 48rem) {
|
|
85
|
+
.closing-call-inner {
|
|
86
|
+
grid-template-columns: minmax(0, 1.6fr) auto;
|
|
87
|
+
align-items: center;
|
|
88
|
+
}
|
|
89
|
+
.closing-call-actions {
|
|
90
|
+
flex-direction: column;
|
|
91
|
+
align-items: stretch;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
</style>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
---
|
|
2
|
+
// The giving footer's donate strip (the footer's `giving` layout, src/lib/chrome.ts),
|
|
3
|
+
// in the slim strip's manner (Cta · Strip): one line across the top of the
|
|
4
|
+
// footer, a dot in the button's colour, the template's own words ("Chip in ·
|
|
5
|
+
// Keep the lights on.") and the donate link at the right as the footer's one
|
|
6
|
+
// button, its label the menu's. Site.astro passes the link it found (the
|
|
7
|
+
// footer menu's first Donate link, else the bottom row's, else the header
|
|
8
|
+
// button when it is Donate); with none it draws nothing. No amount, no
|
|
9
|
+
// count, no total: those are BackGold's, on the donate page the button
|
|
10
|
+
// opens. On a phone the button goes full width under the words.
|
|
11
|
+
import type { MenuNode } from '@backgold/astro/server'
|
|
12
|
+
|
|
13
|
+
interface Props {
|
|
14
|
+
link: MenuNode | null
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const { link } = Astro.props
|
|
18
|
+
---
|
|
19
|
+
{link?.href && (
|
|
20
|
+
<div class="donate-strip">
|
|
21
|
+
<p class="donate-strip-words">
|
|
22
|
+
<span class="donate-strip-dot" aria-hidden="true"></span>
|
|
23
|
+
<span><b>Chip in</b> · Keep the lights on.</span>
|
|
24
|
+
</p>
|
|
25
|
+
<a class="button" href={link.href} rel={link.rel}>{link.label}</a>
|
|
26
|
+
</div>
|
|
27
|
+
)}
|
|
28
|
+
|
|
29
|
+
<style>
|
|
30
|
+
.donate-strip {
|
|
31
|
+
display: grid;
|
|
32
|
+
gap: 0.875rem;
|
|
33
|
+
padding-bottom: 1.5rem;
|
|
34
|
+
margin-bottom: clamp(1.75rem, 1.25rem + 1.5vw, 2.5rem);
|
|
35
|
+
border-bottom: 1px solid var(--line);
|
|
36
|
+
}
|
|
37
|
+
.donate-strip-words {
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
gap: 0.875rem;
|
|
41
|
+
margin: 0;
|
|
42
|
+
line-height: 1.5;
|
|
43
|
+
}
|
|
44
|
+
.donate-strip-words b {
|
|
45
|
+
font-weight: 700;
|
|
46
|
+
}
|
|
47
|
+
.donate-strip-dot {
|
|
48
|
+
flex: 0 0 auto;
|
|
49
|
+
width: 0.5rem;
|
|
50
|
+
height: 0.5rem;
|
|
51
|
+
border-radius: 50%;
|
|
52
|
+
background: var(--button);
|
|
53
|
+
}
|
|
54
|
+
@media (min-width: 48rem) {
|
|
55
|
+
.donate-strip {
|
|
56
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
57
|
+
align-items: center;
|
|
58
|
+
gap: 2rem;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
</style>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
// The footer menu's columns (src/lib/footer.ts footerColumnsOf): a column per
|
|
3
|
+
// group under its label, the loose links in one unlabelled column first.
|
|
4
|
+
// Draws nothing when the menu shows no link on this page.
|
|
5
|
+
import type { FooterColumn } from '../../lib/footer'
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
columns: FooterColumn[]
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const { columns } = Astro.props
|
|
12
|
+
---
|
|
13
|
+
{columns.length > 0 && (
|
|
14
|
+
<nav class="footer-columns" aria-label="Footer menu">
|
|
15
|
+
{columns.map((column) => (
|
|
16
|
+
<div class="footer-column">
|
|
17
|
+
{column.label && <h2 class="footer-heading">{column.label}</h2>}
|
|
18
|
+
<ul>
|
|
19
|
+
{column.links.map((node) => (
|
|
20
|
+
<li>
|
|
21
|
+
{node.href ? (
|
|
22
|
+
<a href={node.href} rel={node.rel} aria-current={node.current ? 'page' : undefined}>{node.label}</a>
|
|
23
|
+
) : (
|
|
24
|
+
<span>{node.label}</span>
|
|
25
|
+
)}
|
|
26
|
+
</li>
|
|
27
|
+
))}
|
|
28
|
+
</ul>
|
|
29
|
+
</div>
|
|
30
|
+
))}
|
|
31
|
+
</nav>
|
|
32
|
+
)}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
// The footer's Contact column (the words the footer's editor in BackGold
|
|
3
|
+
// holds: `/site` chrome.footer): the postal address, each line its own, and
|
|
4
|
+
// the phone line as a call link. Drawn as one more column beside the footer
|
|
5
|
+
// menu's; nothing when neither is set. The footer's contact email never
|
|
6
|
+
// reaches a site drawn from the Content API, so it is not here.
|
|
7
|
+
interface Props {
|
|
8
|
+
address: string | null
|
|
9
|
+
phone: string | null
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const { address, phone } = Astro.props
|
|
13
|
+
const lines = address ? address.split(/\r?\n/).map((line) => line.trim()).filter(Boolean) : []
|
|
14
|
+
const tel = phone ? phone.replace(/[^\d+]/g, '') : ''
|
|
15
|
+
---
|
|
16
|
+
{(lines.length > 0 || phone) && (
|
|
17
|
+
<div class="footer-column footer-contact">
|
|
18
|
+
<h2 class="footer-heading">Contact</h2>
|
|
19
|
+
<ul>
|
|
20
|
+
{lines.length > 0 && (
|
|
21
|
+
<li>
|
|
22
|
+
<address class="footer-address">{lines.map((line, i) => <>{i > 0 && <br />}{line}</>)}</address>
|
|
23
|
+
</li>
|
|
24
|
+
)}
|
|
25
|
+
{phone && <li>{tel.length >= 7 ? <a href={`tel:${tel}`}>{phone}</a> : <span>{phone}</span>}</li>}
|
|
26
|
+
</ul>
|
|
27
|
+
</div>
|
|
28
|
+
)}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
// One level of the header menu, from `menuOf` (the Shows on rules already
|
|
3
|
+
// applied, the header button already left out). In the bar a link with
|
|
4
|
+
// children (a group) is a <details> dropdown; only one is open at a time
|
|
5
|
+
// (they share a `name`), and it opens on a click or Enter, so it works with
|
|
6
|
+
// the keyboard and with scripts off. In the phone sheet every group is open:
|
|
7
|
+
// its label is a small heading over its links. A group that has an address
|
|
8
|
+
// of its own lists it first among its links. Watch Live (lib/stream.ts, while
|
|
9
|
+
// the organization's stream is live) carries a dot in the state red before
|
|
10
|
+
// its label.
|
|
11
|
+
import type { MenuNode } from '@backgold/astro/server'
|
|
12
|
+
import type { LiveMenuNode } from '../../lib/stream'
|
|
13
|
+
|
|
14
|
+
interface Props {
|
|
15
|
+
nodes: LiveMenuNode[]
|
|
16
|
+
mode: 'bar' | 'sheet'
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const { nodes, mode } = Astro.props
|
|
20
|
+
const childrenOf = (node: MenuNode): MenuNode[] => (node.href ? [{ ...node, children: [] }, ...node.children] : node.children)
|
|
21
|
+
const holdsCurrent = (node: MenuNode) => node.children.some((child) => child.current)
|
|
22
|
+
---
|
|
23
|
+
<ul>
|
|
24
|
+
{nodes.map((node) => (
|
|
25
|
+
<li class:list={[node.children.length > 0 && 'menu-group']}>
|
|
26
|
+
{node.children.length === 0 ? (
|
|
27
|
+
node.href ? (
|
|
28
|
+
<a href={node.href} rel={node.rel} aria-current={node.current ? 'page' : undefined}>{node.live ? <span class="menu-live"><span class="live-dot" aria-hidden="true"></span>{node.label}</span> : node.label}</a>
|
|
29
|
+
) : (
|
|
30
|
+
<span>{node.label}</span>
|
|
31
|
+
)
|
|
32
|
+
) : mode === 'bar' ? (
|
|
33
|
+
<details name="site-header-menu" class:list={[holdsCurrent(node) && 'menu-group-current']}>
|
|
34
|
+
<summary>{node.label}</summary>
|
|
35
|
+
<Astro.self nodes={childrenOf(node)} mode="sheet" />
|
|
36
|
+
</details>
|
|
37
|
+
) : (
|
|
38
|
+
<>
|
|
39
|
+
<span class="menu-group-label">{node.label}</span>
|
|
40
|
+
<Astro.self nodes={childrenOf(node)} mode="sheet" />
|
|
41
|
+
</>
|
|
42
|
+
)}
|
|
43
|
+
</li>
|
|
44
|
+
))}
|
|
45
|
+
</ul>
|