Render tag cloud on tags page (#37)
Tags page was quite boring and didn't use horizontal space efficiently. This commit replaces plain tag list with tag cloud that gracefully scales to any screen (Attila's responsive design principle is not violated). Details: - Tags are still sorted alphabetically - Tags with more articles have bigger font size - Number of font size steps is defined via TAG_CLOUD_STEPS variable. If that variable is not set or is zero, default value of 5 steps is used. Stylesheet is written to support up to 10 steps. - Tag tooltip shows number of articles with that tag There exists a separate plugin for tag cloud[1], but using it still requires making changes to the theme. Trivial math calculations can be done as easily in Jinja as in Python, so the dependency on external package can and should be avoided. Screenshots: before [[2]], after [[3]] [1]: https://github.com/getpelican/pelican-plugins/tree/master/tag_cloud [2]: https://i.imgur.com/ivZQIxi.png [3]: https://i.imgur.com/fLNVKpj.png
This commit is contained in:
parent
6de60cb90b
commit
84e7843aaa
3 changed files with 46 additions and 7 deletions
12
README.adoc
12
README.adoc
|
@ -293,6 +293,18 @@ All image paths are relative from the site root directory. You can also
|
|||
use absolute URLs for `og_image` and `twitter_image`.
|
||||
|
||||
|
||||
[[tag-cloud]]
|
||||
=== Tag Cloud
|
||||
|
||||
Attila renders tags page as a tag cloud.
|
||||
|
||||
Use `TAG_CLOUD_STEPS` configuration variable to specify number of font size
|
||||
steps for the tag cloud. Default value is 5, stylesheet is written to support
|
||||
up to 10 steps. If you want more steps, you'll need to configure your CSS
|
||||
manually (see `CSS_OVERRIDE`)
|
||||
|
||||
|
||||
|
||||
[[other-configuration]]
|
||||
=== Other configuration
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue