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

Implement naive meta tag support #49

Closed
wants to merge 3 commits into from

Conversation

jpadilla
Copy link
Contributor

@jpadilla jpadilla commented Jul 2, 2015

After hearing about Dockyard's new site using fastboot, we wanted to take it out for a spin on a new project. We noticed it wasn't yet possible to set meta tags like description. This allows setting meta tags similar to how we can set the document's title.

Ember.set(renderer, '_dom.document.title', 'Application Route -- Title');
Ember.set(renderer, 'metaTags', [{
  name: 'description',
  content: 'something here'
}, {
  property: 'og:image',
  content: 'http://placehold.it/500x500'
}]);

This obviously still feels hacky but seems to work just fine so we decided to share and hopefully get some feedback.

Update: With a few simple tweaks this and #23 can play nicely together.

@gpoitch
Copy link
Contributor

gpoitch commented Jul 2, 2015

@jpadilla ❤️ Looks great. Some ideas for additional support:

  • Supporting metadata with other tags such as link (canonical, author, etc).
  • Expose an api for Routes to keep things in sync during client-side transitions.

@gcollazo
Copy link

gcollazo commented Jul 2, 2015

@gdub22 👍 for supporting supporting <link> tags.

What is the use case for updating <meta> or <link> tags while the app is running in the browser? I believe those are only important when the page is requested by a crawler in which case fastboot would do the right thing.

@gpoitch
Copy link
Contributor

gpoitch commented Jul 2, 2015

@gcollazo you are right about the crawler, it would just be nice to keep them in sync. Thinking about it more, it would be good to have this as an addon where you could define meta for each route, (https://github.com/ronco/ember-cli-meta-tags is a start) and fastboot just provides an injection point. Kinda how the title works now with https://github.com/kimroen/ember-cli-document-title

@ronco
Copy link
Contributor

ronco commented Jul 2, 2015

This is great idea. I'd love to see it support arbitrary head content.

@jasonmit
Copy link
Contributor

jasonmit commented Jul 3, 2015

This is great idea. I'd love to see it support arbitrary head content.

I second this. I'll need to be able to inject additional scripts into the head dynamically and would love for this to be generic enough to support all head content.

@rwjblue
Copy link
Member

rwjblue commented Jul 6, 2015

I would prefer tweaking simple-dom here to add:

this.head = new Element('head');

Then we can handle arbitrary head content here....

@jpadilla
Copy link
Contributor Author

@rwjblue btw this is ready for another look whenever you get the chance.

@jpadilla
Copy link
Contributor Author

Tests are currently not passing, since we'd need ember-fastboot/simple-dom#12 to be merged.

@gpoitch
Copy link
Contributor

gpoitch commented Jul 13, 2015

@jpadilla 👍 I'd say that the head addition by itself is enough, then let the developer/addons implement the meta tags/arbitrary head content. I have this addon just about working with your additions here and in simple dom.

@jasonmit
Copy link
Contributor

@jpadilla Any progress? I can help out if it's a time thing.

@jpadilla
Copy link
Contributor Author

@jasonmit feel free to pick up. There's probably just a few things left after the simple-dom update.

@esistgut
Copy link

Are there updates on this?

@ronco
Copy link
Contributor

ronco commented Sep 22, 2015

@esistgut I was actually planning on taking a crack at finishing it up this evening.

@tomdale
Copy link
Contributor

tomdale commented Feb 10, 2016

Closed in favor of #114

@tomdale tomdale closed this Feb 10, 2016
arjansingh pushed a commit to arjansingh/ember-cli-fastboot that referenced this pull request Oct 29, 2016
* Update Node version matrix in Travis config.

Node 0.11 should not be supported, and we should test against current stable version.

* Ensure `port` is specified to `app.listen`.

Node < 6.0 allows `port` to be `null` / `undefined` and automatically
selects a port for you, in Node 6.0 this is an error.
xg-wang pushed a commit to xg-wang/ember-cli-fastboot that referenced this pull request Nov 16, 2020
…upport-matrix

Update node support matrix
xg-wang pushed a commit to xg-wang/ember-cli-fastboot that referenced this pull request Nov 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants