astro-theme-popular 0.11.0 → 0.12.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro-theme-popular",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "Popular: a warm, community-first Astro theme for meetups, clubs and fan communities. Ships as an Astro integration.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/schemas.ts CHANGED
@@ -49,6 +49,7 @@ const events = defineCollection({
49
49
  time: z.string().optional(),
50
50
  venue: z.string().optional(),
51
51
  venueWanted: z.boolean().default(false),
52
+ planning: z.boolean().default(false), // "Planning" badge instead of "Confirmed", and no RSVP button
52
53
  address: z.string().optional(),
53
54
  speaker: z.string().optional(), // one-liner fallback when no speaker profiles are referenced
54
55
  speakers: z.array(z.string()).default([]), // slugs of entries in the speakers collection
@@ -16,6 +16,10 @@ if (d.venueRef && !venuePage) console.warn(`events/${event.id}: venueRef "${d.ve
16
16
  const venueName = venuePage?.data.title ?? d.venue;
17
17
  const venueAddress = venuePage?.data.address ?? (venuePage ? undefined : d.address);
18
18
  const tbd = d.venueWanted || !venueName;
19
+ /* Planning: the event is on the calendar but its details are not settled.
20
+ Wins over the venue-wanted badge, which is inferred, and hides the RSVP
21
+ button even when `rsvp` is already filled in. */
22
+ const planning = d.planning;
19
23
 
20
24
  /* Speaker line: resolved speaker-profile names, falling back to the string. */
21
25
  const allSpeakers = d.speakers.length ? await safeCollection('speakers') : [];
@@ -57,10 +61,12 @@ const day = d.date.toLocaleDateString(SITE.locale, { month: 'short', day: 'numer
57
61
  <div class="g-event__aside">
58
62
  {d.cancelled
59
63
  ? <span class="g-badge g-badge--danger g-badge--soft">{STRINGS.eventCancelled}</span>
64
+ : planning
65
+ ? <span class="g-badge g-badge--soft">{STRINGS.eventPlanning}</span>
60
66
  : tbd
61
67
  ? <span class="g-badge g-badge--warning g-badge--soft">{STRINGS.venueWanted}</span>
62
68
  : <span class="g-badge g-badge--success g-badge--soft">{STRINGS.confirmed}</span>}
63
- {d.rsvp && (
69
+ {!planning && d.rsvp && (
64
70
  <a class="g-btn g-btn--primary g-btn--sm" href={withBase(d.rsvp)}><i class="fa-solid fa-calendar" aria-hidden="true"></i>{STRINGS.rsvp}</a>
65
71
  )}
66
72
  </div>
@@ -10,7 +10,7 @@ const escapeHtml = (s: string): string =>
10
10
 
11
11
  export function inlineMarkdown(src: string): string {
12
12
  let s = escapeHtml(src);
13
- // [label](http(s)://… | /path) — only http(s) and root-relative targets
13
+ // [label](http(s)://… | /path): only http(s) and root-relative targets
14
14
  s = s.replace(
15
15
  /\[([^\]]+)\]\((https?:\/\/[^\s)]+|\/[^\s)]*)\)/g,
16
16
  (_m, label, href) =>
@@ -72,7 +72,7 @@ const eventLd = jsonld(buildEventLd({
72
72
  </a>
73
73
  </div>
74
74
  <span class="g-eyebrow">{dateStr}{d.time && ` · ${d.time}`}</span>
75
- <h1 style="margin:.5rem 0 0">{d.title}{d.cancelled && <> <span class="g-badge g-badge--danger" style="vertical-align:middle;font-size:var(--text-sm)">{STRINGS.eventCancelled}</span></>}</h1>
75
+ <h1 style="margin:.5rem 0 0">{d.title}{d.cancelled ? <> <span class="g-badge g-badge--danger" style="vertical-align:middle;font-size:var(--text-sm)">{STRINGS.eventCancelled}</span></> : d.planning ? <> <span class="g-badge g-badge--soft" style="vertical-align:middle;font-size:var(--text-sm)">{STRINGS.eventPlanning}</span></> : null}</h1>
76
76
  </div>
77
77
  </header>
78
78
  <div class="g-container g-section--sm">
@@ -129,7 +129,8 @@ const eventLd = jsonld(buildEventLd({
129
129
  </>
130
130
  )}
131
131
 
132
- {d.rsvp && (
132
+ {/* An event still being planned takes no RSVPs yet, even with `rsvp` set. */}
133
+ {!d.planning && d.rsvp && (
133
134
  <div class="g-row" style="margin-top:var(--space-4)">
134
135
  <a class="g-btn g-btn--primary g-btn--lg" href={withBase(d.rsvp)}><i class="fa-solid fa-calendar" aria-hidden="true"></i> {STRINGS.rsvpExternal}</a>
135
136
  </div>
@@ -115,7 +115,7 @@ const orgLd = jsonld(buildOrgLd({
115
115
  </div>
116
116
  {next.data.description && <p style="margin:0;color:var(--text-muted);max-width:34rem">{next.data.description}</p>}
117
117
  <div class="g-row">
118
- {next.data.rsvp && <a class="g-btn g-btn--primary" href={withBase(next.data.rsvp)}><i class="fa-solid fa-calendar" aria-hidden="true"></i> {STRINGS.rsvpExternal}</a>}
118
+ {!next.data.planning && next.data.rsvp && <a class="g-btn g-btn--primary" href={withBase(next.data.rsvp)}><i class="fa-solid fa-calendar" aria-hidden="true"></i> {STRINGS.rsvpExternal}</a>}
119
119
  <a class="g-btn g-btn--outline" href={withBase('/events/')}>{STRINGS.allEvents}</a>
120
120
  </div>
121
121
  </div>