This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

A thumbnail generator for Pelican that automatically scans all image tags looking for missing images and creates the thumbnails based on the filename.

Based on the existing thumbnailer plugin.

Install

To install the library, you can use pip

$ pip install pelican-advthumbnailer

Usage

  1. Update pelicanconf.py:

    1. Add advthumbnailer to PLUGINS.

      You should add it before any image optimization plugins.

      PLUGINS = [..., 'advthumbnailer']
      
  2. Creating a thumbnail:

    1. Ensure original image is copied to the output folder (add to STATIC_PATHS or use the autostatic plugin).

      E.g: output/images/example.png

    2. Add an <img> (or a <source> tag) containing as source (or scrset):

      images/thumbnails/<spec>/example.png
      

      Where <spec> is one of the following:

      • <number>: Perform a square resize of the image to <number>x<number> pixels.
      • <number1>x<number2>: Perform a scale and crop resize of the image to <number1>x<number2> pixels.
      • <number1>x_ or _x<number2>: Perform an aspect-preserving resize of the image enforcing the specified with or height, respectively, in pixels.

      <spec> can also be terminated with a ! in which case upscales (e.g: resize 100px to 200px) will also be allowed. By default this is not the case.

      Example:

      <img src="images/thumbnails/100x_/example.png" />
      
    3. Upon output generation, all files are scanned for image sources and those matching the .*thumbnails/<spec>/.+ regex are thumbnailed according to the <spec>.

Options

  • ADVTHUMB_SEARCH_IMAGES_IN_ANCHORS (default: False): Boolean option that determines if advthumbnailer should consider the href attribute of <a> elements as thumbnail paths.

Integrations

pelican-autostatic

Integration with pelican-autostatic is achieved by adding an option to the {static ...} replacement.

{static images/example.png thumb="100x_"}

Jinja2

Integration with Jinja2 is achieved via the thumbnail function.

<img src="{{ SITEURL + "images/example.png" | thumbnail("100x_") }}" />

Example usage

For a working example check my site and my site’s source code.

Release History

Release History

0.6.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.5.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.4.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pelican-advthumbnailer-0.6.0.zip (14.4 kB) Copy SHA256 Checksum SHA256 Source Sep 24, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting