Переглянути джерело

fix previous & next

https://docs.rs/crate/mdbook/latest/source/CHANGELOG.md#351
Kassapa 2 тижнів тому
батько
коміт
8edbffb2c0
1 змінених файлів з 8 додано та 8 видалено
  1. 8 8
      theme/index.hbs

+ 8 - 8
theme/index.hbs

@@ -189,16 +189,16 @@
 
                     <nav class="nav-wrapper" aria-label="Page navigation">
                         <!-- Mobile navigation buttons -->
-                        {{#previous}}
+                        {{#if previous}}
                             <a rel="prev" href="{{ path_to_root }}{{link}}" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
                                 <i class="fa fa-angle-left"></i>
                             </a>
-                        {{/previous}}
-                        {{#next}}
+                        {{/if}}
+                        {{#if next}}
                             <a rel="next" href="{{ path_to_root }}{{link}}" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
                                 <i class="fa fa-angle-right"></i>
                             </a>
-                        {{/next}}
+                        {{/if}}
 
                         <div style="clear: both"></div>
                     </nav>
@@ -206,17 +206,17 @@
             </div>
 			
             <nav class="nav-wide-wrapper" aria-label="Page navigation">
-                {{#previous}}
+                {{#if previous}}
                     <a rel="prev" href="{{ path_to_root }}{{link}}" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
                         <i class="fa fa-angle-left"></i>
                     </a>
-                {{/previous}}
+                {{/if}}
 
-                {{#next}}
+                {{#if next}}
                     <a rel="next" href="{{ path_to_root }}{{link}}" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
                         <i class="fa fa-angle-right"></i>
                     </a>
-                {{/next}}
+                {{/if}}
             </nav>
         </div>
 		<div style="height:50vh"></div>