Programmatic SEO and AI Content at Scale — Without Getting PenalizedBuilding page systems: templates, links and structured data · Lesson 5 of 14

Template design: turning data into genuinely useful pages

Article · 8 min · 8 min lecture

Video lecture

Template design: turning data into genuinely useful pages

14 chapters · about 8 min · full transcript

Coming soon

Chapter 1 of 14

Template design

  • Anatomy of a strong page
  • Conditional logic
  • Writing the text parts
  • Rendering and performance

The narrated lecture is in production

Every chapter is scripted and ready. Browse the chapters and read the full transcript now — the video will appear here when it’s published.

Chapters

A template is a product decision

The template determines what every page in the system says and does. Design it like a product page, not an SEO container: start from the user's question for the pattern, then decide which data answers it, in what order, with what interaction.

Anatomy of a strong programmatic page

BlockPurposeExample (tutors in [subject] in [city])
Answer firstSatisfy the query immediatelyCount of verified tutors, rate range, next availability
Primary data moduleThe core listing/table/calculatorFilterable tutor list with ratings, languages, online/in-person
Computed insightWhat the raw data means"Rates in Lahore are typically lower than Karachi for O-Level Physics" (computed from bookings)
Contextual guidanceHelp the decisionHow to choose a tutor; questions to ask; typical session lengths
Trust and methodologyWhy believe itHow tutors are verified; data freshness; review policy
Related navigationNext steps and discoveryNearby areas, related subjects, levels
ConversionThe actionBook a trial lesson
FAQ from real questionsRemaining doubtsPulled from support tickets and on-site search

Conditional logic: pages should not all look the same

Use conditional blocks so content adapts to the data:

  • Show a price-trend chart only when there are enough data points.
  • Show "no providers yet — get notified" and noindex when inventory is below threshold.
  • Vary insight sentences based on computed comparisons (above/below average, rising/falling).
  • Include local rules or notes only where they exist.

Hands-on: a Jinja2 template with quality gates

{# templates/tutors_city.html.j2 #}
{% set enough = tutors|length >= 8 %}
{% if not enough %}{% set robots = "noindex,follow" %}{% else %}{% set robots = "index,follow" %}{% endif %}
<meta name="robots" content="{{ robots }}">
<h1>{{ subject.name }} tutors in {{ city.name }}</h1>
<p class="answer">
  {{ tutors|length }} verified {{ subject.name }} tutors in {{ city.name }}.
  Typical rate: {{ stats.p25_rate|money(city.currency) }}–{{ stats.p75_rate|money(city.currency) }} per hour.
  {% if stats.next_available %}Earliest trial: {{ stats.next_available|humandate }}.{% endif %}
</p>
{% if stats.rate_vs_country is not none %}
<p>
  Rates here are {{ "above" if stats.rate_vs_country > 0 else "below" }} the national median
  by about {{ (stats.rate_vs_country|abs * 100)|round|int }}% (based on {{ stats.bookings_n }} bookings in the last 12 months).
</p>
{% endif %}
{% include "partials/tutor_list.html.j2" %}
{% if city.local_notes %}<section><h2>Good to know in {{ city.name }}</h2>{{ city.local_notes|markdown }}</section>{% endif %}
{% include "partials/methodology.html.j2" %}

(This is template code for the rendering system; the page content itself is generated HTML.) Keep business logic (thresholds, stats) in the data layer and presentation in the template.

Writing the text parts

  • Data-driven sentences from computed fields (as above) — accurate by construction.
  • Evergreen guidance written once by an expert per page type or per meaningful segment (e.g., per subject), not duplicated verbatim across thousands of pages without reason; where shared, keep it short and supportive of the data.
  • AI-assisted variation only where it adds meaning (e.g., summarizing reviews for this entity), with human QA (Module 5).

Performance and rendering

  • Server-side render or statically generate pages so content is in the HTML — do not rely on client-side JavaScript to load the main data.
  • Meet Core Web Vitals (LCP, INP, CLS); large lists need pagination or "load more" with crawlable links.
  • Keep templates accessible: headings in order, table semantics, alt text for charts, RTL support for Arabic.

Worked example: a Jeddah restaurant directory

Template for "[cuisine] restaurants in [district]": answer-first summary (count, price bands, open now), map and list with halal certification status, family sections, delivery options; computed insight ("most popular for late-night dining based on reservations"); methodology and last-updated; related districts and cuisines. Districts with fewer than 6 listings show a notify-me module and are noindexed.

Pitfalls

  • Templates where 90% of text is identical across pages.
  • Main content loaded client-side only.
  • Hiding thin pages from users but not from crawlers (or vice versa) — keep behavior consistent.

How to measure success

Engagement per template version (scroll, interactions, conversions), similarity scores within thresholds, Core Web Vitals passing, and user feedback or error reports declining.

Key takeaways

  • Design the template from the user's question: answer first, primary data module, computed insight, guidance, trust, navigation, conversion.
  • Use conditional blocks and quality gates so pages adapt to data and thin pages aren't indexed.
  • Generate sentences from computed data; write evergreen guidance per type or segment, not duplicated filler.
  • Render content in HTML (SSR/SSG), meet Core Web Vitals and accessibility including RTL.
  • Measure template versions on engagement and similarity.

Check your understanding

Quick questions to lock in the lesson. They don’t count towards your certificate.

  1. Which block should appear first on a programmatic page?
  2. A district has only two listings. What should the template do?
  3. Why server-side render or statically generate programmatic pages?

Put it into practice

Sketch the template for one page type with blocks in order, the data field behind each, conditional rules, and the noindex threshold.

Enrol for free to save your progress

Reading is always free. Enrol to keep your place, take the final assessment and earn a verifiable certificate.