Skip to content
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

Partials don't see their metadata #27

Open
sdomagala opened this issue Jun 16, 2015 · 1 comment
Open

Partials don't see their metadata #27

sdomagala opened this issue Jun 16, 2015 · 1 comment
Labels

Comments

@sdomagala
Copy link
Member

Hi,
is there any way to use current partial metadata like in documents?
I mean something like this:


---
title: My awesome blog post
meaningOfLife: 42

---
What is the meaning of life? <%= @document.meaningOfLife %>
@mikeumus
Copy link
Member

mikeumus commented Apr 17, 2016

Hey @sdomagala,
Yeah you can do this. See this recent implementation of this I did on betabulls.docpad:

Notice the custom class meta-data in this page:

---
title: BetaBulls Enterprise
layout: enterprise-default
class: betabulls-enterprise-home
style: '../css/ent-home-style.css'
---

https://github.com/BetaBulls/betabulls.docpad/blob/master/src/documents/ent/index.html.eco#L4

And how it's used in a separate layout file here:

<span class="<%= @document.class %>">
  <%- @content %>
</span>

https://github.com/BetaBulls/betabulls.docpad/blob/master/src/layouts/enterprise-default.html.eco#L117

Did you try it out and it wasn't working for you?
Or were you referring to what Rob's talking about in #18 as my example actually doesn't involve partials specifically.

Let me know and if so, it's it's open-source, please share the repo url so we may explore it's implementation.

Hope it helps.

Best,
Mike

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants