From ca5c8862fdde11be4c2bd8b62315634b78f62ffe Mon Sep 17 00:00:00 2001 From: Will Estes Date: Thu, 9 Jul 2026 08:51:49 -0400 Subject: [PATCH] Restructure course landing page into data-driven sections Splits the single hardcoded-feeling course template into hero, credibility, curriculum, and repeat-CTA sections, each rendering only when its front matter fields are set. The enroll form (and its EEC-trigger JS) moves into a reusable partial so it can appear more than once on a page without id collisions. Co-Authored-By: Claude Sonnet 5 --- assets/css/main.css | 70 +++++++++++++++++++ layouts/courses/single.html | 87 +++++++++++------------- layouts/partials/course-enroll-form.html | 48 +++++++++++++ 3 files changed, 157 insertions(+), 48 deletions(-) create mode 100644 layouts/partials/course-enroll-form.html diff --git a/assets/css/main.css b/assets/css/main.css index 9ea2140..5ac1f25 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -233,3 +233,73 @@ input:focus, textarea:focus { height: 1px; overflow: hidden; } + +/* Course landing pages (layouts/courses/single.html) */ +.course-hero { + text-align: center; +} +.course-subhead { + font-style: italic; + color: var(--fg-muted); + margin-top: 0; +} +.course-value-prop { + font-size: 1.05rem; + margin: 1.5rem 0; +} +.course-social-proof { + font-style: italic; + font-size: 0.9rem; + color: var(--fg-muted); +} +.enroll-form { + max-width: 24rem; + margin: 1.5rem auto; + text-align: left; +} +.enroll-status { + text-align: center; +} + +.course-credibility, +.course-curriculum { + background: var(--bg-raised); + border: 1px solid var(--border); + border-radius: var(--radius); + padding: 2rem; + margin: 3rem 0; +} +.course-bullets { + list-style: none; + padding: 0; + margin: 1.5rem 0 0; +} +.course-bullets li { + position: relative; + padding-left: 1.75rem; + margin-bottom: 0.75rem; +} +.course-bullets li::before { + content: "✓"; + position: absolute; + left: 0; + color: var(--cta); + font-weight: 700; +} +.course-curriculum-list { + list-style: none; + padding: 0; + margin: 1.5rem 0 0; +} +.course-curriculum-list li { + margin-bottom: 1rem; +} +.course-day-label { + font-family: var(--font-heading); + color: var(--cta); + font-weight: 700; +} +.course-repeat-cta { + text-align: center; + margin-top: 3rem; +} diff --git a/layouts/courses/single.html b/layouts/courses/single.html index 4a82609..e1d18e0 100644 --- a/layouts/courses/single.html +++ b/layouts/courses/single.html @@ -1,52 +1,43 @@ {{ define "main" }} -

{{ .Title }}

-{{ with .Params.pitch }}
{{ . | markdownify }}
{{ end }} +
+

{{ .Title }}

+ {{ with .Params.hero_subhead }}

{{ . }}

{{ end }} + {{ with .Params.pitch }}
{{ . | markdownify }}
{{ end }} + + {{ partial "course-enroll-form.html" (dict "id" "top" "page" .) }} + + {{ with .Params.social_proof }}

{{ . }}

{{ end }} +
+ +{{ if or .Params.credibility_heading .Params.credibility_bullets }} +
+ {{ with .Params.credibility_heading }}

{{ . }}

{{ end }} + {{ with .Params.credibility_bullets }} +
    + {{ range . }}
  • {{ . | markdownify }}
  • {{ end }} +
+ {{ end }} +
+{{ end }} + +{{ if or .Params.curriculum_heading .Params.curriculum_items }} +
+ {{ with .Params.curriculum_heading }}

{{ . }}

{{ end }} + {{ with .Params.curriculum_intro }}

{{ . }}

{{ end }} + {{ with .Params.curriculum_items }} +
    + {{ range . }} +
  1. {{ with .label }}{{ . }} {{ end }}{{ .text | markdownify }}
  2. + {{ end }} +
+ {{ end }} +
+{{ end }} + {{ .Content }} -
- - - - - - -
-

- - +
+ {{ with .Params.repeat_cta_heading }}

{{ . }}

{{ end }} + {{ partial "course-enroll-form.html" (dict "id" "bottom" "page" .) }} +
{{ end }} diff --git a/layouts/partials/course-enroll-form.html b/layouts/partials/course-enroll-form.html new file mode 100644 index 0000000..5cc9253 --- /dev/null +++ b/layouts/partials/course-enroll-form.html @@ -0,0 +1,48 @@ +{{ $id := .id }} +{{ $page := .page }} +
+ + + + + + +
+

+ +