Skip to content

sampot/pelican-clean_summary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Clean Summary Plugin#

Plugin to clean your summary of excess images. Images can take up much more space than text and lead to summaries being different sizes on archive and index pages. With this plugin you can specify a maximum number of images that will appear in your summaries.

There is also an option to include a minimum of one image.

##Settings##

This plugin has two settings. CLEAN_SUMMARY_MAXIMUM which takes an int, and CLEAN_SUMMARY_MINIMUM_ONE which takes a boolean. They default to 0 and False.

CLEAN_SUMMARY_MAXIMUM sets the maximum number of images that will appear in your summary.

if CLEAN_SUMMARY_MINIMUM_ONE is set to True and your summary doesn't already contain an image, the plugin will add the first image in your article (if one exists) to the beginning of the summary.

CLEAN_SUMMARY_TAG and CLEAN_SUMMARY_CLASS can be set to clean up elements by its tag name and CSS class.

##Requirements##

Requires Beautiful Soup:

pip install BeautifulSoup4

##Usage with Summary Plugin##

If using the summary plugin, make sure summary appears in your plugins before clean summary. Eg.

PLUGINS = ['summary', 'clean_summary', ... ]

About

My custom clean_summary plugin for Pelican

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages