Skip to main content

Social directives for Pelican Blog Generator

Project description

Social plugin for Pelican

Social directives for Pelican static blog generator.

Easy linking to social networks content through simple inline directives.

Compatibility

pelican-social is compatible with Pelican 3.2+ and Python 2.7.

Support for Python 3 will come in future releases.

Installation

Install the plugin via pip:

~$ pip install pelican-social

Or via easy_install:

~$ easy_install pelican-social

Usage

To load the plugin, you have to add it in your settings file.

PLUGINS = (
    'social',
)

Once loaded you have access to social rst directives.

Each directive can be called in two forms:

:network:`target`

:network:`Displayed text <target>`

As much as possible, the directive give a secure (https) link.

Twitter

You can use both :twitter: and :tw: directives to link to a Twitter profile, they are equivalent. Using an @ in username will only change the displayed username if a custom display is ot specified.

Exemple:

:twitter:`username`
:twitter:`@username`
:twitter:`User <username>`
:twitter:`User <@username>`

will result in:

<a href="https://twitter.com/username">username</a>
<a href="https://twitter.com/username">&#64;username</a>
<a href="https://twitter.com/username">User</a>
<a href="https://twitter.com/username">User</a>

Google+

Google+ is tricky with usernames. If you are famous and lucky you can have a custom username in +MyUser form. If not you will have a 21 digits identifier.

Exemple:

:gplus:`username`
:gplus:`User <username>`

will result in:

<a href="https://plus.google.com/username">username</a>
<a href="https://plus.google.com/username">User</a>

Github

You can use both :github: and :gh: directive to link to github profiles, repositories and issues/pull-requests (github will autmatically redirect you to the pull-request if one is associated with the issue).

The following form are accepted:

Target

Expected target form

profile

username

repository

username/repository

issue/pull-request

username/repository#issue

Exemple:

:github:`username`
:github:`User <username>`
:github:`username/repository`
:github:`Repository <username/repository>`
:github:`username/repository#2`
:github:`Issue #2 <username/repository#2>`

will result in:

<a href="https://github.com/username">username</a>
<a href="https://github.com/username">User</a>
<a href="https://github.com/username/repository">repository</a>
<a href="https://github.com/username/repository">Repository</a>
<a href="https://github.com/username/repository/issues/2">#2</a>
<a href="https://github.com/username/repository/issues/2">Issue #2</a>

Facebook

You can use both :facebook: and :fb: directives to link to a Facebook profile, they are equivalent.

Exemple:

:facebook:`User <username>`
:facebook:`username`

will result in:

<a href="https://facebook.com/username">User</a>
<a href="https://facebook.com/username">username</a>

Changelog

0.1 (2013-06-20)

  • Initial implementation allowing to link to:
    • Facebook profiles

    • Twitter profiles

    • Google+ profiles

    • Github profiles, repositories and issues

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pelican-social-0.1.tar.gz (8.0 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page