-
-
Notifications
You must be signed in to change notification settings - Fork 494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose page's frontmatter data to transformers #2965
Labels
Comments
Adding my voice here. I was adding a custom location to a post front matter for https://github.com/mofosyne/call-to-action-map-static-site
and while it works when doing pagenation, I was unable to directly access it via what I was expecting to be For now, figured out a workaround {% comment %} Workaround for https://github.com/11ty/eleventy/issues/2965 {% endcomment %}
{%- for post in collections.posts -%}
{% if page.url == post.url and post.data.location %}
<div class="post-location">
<h2>Location</h2>
<i>lat:{{post.data.location.latitude}}, long:{{post.data.location.longitude}}</i>
</br>
<strong>{{post.data.location.name}}</strong>
{%- if post.data.location.description %}
</br>
{{post.data.location.description}}
{%- endif %}
{%- if post.data.location.address %}
</br>
<a target="_new" href="https://www.openstreetmap.org/?mlat={{post.data.location.latitude}}&mlon={{post.data.location.longitude}}">{{post.data.location.address}}</a>
{%- endif %}
</div>
{% endif %}
{%- endfor -%} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
With #1522
this.page
was added for transformers. However this page data does not contain any of the front matter data.If the frontmatter data was included it would allow pages to inform transformers to take certain actions.
Describe the solution you'd like
I would like to see the page object to also contain the front matter data
In case the frontmatter was:
The text was updated successfully, but these errors were encountered: