You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			26 lines
		
	
	
		
			877 B
		
	
	
	
		
			HTML
		
	
			
		
		
	
	
			26 lines
		
	
	
		
			877 B
		
	
	
	
		
			HTML
		
	
<h3>Backlinks</h3>
 | 
						|
<ul class="backlinks">
 | 
						|
    {{$url := urls.Parse .Site.BaseURL }}
 | 
						|
    {{$host := strings.TrimRight "/" $url.Path }}
 | 
						|
    {{$curPage := strings.TrimPrefix $host (strings.TrimRight "/" .Page.RelPermalink)}}
 | 
						|
    {{$linkIndex := getJSON "/assets/indices/linkIndex.json"}}
 | 
						|
    {{$inbound := index $linkIndex.index.backlinks $curPage}}
 | 
						|
    {{$contentTable := getJSON "/assets/indices/contentIndex.json"}}
 | 
						|
    {{if $inbound}}
 | 
						|
    {{$cleanedInbound := apply (apply $inbound "index" "." "source") "replace" "." " " "-"}}
 | 
						|
    {{- range $cleanedInbound | uniq -}}
 | 
						|
      {{$l := printf "%s%s/" $host .}}
 | 
						|
      {{$l = cond (eq $l "//") "/" $l}}
 | 
						|
      {{with (index $contentTable .)}}
 | 
						|
      <li>
 | 
						|
          <a href="{{$l}}">{{index (index . "title")}}</a>
 | 
						|
      </li>
 | 
						|
      {{end}}
 | 
						|
    {{- end -}}
 | 
						|
    {{else}}
 | 
						|
    <li>
 | 
						|
        No backlinks found
 | 
						|
    </li>
 | 
						|
    {{end}}
 | 
						|
</ul>
 |