Browse Source

Merge pull request #768 from kernc/representative-image-py3

Make representative_image Py3 compatible
Justin Mayer 7 years ago
parent
commit
0ba26f4595
1 changed files with 2 additions and 1 deletions
  1. 2 1
      representative_image/representative_image.py

+ 2 - 1
representative_image/representative_image.py

@@ -1,3 +1,4 @@
+import six
 from pelican import signals
 from pelican.contents import Article, Draft, Page
 from pelican.generators import ArticlesGenerator
@@ -20,7 +21,7 @@ def images_extraction(instance):
             i.extract()
         if len(images) > 0:
             # set _summary field which is based on metadata. summary field is only based on article's content and not settable
-            instance._summary = unicode(soup)
+            instance._summary = six.text_type(soup)
 
         # If there are no image in summary, look for it in the content body
         if not representativeImage: