kpumuk / meta-tags

Search Engine Optimization (SEO) for Ruby on Rails applications.
MIT License
2.73k stars 275 forks source link

Allow meta tags for custom open graph namespace #30

Closed stereoscott closed 11 years ago

stereoscott commented 11 years ago

This commit allows support for custom meta tag namespaces, as required by facebook open graph for custom object definitions.

    set_meta_tags :open_graph => {
      title:        "My Title"
      type:         "my_custom_namespace:deal",
      url:          the_url
    }
    # new pull request code allows for this:
    set_meta_tags fb_namespace: "my_custom_namespace"
    set_meta_tags "my_custom_namespace" => {
      brand: "Brand Name",
      image: "image_path"
    }

This outputs:

<meta content="Brand Name" property="my_custom_namespace:brand" />
<meta content="image_path" property="my_custom_namespace:image" />

A small modification for greatly enhanced functionality.

kpumuk commented 11 years ago

More flexible solution in issue #31 merged

stereoscott commented 11 years ago

Awesome. Thanks @kpumuk! Your time and efforts are greatly appreciated.