|
| 1 | +{%- comment -%} |
| 2 | + Override of just-the-docs sidebar component. |
| 3 | + French pages (lang: fr) get a French navigation sidebar. |
| 4 | + English pages get the original theme sidebar. |
| 5 | +{%- endcomment -%} |
| 6 | + |
| 7 | +{%- if page.lang == 'fr' -%} |
| 8 | +<header class="side-bar"> |
| 9 | + <div class="site-header"> |
| 10 | + <a href="{{ '/fr/' | relative_url }}" class="site-title lh-tight"> |
| 11 | + {{ site.title }} |
| 12 | + </a> |
| 13 | + <button id="menu-button" class="site-button btn-reset" aria-label="Menu" aria-expanded="false"> |
| 14 | + <svg viewBox="0 0 24 24" class="icon" aria-hidden="true"><use xlink:href="#svg-menu"></use></svg> |
| 15 | + </button> |
| 16 | + </div> |
| 17 | + <nav aria-label="Main" id="site-nav" class="site-nav"> |
| 18 | + <ul class="nav-list"> |
| 19 | + {%- assign fr_pages = site.pages | where: "lang", "fr" | sort: "permalink" -%} |
| 20 | + {%- for p in fr_pages -%} |
| 21 | + <li class="nav-list-item"> |
| 22 | + <a href="{{ p.permalink | prepend: site.baseurl }}" class="nav-list-link{% if page.permalink == p.permalink %} active{% endif %}"> |
| 23 | + {{ p.title }} |
| 24 | + </a> |
| 25 | + </li> |
| 26 | + {%- endfor -%} |
| 27 | + </ul> |
| 28 | + </nav> |
| 29 | + <div class="d-md-block d-none site-footer"> |
| 30 | + {%- capture nav_footer_custom -%}{%- include nav_footer_custom.html -%}{%- endcapture -%} |
| 31 | + {%- if nav_footer_custom != "" -%} |
| 32 | + {{ nav_footer_custom }} |
| 33 | + {%- else -%} |
| 34 | + This site uses <a href="https://github.com/just-the-docs/just-the-docs">Just the Docs</a>, a documentation theme for Jekyll. |
| 35 | + {%- endif -%} |
| 36 | + </div> |
| 37 | +</header> |
| 38 | + |
| 39 | +{%- else -%} |
| 40 | + |
| 41 | +<header class="side-bar"> |
| 42 | + <div class="site-header"> |
| 43 | + <a href="{{ '/' | relative_url }}" class="site-title lh-tight">{% include title.html %}</a> |
| 44 | + <button id="menu-button" class="site-button btn-reset" aria-label="Menu" aria-expanded="false"> |
| 45 | + <svg viewBox="0 0 24 24" class="icon" aria-hidden="true"><use xlink:href="#svg-menu"></use></svg> |
| 46 | + </button> |
| 47 | + </div> |
| 48 | + {% include_cached components/site_nav.html %} |
| 49 | + <div class="d-md-block d-none site-footer"> |
| 50 | + {%- capture nav_footer_custom -%}{%- include nav_footer_custom.html -%}{%- endcapture -%} |
| 51 | + {%- if nav_footer_custom != "" -%} |
| 52 | + {{ nav_footer_custom }} |
| 53 | + {%- else -%} |
| 54 | + This site uses <a href="https://github.com/just-the-docs/just-the-docs">Just the Docs</a>, a documentation theme for Jekyll. |
| 55 | + {%- endif -%} |
| 56 | + </div> |
| 57 | +</header> |
| 58 | + |
| 59 | +{%- endif -%} |
0 commit comments