You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
3.4 KiB
HTML

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

{%- macro document() -%}
{%- if page -%}{{ page | json_encode() | safe }}{%- else -%}{{ section | json_encode() | safe }}{%- endif -%}
{%- endmacro document -%}
{%- macro is_active(current_path) -%}
{%- endmacro is_active -%}
{%- macro get_edit_path() -%}
{%- if page -%}
{%- set document = page -%}
{%- else -%}
{%- set document = section -%}
{%- endif -%}
{{ document.relative_path }}
{%- endmacro get_edit_path -%}
{%- macro get_doc_section(attribute) -%}
{%- if page -%}
{%- set document = page -%}
{%- else -%}
{%- set document = section -%}
{%- endif -%}
{%- set doc_section_name = document.components | first -%}
{%- if doc_section_name -%}
{%- set doc_section = get_section(path=doc_section_name ~ '/_index.md') -%}
{# handle subsections #}
{%- if attribute == "subsections" -%}
{{ macros::print_subsections(subsections=doc_section[attribute]) | safe }}
{%- else -%}
{{ doc_section[attribute] }}
{%- endif -%}
{%- else -%}
HOME
{%- endif -%}
{%- endmacro get_doc_section -%}
{%- macro print_subsections(subsections) -%}
{% for s in subsections %}
{% set subsection = get_section(path=s) %}
<li {% if current_path == subsection.path %}class="active"{% endif %}>
{% set chapter_num = loop.index %}
<a {% if subsection.extra.missing_content %}class="deadlink"{% endif %} href="{{ subsection.permalink | safe }}">
{% if config.extra.book_number_chapters %}<strong>{{ chapter_num }}.</strong>{% endif %}
{{ subsection.title }}
</a>
{% if subsection.pages %}
<ul>
{% for subpage in subsection.pages %}
<li {% if current_path == subpage.path %}class="active"{% endif %}>
<a {% if subpage.extra.missing_content %}class="deadlink"{% endif %} href="{{ subpage.permalink | safe }}">
{% if config.extra.book_number_chapters %}<strong>{{ chapter_num }}.{{ loop.index }}.</strong>{% endif %}
{{ subpage.title }}
</a>
</li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
{%- endmacro print_subsections -%}
{%- macro alert(alert_type) -%}
<div class="alert alert-{{ alert_type }}">
{%- if alert_type == "todo" -%}
<div class="alert-title">Cette page est manquante.</div>
<div class="alert-content">Cette page na pas encore été rédigée. Merci de revenir plus tard !</div>
<div class="alert-contribute">Si vous souhaitez vous essayer à sa rédaction, consultez le dépôt de cette documentation et prenez contact avec ses contributeur·ices.</div>
{%- elif alert_type == "deprecated" -%}
<div class="alert-title">Le contenu de cette page est obsolète.</div>
<div class="alert-content">Cette page fait référence à danciennes informations qui ne sont plus dactualité.</div>
<div class="alert-contribute">Si vous souhaitez la mettre à jour, consultez le dépôt de cette documentation et prenez contact avec ses contributeur·ices.</div>
{%- elif alert_type == "wip" -%}
<div class="alert-title">Cette page est en cours de modification.</div>
<div class="alert-content">Merci de prendre contact avec les contributeur·ices si vous souhaitez éditer cette page.</div>
{%- endif -%}
</div>
{%- endmacro alert -%}