{#- The application frame: skip link, sidebar, top bar, page header, content. Extend it. Everything an application owns is a block, and everything the SYSTEM owns is the markup between them — the class names, their nesting, and the four layouts that all render this same DOM. A project that hand-writes this frame has forked the part of the design system that is hardest to keep in step, which is the whole reason this file exists. Navigation arrives as DATA rather than markup, because markup is what drifts: nav = [{"section": "Directory", "items": [{"href": "/contacts", "label": "Contacts", "icon": "users"}]}] A group with no `section` renders its items flat. `icon` is optional and is only used if the application has registered an `icon()` global — the package ships no icon set, on purpose (see the docs). For anything the data cannot express, override `{% block nav %}` and write the `ads-nav` markup yourself. Context it reads, all optional: nav the groups above current the path of the page being rendered, for `aria-current` layout_class "", "ads-app--folded", "ads-app--right" or "ads-app--horizontal". The reader can fold and unfold the sidebar with the top bar's menu button; their choice is remembered and wins over this one. container_class "", "ads-container--narrow" or "ads-container--fluid" stylesheet where the vendored ads.css is served from shell_script where the vendored shell.js is served from -#} {% import "ads/nav.html" as ads_nav with context %} {% block title %}{% endblock %} {% block stylesheet %} {% endblock %} {# Inline and blocking on purpose: `shell.js` is deferred, and a theme restored after first paint is a white flash on every navigation for anyone who chose dark. #} {% block theme_restore %} {% endblock %} {# A separate slot from `head` on purpose: `head` is the one PAGES override, and a favicon declared there disappears from every page that wants a stylesheet of its own. Site-wide links belong to the site. #} {% block icon %}{% endblock %} {% block head %}{% endblock %} {# First focusable thing on the page, and the reason `ads-page-body` carries the id it jumps to. A keyboard reader should not walk thirty navigation links to reach the content. #} {% block skip %}Skip to main content{% endblock %}
{# Inline and blocking for the same reason as the theme: a fold restored after first paint is the whole page jumping sideways on every navigation. #}
{% block topbar %}
{% block menu_button %} {% endblock %} {% block topbar_start %}{% endblock %}
{% block topbar_end %}{% endblock %}
{% endblock %} {% block page_header %}
{% block pretitle %}{% endblock %}
{% set page_heading = self.heading() %} {% if page_heading | trim %}

{{ page_heading }}

{% endif %}
{% block actions %}{% endblock %}
{% endblock %}
{% block body %}{% endblock %}
{% block page_foot %}{% endblock %}
{# Anything an application puts here — a lightbox, a cookie notice, a toast region — has to come BEFORE the script that wires it, because a script looks its elements up by id when it runs and an element declared later does not exist yet. #} {% block overlays %}{% endblock %} {# The behaviour the components need: dropdowns that close, drawers that open, the theme toggle, and a sidebar that remembers which groups you left open. `.ads-dropdown` and `.ads-drawer` are not usable without it, so it is vendored by `abilian-ds sync` next to the stylesheet rather than left as an exercise. #} {% block shell_script %} {% endblock %} {% block scripts %}{% endblock %}