imio.smartweb.core 1.2.59__py3-none-any.whl → 1.2.60__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,30 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
+ # from imio.smartweb.core.contents import IPortalPage
3
4
  from plone.app.layout.viewlets.social import SocialTagsViewlet as BaseSocialTagsViewlet
4
5
 
5
6
 
6
7
  class SocialTagsViewlet(BaseSocialTagsViewlet):
7
8
  social_image_scale = "paysage_vignette"
9
+
10
+ @property
11
+ def tags(self):
12
+ tags = super(SocialTagsViewlet, self).tags
13
+ # if IPortalPage.providedBy(self.context):
14
+ if getattr(self.context, "image", None) is None:
15
+ return tags
16
+ tags = [item for item in tags if "og:image" not in item.get("property", "")]
17
+ scales = self.context.restrictedTraverse("@@images")
18
+ scale = scales.scale("image", scale=self.social_image_scale)
19
+ scale_url = scale.absolute_url()
20
+ image = self.context.image
21
+ tags.extend(
22
+ [
23
+ dict(property="og:image", content=scale_url),
24
+ dict(property="og:image:width", content=scale.width),
25
+ dict(property="og:image:height", content=scale.height),
26
+ dict(itemprop="image", content=scale_url),
27
+ dict(property="og:image:type", content=image.contentType),
28
+ ]
29
+ )
30
+ return tags
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: imio.smartweb.core
3
- Version: 1.2.59
3
+ Version: 1.2.60
4
4
  Summary: Core product for iMio websites
5
5
  Home-page: https://github.com/imio/imio.smartweb.core
6
6
  Author: Christophe Boulanger
@@ -191,6 +191,13 @@ Changelog
191
191
  =========
192
192
 
193
193
 
194
+ 1.2.60 (2024-07-12)
195
+ -------------------
196
+
197
+ - WEB-4125 : Take scale on context leadimage to populate og:image:* tags
198
+ [boulch]
199
+
200
+
194
201
  1.2.59 (2024-07-10)
195
202
  -------------------
196
203
 
@@ -1,4 +1,4 @@
1
- imio.smartweb.core-1.2.59-py3.10-nspkg.pth,sha256=wnCUSUElqssZ5FI3x-9HqwD229HQ-bAuPoDUNJHmMtU,1684
1
+ imio.smartweb.core-1.2.60-py3.10-nspkg.pth,sha256=wnCUSUElqssZ5FI3x-9HqwD229HQ-bAuPoDUNJHmMtU,1684
2
2
  imio/smartweb/core/__init__.py,sha256=iwhKnzeBJLKxpRVjvzwiRE63_zNpIBfaKLITauVph-0,24
3
3
  imio/smartweb/core/config.py,sha256=BUgfvh4hCaw0onCYAG4gQI1O4hZ-GzXWEltdHi4YLIs,337
4
4
  imio/smartweb/core/configure.zcml,sha256=PeC4rF--rF6MfVQ0NzggQrZWIl35oPtJdEhvQwGxhhI,1459
@@ -619,7 +619,7 @@ imio/smartweb/core/viewlets/ogptags.py,sha256=3Hgi412JCrRQTGHAgh9tPhSJxguNWPsHro
619
619
  imio/smartweb/core/viewlets/procedure.pt,sha256=gLwNuikgXsWMnBybKdFeKfkfDKnI3SlrU3y2z8sVt5k,602
620
620
  imio/smartweb/core/viewlets/procedure.py,sha256=7nqBU_Sl5tcQaV_UNM-2BPLc8vogCzTO6kQlu4hwofI,633
621
621
  imio/smartweb/core/viewlets/searchbox.pt,sha256=Wv0DbGTKif1z_SDl9-FQKIAPJcfFAHHO1qOtR-LtnR4,403
622
- imio/smartweb/core/viewlets/social.py,sha256=stsP-nhT03xkmP_g0tJLS13ahdgEgHbYfKXb2FNJmQs,207
622
+ imio/smartweb/core/viewlets/social.py,sha256=gau_zEDo1IM9ZeYWPHjNl-eMTwbmO23lxFSWf-DO9uk,1187
623
623
  imio/smartweb/core/viewlets/subsite.py,sha256=2MFX2UukohUDybF7lDklcmgtY2Z0MaFdHU2cFfiBkDo,4218
624
624
  imio/smartweb/core/viewlets/subsite_header_viewlet.pt,sha256=v0sSWJeSdUcsFygVh9UHRaf204abjZniMbaRs3eC9BQ,137
625
625
  imio/smartweb/core/viewlets/subsite_logo.pt,sha256=6htSau-jXv0psDpzSyWc74fePaGk5-yI8sUH46vfoFE,503
@@ -727,10 +727,10 @@ imio/smartweb/core/webcomponents/src/utils/Map.jsx,sha256=cYuZykMIaLjr4KiLvmS4aY
727
727
  imio/smartweb/core/webcomponents/src/utils/Map.scss,sha256=xXWz0O-JBwSZrzz2XeQdN4nZEOjppU2sVFtlLQOitQ8,77
728
728
  imio/smartweb/core/webcomponents/src/utils/translation.js,sha256=5YDHwdaRNWFWOgyNd7YejoAdcDvnvAENo3Xn0GDT8P8,8941
729
729
  imio/smartweb/core/webcomponents/src/utils/url.js,sha256=iyl_1QXfPBgUn0LEbZYT_zMEEjmj5DMiEz44Z6AKLcg,244
730
- imio.smartweb.core-1.2.59.dist-info/LICENSE.GPL,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
731
- imio.smartweb.core-1.2.59.dist-info/LICENSE.rst,sha256=RzkMFz6AX3-cHd531zd2YQcXai8RIbjFWTs6m66Y5u4,653
732
- imio.smartweb.core-1.2.59.dist-info/METADATA,sha256=KreZYbjIJM3gW2Z1l3_MqOiZYW_zUZgwIavEN-2WvHU,54920
733
- imio.smartweb.core-1.2.59.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
734
- imio.smartweb.core-1.2.59.dist-info/namespace_packages.txt,sha256=Pg8AH8t9viMMW1hJbNZvTy_n2jXG2igIYUpon5RA4Js,19
735
- imio.smartweb.core-1.2.59.dist-info/top_level.txt,sha256=ZktC0EGzThvMTAin9_q_41rzvvfMT2FYbP8pbhSLMSA,5
736
- imio.smartweb.core-1.2.59.dist-info/RECORD,,
730
+ imio.smartweb.core-1.2.60.dist-info/LICENSE.GPL,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
731
+ imio.smartweb.core-1.2.60.dist-info/LICENSE.rst,sha256=RzkMFz6AX3-cHd531zd2YQcXai8RIbjFWTs6m66Y5u4,653
732
+ imio.smartweb.core-1.2.60.dist-info/METADATA,sha256=TtHQdUqrav0W85kvACxp83LWkpc3JmmPpqKY2TpMA74,55047
733
+ imio.smartweb.core-1.2.60.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
734
+ imio.smartweb.core-1.2.60.dist-info/namespace_packages.txt,sha256=Pg8AH8t9viMMW1hJbNZvTy_n2jXG2igIYUpon5RA4Js,19
735
+ imio.smartweb.core-1.2.60.dist-info/top_level.txt,sha256=ZktC0EGzThvMTAin9_q_41rzvvfMT2FYbP8pbhSLMSA,5
736
+ imio.smartweb.core-1.2.60.dist-info/RECORD,,