@@ -3,11 +3,19 @@ import { Telegram } from "../../_components/Telegram.tsx";
33import { GitHub } from "../../_components/GitHub.tsx" ;
44
55export default (
6- { title, url, children, prev, next, hide_toc, toc, walkthrough } : Lume . Data ,
6+ { title, url, children, prev, next, hide_toc, toc, walkthrough, walkthroughProgress } : Lume . Data ,
77 { bc, getTitle } : Lume . Helpers ,
88) => {
99 const hasToc = ! hide_toc && toc ?. length > 0 ;
1010 const audience = walkthrough ?. track === "user" || walkthrough ?. track === "bot" ? walkthrough . track : undefined ;
11+ const progress = walkthroughProgress &&
12+ typeof walkthroughProgress . label === "string" &&
13+ Number . isInteger ( walkthroughProgress . step ) &&
14+ Number . isInteger ( walkthroughProgress . total ) &&
15+ walkthroughProgress . step > 0 &&
16+ walkthroughProgress . step <= walkthroughProgress . total
17+ ? walkthroughProgress
18+ : undefined ;
1119 const searchable = ! url . startsWith ( "/gh/" ) && ! url . startsWith ( "/404" ) && url !== "/source-map/" ;
1220 const searchKind = url . startsWith ( "/methods/" ) ? "Methods" : url . startsWith ( "/types/" ) ? "Types" : url . startsWith ( "/server/" ) ? "Server" : "Guides" ;
1321
@@ -55,7 +63,18 @@ export default (
5563
5664 return (
5765 < aside class = "toc" >
58- < nav aria-label = "On this page" >
66+ < button
67+ type = "button"
68+ class = "toc-mobile-toggle"
69+ aria-expanded = "false"
70+ aria-controls = "toc-navigation"
71+ >
72+ < span > On this page</ span >
73+ < svg viewBox = "0 0 16 16" aria-hidden = "true" >
74+ < path d = "M3 5.5l5 5 5-5" />
75+ </ svg >
76+ </ button >
77+ < nav id = "toc-navigation" aria-label = "On this page" >
5978 < div class = "toc-list-wrap" >
6079 < ol class = "toc-list" >
6180 { toc . map ( ( v : any ) => (
@@ -178,6 +197,23 @@ export default (
178197 </ span >
179198 ) }
180199 </ h1 >
200+ { progress && (
201+ < div class = "walkthrough-progress" data-pagefind-ignore = "all" >
202+ < div class = "walkthrough-progress-label" >
203+ { progress . label } Walkthrough < span aria-hidden = "true" > ·</ span > { progress . step } of { progress . total }
204+ </ div >
205+ < div
206+ class = "walkthrough-progress-track"
207+ role = "progressbar"
208+ aria-label = { `${ progress . label } walkthrough progress` }
209+ aria-valuemin = "1"
210+ aria-valuemax = { progress . total }
211+ aria-valuenow = { progress . step }
212+ >
213+ < span style = { `width:${ ( progress . step / progress . total ) * 100 } %` } > </ span >
214+ </ div >
215+ </ div >
216+ ) }
181217 { children }
182218 { ( next || prev ) && (
183219 < nav class = "bottom-nav" aria-label = "Documentation pagination" data-pagefind-ignore = "all" >
0 commit comments