|
2 | 2 | <%= open_graph_tag 'site_name', :site_name %> |
3 | 3 | <%= open_graph_tag 'locale', 'en_GB' %> |
4 | 4 | <%= open_graph_tag 'image', 'os-social/opengraph-image.png' %> |
5 | | -<% if petition_page? %> |
6 | | -<%= open_graph_tag 'url', petition_url(@petition) %> |
7 | | -<%= open_graph_tag 'type', 'article' %> |
8 | | -<%= open_graph_tag 'title', :title, petition: @petition.action %> |
9 | | -<%= open_graph_tag 'description', @petition.background %> |
10 | | -<% elsif archived_petition_page? %> |
| 5 | +<% if archived_petition_page? %> |
11 | 6 | <%= open_graph_tag 'url', archived_petition_url(@petition) %> |
12 | 7 | <%= open_graph_tag 'type', 'article' %> |
13 | 8 | <%= open_graph_tag 'title', :archived_title, petition: @petition.title %> |
14 | 9 | <%= open_graph_tag 'description', @petition.description %> |
| 10 | +<% elsif defined?(@petition) %> |
| 11 | +<%= open_graph_tag 'url', petition_url(@petition) %> |
| 12 | +<%= open_graph_tag 'type', 'article' %> |
| 13 | +<%= open_graph_tag 'title', :title, petition: @petition.action %> |
| 14 | +<%= open_graph_tag 'description', @petition.background %> |
15 | 15 | <% else %> |
16 | 16 | <%= open_graph_tag 'url', request.original_url %> |
17 | 17 | <%= open_graph_tag 'type', 'website' %> |
18 | 18 | <%= open_graph_tag 'title', page_title %> |
19 | 19 | <% end %> |
20 | | - |
21 | 20 | <!-- Twitter --> |
22 | 21 | <%= twitter_card_tag 'card', 'summary' %> |
23 | 22 | <%= twitter_card_tag 'site', '@hocpetitions' %> |
24 | 23 | <%= twitter_card_tag 'image', 'os-social/opengraph-image.png' %> |
25 | | -<% if petition_page? %> |
26 | | -<%= twitter_card_tag 'title', :title, petition: @petition.action %> |
27 | | -<%= twitter_card_tag 'description', @petition.background %> |
28 | | -<% elsif archived_petition_page? %> |
| 24 | +<% if archived_petition_page? %> |
29 | 25 | <%= twitter_card_tag 'title', :title, petition: @petition.title %> |
30 | 26 | <%= twitter_card_tag 'description', @petition.description %> |
| 27 | +<% elsif defined?(@petition) %> |
| 28 | +<%= twitter_card_tag 'title', :title, petition: @petition.action %> |
| 29 | +<%= twitter_card_tag 'description', @petition.background %> |
31 | 30 | <% else %> |
32 | 31 | <%= twitter_card_tag 'title', page_title %> |
33 | 32 | <% end %> |
0 commit comments