Class

SEO

SEO(seoConfig)

This class represents the SEO tag generator, and is the main export from this library.

The SEO class works by passing the data related to the current page through a series of Generators, which take data and return a series of tags.

By default, the following generators are included:

This library should already be installed in the malibu app generator, and an example can be found in there.

new SEO({
  staticTags: {
    "twitter:site": "Quintype",
    "twitter:domain": "quintype.com",
    "twitter:app:name:ipad": "Quintype",
    "twitter:app:name:googleplay": "Quintype (Official App)",
    "twitter:app:id:googleplay": "com.quintype",
    "twitter:app:name:iphone": "Quintype for iPhone",
    "twitter:app:id:iphone": "42",
    "apple-itunes-app": "app-id=42",
    "google-play-app": "app-id=com.quintype",
    "fb:app_id": "42",
    "fb:pages": "42",
    "og:site_name": "Quintype"
  },
  enableTwitterCards: true,
  enableOgTags: true,
  enableNews: true,
  structuredData: {
    organization: {
      name: "Quintype",
      url: "http://www.quintype.com/",
      logo: "https://quintype.com/logo.png",
      sameAs: ["https://www.facebook.com/quintype","https://twitter.com/quintype_in","https://plus.google.com/+quintype","https://www.youtube.com/user/Quintype"],
    },
    enableNewsArticle: true
  },
  ampStoryPages: true
});
Constructor

# new SEO(seoConfig)

Create a new SEO Object

Parameters:
Name Type Description
seoConfig Object

Configuration that is passed as the first argument to each Generator

generators Array.<Generator>

List of generators to run (optional)

extraGenerators Array.<Generator>

List of generators to run after the main generators run. Generators here can override tags that are returned by earlier generator. See Custom SEO Malibu Tutorial.

pageTypeAliases Object

A map of aliases to their original page type. This is a convenience if you want to have a different page type for some sections. ex: {"budget-page":"section-page"}

View Source index.js, line 100

Classes

SEO