npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ember-seo-meta-tags

v1.0.1

Published

This Ember-CLI addon is used to add/change meta-tags and title on different pages of your single page application and thus make your website SEO friendly.

Downloads

8

Readme

Ember-seo-meta-tags

This Ember-CLI addon is used to add/change meta-tags and title on different pages of your single page application and thus make your website SEO friendly.

Installation

  • ember install ember-seo-meta-tags

To make it work follow the given steps

  1. Inside any route add the title and metaTags properties and it will be reflected in your single page application accordingly. you can even set these properties dynamically and this addon will pick those up for you.
  2. If title and meta tags are going to be dynamically set, then we advise you to set these in the afterModel hook in your route. If you want to set it later then you can use a service like prerender.io to make sure your meta tags and title are picked up by crawlers.
  3. If you want a single place where you can list all title and metaTags information related to all your routes then
    • Open a service named tags-data inside your hosting application. This service will be auto generated when you install this addon.
    • Add data in service in the format given below
import Ember from 'ember';

export default Ember.Service.extend({
// Basic convention that you must follow
// routeName must be as specified in router.coffee file  
// Eg for Route - this.route('products', {path: 'products/:pid'}), routeName will be 'products'
'routeName': {
    title: 'Your title goes here',
    metaTags: [
      {
        tagName: 'description',
        tagContent: 'Text for description meta tag goes here'
      }, {
        tagName: 'keywords',
        tagContent: 'Keyword 1, keyword 2, keyword 3'
      }
      // You may add as many meta tags as you want
    ]
  }
});

Examples

Usage inside routes

// hostingApp/routes/home
export default Ember.route.extend({
 title: 'Home Page',
 metaTags: [
      {
        tagName: 'description',
        tagContent: 'Contact us to know more deals'
      }, {
        tagName: 'keywords',
        tagContent: 'choose us, '
      }
    ],
  model: function(){
   // Code for your model hook goes here
  }
});

Usage inside routes with dynamic data

// hostingApp/routes/home
export default Ember.route.extend({
 model: function(){
  //get your title and meta tags data here
 },
 afterModel: function(model){
  //set the title and meta tags from model data
  this.set('title', model.data);
  this.set('metaTags', model.data);
 }
})

Usage with service

export default Ember.Service.extend({
  'contact-us': {
    title: 'Contact Us',
    metaTags: [
      {
        tagName: "description",
        tagContent: "Contact us to know more deals"
      }, {
        tagName: "keywords",
        tagContent: "contact us, more-deals"
      },{
        tagName: "og:title",
        tagContent: "Facebook Open Graph META Tags"
      }, {
        tagName: "viewport",
        tagContent: "width=device-width, initial-scale=1.0"
      }
    ]
  },
  'about-us': {
    title: 'About Us',
    metaTags: [
      {
        tagName: "author",
        tagContent: "Some crazy guitarist"
      },{
        tagName: "twitter:card",
        tagContent: "summary"
      },{
        tagName: "twitter:url",
        tagContent: "http://www.yourdomain.com"
      },{
        tagName: "st:image",
        tagContent: "http://www.yoursite.com/static/thumbnail.jpg"
      },{
        tagName: "st:published_at",
        tagContent: "2012-08-05T05:33:00-0700"
      }
    ]
  },
});

Demo Application

We have hosted a demo application where you can see this addon in action.

Further Reading

  • Read more about open graph here
  • Read more about swift type here