Readme.rst 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. GitHub activity
  2. ---------------
  3. This plugin makes use of the `feedparser`_ library that you'll need to
  4. install.
  5. Set the ``GITHUB_ACTIVITY_FEED`` parameter to your GitHub activity feed.
  6. For example, to track Pelican project activity, the setting would be::
  7. GITHUB_ACTIVITY_FEED = 'https://github.com/getpelican.atom'
  8. If you want to limit the amount of entries to a certain maximum set the
  9. ``GITHUB_ACTIVITY_MAX_ENTRIES`` parameter.
  10. GITHUB_ACTIVITY_MAX_ENTRIES = 10
  11. On the template side, you just have to iterate over the ``github_activity``
  12. variable, as in this example::
  13. {% if GITHUB_ACTIVITY_FEED %}
  14. <div class="social">
  15. <h2>Github Activity</h2>
  16. <ul>
  17. {% for entry in github_activity %}
  18. <li><b>{{ entry[0] }}</b><br /> {{ entry[1] }}</li>
  19. {% endfor %}
  20. </ul>
  21. </div><!-- /.github_activity -->
  22. {% endif %}
  23. ``github_activity`` is a list of lists. The first element is the title,
  24. and the second element is the raw HTML from GitHub.
  25. .. _feedparser: https://crate.io/packages/feedparser/