feat: dynamically fetch indices
This commit is contained in:
		
							parent
							
								
									4587b13360
								
							
						
					
					
						commit
						fcd5d2807d
					
				
					 10 changed files with 205 additions and 175 deletions
				
			
		| 
						 | 
				
			
			@ -11,6 +11,8 @@
 | 
			
		|||
    }
 | 
			
		||||
</style>
 | 
			
		||||
<script>
 | 
			
		||||
async function run() {
 | 
			
		||||
  const { index, links, content } = await fetchData()
 | 
			
		||||
  const curPage = {{ strings.TrimRight "/" .Page.Permalink }}.replace({{strings.TrimRight "/" .Site.BaseURL }}, "")
 | 
			
		||||
  const pathColors = {{$.Site.Data.graphConfig.paths}}
 | 
			
		||||
  let depth = {{$.Site.Data.graphConfig.depth}}
 | 
			
		||||
| 
						 | 
				
			
			@ -225,12 +227,15 @@
 | 
			
		|||
      .attr("x1", d => d.source.x)
 | 
			
		||||
      .attr("y1", d => d.source.y)
 | 
			
		||||
      .attr("x2", d => d.target.x)
 | 
			
		||||
      .attr("y2", d => d.target.y);
 | 
			
		||||
      .attr("y2", d => d.target.y)
 | 
			
		||||
    node
 | 
			
		||||
      .attr("cx", d => d.x)
 | 
			
		||||
      .attr("cy", d => d.y);
 | 
			
		||||
      .attr("cy", d => d.y)
 | 
			
		||||
    labels
 | 
			
		||||
      .attr("x", d => d.x)
 | 
			
		||||
      .attr("y", d => d.y);
 | 
			
		||||
      .attr("y", d => d.y)
 | 
			
		||||
  });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
run()
 | 
			
		||||
</script>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue