Skip to content

SEO Guidance and/or Solution? #3013

@jmlivingston

Description

@jmlivingston

What is the recommendation for implementing SEO within an angular-cli site?

Current Problem

Implementing a SEO friendly solution for a SPA application typically requires server side rendering or possible pre-building static HTML files. This ensures the meta tags are populated when crawled by by search engines like Google, Bing, and Yahoo and when shared with social media sites like Facebook, LinkedIn, and Google+.

Note: There are some trends of search engines being more forgiving of SPA applications, but this is not true of all of them. Anecdotally, I have found Google and Facebook very tolerant, but LinkedIn to be terribly intolerant.

Possible Solutions?

- Angular Universal + angular-cli - Ultimately this marriage would be ideal, though it’s not clear when this will happen.
- Host using a different technology - For example, for a .NET application, we could use an index.aspx and server side data-binding to add the meta tags based on the initial server request. The one drawback is this data would need to come from somewhere and match the routing table of our client side code.
- Use Existing Solution - This would be ideal as we don't have to rely on 3rd parties. Since angular-cli is already using Express and Handlebars (what?), we could use server side rendering to generate the index.html based on some pre-determined data. This data can come from a configuration file which mimics the client side routing (probably not ideal), or reads existing Angular routing classes that have been decorated with SEO properties. While we could create a standard for this, perhaps some kind of hook that would allow an angular-cli middleware plug-in would be ideal.

Sample SEO Tags
title tag: Example: <title>New York Times - Cooking</title>

meta tag names: Example:

  • meta:title
  • meta:description
  • meta:keywords
  • meta:author
  • meta:og:type
  • meta:og:site_name
  • meta:og:url
  • meta:og:title
  • meta:og:description
  • meta:og:image
  • meta:twitter:card
  • meta:twitter:url
  • meta:twitter:title
  • meta:twitter:description
  • meta:twitter:image:src

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions