pelican-themes icon indicating copy to clipboard operation
pelican-themes copied to clipboard

Reordering the sidebar

Open dmark opened this issue 8 years ago • 3 comments

Is there some way to reorder the elements in the sidebar or is this something that can be engineered? I assume right now it depends on the order of the elements in sidebar.html. Adding the ability to specify the order of the sidebar sections sounds like a lot of work, but I'm not an expert with this stuff. Happy to lend a hand if I can.

dmark avatar May 05 '16 13:05 dmark

I actually came here to investigate the same thing. It would be pretty nice to reorder these elements. Maybe someone who has experience with the matter will be able to lend some insight.

neutrinos4all avatar Aug 02 '17 19:08 neutrinos4all

It is implementation dependent. So, a theme would need a custom setting representing the sidebar sequence (e.g. ['blogroll', 'tags', 'categories']), and understand how to interpret this in the relevant template files.

an example could be:

{% for sideitem in SIDEBAR_ORDER %}
  {% if sideitem == 'links' or sideitem == 'blogroll' %}
    # show links sidebar section
  {% endif %}
  {% if sideitem == 'social' %}
    # show social media
  {% endif %}
{% endfor %}

An advantage is the order could also specify what sidebar sections to show or hide (omitted from the sequence). But it would need to be documented very clearly what keywords map to which sections, or sections will not appear or be duplicated.

rask004 avatar Oct 25 '18 04:10 rask004

I just noticed I opened this issue directly under pelican-themes. I suspect it was meant for the pelican-bootstrap3 theme specifically.

dmark avatar Dec 13 '18 02:12 dmark