add meta tag for short story url

This commit is contained in:
joshua stein 2012-07-06 18:10:08 -05:00
parent 911bc2d088
commit e453ba8b81
2 changed files with 6 additions and 0 deletions

View file

@ -97,6 +97,8 @@ class StoriesController < ApplicationController
@page_title = "[Story removed]"
end
@short_url = @story.short_id_url
@comments = Comment.ordered_for_story_or_thread_for_user(@story.id, nil,
@user ? @user.id : nil)
@comment = Comment.new

View file

@ -5,6 +5,10 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="apple-touch-icon" href="/apple-touch-icon.png"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<% if @short_url %>
<link rev="canonical" rel="self alternate shorter shorturl shortlink"
href="<%= @short_url %>" />
<% end %>
<title><%= @page_title ? "#{@page_title} | Lobsters" : "Lobsters" %></title>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>