#3292·zola

feature request: Allow get_page/get_section in page body (metadata_only)

Author: wrengerCreated Sep 28, 2026Updated Sep 28, 2026
Labelsenhancement

This is probably a larger request, but it would be great to be able to read page/section frontmatter inside page bodies. Especially for Tera components that could look up metadata from pages/sections.

jinja2
{%- set person = get_section(path="People/" ~ n ~ "/_index.md", metadata_only=true) -%}
{%- set image = person.extra?.image | default(value="/placeholder.png") -%}
...

This currently only works in templates. Inside page bodies (or components resolved there), which are parsed earlier, there is only a hacky way to get the frontmatter.

jinja2
{%- set person_data = load_data(path="People/" ~ n ~ "/_index.md") | split(pat="+++") | nth(n=1) -%}
{%- set person = load_data(literal=person_data, format="toml") -%}
{%- set image = person.extra?.image | default(value="/placeholder.png") -%}

However, there might be metadata that might not be available yet, as page contents are resolved earlier (like section.pages...).