A Pelican plugin to create share URLs of article
Project description
Share Post: A Plugin for Pelican
Share Post is a Pelican plugin that creates share links in articles that allow site visitors to share the current article with others in a privacy-friendly manner.
Many web sites have share widgets to let readers share posts on social networks. Most of these widgets are used by vendors for online tracking. These widgets can also be visually-distracting and negatively affect readers’ attention.
Share Post creates old-school URLs for some popular sites which your theme can use. These links do not have the ability to track site visitors. They can also be unobtrusive depending on how Pelican theme uses them.
Installation
This plugin can be installed via:
python -m pip install pelican-share-post
Usage
This plugin adds to each Pelican article a dictionary of URLs that, when followed, allows the reader to easily share the article via specific channels. When activated, the plugin adds the attribute share_post
to each article with the following format:
article.share_post = {
"email": "<URL>",
"diaspora": "<URL>",
"facebook": "<URL>",
"hacker-news": "<URL>",
"linkedin": "<URL>",
"mastodon": "<URL>",
"reddit": "<URL>",
"twitter": "<URL>",
}
You can then access those variables in your template. For example:
{% if article.share_post and article.status != 'draft' %}
<section>
<p id="post-share-links">
Share on:
<a href="{{article.share_post['email']}}" title="Share via Email">Email</a>
❄
<a href="{{article.share_post['diaspora']}}" title="Share on Diaspora">Diaspora</a>
❄
<a href="{{article.share_post['facebook']}}" title="Share on Facebook">Facebook</a>
❄
<a href="{{article.share_post['hacker-news']}}" title="Share on Hacker News">Hacker News</a>
❄
<a href="{{article.share_post['linkedin']}}" title="Share on LinkedIn">LinkedIn</a>
❄
<a href="{{article.share_post['mastodon]}}" title="Share on Mastodon">Mastodon</a>
❄
<a href="{{article.share_post['reddit']}}" title="Share via Reddit">Reddit</a>
❄
<a href="{{article.share_post['twitter']}}" title="Share on Twitter">Twitter</a>
</p>
</section>
{% endif %}
Contributing
Contributions are welcome and much appreciated. Every little bit helps. You can contribute by improving the documentation, adding missing features, and fixing bugs. You can also help out by reviewing and commenting on existing issues.
To start contributing to this plugin, review the Contributing to Pelican documentation, beginning with the Contributing Code section.
Contributors
- Talha Mansoor - talha131@gmail.com
- Jonathan DEKHTIAR - contact@jonathandekhtiar.eu
- Justin Mayer
- Leonardo Giordani
- Maurizio Paglia
License
This project is licensed under the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pelican_share_post-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75eab648bb26f3aa549cac70d5564e89507543c76452b02b63034c62fb3f44b2 |
|
MD5 | 58d08ce00af6320a2e105da1bdf2ac4b |
|
BLAKE2b-256 | 46ef0910172593af2cd9c873e92800391b6c53e68ae2c957050449f459eb3ba3 |