mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
better plugins doc
This commit is contained in:
parent
67f7fcba26
commit
7cd4d28bb2
1 changed files with 15 additions and 26 deletions
|
|
@ -3,17 +3,18 @@
|
||||||
Plugins
|
Plugins
|
||||||
#######
|
#######
|
||||||
|
|
||||||
Since version 3.0, pelican manages plugins. Plugins are a way to add feature to
|
Since version 3.0, pelican manages plugins. Plugins are a way to add features
|
||||||
pelican without having to directly hack pelican code.
|
to pelican without having to directly hack pelican code.
|
||||||
|
|
||||||
Pelican is shipped with a set of core plugins, but you can easily implement
|
Pelican is shipped with a set of core plugins, but you can easily implement
|
||||||
your own (and this page describes how)
|
your own (and this page describes how).
|
||||||
|
|
||||||
How to use plugins?
|
How to use plugins?
|
||||||
====================
|
====================
|
||||||
|
|
||||||
To load plugins, you have to specify a them in your settings file. You have two
|
To load plugins, you have to specify them in your settings file. You have two
|
||||||
ways to do so: by specifying strings with the path to the callables: ::
|
ways to do so.
|
||||||
|
Either by specifying strings with the path to the callables::
|
||||||
|
|
||||||
PLUGINS = ['pelican.plugins.gravatar',]
|
PLUGINS = ['pelican.plugins.gravatar',]
|
||||||
|
|
||||||
|
|
@ -76,28 +77,18 @@ Translation
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
Github Activity
|
Github Activity
|
||||||
_______________
|
---------------
|
||||||
|
|
||||||
This plugins introduces a new depencency, you have to install feedparser
|
This plugin makes use of the ``feedparser`` library that you'll need to
|
||||||
if you want to use it, these are some ways to do it::
|
install.
|
||||||
|
|
||||||
apt-get install python-feedparser # on debian based distributions like ubuntu
|
Set the GITHUB_ACTIVITY_FEED parameter to your github activity feed.
|
||||||
sudo easy_install feedparser
|
For example, my setting would look like::
|
||||||
sudo pip install feedparser
|
|
||||||
|
|
||||||
To enable it set in your pelican config file the GITHUB_ACTIVITY_FEED
|
|
||||||
parameter pointing to your github activity feed.
|
|
||||||
|
|
||||||
for example my personal activity feed is::
|
|
||||||
|
|
||||||
https://github.com/kpanic.atom
|
|
||||||
|
|
||||||
and the config line could be::
|
|
||||||
|
|
||||||
GITHUB_ACTIVITY_FEED = 'https://github.com/kpanic.atom'
|
GITHUB_ACTIVITY_FEED = 'https://github.com/kpanic.atom'
|
||||||
|
|
||||||
in your template just write a for in jinja2 syntax against the
|
On the templates side, you just have to iterate over the ``github_activity``
|
||||||
github_activity variable, like for example::
|
variable, as in the example::
|
||||||
|
|
||||||
{% if GITHUB_ACTIVITY_FEED %}
|
{% if GITHUB_ACTIVITY_FEED %}
|
||||||
<div class="social">
|
<div class="social">
|
||||||
|
|
@ -113,7 +104,5 @@ github_activity variable, like for example::
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
github_activity is a list containing a list. The first element is the title and
|
``github_activity`` is a list of lists. The first element is the title
|
||||||
the second element is the raw html from github so you can include it directly
|
and the second element is the raw html from github.
|
||||||
in your (for example base.html) template and style it in a way that your prefer
|
|
||||||
using your css skills
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue