Example #1
0
 def resolve_srcset(self, info):
     asset = self.primary_image_webasset
     if asset:
         return [
             f"{src[1]} {src[0]}w" for src in generate_srcset_urls(asset)
         ]
     return []
Example #2
0
 def get_srcset(self, path):
     rel_path = path.relative_to(self.get_root()).as_posix()
     return generate_srcset_urls(rel_path)
Example #3
0
 def get_srcset(self, p):
     return generate_srcset_urls(self.upload)
Example #4
0
 def get_srcset(self, mo):
     return generate_srcset_urls(self._get_image_url(mo))