(Diataxis) Grid in Left Sidebar: Non-HTML Options #1313
-
The developers of the PyMC Example Gallery documentation had the fantastic idea to put a Diataxis grid in the left sidebar: Their relevant html template looks something like this: <!-- diataxis type categories -->
<div class="container sd-fs-6 sd-font-weight-bold">
<div class="row border-top border-bottom">
{% set t_bool = "tutorial" in post.category|map('string') %}
<div class="col"><a class="{{ setcolorclass(t_bool) }}" href="{{ pathtocategory('tutorial') }}">Tutorial</a></div>
{% set h_bool = "how-to" in post.category|map('string') %}
<div class="col"><a class="{{ setcolorclass(h_bool) }}" href="{{ pathtocategory('how-to') }}">How-to</a></div>
<div class="w-100"></div>
{% set e_bool = "explanation" in post.category|map('string') %}
<div class="col"><a class="{{ setcolorclass(e_bool) }}" href="{{ pathtocategory('explanation') }}">Explanation</a></div>
{% set r_bool = "reference" in post.category|map('string') %}
<div class="col"><a class="{{ setcolorclass(r_bool) }}" href="{{ pathtocategory('reference') }}">Reference</a></div>
</div>
</div> I tried to adapt this, but it looks a bit awkward. Is there a way to adapt the for use with the sidebar? I would greatly appreciate any suggestions/ideas! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I'd probably start with a Bootstrap |
Beta Was this translation helpful? Give feedback.
-
Following @drammock's suggestion, we added a grid. The relevant files:
|
Beta Was this translation helpful? Give feedback.
Following @drammock's suggestion, we added a grid. The relevant files:
source/_static/css/custom.css
source/_templates/sidebar_grid_diataxis.html