A course landing page built with Astro is a single static page that states the outcome of the course, shows the full curriculum, introduces the instructor, answers objections and links to checkout. Store the curriculum in a content collection so the page and any lesson pages read from one source, load the preview video only when someone clicks play, and add Course structured data so search engines understand what you’re selling.
Key Takeaways
- Lead with the outcome a student gets, then prove it with the curriculum, the instructor and real student feedback.
- Keep modules and lessons in a
file()collection; the landing page renders them as an outline.- Replace an embedded video player with a click-to-load preview to keep the page fast.
- Link checkout to your course platform or payment provider; the landing page stays static.
- Add
CourseandFAQPagestructured data that matches the visible content.
The sections a course landing page needs
Course buyers compare a few options before they pay, and they look for the same things on every page. Put the sections in roughly this order:
| Section | Job | Notes |
|---|---|---|
| Hero | Outcome in one line, who it’s for, price or “enrol” button | No vague claims; say what students will be able to do |
| Problem | The situation students are in now | Use the words students use |
| Curriculum | Every module and lesson | The most-read section on most course pages |
| Instructor | Why you’re qualified | Specific experience, links to your work |
| Preview | A free lesson or short video | Lets people judge the teaching style |
| Feedback | What past students said | Only real, attributed quotes |
| Pricing | What’s included, refund policy | One plan is easier to choose than three |
| FAQ | Objections answered | Time required, prerequisites, access length |
| Final call to action | Enrol button repeated | Same wording as the hero |
The landing page sections guide explains how each section works on a general landing page; a course page adds the curriculum and instructor sections on top.
Set up the project
npm create astro@latest -- --template minimal course-site
cd course-site
npm run dev
The landing page is src/pages/index.astro if the domain is only for the course, or src/pages/courses/<name>.astro if you’ll sell more than one later. Set site in astro.config.mjs to your domain so canonical URLs and structured data use absolute links.
Store the curriculum as data
A curriculum is structured data: modules containing lessons with a title and a duration. Put it in a JSON file and load it with the file() loader:
[
{
"id": "01-foundations",
"title": "Foundations",
"lessons": [
{ "title": "How the course works", "minutes": 6, "free": true },
{ "title": "Setting up your workspace", "minutes": 14 }
]
},
{
"id": "02-first-project",
"title": "Your first project",
"lessons": [
{ "title": "Planning the project", "minutes": 18 },
{ "title": "Building the first page", "minutes": 25 }
]
}
]
// src/content.config.ts
import { defineCollection } from 'astro:content';
import { file } from 'astro/loaders';
import { z } from 'astro/zod';
const modules = defineCollection({
loader: file('src/data/curriculum.json'),
schema: z.object({
title: z.string(),
lessons: z.array(
z.object({
title: z.string(),
minutes: z.number().int().positive(),
free: z.boolean().default(false),
}),
),
}),
});
export const collections = { modules };
Save the JSON as src/data/curriculum.json. Each object needs an id, which file() uses as the entry ID. If a lesson is missing minutes, the build fails and names the entry, so the outline never shows “undefined min”. The content docs show how collections fit into a project.
Render the curriculum
The outline uses native <details> elements, so modules expand and collapse with no JavaScript:
---
// src/components/Curriculum.astro
import { getCollection } from 'astro:content';
const modules = (await getCollection('modules')).sort((a, b) => a.id.localeCompare(b.id));
const totalMinutes = modules.flatMap((m) => m.data.lessons).reduce((sum, l) => sum + l.minutes, 0);
const lessonCount = modules.reduce((n, m) => n + m.data.lessons.length, 0);
---
<section id="curriculum">
<h2>What you'll learn</h2>
<p>{modules.length} modules, {lessonCount} lessons, about {Math.round(totalMinutes / 60)} hours of video.</p>
{modules.map((m, i) => (
<details open={i === 0}>
<summary>Module {i + 1}: {m.data.title}</summary>
<ol>
{m.data.lessons.map((l) => (
<li>
{l.title} <span>{l.minutes} min</span>
{l.free && <span class="badge">Free preview</span>}
</li>
))}
</ol>
</details>
))}
</section>
The totals are computed from the data, so adding a lesson updates the summary line automatically. That matters, because “about 6 hours” in the hero that disagrees with the outline is the kind of detail that makes buyers hesitate.
Add a fast video preview
A YouTube or Vimeo embed loads its player scripts as soon as the page loads, even if nobody presses play. On a landing page, that weight hurts Largest Contentful Paint. Show a poster image and a button, and swap in the iframe on click:
---
// src/components/VideoPreview.astro
import { Image } from 'astro:assets';
import poster from '../assets/preview-poster.jpg';
const { videoId, title } = Astro.props;
---
<div class="video" data-video-id={videoId} data-title={title}>
<Image src={poster} alt="" width={1280} height={720} loading="eager" />
<button type="button" aria-label={`Play: ${title}`}>Play preview</button>
</div>
<script>
document.querySelectorAll<HTMLElement>('.video').forEach((box) => {
box.querySelector('button')?.addEventListener('click', () => {
const iframe = document.createElement('iframe');
iframe.src = `https://www.youtube-nocookie.com/embed/${box.dataset.videoId}?autoplay=1`;
iframe.title = box.dataset.title ?? 'Video';
iframe.allow = 'autoplay; encrypted-media; picture-in-picture';
iframe.allowFullscreen = true;
box.replaceChildren(iframe);
});
});
</script>
<style>
.video { position: relative; aspect-ratio: 16 / 9; }
.video :global(img), .video :global(iframe) { width: 100%; height: 100%; border: 0; }
.video button { position: absolute; inset: auto 1rem 1rem auto; }
</style>
The poster goes through astro:assets, so it’s resized and served in a modern format. The aspect-ratio keeps the layout stable when the iframe replaces the image. Our layout shift guide explains why that matters for Core Web Vitals.
Link to checkout
The landing page doesn’t need to process payments. Point the enrol buttons at wherever the course lives:
- A course platform (Teachable, Thinkific, Podia and similar) that handles checkout and hosts the lessons.
- A payment link from Stripe, Lemon Squeezy, Paddle or a similar provider, with lesson access delivered by email or a members area.
- Your own Astro app, if you’re building lessons and accounts yourself. That part needs an adapter and on-demand routes; the landing page can stay prerendered.
Use the same button text everywhere, and put the price next to it. Hiding the price until checkout loses buyers who just want to know if the course fits their budget.
Course landing page SEO and structured data
Give the page a title that names the subject and the outcome, not just the course brand, and use the subject in the H1 and at least one H2. Then add Course structured data built from the same data the page shows:
---
// src/components/CourseSchema.astro
const course = {
'@context': 'https://schema.org',
'@type': 'Course',
name: 'Build Your First Astro Site',
description: 'A self-paced video course that takes you from an empty folder to a deployed Astro site.',
provider: {
'@type': 'Organization',
name: 'Jane Doe Courses',
sameAs: Astro.site?.href,
},
};
---
<script type="application/ld+json" set:html={JSON.stringify(course)} />
Google’s course structured data has more fields (offers, course instances, workload) and specific eligibility rules, so check the course info documentation before relying on rich results. The FAQ section can carry FAQPage markup; the FAQ schema guide shows a component that renders both the visible questions and the JSON-LD from one array.
Only add review or rating markup if you collect reviews on the page itself. Invented ratings are a fast way to lose rich results entirely.
Before you launch
- Test the page on a slow mobile connection; the hero and curriculum should render before any video loads.
- Click every enrol button and confirm it reaches checkout with the right price.
- Check that the free preview lesson works without an account.
- Read the FAQ out loud and remove anything you wouldn’t say to a student.
- Deploy the
dist/folder to a static host such as Cloudflare Pages, Netlify or GitHub Pages.
Start from a course theme
The Education category has several designs built for selling courses. Course X is focused on promoting a single online course, with course, product and video pages, and CourseKit+ includes course library and single-course layouts. Both are editable Astro source, so you can plug in the curriculum collection above.
FAQ
What should a course landing page include?
A clear outcome in the hero, the full curriculum, an instructor section, a free preview, real student feedback, pricing with the refund policy, an FAQ and a repeated enrol button. The curriculum and price are what most buyers look for first.
Can I sell a course from a static Astro site?
Yes. The landing page stays static and the enrol button links to a course platform or a payment provider’s checkout. You only need a server if you build accounts and lesson access into the Astro site yourself.
How do I embed a course preview video without slowing the page down?
Show a poster image with a play button and create the video iframe only when someone clicks. The page loads no third-party player scripts until a visitor asks for the video.
How long should a course landing page be?
Long enough to answer the questions a buyer has before paying. For most courses that means a full curriculum, an instructor section and an FAQ, which makes the page long, but each section should be easy to skim with clear headings.
Does Course schema help a course landing page rank?
Structured data helps search engines understand the page and can make it eligible for course rich results, but it doesn’t replace useful content. Add it with accurate details that match what’s visible on the page.