Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to set specific meta info on each page (not articles) #106

Open
benjamincharity opened this issue Nov 4, 2011 · 1 comment

Comments

@benjamincharity
Copy link

Setting meta desc etc on articles is incredibly simple. But as far as I can tell, the description pulled in on your layout file will be used on all other pages. Is there a way to pass a custom description on other pages such as an archive?

@ixti
Copy link

ixti commented Dec 12, 2011

You can write a simple helper for this purposes, e.g. put this in your config.ru:

module Toto
  module Template
    attr_accessor :meta_desc
  end
end

then you'll be able to call:

meta_desc = <<-META
My page description
<<META

and have something like this in your layout:

<meta name="description" value="<%= meta_desc || 'Default one...' %>" />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants