| 
									
										
										
										
											2023-07-29 17:41:25 +01:00
										 |  |  | {{/* Table of Contents */}} | 
					
						
							|  |  |  | {{/* TODO: toc bottom part should be able to hide */}} | 
					
						
							| 
									
										
										
										
											2023-08-09 22:57:43 +01:00
										 |  |  | {{- $toc := .Params.toc | default true -}} | 
					
						
							| 
									
										
										
										
											2023-08-27 17:32:44 +01:00
										 |  |  | {{- $onThisPage := (T "onThisPage") | default "On this page"}} | 
					
						
							|  |  |  | {{- $editThisPage := (T "editThisPage") | default "Edit this page"}} | 
					
						
							| 
									
										
										
										
											2023-10-01 05:06:28 -04:00
										 |  |  | {{- $backToTop := (T "backToTop") | default "Scroll to top" -}} | 
					
						
							| 
									
										
										
										
											2023-08-09 22:57:43 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-12 22:48:41 +01:00
										 |  |  | <nav class="hextra-toc order-last hidden w-64 shrink-0 xl:block print:hidden px-4" aria-label="table of contents"> | 
					
						
							| 
									
										
										
										
											2023-08-14 21:56:26 +01:00
										 |  |  |   {{- if $toc }} | 
					
						
							| 
									
										
										
										
											2023-09-13 19:01:38 -04:00
										 |  |  |     <div class="hextra-scrollbar sticky top-16 overflow-y-auto pr-4 pt-6 text-sm [hyphens:auto] max-h-[calc(100vh-var(--navbar-height)-env(safe-area-inset-bottom))] ltr:-mr-4 rtl:-ml-4"> | 
					
						
							| 
									
										
										
										
											2023-08-14 21:56:26 +01:00
										 |  |  |       {{- with .Fragments.Headings -}} | 
					
						
							| 
									
										
										
										
											2023-08-27 17:32:44 +01:00
										 |  |  |         <p class="mb-4 font-semibold tracking-tight">{{ $onThisPage }}</p> | 
					
						
							| 
									
										
										
										
											2023-08-14 21:56:26 +01:00
										 |  |  |         {{- range . -}} | 
					
						
							| 
									
										
										
										
											2023-08-09 22:57:43 +01:00
										 |  |  |           <ul> | 
					
						
							| 
									
										
										
										
											2023-08-14 21:56:26 +01:00
										 |  |  |             {{- with .Headings -}}{{ template "toc-subheading" (dict "headings" . "level" 0) }}{{- end -}} | 
					
						
							| 
									
										
										
										
											2023-08-09 22:57:43 +01:00
										 |  |  |           </ul> | 
					
						
							| 
									
										
										
										
											2023-08-14 21:56:26 +01:00
										 |  |  |         {{- end -}} | 
					
						
							|  |  |  |       {{- end -}} | 
					
						
							| 
									
										
										
										
											2023-07-29 17:41:25 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-14 21:56:26 +01:00
										 |  |  |       {{- $borderClass := "mt-8 border-t bg-white pt-8 shadow-[0_-12px_16px_white] dark:bg-dark dark:shadow-[0_-12px_16px_#111]" -}} | 
					
						
							|  |  |  |       {{- if not .Fragments.Headings -}} | 
					
						
							|  |  |  |         {{- $borderClass = "" -}} | 
					
						
							|  |  |  |       {{- end -}} | 
					
						
							| 
									
										
										
										
											2023-07-29 17:41:25 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-12 19:53:14 +01:00
										 |  |  |       {{/* TOC bottom part */}} | 
					
						
							| 
									
										
										
										
											2023-08-09 22:57:43 +01:00
										 |  |  |       <div class="{{ $borderClass }} sticky bottom-0 flex flex-col items-start gap-2 pb-8 dark:border-neutral-800 contrast-more:border-t contrast-more:border-neutral-400 contrast-more:shadow-none contrast-more:dark:border-neutral-400"> | 
					
						
							| 
									
										
										
										
											2023-08-23 01:00:36 +01:00
										 |  |  |         {{- if site.Params.editURL.enable -}} | 
					
						
							| 
									
										
										
										
											2023-08-12 22:48:41 +01:00
										 |  |  |           {{- $editURL := site.Params.editURL.base | default "" -}} | 
					
						
							| 
									
										
										
										
											2023-10-19 06:33:36 +09:00
										 |  |  |           {{- with .File -}}{{ $editURL = urls.JoinPath $editURL (replace .Path "\\" "/") }}{{- end -}} | 
					
						
							| 
									
										
										
										
											2023-11-10 17:03:08 -05:00
										 |  |  |           {{- with .Params.editURL -}}{{ $editURL = . }}{{- end -}} | 
					
						
							| 
									
										
										
										
											2023-08-27 17:32:44 +01:00
										 |  |  |           <a class="text-xs font-medium text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-100 contrast-more:text-gray-800 contrast-more:dark:text-gray-50" href="{{ $editURL }}" target="_blank" rel="noreferer">{{ $editThisPage }}</a> | 
					
						
							| 
									
										
										
										
											2023-08-12 19:53:14 +01:00
										 |  |  |         {{- end -}} | 
					
						
							| 
									
										
										
										
											2023-10-01 05:06:28 -04:00
										 |  |  |         {{/* Scroll To Top */}} | 
					
						
							|  |  |  |         <button aria-hidden="true" id="backToTop" onClick="scrollUp();" class="transition-all transition duration-75 opacity-0 text-xs font-medium text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-100 contrast-more:text-gray-800 contrast-more:dark:text-gray-50"> | 
					
						
							|  |  |  |           <span> | 
					
						
							|  |  |  |             {{- $backToTop -}} | 
					
						
							|  |  |  |           </span> | 
					
						
							|  |  |  |           <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="inline ml-1 h-3.5 w-3.5 border rounded-full border-gray-500 hover:border-gray-900 dark:border-gray-400 dark:hover:border-gray-100 contrast-more:border-gray-800 contrast-more:dark:border-gray-50"> | 
					
						
							|  |  |  |             <path stroke-linecap="round" stroke-linejoin="round" d="M4.5 15.75l7.5-7.5 7.5 7.5" /> | 
					
						
							|  |  |  |           </svg> | 
					
						
							|  |  |  |         </button> | 
					
						
							| 
									
										
										
										
											2023-08-09 22:57:43 +01:00
										 |  |  |       </div> | 
					
						
							| 
									
										
										
										
											2023-07-29 17:41:25 +01:00
										 |  |  |     </div> | 
					
						
							| 
									
										
										
										
											2023-08-14 21:56:26 +01:00
										 |  |  |   {{ end -}} | 
					
						
							| 
									
										
										
										
											2023-08-09 22:57:43 +01:00
										 |  |  | </nav> | 
					
						
							| 
									
										
										
										
											2023-07-29 17:41:25 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-09 22:57:43 +01:00
										 |  |  | {{/* TOC subheadings component. This is a recursive component that renders a list of headings. */}} | 
					
						
							|  |  |  | {{- define "toc-subheading" -}} | 
					
						
							| 
									
										
										
										
											2023-08-14 21:56:26 +01:00
										 |  |  |   {{- $headings := .headings -}} | 
					
						
							|  |  |  |   {{- $level := .level -}} | 
					
						
							|  |  |  |   {{- if ge $level 6 -}} | 
					
						
							| 
									
										
										
										
											2023-07-29 17:41:25 +01:00
										 |  |  |     {{ return }} | 
					
						
							| 
									
										
										
										
											2023-08-14 21:56:26 +01:00
										 |  |  |   {{- end -}} | 
					
						
							| 
									
										
										
										
											2023-07-29 17:41:25 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-14 21:56:26 +01:00
										 |  |  |   {{- $padding := (mul $level 4) -}} | 
					
						
							|  |  |  |   {{- $class := cond (eq $level 0) "font-semibold" (printf "ltr:pl-%d rtl:pr-%d" $padding $padding) -}} | 
					
						
							| 
									
										
										
										
											2023-07-29 17:41:25 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-14 21:56:26 +01:00
										 |  |  |   {{- range $headings }} | 
					
						
							|  |  |  |     {{- if .Title }} | 
					
						
							| 
									
										
										
										
											2023-07-29 17:41:25 +01:00
										 |  |  |       <li class="my-2 scroll-my-6 scroll-py-6"> | 
					
						
							|  |  |  |         <a class="{{ $class }} inline-block text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-300 contrast-more:text-gray-900 contrast-more:underline contrast-more:dark:text-gray-50 w-full break-words" href="#{{ anchorize .ID }}"> | 
					
						
							| 
									
										
										
										
											2023-11-05 05:26:00 -05:00
										 |  |  |           {{- .Title | safeHTML | plainify | htmlUnescape }} | 
					
						
							| 
									
										
										
										
											2023-07-29 17:41:25 +01:00
										 |  |  |         </a> | 
					
						
							|  |  |  |       </li> | 
					
						
							| 
									
										
										
										
											2023-08-14 21:56:26 +01:00
										 |  |  |     {{- end -}} | 
					
						
							|  |  |  |     {{- with .Headings -}} | 
					
						
							| 
									
										
										
										
											2023-08-09 22:57:43 +01:00
										 |  |  |       {{ template "toc-subheading" (dict "headings" . "level" (add $level 1)) }} | 
					
						
							| 
									
										
										
										
											2023-08-14 21:56:26 +01:00
										 |  |  |     {{- end -}} | 
					
						
							| 
									
										
										
										
											2023-07-29 17:41:25 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-14 21:56:26 +01:00
										 |  |  |   {{- end -}} | 
					
						
							| 
									
										
										
										
											2023-07-29 17:41:25 +01:00
										 |  |  | {{- end -}} |