Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion apps/website/src/coursebuilder/workshop-lessons.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,23 @@ it('releases signed playback to buyers at the stored instant, never public playb
null,
);
assert.equal(
chapterUnlockLabel('2026-11-10T08:00:00Z'),
chapterUnlockLabel('2026-11-10T08:00:00Z', input.now),
'Unlocks Tue, Nov 10 at 12:00 AM PT',
);
});

it('labels released chapters as unlocked at and after their release time', () => {
for (const now of [
new Date('2026-11-10T08:00:00Z'),
new Date('2026-11-11T08:00:00Z'),
]) {
assert.equal(
chapterUnlockLabel('2026-11-10T08:00:00Z', now),
'Unlocked Tue, Nov 10 at 12:00 AM PT',
);
}
});

it('public content projections remove playback and exercises through nested resource/edge API shapes', () => {
const video = {
id: 'video',
Expand Down
5 changes: 3 additions & 2 deletions apps/website/src/coursebuilder/workshop-lessons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ export function isChapterUnlocked(startsAt: string | null, now = new Date()) {
);
}

export function chapterUnlockLabel(startsAt: string | null) {
export function chapterUnlockLabel(startsAt: string | null, now = new Date()) {
if (!startsAt || !Number.isFinite(Date.parse(startsAt)))
return 'Release date to be announced';
return `Unlocks ${new Intl.DateTimeFormat('en-US', {
const label = isChapterUnlocked(startsAt, now) ? 'Unlocked' : 'Unlocks';
return `${label} ${new Intl.DateTimeFormat('en-US', {
timeZone: 'America/Los_Angeles',
weekday: 'short',
month: 'short',
Expand Down
93 changes: 1 addition & 92 deletions apps/website/src/pages/workshops/[slug].astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
import '../../styles/workshop-body.css';
import WorkshopTicket from '../../components/workshops/workshop-ticket.astro';
import WorkshopChapters from '../../components/workshops/workshop-chapters.astro';
import { chapterUnlockLabel } from '../../coursebuilder/workshop-lessons';
Expand Down Expand Up @@ -376,96 +377,6 @@ const included = [
}
}

.workshop-body {
color: var(--text);
font-family: var(--font-family);
font-size: 1.0625rem;
line-height: 1.6;
max-inline-size: 68ch;
min-inline-size: 0;
overflow-wrap: anywhere;

:global(> :first-child) {
margin-block-start: 0;
}

:global(> * + *) {
margin-block-start: 1.25rem;
}

:global(:is(h2, h3, h4)) {
color: var(--text-emphasized);
font-family: var(--font-family-heading);
line-height: 1.2;
}

:global(:is(h2, h3, h4):not(:first-child)) {
margin-block-start: 2.5rem;
}

:global(:is(h2, h3, h4) + *) {
margin-block-start: 0.75rem;
}

:global(h3) {
font-size: 1.25em;
}

:global(:is(ul, ol)) {
padding-inline-start: 1.5em;
}

:global(li) {
padding-inline-start: 0.25em;
}

:global(li + li) {
margin-block-start: 0.5rem;
}

:global(li::marker) {
color: var(--orange);
}

:global(li > :is(ul, ol, p) + *) {
margin-block-start: 0.75rem;
}

:global(blockquote) {
background: var(--bg);
border-inline-start: 0.25rem solid var(--orange);
color: var(--text-emphasized);
font-style: italic;
padding: 1rem 1.25rem;
}

:global(blockquote > * + *) {
margin-block-start: 1rem;
}

:global(blockquote + p) {
color: var(--text-muted);
font-size: 1rem;
margin-block-start: 0.5rem;
}

:global(blockquote + p + *) {
margin-block-start: 1rem;
}

:global(a) {
color: var(--text-link);
text-decoration: underline;
text-decoration-thickness: 0.08em;
text-underline-offset: 0.15em;
}

:global(pre) {
max-inline-size: 100%;
overflow-x: auto;
}
}

.workshop-faq {
:global(p:has(> strong:first-child):not(:first-child)) {
margin-block-start: 2rem;
Expand Down Expand Up @@ -494,7 +405,6 @@ const included = [
text-align: center;
}

.workshop-body :global(a:focus-visible),
.workshop-hero-cta:focus-visible {
outline: 3px solid var(--orange);
outline-offset: 4px;
Expand All @@ -506,7 +416,6 @@ const included = [
}

.workshop-body {
font-size: 1.125rem;
grid-column: 2;
}
}
Expand Down
Loading
Loading