소스 검색

Featured images could be used among all kinds of pages.

murchik 11 년 전
부모
커밋
7817b26ceb
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      representative_image/representative_image.py

+ 2 - 2
representative_image/representative_image.py

@@ -1,11 +1,11 @@
 from pelican import signals
-from pelican.contents import Content, Article
+from pelican.contents import Article, Draft, Page
 from bs4 import BeautifulSoup
 
 
 def images_extraction(instance):
     representativeImage = None
-    if type(instance) == Article:
+    if type(instance) in (Article, Draft, Page):
         if 'image' in instance.metadata:
             representativeImage = instance.metadata['image']