@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,2 @@
|
|
|
1
|
+
export { A as Areas, r as CourseDetail, s as CourseLesson, t as CourseProgress, u as CourseSummary, v as EntryLock, L as LessonResponse, w as VISITOR_PROGRESS_PATH, x as VISITOR_SIGN_IN_PATH, y as Visitor } from '../content-api-CYeY0vU8.js';
|
|
2
|
+
export { C as ContentAccessLevel } from '../constants-DvTNj4JI.d-Batjcj3Z.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { VISITOR_PROGRESS_PATH, VISITOR_SIGN_IN_PATH } from '../chunk-KOB36GSF.js';
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { S as SiteNavItemType } from '../constants-DvTNj4JI.d-Batjcj3Z.js';
|
|
3
|
+
|
|
4
|
+
/** A starter menu link's Shows on rule; the pages are starter page slugs. */
|
|
5
|
+
declare const starterShowsOnSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
6
|
+
rule: z.ZodEnum<{
|
|
7
|
+
every_page: "every_page";
|
|
8
|
+
donation_pages: "donation_pages";
|
|
9
|
+
}>;
|
|
10
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
11
|
+
rule: z.ZodEnum<{
|
|
12
|
+
only_pages: "only_pages";
|
|
13
|
+
except_pages: "except_pages";
|
|
14
|
+
}>;
|
|
15
|
+
pages: z.ZodArray<z.ZodString>;
|
|
16
|
+
}, z.core.$strip>]>;
|
|
17
|
+
interface SiteTemplateMenuItem {
|
|
18
|
+
label: string;
|
|
19
|
+
kind: SiteNavItemType;
|
|
20
|
+
target: {
|
|
21
|
+
slug?: string;
|
|
22
|
+
url?: string;
|
|
23
|
+
anchor?: string;
|
|
24
|
+
type_key?: string;
|
|
25
|
+
entry_slug?: string;
|
|
26
|
+
taxonomy?: string;
|
|
27
|
+
term_slug?: string;
|
|
28
|
+
};
|
|
29
|
+
shows_on: z.infer<typeof starterShowsOnSchema>;
|
|
30
|
+
header_button: boolean;
|
|
31
|
+
children: SiteTemplateMenuItem[];
|
|
32
|
+
}
|
|
33
|
+
declare const siteTemplateManifestSchema: z.ZodObject<{
|
|
34
|
+
key: z.ZodString;
|
|
35
|
+
name: z.ZodString;
|
|
36
|
+
audience: z.ZodString;
|
|
37
|
+
version: z.ZodNumber;
|
|
38
|
+
variants: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
|
|
39
|
+
areas: z.ZodObject<{
|
|
40
|
+
unknown: z.ZodLiteral<"after_page">;
|
|
41
|
+
}, z.core.$catchall<z.ZodString>>;
|
|
42
|
+
entryLayouts: z.ZodRecord<z.ZodEnum<{
|
|
43
|
+
post: "post";
|
|
44
|
+
video: "video";
|
|
45
|
+
course: "course";
|
|
46
|
+
podcast: "podcast";
|
|
47
|
+
plank: "plank";
|
|
48
|
+
team_member: "team_member";
|
|
49
|
+
open_role: "open_role";
|
|
50
|
+
newsletter: "newsletter";
|
|
51
|
+
}> & z.core.$partial, z.ZodObject<{
|
|
52
|
+
entry: z.ZodString;
|
|
53
|
+
list: z.ZodString;
|
|
54
|
+
}, z.core.$strip>>;
|
|
55
|
+
chrome: z.ZodObject<{
|
|
56
|
+
header: z.ZodArray<z.ZodEnum<{
|
|
57
|
+
bar: "bar";
|
|
58
|
+
centered: "centered";
|
|
59
|
+
}>>;
|
|
60
|
+
footer: z.ZodArray<z.ZodEnum<{
|
|
61
|
+
columns: "columns";
|
|
62
|
+
closing: "closing";
|
|
63
|
+
compact: "compact";
|
|
64
|
+
giving: "giving";
|
|
65
|
+
}>>;
|
|
66
|
+
takeoverBanner: z.ZodBoolean;
|
|
67
|
+
legalLine: z.ZodBoolean;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
starter: z.ZodObject<{
|
|
70
|
+
pages: z.ZodArray<z.ZodObject<{
|
|
71
|
+
slug: z.ZodString;
|
|
72
|
+
title: z.ZodString;
|
|
73
|
+
sections: z.ZodArray<z.ZodObject<{
|
|
74
|
+
id: z.ZodString;
|
|
75
|
+
type: z.ZodString;
|
|
76
|
+
band: z.ZodEnum<{
|
|
77
|
+
plain: "plain";
|
|
78
|
+
tint: "tint";
|
|
79
|
+
panel: "panel";
|
|
80
|
+
wash: "wash";
|
|
81
|
+
contrast: "contrast";
|
|
82
|
+
}>;
|
|
83
|
+
bleed: z.ZodEnum<{
|
|
84
|
+
full: "full";
|
|
85
|
+
contained: "contained";
|
|
86
|
+
}>;
|
|
87
|
+
variant: z.ZodNullable<z.ZodString>;
|
|
88
|
+
copy: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
89
|
+
media: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
90
|
+
url: z.ZodString;
|
|
91
|
+
alt: z.ZodOptional<z.ZodString>;
|
|
92
|
+
}, z.core.$strip>>;
|
|
93
|
+
links: z.ZodArray<z.ZodObject<{
|
|
94
|
+
label: z.ZodString;
|
|
95
|
+
target: z.ZodObject<{
|
|
96
|
+
kind: z.ZodEnum<{
|
|
97
|
+
page: "page";
|
|
98
|
+
section: "section";
|
|
99
|
+
external: "external";
|
|
100
|
+
surface: "surface";
|
|
101
|
+
}>;
|
|
102
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
103
|
+
anchor: z.ZodOptional<z.ZodString>;
|
|
104
|
+
url: z.ZodOptional<z.ZodString>;
|
|
105
|
+
path: z.ZodOptional<z.ZodString>;
|
|
106
|
+
}, z.core.$strip>;
|
|
107
|
+
url: z.ZodString;
|
|
108
|
+
style: z.ZodOptional<z.ZodString>;
|
|
109
|
+
}, z.core.$strip>>;
|
|
110
|
+
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
111
|
+
data: z.ZodOptional<z.ZodObject<{
|
|
112
|
+
source: z.ZodEnum<{
|
|
113
|
+
issues: "issues";
|
|
114
|
+
petition: "petition";
|
|
115
|
+
dates: "dates";
|
|
116
|
+
platform: "platform";
|
|
117
|
+
ladder: "ladder";
|
|
118
|
+
ballot: "ballot";
|
|
119
|
+
words: "words";
|
|
120
|
+
credentials: "credentials";
|
|
121
|
+
stats: "stats";
|
|
122
|
+
quotes: "quotes";
|
|
123
|
+
votes: "votes";
|
|
124
|
+
faq: "faq";
|
|
125
|
+
comparison: "comparison";
|
|
126
|
+
stories: "stories";
|
|
127
|
+
share: "share";
|
|
128
|
+
financials: "financials";
|
|
129
|
+
services: "services";
|
|
130
|
+
cases: "cases";
|
|
131
|
+
resources: "resources";
|
|
132
|
+
pathways: "pathways";
|
|
133
|
+
work: "work";
|
|
134
|
+
mediakit: "mediakit";
|
|
135
|
+
}>;
|
|
136
|
+
items: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
137
|
+
}, z.core.$strip>>;
|
|
138
|
+
}, z.core.$strip>>;
|
|
139
|
+
}, z.core.$strip>>;
|
|
140
|
+
menus: z.ZodObject<{
|
|
141
|
+
primary: z.ZodArray<z.ZodType<SiteTemplateMenuItem, unknown, z.core.$ZodTypeInternals<SiteTemplateMenuItem, unknown>>>;
|
|
142
|
+
footer: z.ZodArray<z.ZodType<SiteTemplateMenuItem, unknown, z.core.$ZodTypeInternals<SiteTemplateMenuItem, unknown>>>;
|
|
143
|
+
}, z.core.$strip>;
|
|
144
|
+
sections: z.ZodArray<z.ZodObject<{
|
|
145
|
+
key: z.ZodString;
|
|
146
|
+
label: z.ZodString;
|
|
147
|
+
kind: z.ZodEnum<{
|
|
148
|
+
sidebar: "sidebar";
|
|
149
|
+
custom: "custom";
|
|
150
|
+
announcement: "announcement";
|
|
151
|
+
pre_footer: "pre_footer";
|
|
152
|
+
}>;
|
|
153
|
+
document: z.ZodArray<z.ZodObject<{
|
|
154
|
+
id: z.ZodString;
|
|
155
|
+
type: z.ZodString;
|
|
156
|
+
band: z.ZodEnum<{
|
|
157
|
+
plain: "plain";
|
|
158
|
+
tint: "tint";
|
|
159
|
+
panel: "panel";
|
|
160
|
+
wash: "wash";
|
|
161
|
+
contrast: "contrast";
|
|
162
|
+
}>;
|
|
163
|
+
bleed: z.ZodEnum<{
|
|
164
|
+
full: "full";
|
|
165
|
+
contained: "contained";
|
|
166
|
+
}>;
|
|
167
|
+
variant: z.ZodNullable<z.ZodString>;
|
|
168
|
+
copy: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
169
|
+
media: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
170
|
+
url: z.ZodString;
|
|
171
|
+
alt: z.ZodOptional<z.ZodString>;
|
|
172
|
+
}, z.core.$strip>>;
|
|
173
|
+
links: z.ZodArray<z.ZodObject<{
|
|
174
|
+
label: z.ZodString;
|
|
175
|
+
target: z.ZodObject<{
|
|
176
|
+
kind: z.ZodEnum<{
|
|
177
|
+
page: "page";
|
|
178
|
+
section: "section";
|
|
179
|
+
external: "external";
|
|
180
|
+
surface: "surface";
|
|
181
|
+
}>;
|
|
182
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
183
|
+
anchor: z.ZodOptional<z.ZodString>;
|
|
184
|
+
url: z.ZodOptional<z.ZodString>;
|
|
185
|
+
path: z.ZodOptional<z.ZodString>;
|
|
186
|
+
}, z.core.$strip>;
|
|
187
|
+
url: z.ZodString;
|
|
188
|
+
style: z.ZodOptional<z.ZodString>;
|
|
189
|
+
}, z.core.$strip>>;
|
|
190
|
+
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
191
|
+
data: z.ZodOptional<z.ZodObject<{
|
|
192
|
+
source: z.ZodEnum<{
|
|
193
|
+
issues: "issues";
|
|
194
|
+
petition: "petition";
|
|
195
|
+
dates: "dates";
|
|
196
|
+
platform: "platform";
|
|
197
|
+
ladder: "ladder";
|
|
198
|
+
ballot: "ballot";
|
|
199
|
+
words: "words";
|
|
200
|
+
credentials: "credentials";
|
|
201
|
+
stats: "stats";
|
|
202
|
+
quotes: "quotes";
|
|
203
|
+
votes: "votes";
|
|
204
|
+
faq: "faq";
|
|
205
|
+
comparison: "comparison";
|
|
206
|
+
stories: "stories";
|
|
207
|
+
share: "share";
|
|
208
|
+
financials: "financials";
|
|
209
|
+
services: "services";
|
|
210
|
+
cases: "cases";
|
|
211
|
+
resources: "resources";
|
|
212
|
+
pathways: "pathways";
|
|
213
|
+
work: "work";
|
|
214
|
+
mediakit: "mediakit";
|
|
215
|
+
}>;
|
|
216
|
+
items: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
217
|
+
}, z.core.$strip>>;
|
|
218
|
+
}, z.core.$strip>>;
|
|
219
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
220
|
+
area_key: z.ZodString;
|
|
221
|
+
shows_on: z.ZodEnum<{
|
|
222
|
+
events: "events";
|
|
223
|
+
store: "store";
|
|
224
|
+
every_page: "every_page";
|
|
225
|
+
pages: "pages";
|
|
226
|
+
entries: "entries";
|
|
227
|
+
every_page_except: "every_page_except";
|
|
228
|
+
pages_holding: "pages_holding";
|
|
229
|
+
entry_types: "entry_types";
|
|
230
|
+
type_lists: "type_lists";
|
|
231
|
+
}>;
|
|
232
|
+
pages: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
233
|
+
content_types: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
234
|
+
modules: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
235
|
+
kind: z.ZodEnum<{
|
|
236
|
+
store: "store";
|
|
237
|
+
petition: "petition";
|
|
238
|
+
form: "form";
|
|
239
|
+
poll: "poll";
|
|
240
|
+
event: "event";
|
|
241
|
+
signup: "signup";
|
|
242
|
+
donation_form: "donation_form";
|
|
243
|
+
advocacy: "advocacy";
|
|
244
|
+
}>;
|
|
245
|
+
}, z.core.$strip>>>;
|
|
246
|
+
}, z.core.$strip>>;
|
|
247
|
+
}, z.core.$strip>>;
|
|
248
|
+
}, z.core.$strip>;
|
|
249
|
+
}, z.core.$strip>;
|
|
250
|
+
type SiteTemplateManifest = z.infer<typeof siteTemplateManifestSchema>;
|
|
251
|
+
|
|
252
|
+
export { type SiteTemplateManifest, siteTemplateManifestSchema };
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { SITE_AREA_KEY_RE, SECTION_BLEEDS, SECTION_BANDS, SITE_NAV_SHOWS_ON, SITE_NAV_ITEM_TYPES, SITE_PAGE_MODULE_KINDS, SITE_SECTION_RULE_SHOWS_ON, SITE_SECTION_KINDS, SITE_CHROME_LAYOUTS, BUILT_IN_CONTENT_TYPE_KEYS, TEMPLATE_KEY_PATTERN } from '../chunk-KOB36GSF.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
var name = z.string().trim().min(1).max(120);
|
|
5
|
+
var layoutName = z.string().regex(/^[a-z][a-z0-9_]{0,39}$/);
|
|
6
|
+
var slug = z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$|^$/, "a page slug (lower case, words joined by -; empty for home)");
|
|
7
|
+
var areaKey = z.string().regex(SITE_AREA_KEY_RE);
|
|
8
|
+
var SITE_TEMPLATE_AUTHORED_DATA_SOURCES = [
|
|
9
|
+
"issues",
|
|
10
|
+
"stats",
|
|
11
|
+
"quotes",
|
|
12
|
+
"platform",
|
|
13
|
+
"dates",
|
|
14
|
+
"ballot",
|
|
15
|
+
"votes",
|
|
16
|
+
"faq",
|
|
17
|
+
"comparison",
|
|
18
|
+
"stories",
|
|
19
|
+
"services",
|
|
20
|
+
"cases",
|
|
21
|
+
"resources",
|
|
22
|
+
"pathways",
|
|
23
|
+
"work",
|
|
24
|
+
"mediakit",
|
|
25
|
+
"credentials",
|
|
26
|
+
// Sections batch 3 (2026-10-14): the Hero's rotating words, QuickDonate's
|
|
27
|
+
// impact ladder, ShareKit's posts and Financials' figures.
|
|
28
|
+
"words",
|
|
29
|
+
"ladder",
|
|
30
|
+
"share",
|
|
31
|
+
"financials",
|
|
32
|
+
// The petition-drive template (2026-10-15): the asks and the typed stat tiles.
|
|
33
|
+
"petition"
|
|
34
|
+
];
|
|
35
|
+
var SITE_TEMPLATE_AUTHORED_DATA = {
|
|
36
|
+
Issues: "issues",
|
|
37
|
+
StatCards: "stats",
|
|
38
|
+
QuoteStrip: "quotes",
|
|
39
|
+
PlatformPlanks: "platform",
|
|
40
|
+
VoterTools: "dates",
|
|
41
|
+
SampleBallot: "ballot",
|
|
42
|
+
Scorecard: "votes",
|
|
43
|
+
Faq: "faq",
|
|
44
|
+
Comparison: "comparison",
|
|
45
|
+
Stories: "stories",
|
|
46
|
+
Services: "services",
|
|
47
|
+
CaseStudies: "cases",
|
|
48
|
+
Resources: "resources",
|
|
49
|
+
Pathways: "pathways",
|
|
50
|
+
Portfolio: "work",
|
|
51
|
+
MediaKit: "mediakit",
|
|
52
|
+
About: "credentials",
|
|
53
|
+
Hero: "words",
|
|
54
|
+
QuickDonate: "ladder",
|
|
55
|
+
ShareKit: "share",
|
|
56
|
+
Financials: "financials",
|
|
57
|
+
Petition: "petition"
|
|
58
|
+
};
|
|
59
|
+
var starterSectionSchema = z.object({
|
|
60
|
+
id: z.string().min(1).max(64),
|
|
61
|
+
type: z.string().regex(/^[A-Z][A-Za-z]{0,39}$/),
|
|
62
|
+
band: z.enum(SECTION_BANDS),
|
|
63
|
+
bleed: z.enum(SECTION_BLEEDS),
|
|
64
|
+
variant: layoutName.nullable(),
|
|
65
|
+
copy: z.record(z.string(), z.string()),
|
|
66
|
+
media: z.record(z.string(), z.object({ url: z.string(), alt: z.string().optional() })),
|
|
67
|
+
links: z.array(
|
|
68
|
+
z.object({
|
|
69
|
+
label: z.string(),
|
|
70
|
+
target: z.object({
|
|
71
|
+
kind: z.enum(["page", "section", "external", "surface"]),
|
|
72
|
+
slug: z.string().optional(),
|
|
73
|
+
anchor: z.string().optional(),
|
|
74
|
+
url: z.string().optional(),
|
|
75
|
+
path: z.string().optional()
|
|
76
|
+
}),
|
|
77
|
+
url: z.string(),
|
|
78
|
+
style: z.string().optional()
|
|
79
|
+
})
|
|
80
|
+
),
|
|
81
|
+
options: z.record(z.string(), z.union([z.string(), z.number(), z.boolean()])).optional(),
|
|
82
|
+
data: z.object({
|
|
83
|
+
source: z.enum(SITE_TEMPLATE_AUTHORED_DATA_SOURCES),
|
|
84
|
+
items: z.array(z.record(z.string(), z.unknown())).min(1).max(20)
|
|
85
|
+
}).optional()
|
|
86
|
+
}).superRefine((section, ctx) => {
|
|
87
|
+
if (!section.data) return;
|
|
88
|
+
const own = Object.hasOwn(SITE_TEMPLATE_AUTHORED_DATA, section.type) ? SITE_TEMPLATE_AUTHORED_DATA[section.type] : void 0;
|
|
89
|
+
if (section.data.source !== own) {
|
|
90
|
+
ctx.addIssue({
|
|
91
|
+
code: "custom",
|
|
92
|
+
path: ["data", "source"],
|
|
93
|
+
message: own ? `a ${section.type} section's rows are '${own}'` : `a ${section.type} section's rows are BackGold's to fill, never starter content`
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
var starterPageSchema = z.object({
|
|
98
|
+
slug,
|
|
99
|
+
title: name,
|
|
100
|
+
sections: z.array(starterSectionSchema)
|
|
101
|
+
});
|
|
102
|
+
var starterShowsOnSchema = z.union([
|
|
103
|
+
z.object({ rule: z.enum(SITE_NAV_SHOWS_ON).extract(["every_page", "donation_pages"]) }),
|
|
104
|
+
z.object({ rule: z.enum(SITE_NAV_SHOWS_ON).extract(["only_pages", "except_pages"]), pages: z.array(slug).min(1) })
|
|
105
|
+
]);
|
|
106
|
+
var starterMenuItemSchema = z.lazy(
|
|
107
|
+
() => z.object({
|
|
108
|
+
label: name,
|
|
109
|
+
kind: z.enum(SITE_NAV_ITEM_TYPES),
|
|
110
|
+
target: z.object({
|
|
111
|
+
slug: slug.optional(),
|
|
112
|
+
url: z.string().optional(),
|
|
113
|
+
anchor: z.string().optional(),
|
|
114
|
+
type_key: z.string().optional(),
|
|
115
|
+
entry_slug: z.string().optional(),
|
|
116
|
+
taxonomy: z.string().optional(),
|
|
117
|
+
term_slug: z.string().optional()
|
|
118
|
+
}),
|
|
119
|
+
shows_on: starterShowsOnSchema,
|
|
120
|
+
header_button: z.boolean(),
|
|
121
|
+
children: z.array(starterMenuItemSchema)
|
|
122
|
+
})
|
|
123
|
+
);
|
|
124
|
+
var starterRuleSchema = z.object({
|
|
125
|
+
area_key: areaKey,
|
|
126
|
+
shows_on: z.enum(SITE_SECTION_RULE_SHOWS_ON),
|
|
127
|
+
pages: z.array(slug).optional(),
|
|
128
|
+
content_types: z.array(z.string()).optional(),
|
|
129
|
+
modules: z.array(z.object({ kind: z.enum(SITE_PAGE_MODULE_KINDS) })).optional()
|
|
130
|
+
});
|
|
131
|
+
var starterReusableSectionSchema = z.object({
|
|
132
|
+
key: z.string().regex(/^[a-z][a-z0-9-]{0,63}$/),
|
|
133
|
+
label: name,
|
|
134
|
+
kind: z.enum(SITE_SECTION_KINDS),
|
|
135
|
+
document: z.array(starterSectionSchema),
|
|
136
|
+
rules: z.array(starterRuleSchema)
|
|
137
|
+
});
|
|
138
|
+
var entryLayoutSchema = z.object({ entry: layoutName, list: layoutName });
|
|
139
|
+
var siteTemplateManifestSchema = z.object({
|
|
140
|
+
/**
|
|
141
|
+
* The template's key, by shape: a template is written in the sites
|
|
142
|
+
* repository before the platform registers it, so the schema cannot know
|
|
143
|
+
* the registry. The platform's own copies are held to SITE_TEMPLATE_KEYS by
|
|
144
|
+
* site-template-manifests.ts, which refuses a copy whose key is not the one
|
|
145
|
+
* it was filed under.
|
|
146
|
+
*/
|
|
147
|
+
key: z.string().regex(TEMPLATE_KEY_PATTERN),
|
|
148
|
+
name,
|
|
149
|
+
audience: z.string().regex(/^[a-z][a-z_]{0,39}$/),
|
|
150
|
+
version: z.number().int().min(1),
|
|
151
|
+
/** Section type → the layouts the template draws, the default first. */
|
|
152
|
+
variants: z.record(z.string(), z.array(layoutName).min(1)),
|
|
153
|
+
/**
|
|
154
|
+
* Area key → where the layout places it, in words. `unknown` is what the
|
|
155
|
+
* template does with an area it does not name: `after_page` draws it after
|
|
156
|
+
* the page, full width, in the order the site lists its areas.
|
|
157
|
+
*/
|
|
158
|
+
areas: z.object({ unknown: z.literal("after_page") }).catchall(name).superRefine((areas, ctx) => {
|
|
159
|
+
for (const key of Object.keys(areas)) {
|
|
160
|
+
if (!areaKey.safeParse(key).success) ctx.addIssue({ code: "custom", path: [key], message: "not an area key" });
|
|
161
|
+
}
|
|
162
|
+
}),
|
|
163
|
+
/** Routable built-in content type key → its entry layout and its list layout. */
|
|
164
|
+
entryLayouts: z.partialRecord(z.enum(BUILT_IN_CONTENT_TYPE_KEYS), entryLayoutSchema),
|
|
165
|
+
/**
|
|
166
|
+
* The site parts the template draws around every page: the header and
|
|
167
|
+
* footer layouts it draws (SITE_CHROME_LAYOUTS, its default first; the
|
|
168
|
+
* site's choice is `/site`'s `chrome`), the takeover banner and the legal
|
|
169
|
+
* line.
|
|
170
|
+
*/
|
|
171
|
+
chrome: z.object({
|
|
172
|
+
header: z.array(z.enum(SITE_CHROME_LAYOUTS.header)).min(1),
|
|
173
|
+
footer: z.array(z.enum(SITE_CHROME_LAYOUTS.footer)).min(1),
|
|
174
|
+
takeoverBanner: z.boolean(),
|
|
175
|
+
legalLine: z.boolean()
|
|
176
|
+
}),
|
|
177
|
+
starter: z.object({
|
|
178
|
+
pages: z.array(starterPageSchema),
|
|
179
|
+
menus: z.object({ primary: z.array(starterMenuItemSchema), footer: z.array(starterMenuItemSchema) }),
|
|
180
|
+
sections: z.array(starterReusableSectionSchema)
|
|
181
|
+
})
|
|
182
|
+
});
|
|
183
|
+
siteTemplateManifestSchema.omit({ audience: true });
|
|
184
|
+
|
|
185
|
+
export { siteTemplateManifestSchema };
|
package/package.json
CHANGED
|
@@ -1,6 +1,73 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backgold/template-kit",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"description": "What every BackGold Astro template draws the same way: the section, entry and chrome components, the Site layout, the routes, lib and the stylesheets, shipped as source, with the Content API contract names they use.",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./src/index.d.ts",
|
|
10
|
+
"import": "./src/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./template": "./src/template.ts",
|
|
13
|
+
"./contract/*": {
|
|
14
|
+
"types": "./dist/contract/*.d.ts",
|
|
15
|
+
"import": "./dist/contract/*.js"
|
|
16
|
+
},
|
|
17
|
+
"./routes/*": "./src/routes/*",
|
|
18
|
+
"./layouts/*": "./src/layouts/*",
|
|
19
|
+
"./components/*": "./src/components/*",
|
|
20
|
+
"./lib/*": "./src/lib/*.ts",
|
|
21
|
+
"./styles/*": "./src/styles/*"
|
|
22
|
+
},
|
|
23
|
+
"imports": {
|
|
24
|
+
"#contract/*": {
|
|
25
|
+
"types": "./dist/contract/*.d.ts",
|
|
26
|
+
"import": "./dist/contract/*.js"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"src",
|
|
31
|
+
"!src/contract",
|
|
32
|
+
"dist",
|
|
33
|
+
"README.md"
|
|
34
|
+
],
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"maplibre-gl": "^6.14.0",
|
|
37
|
+
"zod": "^4.6.7"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"astro": "^7",
|
|
41
|
+
"@backgold/content": "^0.4.0",
|
|
42
|
+
"@backgold/astro": "^0.4.2"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@astrojs/check": "^0.9.10",
|
|
46
|
+
"astro": "^7.3.5",
|
|
47
|
+
"typescript": "^6.0.3",
|
|
48
|
+
"tsup": "^8.5.1",
|
|
49
|
+
"@backgold/astro": "^0.4.2",
|
|
50
|
+
"@backgold/content": "^0.4.0",
|
|
51
|
+
"@backgold/contract": "0.0.0"
|
|
52
|
+
},
|
|
53
|
+
"engines": {
|
|
54
|
+
"node": ">= 22.12"
|
|
55
|
+
},
|
|
56
|
+
"repository": {
|
|
57
|
+
"type": "git",
|
|
58
|
+
"url": "git+https://github.com/BackGoldHQ/sites.git",
|
|
59
|
+
"directory": "packages/template-kit"
|
|
60
|
+
},
|
|
61
|
+
"keywords": [
|
|
62
|
+
"backgold",
|
|
63
|
+
"astro",
|
|
64
|
+
"astro-integration",
|
|
65
|
+
"withastro",
|
|
66
|
+
"cloudflare-workers",
|
|
67
|
+
"template"
|
|
68
|
+
],
|
|
69
|
+
"scripts": {
|
|
70
|
+
"build": "tsup",
|
|
71
|
+
"lint": "astro check && tsc --noEmit"
|
|
72
|
+
}
|
|
6
73
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
// One entry in a list: indexes, term pages, the Blog and Collection sections.
|
|
3
|
+
// A raised card (boards A1 and C1): the cover, the entry's category as a
|
|
4
|
+
// chip, its title, its summary, and its line under them: the card's `meta`
|
|
5
|
+
// (what the section that made it says there) and the day it was published.
|
|
6
|
+
import type { Card } from '../lib/section'
|
|
7
|
+
import { formatShortDay } from '../lib/format'
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
card: Card
|
|
11
|
+
/** The card title's level: 2 on an index page (under its h1), 3 inside a section (under its h2). */
|
|
12
|
+
level?: 2 | 3
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const { card, level = 2 } = Astro.props
|
|
16
|
+
const Heading = level === 2 ? 'h2' : 'h3'
|
|
17
|
+
const day = formatShortDay(card.date)
|
|
18
|
+
---
|
|
19
|
+
<article class="card">
|
|
20
|
+
{card.image && <img class="card-image" src={card.image.url} alt={card.image.alt} loading="lazy" decoding="async" />}
|
|
21
|
+
<div class="card-body">
|
|
22
|
+
{card.category && <p class="card-chips"><span class="chip chip-wash">{card.category}</span></p>}
|
|
23
|
+
<Heading class="card-title">
|
|
24
|
+
{card.href ? <a href={card.href}>{card.title}</a> : card.title}
|
|
25
|
+
</Heading>
|
|
26
|
+
{card.summary && <p class="card-summary">{card.summary}</p>}
|
|
27
|
+
{(card.meta || day) && (
|
|
28
|
+
<p class="card-meta">
|
|
29
|
+
{card.meta}
|
|
30
|
+
{card.meta && day && ' · '}
|
|
31
|
+
{day && card.date && <time datetime={card.date}>{day}</time>}
|
|
32
|
+
</p>
|
|
33
|
+
)}
|
|
34
|
+
</div>
|
|
35
|
+
</article>
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
---
|
|
2
|
+
// An event's map on its page (board C6), the main column's full width: the
|
|
3
|
+
// kit's own, drawn in the browser by MapLibre GL over OpenFreeMap's tiles
|
|
4
|
+
// (src/lib/event-map-draw.ts: the venue's pin in the brand's accent, page
|
|
5
|
+
// scrolling never caught, the OpenStreetMap credit folding to ⓘ). MapLibre
|
|
6
|
+
// loads only when the map comes near the screen, so the page above it costs
|
|
7
|
+
// nothing. Until it draws (with scripts off, without WebGL, before it loads)
|
|
8
|
+
// the frame shows the place and a link to it on OpenStreetMap.
|
|
9
|
+
interface Props {
|
|
10
|
+
lat: number
|
|
11
|
+
lng: number
|
|
12
|
+
/** The place as the page names it: the venue, else the location. */
|
|
13
|
+
place: string | null
|
|
14
|
+
/** The venue's street address, or null. */
|
|
15
|
+
address: string | null
|
|
16
|
+
/** What the event is, for the map's name when it has no place. */
|
|
17
|
+
title: string
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const { lat, lng, place, address, title } = Astro.props
|
|
21
|
+
const label = `Map: ${place ?? title}`
|
|
22
|
+
const at = `${lat.toFixed(5)}/${lng.toFixed(5)}`
|
|
23
|
+
const osm = `https://www.openstreetmap.org/?mlat=${lat.toFixed(5)}&mlon=${lng.toFixed(5)}#map=17/${at}`
|
|
24
|
+
---
|
|
25
|
+
<div class="event-map" role="region" aria-label={label} data-event-map data-lat={lat} data-lng={lng} data-label={label}>
|
|
26
|
+
<div class="event-map-canvas" data-event-map-canvas></div>
|
|
27
|
+
<div class="event-map-fallback" data-event-map-fallback>
|
|
28
|
+
<svg viewBox="0 0 32 42" aria-hidden="true"><path d="M16 41s14-13.2 14-24.5A14 14 0 0 0 2 16.5C2 27.8 16 41 16 41z" /><circle cx="16" cy="16.5" r="5.5" /></svg>
|
|
29
|
+
{(place || address) && <p>{[place, address].filter(Boolean).join(', ')}</p>}
|
|
30
|
+
<a class="text-link" href={osm} rel="noopener">Open in OpenStreetMap</a>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<script>
|
|
35
|
+
// Load the map's code when it is within a screen of view; once per map.
|
|
36
|
+
const maps = document.querySelectorAll<HTMLElement>('[data-event-map]')
|
|
37
|
+
const draw = (figure: HTMLElement) =>
|
|
38
|
+
import('../lib/event-map-draw')
|
|
39
|
+
.then((m) => m.drawEventMap(figure))
|
|
40
|
+
.catch(() => {})
|
|
41
|
+
if (maps.length > 0 && 'IntersectionObserver' in window) {
|
|
42
|
+
const near = new IntersectionObserver(
|
|
43
|
+
(entries) => {
|
|
44
|
+
for (const entry of entries) {
|
|
45
|
+
if (!entry.isIntersecting) continue
|
|
46
|
+
near.unobserve(entry.target)
|
|
47
|
+
draw(entry.target as HTMLElement)
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
{ rootMargin: '100% 0px' },
|
|
51
|
+
)
|
|
52
|
+
maps.forEach((figure) => near.observe(figure))
|
|
53
|
+
} else {
|
|
54
|
+
maps.forEach(draw)
|
|
55
|
+
}
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<style>
|
|
59
|
+
.event-map {
|
|
60
|
+
position: relative;
|
|
61
|
+
overflow: hidden;
|
|
62
|
+
aspect-ratio: 3 / 2;
|
|
63
|
+
margin-top: 1.625rem;
|
|
64
|
+
border: 1px solid var(--line);
|
|
65
|
+
border-radius: var(--radius-card);
|
|
66
|
+
/* C6's ground under the map: the band's tint, ruled in a faint grid. */
|
|
67
|
+
background:
|
|
68
|
+
repeating-linear-gradient(0deg, transparent 0 38px, var(--line) 38px 39px),
|
|
69
|
+
repeating-linear-gradient(90deg, transparent 0 38px, var(--line) 38px 39px),
|
|
70
|
+
var(--band-tint);
|
|
71
|
+
}
|
|
72
|
+
.event-map-canvas {
|
|
73
|
+
position: absolute;
|
|
74
|
+
inset: 0;
|
|
75
|
+
}
|
|
76
|
+
.event-map-fallback {
|
|
77
|
+
position: absolute;
|
|
78
|
+
inset: 0;
|
|
79
|
+
display: grid;
|
|
80
|
+
place-content: center;
|
|
81
|
+
justify-items: center;
|
|
82
|
+
gap: 0.375rem;
|
|
83
|
+
padding: 1rem;
|
|
84
|
+
text-align: center;
|
|
85
|
+
}
|
|
86
|
+
.event-map-fallback[hidden] {
|
|
87
|
+
display: none;
|
|
88
|
+
}
|
|
89
|
+
.event-map-fallback svg,
|
|
90
|
+
.event-map :global(.event-map-pin svg) {
|
|
91
|
+
display: block;
|
|
92
|
+
width: 2rem;
|
|
93
|
+
height: 2.625rem;
|
|
94
|
+
fill: var(--bg-brand-accent, var(--accent));
|
|
95
|
+
stroke: color-mix(in srgb, var(--bg-brand-accent, var(--accent)) 55%, #000);
|
|
96
|
+
stroke-width: 1.25;
|
|
97
|
+
}
|
|
98
|
+
.event-map :global(.event-map-pin circle) {
|
|
99
|
+
fill: #fff;
|
|
100
|
+
stroke: none;
|
|
101
|
+
}
|
|
102
|
+
.event-map-fallback circle {
|
|
103
|
+
fill: #fff;
|
|
104
|
+
stroke: none;
|
|
105
|
+
}
|
|
106
|
+
.event-map-fallback p {
|
|
107
|
+
margin: 0;
|
|
108
|
+
font-weight: 700;
|
|
109
|
+
}
|
|
110
|
+
.event-map-fallback a {
|
|
111
|
+
font-size: var(--text-sm);
|
|
112
|
+
}
|
|
113
|
+
@media (min-width: 40rem) {
|
|
114
|
+
.event-map {
|
|
115
|
+
aspect-ratio: 2 / 1;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
</style>
|