Inject meta tags into your head
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.gitignore
Gemfile
LICENSE
README.md
Rakefile
rack-metadata.gemspec

README.md

rack-metadata Build Status

Inject meta tags into your head. This rack middleware collects meta data about a page and will inject meta tags into the head of your html content.

Usage

# in your rack up/config file
use Rack::Metadata

# in your application
env['rack.metadata'] = {
  description: "My page's meta description",
  keywords: "Foo, bar"
}

It the request is text/html, the middleware will add meta tags for description and keywords:

<head>
  …
  <meta name="description" content="My page's meta description" />
  <meta name="keywords" content="Foo, bar" />
  …
</head>

All other content types are currently ignored.