ember-cli-document-title
ember-cli-document-title copied to clipboard
Support for other meta tags
This is a great little nifty library! I'm currently using it on https://www.ludu.co together with Prerender.io in order not to screw up SEO with Ember. :) Do you have any plans on extending it to support for example description tags or Facebook's open graph tags? In my case, I would love to be able to set the og:image based on the model's image for example.
I don't have any specific plans to do this, but I can see the value and really like the idea! Seems doable, although maybe a little brittle (the way it works at the moment is slightly brittle as well, especially considering the changes coming up in Ember, with Fastboot and everything).
How would you like it to work in your app, API wise? What kind of hooks do you envision needing?
I haven't actually looked at your code to be honest, but it seems to work fine right now and it just makes a lot of sense to put that stuff as values on the route-level as you have done. What I see as mandatory for every page is a title, description and image. It would be nice to be able to just set these three simple values and let the addon automatically set the necessary meta tags, OpenGraph tags, Twitter card tags... etc. Fits well with the ember philosophy of reducing boiler-plate code too!
Oh, I get what you're saying, I was just wondering how you would like it to work when you use it in your app!
Right now we have the two hooks, titleToken and title that are available on all routes. These would need to be more generic. Given that you can define any number of tags you want, probably with different kinds of needs, we'll nee to rework how things work.
For instance, descriptions probably don't need the bubbling behavior, it should just use the description defined in the leafmost route, and the same thing probably goes for things like images.
Should you define those three things (title, description and image), and then specify which meta tags you want, or should you specify all of them independently? How can we make that clear? What about more obscure tags, like the tags google analytics wants for ecommerce-sites, for instance?
At first glance, it seems that a lot of thought will be required to come up with something that is flexible enough to handle these things.
I'm not concerned about the implementation - defining the hooks is the hard part here.
I'll give it a think, but let me know if you have some insights or ideas :)
Hi @kimroen, thanks for making this! It's the best thing I could find so far when it comes to doing SEO. From the sounds of things, you seem interested in improving/expanding this Addon as good as can be and I know enough about ember & have digital MKTG experience to provide some suggestions. If this was of interest, let me know! I'm available to chat via email/skype/screenhero the next few days.
+1 for more tags options! Description, especially.
Again, ideas for how you would want this to look during use would be really helpful!
I have some thoughts, but would love some more perspective.
Following the model that liquid-fire has setup would be ideal from my perspective.
By that I mean having minimally all Meta/Title inputs for the entire app on one page that could be appended invisibly(addon style) to the router.js file structured in JSON-API format? { route1: { title: meta-description: }, route2: { title: ....etc etc. } }
I like the idea, but I think it's another add-on, not this library. We have a RouteMetaMixin that is used for exactly this purpose. Here's the source if you'd like to check it out. Yeah, yeah it's CoffeeScript - we're migrating to ES2015 over time.
This add-on is nice and simple just for handling the page title. Perhaps a good starting place would be forking this library and changing the name if that's the kind of functionality you're wanting.
@blimmer I agree that it would probably be a separate library. Thanks for sharing!
Oh, and I don't mind CoffeeScript ;) (kimroen/ember-cli-coffeescript)
We're using it! Thanks for maintaining that library, it's been totally invaluable as we migrate our global app to CoffeeScript.
ember-cli-document-title + RouteMetaMixin looks like a great combo. You should release RouteMetaMixin as it's own add-on!
Hi, I just made an add-on working with any other meta (& title) for my own use :
https://github.com/didacte/ember-meta-meta
I do not deal with nesting tokens, you could deal with it in your app or make a pull request to add this feature.
Fantastic addition! Thanks for sharing. I just installed and it works exactly as advertised.
On Tue, Apr 21, 2015 at 10:29 AM, Jean-Philippe Doyle < [email protected]> wrote:
Hi, I just made an add-on working with any other meta (& title) for my own use :
https://github.com/didacte/ember-meta-meta
I do not deal with nesting tokens, you could deal with it in your app or make a pull request to add this feature.
— Reply to this email directly or view it on GitHub https://github.com/kimroen/ember-cli-document-title/issues/4#issuecomment-94880217 .
@j15e That's very cool - thanks for sharing!
@blimmer told me about the interest in my RouteMetaMixin.
I've finally addon'd it as ember-cli-meta-tags converting it to javascript in the process. I also eliminated the lodash dependency we had when we were using it internally and added several tests.
I see @j15e has developed an alternate one-stop solution which looks great too.
@blimmer Yeah, yeah it's CoffeeScript - we're migrating to ES2015 over time. Why are you apologizing for using coffeescript? I find the argument that it is now antiquated due to es6/babel/etc to be misleading and highly subjective. Coffeescript has been and remains a powerful tool if you know how to use it AND you are productive with it (I know many that are). You should never use a language/framework/tool/etc strictly because "everyone else is"... /endrant