Unit 07 · lesson
Override a Theme Safely
Jekyll allows site source to override theme defaults for important source families.
That gives you a controlled customization boundary.
Override lookup
The official theme docs explain that local site content can override theme files with matching names in areas such as:
assets
_data
_layouts
_includes
_sass
The exact theme and Jekyll version still matter. Inspect the theme you are using.
Example: footer override
Suppose the theme provides:
_includes/footer.html
Create the same path/name in your project:
_includes/footer.html
Jekyll can prefer the site's file over the theme default.
Now the customization lives in your repository.
Before copying, read the cost
Jekyll's theme docs warn about an important maintenance tradeoff: when you copy a theme file into your project and override it, updates to that theme file no longer flow through automatically.
You now own the copied override.
That is not bad.
It is a fork point.
Smallest-override rule
If you only need custom color/spacing, you may not need to copy a whole layout.
If you need to add one semantic element, copy/override the smallest source that owns that behavior.
Do not copy every theme file just because you can.
Controlled experiment
In a disposable theme experiment:
- capture generated footer/header output;
- create one local override;
- rebuild;
- confirm the local file wins;
- remove the override;
- confirm the theme default returns.
Record ownership
Responsibility:
Theme source:
Local override:
Why override is necessary:
Theme updates no longer inherited for this file? yes/no
Checkpoint
Explain why a local override increases control and maintenance responsibility at the same time.