| 
									
										
										
										
											2023-10-21 16:00:39 -04:00
										 |  |  | {{/* FlexSearch Index Data */}} | 
					
						
							|  |  |  | {{- $indexType := site.Params.search.flexsearch.index | default "content" -}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | {{- if not (in (slice "content" "summary" "heading" "title" ) $indexType) -}} | 
					
						
							|  |  |  |   {{- errorf "unknown flexsearch index type: %s" $indexType -}} | 
					
						
							|  |  |  | {{- end -}} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-04 01:11:31 +01:00
										 |  |  | {{- $pages := where .Site.Pages "Kind" "in" (slice "page" "section") -}} | 
					
						
							|  |  |  | {{- $pages = where $pages "Params.excludeSearch" "!=" true -}} | 
					
						
							| 
									
										
										
										
											2024-10-21 22:22:56 +01:00
										 |  |  | {{- $pages = where $pages "Content" "!=" "" -}} | 
					
						
							| 
									
										
										
										
											2023-08-04 01:11:31 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-06 01:06:32 +01:00
										 |  |  | {{- $output := dict -}} | 
					
						
							| 
									
										
										
										
											2023-08-04 01:11:31 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-06 01:06:32 +01:00
										 |  |  | {{- range $index, $page := $pages -}} | 
					
						
							|  |  |  |   {{- $pageTitle := $page.LinkTitle | default $page.File.BaseFileName -}} | 
					
						
							|  |  |  |   {{- $pageLink := $page.RelPermalink -}} | 
					
						
							| 
									
										
										
										
											2023-10-21 16:00:39 -04:00
										 |  |  |   {{- $data := partial "utils/fragments" (dict "context" $page "type" $indexType) -}} | 
					
						
							| 
									
										
										
										
											2023-08-06 01:06:32 +01:00
										 |  |  |   {{- $output = $output | merge (dict $pageLink (dict "title" $pageTitle "data" $data)) -}} | 
					
						
							|  |  |  | {{- end -}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | {{- $output | jsonify -}} |