Files
ferrix/docs/templates/macros/docs.html
T
Rayhaan JaufeerallyandClaude Opus 5.5 dc275f99d7
ci / check (push) Canceled after 0s
ci / docs (push) Canceled after 0s
ci / interop (push) Canceled after 0s
ci / fuzz (push) Canceled after 0s
Add a documentation website, built with Zola
The documentation moves from READMEs into a site in docs/: getting
started, a user guide, operations, a reference, and development pages,
written in the style of network vendors' documentation (docs/STYLE.md).
bin/bgp/README.md and docs/RFCs.md are folded into it.

- A theme of its own in the International Typographic Style, in blues,
  with self-hosted Inter and JetBrains Mono, search over Zola's index,
  dark mode, and no resources loaded from other hosts.
- Example configurations in docs/examples/, shown on the pages and
  checked with `bgp --check` in CI.
- A test that fails when a field of config.proto is missing from the
  configuration reference.
- A CI job that builds the site; Zola fails on broken links and anchors.
- A hardened systemd unit, tried under systemd with kernel routes on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 15:12:43 +02:00

75 lines
2.4 KiB
HTML

{#- The documentation's navigation: every section under docs/, by weight, and
the pages in each, by weight. -#}
{%- macro sidebar(current) -%}
{%- set docs = get_section(path="docs/_index.md") -%}
<nav class="sidebar-nav" aria-label="Documentation">
{%- for sub_path in docs.subsections %}
{%- set sub = get_section(path=sub_path) %}
<div class="nav-group">
<a class="nav-group-title" href="{{ sub.permalink }}"{% if sub.path == current %} aria-current="page"{% endif %}><span>{{ sub.extra.number }}</span>{{ sub.title }}</a>
<ul>
{%- for p in sub.pages %}
<li><a href="{{ p.permalink }}"{% if p.path == current %} aria-current="page"{% endif %}>{{ p.extra.nav | default(value=p.title) }}</a></li>
{%- endfor %}
</ul>
</div>
{%- endfor %}
</nav>
{%- endmacro sidebar -%}
{#- The pages before and after this one, in the order of the sidebar. -#}
{%- macro pager(current) -%}
{%- set docs = get_section(path="docs/_index.md") -%}
{%- set_global flat = [] -%}
{%- for sub_path in docs.subsections -%}
{%- set sub = get_section(path=sub_path) -%}
{%- for p in sub.pages -%}
{%- set_global flat = flat | concat(with=p) -%}
{%- endfor -%}
{%- endfor -%}
{%- set_global at = -1 -%}
{%- for p in flat -%}
{%- if p.path == current %}{% set_global at = loop.index0 %}{% endif -%}
{%- endfor -%}
{%- if at >= 0 %}
<nav class="pager" aria-label="Pages">
{%- if at > 0 %}
{%- set prev = flat | nth(n=at - 1) %}
<a class="pager-link pager-prev" href="{{ prev.permalink }}">
<span class="pager-label">Previous</span>
<span class="pager-title">{{ prev.title }}</span>
</a>
{%- else %}<span></span>{% endif %}
{%- if at + 1 < flat | length %}
{%- set next = flat | nth(n=at + 1) %}
<a class="pager-link pager-next" href="{{ next.permalink }}">
<span class="pager-label">Next</span>
<span class="pager-title">{{ next.title }}</span>
</a>
{%- endif %}
</nav>
{%- endif %}
{%- endmacro pager -%}
{%- macro toc(entries) -%}
{%- if entries | length > 0 %}
<nav class="toc" aria-label="On this page">
<p class="toc-title">On this page</p>
<ul>
{%- for h2 in entries %}
<li><a href="#{{ h2.id }}" data-toc-link>{{ h2.title }}</a>
{%- if h2.children | length > 0 %}
<ul>
{%- for h3 in h2.children %}
<li><a href="#{{ h3.id }}" data-toc-link>{{ h3.title }}</a></li>
{%- endfor %}
</ul>
{%- endif %}
</li>
{%- endfor %}
</ul>
</nav>
{%- endif %}
{%- endmacro toc -%}