Multiple attributes on meta tags
I would love to be able to create a single meta tag for my meta description looking something like this:
<meta name="description" property="og:description" content="My awesome website will knock your socks off">
Sadly, that doesn't seem to be possible with the current API. May I instead suggest an API where passing an object with options to Meta.set would use the key as the property name and the value as the value for that property. For my example meta tag above, this would look something like this:
Meta.set({
name: 'description',
property: 'og:description',
content: 'My awesome website will knock your socks off'
});
What do you think?
It looks like #1 did you check that issue ?
Yes, I checked that issue, and no, it's not the same.
What I am suggesting is that the object properties of the options object passed to Meta.set should be used to generate the attributes of the resulting meta tag. In other words, if I pass an options object with a property named foo and give it the value bar, then it will generate a meta tag that looks like this:
<meta foo="bar">
An API like that would allow me to generate completely crazy and invalid meta tags, but it would also allow me complete freedom in generating whatever meta tag I want. I don't think it's blaze-meta's job to ensure valid markup. That responsibility should rest with the developer.
Just to clarify, here is another example using completely invalid properties, but hopefully it better illustrates my point than my previous post:
Meta.set({
arnold: 'Schwarzenegger',
sylvester: 'Stallone',
bruce: 'Willis'
});
And that would generate this meta tag:
<meta arnold="Schwarzenegger" sylvester="Stallone" bruce="Willis">
I hope it makes more sense now.
It's crystal clear now. I'll have a look at it. Right now we set and unset things, in order to do that we need to have a key. I might update it to work with in-mem collections.
Cool. I am glad you agree that this is a good API. An in-memory collection does indeed seem like a viable approach.