File tree 2 files changed +13
-0
lines changed
2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -201,6 +201,7 @@ def crumbs(self):
201
201
def get_context_data (self , ** kwargs ):
202
202
product = self .get_object ()
203
203
context = super ().get_context_data (** kwargs )
204
+ request = context ["view" ].request
204
205
205
206
subheadings = extract_subheadings (product .content , tag = "h2" )
206
207
@@ -217,6 +218,8 @@ def get_context_data(self, **kwargs):
217
218
anchors .append (("#contact" , _ ("Contact" )))
218
219
219
220
context ["meta_description" ] = product .summary
221
+ context ["meta_image_url" ] = request .build_absolute_uri (product .icon .url )
222
+ context ["meta_page_url" ] = request .build_absolute_uri (request .path )
220
223
context ["anchors" ] = anchors
221
224
context ["related_products_start" ] = 6 if product .links .exists () else 1
222
225
context ["product_links" ] = product .links .order_by ("pk" )
Original file line number Diff line number Diff line change 10
10
{% if meta_description %}
11
11
< meta property ="og:description " content ="{{ meta_description }} ">
12
12
< meta name ="twitter:description " content ="{{ meta_description }} ">
13
+ < meta name ="description " content ="{{ meta_description }} "/>
13
14
{% endif %}
15
+ {% if meta_image_url %}
16
+ < meta property ="og:image " content ="{{ meta_image_url }} ">
17
+ < meta name ="twitter:image " content ="{{ meta_image_url }} ">
18
+ {% endif %}
19
+ {% if meta_page_url %}
20
+ < meta property ="og:url " content ="{{ meta_page_url }} ">
21
+ {% endif %}
22
+ < meta property ="og:type " content ="article ">
23
+
14
24
15
25
{% if favicon %}< link rel ="icon " href ="{{ favicon }} " />
16
26
< link rel ="apple-touch-icon " href ="{{ favicon }} "> {% endif %}
You can’t perform that action at this time.
0 commit comments