浏览代码

Better Images: Prevent errors when RESPONIVE_IMAGES is not set.

This fixes the case where RESPONSIVE_IMAGES is not set and you get
errors like this:

ERROR: Could not process ./my-blog-post.md
  | u'RESPONSIVE_IMAGES'
Austin Dworaczyk Wiltshire 10 年之前
父节点
当前提交
3d48c68594
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      better_figures_and_images/better_figures_and_images.py

+ 1 - 1
better_figures_and_images/better_figures_and_images.py

@@ -59,7 +59,7 @@ def content_object_init(instance):
                 im = Image.open(src)
                 extra_style = 'width: {}px; height: auto;'.format(im.size[0])
 
-                if instance.settings['RESPONSIVE_IMAGES']:
+                if 'RESPONSIVE_IMAGES' in instance.settings and instance.settings['RESPONSIVE_IMAGES']:
                     extra_style += ' max-width: 100%;'
 
                 if img.get('style'):