I have layout chaining on an 11ty site. When I add front matter to the base template, the front matter gets rendered and appears in the browser. I don't understand why. Note: Also using nunjucks.
base.njk:
---
test1: hello
---
<!doctype html>
HTML GOES HERE
layer.njk:
---
test2: goodbye
---
{% extends "base.njk" %}
HTML GOES HERE
page.html:
---
layout: layer.njk
---
HTML GOES HERE
{{test1}}
{{test2}}
HTML GOES HERE
When I view the page.html, the templates render properly, but the front matter from base.njk appears on the page. In other words, I see the dashes and the property/value declaration literally. The front matter from layer.njk does not appear on page.
What I am trying to accomplish is to establish global constants in the base.njk so that other pages can access those global constants.