Hi rdyar, thanks for the reply. Sorry, I was trying not to get too complicated in my question.
I was trying to create a way for a template to know what ‘section’ of a website a page is from. The Front matter might contain a variable like ‘section: about’, so that the template knows that the particular page is a child of the ‘about’ page. The template can then pull out some variable that it needs from the parent page (the actual use case is having a hero image for the top-level pages acting as a default for all the sub-pages in a section unless there is a hero image supplied for a particular sub-page).
I know you can get at the variables of any page by iterating over site.pages:
{% for item in site.pages %}
find specific page and do something...
{% endfor %}
I was just wondering if there was a way to access another page and it’s front matter variables without the iterative process (which I assume slows build times down if you start to use lots of loops).
As it turns out, I have ended up using a data file and some front matter variables to achieve what I wanted, but I’d still be interested to know if that direct access is possible.
Hopefully that is a bit clearer.