@entry = entries.find_by(:id => params[:id])
if @entry
@title = t ".title", :user => params[:display_name], :title => @entry.title
- @og_image = @entry.body.image
- @og_image_alt = @entry.body.image_alt
+ @opengraph_properties = {
+ "og:image" => @entry.body.image,
+ "og:image:alt" => @entry.body.image_alt
+ }
@comments = can?(:unhide, DiaryComment) ? @entry.comments : @entry.visible_comments
else
@title = t "diary_entries.no_such_entry.title", :id => params[:id]
<% end -%>
<%= tag.link :rel => "search", :type => "application/opensearchdescription+xml", :title => "OpenStreetMap Search", :href => asset_path("osm.xml") %>
<%= tag.meta :name => "description", :content => "OpenStreetMap is the free wiki world map." %>
-<%= opengraph_tags(@title, "og:image" => @og_image, "og:image:alt" => @og_image_alt) %>
+<%= opengraph_tags(@title, @opengraph_properties || {}) %>
<% if flash[:matomo_goal] -%>
<%= tag.meta :name => "matomo-goal", :content => flash[:matomo_goal] %>
<% end -%>