Skip to main content

Pelican Flickr Tag

Pelican Flickr Tag is a library to make it easy to display Flickr images in your Pelican blogs.

Installation

To install the plugin, simply:

$ pip install pelican-flickrtag

Then add a bit of code to your blog configuration:

PLUGINS = [
    # ...
    'pelican_flickrtag',
    # ...
]

Usage

In your articles, just add lines to your posts that look like:

[flickr:id=5128831453]

This will tell the plugin to insert the image with id 8152886277 into your post. By default the resulting HTML will look like:

<p class="caption-container">
    <a class="caption" href="http://www.flickr.com/photos/chrisstreeter/5128831453/" target="_blank">
        <img src="http://farm5.static.flickr.com/4037/5128831453_792359af82_z.jpg" alt="Sand Dunes" title="Sand Dunes" class="img-polaroid" />
    </a>
    <span class="caption-text muted">Sand Dunes</span>
</p>

If you want a custom title, you can use:

[flickr:id=5128831453,title=Sand dunes at Inyo, California]

If you want to change what the output looks like, you can create your own Jinja template and stick it in your theme directory. Then override the FLICKR_TAG_TEMPLATE_NAME setting to point to your template. See below for more information.

Settings

FLICKR_TAG_TEMPLATE_NAME - Specifies the name of the template to be used to render each replaced tag. This uses Pelican’s template lookup to find the name of the template. If the template is named flickrtag.html, then this setting should be set to flickrtag. (Optional) The default template looks like:

<p class="caption-container">
    <a class="caption" href="{{url}}" target="_blank">
        <img src="{{raw_url}}"
            alt="{{title}}"
            title="{{title}}"
            class="img-polaroid"
            {% if FLICKR_TAG_INCLUDE_DIMENSIONS %}
                width="{{width}}"
                height="{{height}}"
            {% endif %} />
    </a>
    <span class="caption-text muted">{{title}}</span>
</p>

FLICKR_TAG_CACHE_LOCATION - The cache location which stores the looked up photo information. This dramatically speeds up building of the site and permits you to do it offline as well. Defaults to /tmp/com.chrisstreeter.flickrtag-images.cache (Optional)

FLICKR_TAG_INCLUDE_DIMENSIONS - Whether to include the dimensions on the image tag generated by the template. Default is False. (Optional)

FLICKR_TAG_IMAGE_SIZE - The size alias used if FLICKR_TAG_INCLUDE_DIMENSIONS is set to True. Default is ‘Medium 640’. See the Flickr getSizes documentation for the valid values. (Optional)

Flickr Settings

The following two settings are required. In order to set them up, you will need to set up a Flickr API key. You can do this by creating an app on Flickr. If the blog is a personal blog, then apply for a non-commercial key. Once you’ve got your key and secret, add them to your Pelican configuration.

FLICKR_API_KEY - The API key for your app to access the Flickr API. (Required)

FLICKR_API_SECRET - The API secret for your app to access the Flickr API. (Required)

Flickr Tokens

A Flickr API token is only required if you want to access photos that are private to your account and cannot be gotten through the public API. I’ll assume you know what you’re doing and how to get a Flickr API token for this setting.

FLICKR_API_TOKEN - The API token to access the Flickr API. (Optional)

Notes

Uses portions of code from flickrpy.

License

Uses the MIT license.

Metadata

Release files for pelican-flickrtag 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pelican-flickrtag 0.6.0
File Size Uploaded
pelican-flickrtag-0.6.0.tar.gz 16.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pelican-flickrtag 0.6.0
File Interpreter ABI Platform
pelican_flickrtag-0.6.0-py2-none-any.whl Python 2 none any Details

Total release size: 36.1 kB

Release files / pelican-flickrtag-0.6.0.tar.gz

Download URL pelican-flickrtag-0.6.0.tar.gz
Size 16.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ad42b7373dad5e0cd7304505af04ee2e14dd12d8ea64002d9f154c2a093566d2
BLAKE2b-256 checksum
How to use checksums
0ec802fba6449aaa7270240cf4b85a5538824d748c573e2d726345ebe40b9215
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pelican_flickrtag-0.6.0-py2-none-any.whl

Download URL pelican_flickrtag-0.6.0-py2-none-any.whl
Size 19.4 kB
Tags Python 2
SHA-256 checksum
How to use checksums
0c27b1193c14b1e7d0c92b14a66320e8b441c42f20bbd621100890bb2aa9ed10
BLAKE2b-256 checksum
How to use checksums
bd96d94efeea56ae72eb96624154ed34efb0860aa195a3cc3943fa29d2eaab63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

1 release file

0.3.2

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page