From d29693066ee6ff50258b52049ec024b351430945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yngve=20H=C3=B8iseth?= Date: Mon, 22 Feb 2021 21:05:45 +0100 Subject: [PATCH] Document conditional TOC rendering (#1376) * Document conditional TOC rendering * Simplify demonstration of conditional rendering --- .../content/table-of-contents.md | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/docs/content/documentation/content/table-of-contents.md b/docs/content/documentation/content/table-of-contents.md index b42a4dfd..7a94c667 100644 --- a/docs/content/documentation/content/table-of-contents.md +++ b/docs/content/documentation/content/table-of-contents.md @@ -12,22 +12,24 @@ documentation for information on its structure. Here is an example of using that field to render a two-level table of contents: ```jinja2 - +{% if page.toc %} + +{% endif %} ``` While headers are neatly ordered in this example, it will work just as well with disjoint headers.