Unit 03 · lesson
Debug Layout and Include Failures
Shared templates reduce duplication.
They also make one broken shared file capable of affecting many pages.
That is not a reason to avoid abstraction.
It is a reason to read failure patterns.
Pattern 1: every page fails
Likely suspects become shared:
- default layout;
- shared include;
- site configuration;
- shared asset path.
Do not begin by editing one page's body.
Pattern 2: one page fails
Likely suspects become more local:
- that page's front matter;
- layout selection;
- page-specific data;
- page content.
Pattern 3: only one content type fails
If every project page fails but Home/About work, inspect the project-specific layout or collection/content-type assumptions.
Controlled failures
Create and repair two disposable failures:
Missing include
Reference a non-existent include.
Read the build error.
Wrong layout
Select a missing/incorrect layout.
Record the behavior.
For each:
Scope of failure:
Build or output failure?
Shared/local evidence:
Repair:
Verification:
Generated-output clue
If the build completes but a wrapper is missing, inspect generated nesting.
The source files may all exist while the composition is wrong.
Checkpoint
Complete this claim:
Because the failure appears on __________ pages, I will inspect __________ before __________.
The scope of the symptom should influence the scope of your investigation.