Pelican plugin that creates privacy-friendly URLs for sharing the current article
Find a file
2023-05-11 08:27:01 +02:00
.github Trying to fix the CI tasks 2022-12-23 10:40:29 +00:00
pelican/plugins/share_post Update share_post.py 2023-05-11 08:27:01 +02:00
.editorconfig Modernize code and add a test 2021-03-19 09:42:02 +01:00
.gitignore Modernize code and add a test 2021-03-19 09:42:02 +01:00
.pre-commit-config.yaml [pre-commit.ci] pre-commit autoupdate 2022-12-23 10:43:11 +00:00
CHANGELOG.md Fixed file termination 2021-05-04 08:08:46 +01:00
CONTRIBUTING.md Modernize code and add a test 2021-03-19 09:42:02 +01:00
pyproject.toml Fixed Black version 2022-12-23 10:35:41 +00:00
README.md Added Maurizio Paglia as a contributor 2022-12-23 10:49:02 +00:00
tasks.py Support Poetry-managed virtualenvs in Invoke tasks 2021-05-04 05:37:47 -05:00
tox.ini Modernize code and add a test 2021-03-19 09:42:02 +01:00

Share Post: A Plugin for Pelican

Build Status PyPI Version License

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 = {
	"facebook": "<URL>",
	"email": "<URL>",
	"twitter": "<URL>",
	"diaspora": "<URL>",
	"linkedin": "<URL>",
	"hacker-news": "<URL>",
	"reddit": "<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['diaspora']}}" title="Share on Diaspora">Diaspora*</a>
    ❄
    <a href="{{article.share_post['twitter']}}" title="Share on Twitter">Twitter</a>
    ❄
    <a href="{{article.share_post['facebook']}}" title="Share on Facebook">Facebook</a>
    ❄
    <a href="{{article.share_post['linkedin']}}" title="Share on LinkedIn">LinkedIn</a>
    ❄
    <a href="{{article.share_post['hacker-news']}}" title="Share on HackerNews">HackerNews</a>
    ❄
    <a href="{{article.share_post['email']}}" title="Share via Email">Email</a>
    ❄
    <a href="{{article.share_post['reddit']}}" title="Share via Reddit">Reddit</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

License

This project is licensed under the MIT license.