mirror of
https://github.com/pelican-plugins/share-post.git
synced 2025-10-15 17:08:54 +02:00
Document Mastodon functionality in README
This commit is contained in:
parent
2387c73609
commit
33e329de02
1 changed files with 13 additions and 10 deletions
23
README.md
23
README.md
|
|
@ -23,38 +23,41 @@ 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:
|
||||
|
||||
``` python
|
||||
```python
|
||||
article.share_post = {
|
||||
"facebook": "<URL>",
|
||||
"email": "<URL>",
|
||||
"twitter": "<URL>",
|
||||
"diaspora": "<URL>",
|
||||
"linkedin": "<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:
|
||||
|
||||
``` html+jinja
|
||||
```html+jinja
|
||||
{% 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['email']}}" title="Share via Email">Email</a>
|
||||
❄
|
||||
<a href="{{article.share_post['twitter']}}" title="Share on Twitter">Twitter</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['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['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 %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue