feat: dynamically fetch indices
This commit is contained in:
		
							parent
							
								
									4587b13360
								
							
						
					
					
						commit
						fcd5d2807d
					
				
					 10 changed files with 205 additions and 175 deletions
				
			
		| 
						 | 
				
			
			@ -3,8 +3,9 @@
 | 
			
		|||
    {{$url := urls.Parse .Site.BaseURL }}
 | 
			
		||||
    {{$host := strings.TrimRight "/" $url.Path }}
 | 
			
		||||
    {{$curPage := strings.TrimPrefix $host (strings.TrimRight "/" .Page.RelPermalink) }}
 | 
			
		||||
    {{$inbound := index $.Site.Data.linkIndex.index.backlinks $curPage}}
 | 
			
		||||
    {{$contentTable := $.Site.Data.contentIndex}}
 | 
			
		||||
    {{$linkIndex := getJSON "/static/linkIndex.json"}}
 | 
			
		||||
    {{$inbound := index $linkIndex.index.backlinks $curPage}}
 | 
			
		||||
    {{$contentTable := getJSON "/static/contentIndex.json"}}
 | 
			
		||||
    {{if $inbound}}
 | 
			
		||||
    {{$cleanedInbound := apply (apply $inbound "index" "." "source") "replace" "." " " "-"}}
 | 
			
		||||
    {{- range $cleanedInbound | uniq -}}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue