added meta description tag
This commit is contained in:
@@ -9,6 +9,10 @@ class WikiPagePresenter
|
||||
wiki_page.body.split(/\r\n|\r|\n/).first
|
||||
end
|
||||
|
||||
def blurb
|
||||
excerpt.gsub(/<.+?>/, "")
|
||||
end
|
||||
|
||||
# Produce a formatted page that shows the difference between two versions of a page.
|
||||
def diff(other_version)
|
||||
pattern = Regexp.new('(?:<.+?>)|(?:[0-9_A-Za-z\x80-\xff]+[\x09\x20]?)|(?:[ \t]+)|(?:\r?\n)|(?:.+?)')
|
||||
|
||||
@@ -31,3 +31,9 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= content_for(:html_header) do %>
|
||||
<%= auto_discovery_link_tag :atom, :controller => "posts", :action => "index", :format => "atom", :tags => params[:tags] %>
|
||||
<% if @post_set.wiki_page %>
|
||||
<meta name="description" content="<%= @post_set.wiki_page.presenter.blurb %>"></meta>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<%= error_messages_for("wiki_page") %>
|
||||
|
||||
<%= simple_form_for(@wiki_page) do |f| %>
|
||||
<%= f.input :title %>
|
||||
<%= f.input :title, :as => :string %>
|
||||
|
||||
<%= dtext_field "wiki_page", "body" %>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user