@@ -20,10 +20,12 @@ <h1 class="side-panel-title">{% translate "Visibility" %}</h1>
20
20
<!-- Bootstrap 5.2 supports responsive offcanvas.
21
21
This duplication is a workaround and should be removed after the upgrade -->
22
22
< div class ="d-none d-lg-block side-panel-container ">
23
+ {%if parsed_md.1|hasTocContent %}
23
24
< aside class ="side-panel border-accent sidebar-container d-print-none ">
24
25
< h1 class ="side-panel-title "> {% translate "Table of contents" %}</ h1 >
25
26
{{ parsed_md.1 }}
26
27
</ aside >
28
+ {% endif %}
27
29
{% if page.attachments.all %}
28
30
< aside class ="side-panel border-accent sidebar-container d-print-none ">
29
31
< h1 class ="side-panel-title "> {% translate "Attachments" %}</ h1 >
@@ -38,28 +40,30 @@ <h1 class="side-panel-title">{% translate "Attachments" %}</h1>
38
40
{% endif %}
39
41
</ div >
40
42
41
- < div class ="offcanvas offcanvas-bottom " tabindex ="-1 " id ="sidebar-offcanvas " aria-labelledby ="sidebar-offcanvas-label ">
42
- < div class ="offcanvas-header ">
43
- < h5 class ="offcanvas-title " id ="sidebar-offcanvas-label "> {% translate "Table of contents" %}</ h5 >
44
- < button type ="button " class ="btn-close " data-bs-dismiss ="offcanvas "
45
- aria-label ="{% translate 'Close' %} "> </ button >
46
- </ div >
47
- < div class ="offcanvas-body ">
48
- < aside class ="side-panel border-accent sidebar-container d-print-none ">
49
- < h1 class ="side-panel-title "> {% translate "Table of contents" %}</ h1 >
50
- {{ parsed_md.1 }}
51
- </ aside >
52
- {% if page.attachments.all %}
43
+ {%if parsed_md.1|hasTocContent %}
44
+ < div class ="offcanvas offcanvas-bottom " tabindex ="-1 " id ="sidebar-offcanvas " aria-labelledby ="sidebar-offcanvas-label ">
45
+ < div class ="offcanvas-header ">
46
+ < h5 class ="offcanvas-title " id ="sidebar-offcanvas-label "> {% translate "Table of contents" %}</ h5 >
47
+ < button type ="button " class ="btn-close " data-bs-dismiss ="offcanvas "
48
+ aria-label ="{% translate 'Close' %} "> </ button >
49
+ </ div >
50
+ < div class ="offcanvas-body ">
53
51
< aside class ="side-panel border-accent sidebar-container d-print-none ">
54
- < h1 class ="side-panel-title "> {% translate "Attachments" %}</ h1 >
55
- < ul >
56
- {% for attachment in page.attachments.all %}
57
- < li >
58
- < a href ="{{ attachment.url }} "> {{ attachment.title }}</ a >
59
- </ li >
60
- {% endfor %}
61
- </ ul >
52
+ < h1 class ="side-panel-title "> {% translate "Table of contents" %}</ h1 >
53
+ {{ parsed_md.1 }}
62
54
</ aside >
63
- {% endif %}
55
+ {% if page.attachments.all %}
56
+ < aside class ="side-panel border-accent sidebar-container d-print-none ">
57
+ < h1 class ="side-panel-title "> {% translate "Attachments" %}</ h1 >
58
+ < ul >
59
+ {% for attachment in page.attachments.all %}
60
+ < li >
61
+ < a href ="{{ attachment.url }} "> {{ attachment.title }}</ a >
62
+ </ li >
63
+ {% endfor %}
64
+ </ ul >
65
+ </ aside >
66
+ {% endif %}
67
+ </ div >
64
68
</ div >
65
- </ div >
69
+ {% endif %}
0 commit comments