Web Development Pro | Lesson 056 | Capstone Build: Content and Semantic HTML
Web Development Pro · Lesson 56 of 60
Module 6: Delivery and the capstone
In this lesson
Prerequisites and learning outcomes
Complete lesson 55 first. This lesson builds on content-first structure and local assets. By the end, you can build the complete semantic foundation of a community learning hub. Plan 10–15 minutes for the core explanation and additional time for the worked practice.
Build the information before the interaction
The first capstone snapshot is a complete semantic three-page site. Home explains the fictional learning project, Events contains every workshop's essential information, and Access information describes the fictional venues and privacy limits. The pages are useful before styling or JavaScript enhancement is added.
Open the source files and compare each page with the plan from lesson 055. Every event should have a title, category, exact UTC time, duration, published capacity, venue, and access description. Missing content cannot be repaired by an attractive card layout. Establish the information contract while the structure is still easy to inspect.
Give each page a distinct identity
Each document declares its language, character encoding, viewport, and page-specific title. The main heading names the page's purpose. A consistent navigation lists Home, Events, and Access information; aria-current=page identifies the current destination. The links are ordinary relative links, so direct navigation and copied page URLs remain meaningful.
A skip link points to the main landmark. The main element has tabindex=-1 so it can serve as a focus target without becoming another regular tab stop. This is an implementation intention; actual skip-link focus and keyboard behavior still need manual observation in a browser.
Structure repeated events as a real list
The schedule is a list of event records. Each list item contains an article with a heading and related details. A section heading names the full schedule, while each event uses the next appropriate heading level. Do not choose heading levels merely to obtain a desired font size; CSS will handle the presentation later.
<li data-event-id="bike-basics">
<article class="card">
<h3>Bike basics</h3>
<p>Category: repair</p>
<p><time datetime="2027-04-10T10:00:00.000Z">2027-04-10, 10:00 UTC</time>; 90 minutes</p>
<p>Published capacity: 12. This is not live availability.</p>
<p>River room, North building</p>
</article>
</li>
The machine-readable datetime and visible time agree. UTC is stated explicitly rather than allowing a date label to imply a real venue timezone. Published capacity is described accurately. This card does not show a fake reservation button or claim to know how many real seats remain.
Keep the fallback synchronized with the fixture
The complete snapshot includes events.json and the contract validator beside the HTML. Static content and data intentionally duplicate a tiny schedule so that the page remains useful when enhancement is unavailable. That choice requires a synchronization check whenever the schedule changes.
Use stable data-event-id values to connect each static article with its JSON record. Compare the set of ids, titles, timestamps, capacities, venue details, and access statements. Matching only the number of cards would miss a stale title or an event attached to the wrong room.
The validator checks shape and bounds, including unique slug ids up to sixty-four characters and text lengths measured using JavaScript string length, which counts UTF-16 code units. That is not always the same as a person's perceived character count. The capstone uses simple English fixtures, but the distinction should remain documented if the content expands.
Prepare future controls without a broken form
The Events page contains a hidden enhancement form for the next stages. It includes visible labels in its markup, a query input, a category selector, Apply and Reset buttons, and a spacing selector. Because the entire form is hidden until the application is ready, the semantic-only snapshot does not offer a search that cannot work.
The Apply button is a submit button for the later JavaScript-controlled search interaction. Reset and other actions use type=button so they do not accidentally submit. In the enhanced stage, a handler prevents the search submission and updates local state. In this stage the form remains hidden and no module runs.
A noscript explanation reinforces that the static schedule remains available without JavaScript. Do not put the only schedule inside noscript, because a module can fail even when JavaScript is technically enabled. The fallback is ordinary content, and later code hides it only after validated enhancement succeeds.
Give images a purpose and a stable shape
The home page includes a small local SVG illustration. It is decorative and contributes no facts beyond the adjacent introduction, so alt is empty. Width and height reserve its aspect ratio. The image is owned by the example and requires no remote request, account, or attribution to an unknown source.
The local asset path is hub.svg from the home page's directory. Keep filenames and references consistent. The next stylesheet can scale the illustration without changing its semantic purpose or replacing its text alternative with decorative captions.
Review content as a visitor would
Check link names in isolation as well as in context. “Privacy and demo limits” clearly describes a destination. Repeated vague phrases such as “More” force visitors to inspect surrounding content. Good wording helps sighted scanning, keyboard navigation, and assistive-technology use without requiring an additional widget.
Verify structure without overstating experience
Run the included contract tests with an existing Node installation. Static HTML checks can inspect language, titles, ids, landmarks, local references, and fixture alignment. They do not render the page or establish that a screen reader announces the intended structure.
The manual checklist remains untested until someone uses an available browser. Record the exact snapshot and observations for navigation, reading order, keyboard access, and no-script behavior. This stage establishes a coherent content foundation; later visual and interactive work should preserve it rather than rebuilding the site's meaning from scratch.
Worked practice
Worked exercise 1: Detect stale static content
Task: JSON changes Garden planning to a different room, but the static page still shows the old room. Worked answer: update both representations and run the fixture-alignment check. Stable ids help find the correct card; matching the number of cards alone would not catch the discrepancy.
Worked exercise 2: Keep failure content available
Task: A developer places the schedule only inside noscript. Worked answer: keep the schedule as ordinary HTML. A fetch or module can fail while JavaScript remains enabled, so noscript alone does not cover the failure state. Hide fallback only after successful enhancement.
Worked exercise 3: Choose an alternative
Task: The decorative SVG is replaced with a map to a real entrance. Worked answer: reassess its purpose and provide an appropriate textual equivalent and authorization for the image. The old empty alt was correct for decoration, not necessarily for navigation information.
Knowledge check
Question 1
Why build the complete static schedule first? A) To preserve essential information before enhancement works. B) To guarantee all runtime interactions pass. C) To eliminate later data checks. D) To make a backend unnecessary for real booking.
Check question 1: answer and explanation
Answer: A. The information task remains useful independently of JavaScript.
Question 2
What identifies the current navigation destination? A) A current-looking CSS class without a programmatic current-page indicator. B) aria-current=page on the relevant link. C) aria-selected on every navigation link regardless of its role. D) aria-current=page on all three navigation destinations.
Check question 2: answer and explanation
Answer: B. It communicates orientation without removing useful destinations.
Question 3
Why is a noscript-only fallback insufficient? A) It appears only when a fetch request fails. B) It runs the fallback whenever a module throws. C) Scripts can be enabled while a module or request still fails. D) It detects invalid event JSON and replaces the script output.
Check question 3: answer and explanation
Answer: C. Fallback must also cover enabled-but-broken enhancement.
Question 4
What should a fixture-alignment check compare? A) Only the last modification time of HTML and JSON. B) Only the number of cards. C) Only the first event title. D) Stable identities and the relevant public fields.
Check question 4: answer and explanation
Answer: D. Equal counts can conceal stale or mismatched content.
Question 5
What does a static structure pass establish? A) Actual screen-reader announcements. B) The inspected source relationships, with browser experience still pending. C) Every keyboard path in every browser. D) The final responsive layout.
Check question 5: answer and explanation
Answer: B. Source evidence is useful but has a defined layer.