diff --git a/docs/plugins.rst b/docs/plugins.rst index 6763f5ef..42ecd656 100644 --- a/docs/plugins.rst +++ b/docs/plugins.rst @@ -52,12 +52,13 @@ List of signals Here is the list of currently implemented signals: -========================= ============================ ===================== +========================= ============================ ========================================= Signal Arguments Description -========================= ============================ ===================== +========================= ============================ ========================================= initialized pelican object article_generate_context article_generator, metadata -========================= ============================ ===================== +article_generator_init article_generator invoked in the ArticlesGenerator.__init__ +========================= ============================ ========================================= The list is currently small, don't hesitate to add signals and make a pull request if you need them! @@ -73,3 +74,41 @@ Tag cloud Translation ----------- + +Github Activity +_______________ + +This plugins introduces a new depencency, you have to install feedparser +if you want to use it, these are some ways to do it:: + + apt-get install python-feedparser # on debian based distributions like ubuntu + sudo easy_install feedparser + 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' + +in your template just write a for in jinja2 syntax against the +github_activity variable, like for example:: + + {% if GITHUB_ACTIVITY_FEED %} +
+ {% endif %} + + +github_activity is a list containing raw html from github so you can include it +directly in your (for example base.html) template and style it in a way that +your prefer using your css skills diff --git a/pelican/generators.py b/pelican/generators.py index 38fa9da7..9baf240e 100755 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -101,6 +101,7 @@ class ArticlesGenerator(Generator): self.categories = defaultdict(list) super(ArticlesGenerator, self).__init__(*args, **kwargs) self.drafts = [] + signals.article_generator_init.send(self) def generate_feeds(self, writer): """Generate the feeds from the current context, and output files.""" diff --git a/pelican/plugins/github_activity.py b/pelican/plugins/github_activity.py new file mode 100644 index 00000000..ba6cd70f --- /dev/null +++ b/pelican/plugins/github_activity.py @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- +""" + Copyright (c) Marco Milanesi