소스 검색

Update readme to clarify behaviour of plugin and specifying a custom image

Jesse Kershaw 10 년 전
부모
커밋
17efcb10d3
1개의 변경된 파일19개의 추가작업 그리고 6개의 파일을 삭제
  1. 19 6
      representative_image/Readme.md

+ 19 - 6
representative_image/Readme.md

@@ -1,10 +1,8 @@
 # Summary
 
-This plugin extracts a representative image (i.e, featured image) from the article's summary or article's content. The image can be access at `article.featured_image`. 
+This plugin extracts a representative image (i.e, featured image) from the article's summary or content if not specifed in the metadata. 
 
-To specify an image, set the Image metadata attribute in the content file.
-
-The plugin also remove any images from the summary after extraction to avoid duplication. 
+The plugin also removes any images from the summary after extraction to avoid duplication. 
 
 It allows the flexibility on where and how to display the featured image of an article together with its summary in a template page. For example, the article metadata can be displayed in thumbnail format, in which there is a short summary and an image. The layout of the summary and the image can be varied for aesthetical purpose. It doesn't have to depend on article's content format. 
 
@@ -25,8 +23,23 @@ To enable, add the following to your settings.py:
 Usage
 -----
 
-To include a representative image add the following to the template
-	
+To override the default behaviour of selecting the first image in the article's summary or content, set the image property the article's metadata to the url of the image to display, e.g:
+
+```markdown
+Title: My super title
+Date: 2010-12-03 10:20
+Category: Python
+Tags: pelican, publishing
+Slug: my-super-post
+Author: Alexis Metaireau
+Summary: Short version for index and feeds
+Image: /images/my-super-image.png
+
+Article content...
+```
+
+To include a representative image in a page add the following to the template:
+
     {% if  article.featured_image %}
         <img src="{{ article.featured_image }}">
     {% endif %}