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

Should we use the same key for titles/names? #82

Open
tylersticka opened this issue Apr 22, 2016 · 4 comments
Open

Should we use the same key for titles/names? #82

tylersticka opened this issue Apr 22, 2016 · 4 comments
Labels

Comments

@tylersticka
Copy link
Member

I'm noticing that a little bit of template complexity so far is accounting for pages having titles while patterns have names. I can't remember which ones collections have.

It's not a huge deal, and there may be value in differentiating them. But if not, we may want to consider using the same term for everything for straightforwardness.


@mrgerardorodriguez @erikjung

@gerardo-rodriguez
Copy link
Member

Now that I'm getting deeper into this, I'm noticing this as well. Do we have a preference of one over the other?

@gerardo-rodriguez
Copy link
Member

FWIW, I am not aware of a specific reason to differentiate between them. In working to solve cloudfour/drizzle#22, I'm also finding this awkard. In the case of cloudfour/drizzle#22, it would make more sense for them to have the same key. Does this mean changes would need to happen to the https://github.com/cloudfour/drizzle-builder repo? I'm not clear of the separation here.

@erikjung
Copy link
Contributor

@mrgerardorodriguez Looking at the docs for the builder, it says that name is auto-assigned to each pattern: https://github.com/cloudfour/drizzle-builder#patterns (not sure this is 100% accurate).

I believe every instance of title is simply a manually added front-matter property. Based on these two observations, I think name should be used identify specific patterns, and that title should mean "the page title".

That said, I need to see exactly what the builder is doing under the hood to verify how name is treated. We might be getting inconsistent behavior with pattern variations (e.g. button/large.hbs would need a manual override to be labeled as "Large Button" vs. just "Large").

Regarding your partial, what challenges are you facing? I think the partial should be ignorant of these title and name properties, and know only what you pass into it via hash properties or inner content.

@gerardo-rodriguez
Copy link
Member

I think the partial should be ignorant of these title and name properties, and know only what you pass into it via hash properties or inner content.

You were spot on. :)

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

3 participants