README.rst 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. tag_cloud
  2. =========
  3. This plugin generates a tag-cloud.
  4. Settings
  5. --------
  6. ================================================ =====================================================
  7. Setting name (followed by default value) What does it do?
  8. ================================================ =====================================================
  9. ``TAG_CLOUD_STEPS = 4`` Count of different font sizes in the tag
  10. cloud.
  11. ``TAG_CLOUD_MAX_ITEMS = 100`` Maximum number of tags in the cloud.
  12. ``TAG_CLOUD_SORTING = 'random'`` The tag cloud ordering scheme. Valid values:
  13. random, alphabetically, alphabetically-rev, size and
  14. size-rev
  15. ================================================ =====================================================
  16. The default theme does not include a tag cloud, but it is pretty easy to add one::
  17. <ul class="tagcloud">
  18. {% for tag in tag_cloud %}
  19. <li class="tag-{{ tag.1 }}"><a href="{{ SITEURL }}/{{ tag.0.url }}">{{ tag.0 }}</a></li>
  20. {% endfor %}
  21. </ul>
  22. You should then also define CSS styles with appropriate classes (tag-1 to tag-N,
  23. where N matches ``TAG_CLOUD_STEPS``), tag-1 being the most frequent, and
  24. define a ``ul.tagcloud`` class with appropriate list-style to create the cloud.
  25. For example::
  26. ul.tagcloud {
  27. list-style: none;
  28. padding: 0;
  29. }
  30. ul.tagcloud li {
  31. display: inline-block;
  32. }
  33. li.tag-1 {
  34. font-size: 150%;
  35. }
  36. li.tag-2 {
  37. font-size: 120%;
  38. }
  39. ...
  40. By default the tags in the cloud are sorted randomly, but if you prefers to have it alphabetically use the `alphabetically` (ascending) and `alphabetically-rev` (descending). Also is possible to sort the tags by it's size (number of articles with this specific tag) using the values `size` (ascending) and `size-rev` (descending).