pelican-themes
pelican-themes copied to clipboard
Reordering the sidebar
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.
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.
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.
I just noticed I opened this issue directly under pelican-themes
. I suspect it was meant for the pelican-bootstrap3
theme specifically.