{{- $url_struct := urls.Parse .Destination -}} {{/* Ignore anchor links to other sections of the same page. */}} {{- if not (or $url_struct.IsAbs (strings.HasPrefix $url_struct.String "#")) }} {{- $page_path := strings.TrimPrefix "./" $url_struct.Path -}} {{- with .PageInner.GetPage $page_path }} {{- $page := dict "date" ($.Page.Date.UTC.Format "2006-01-02T15:04:05-07:00") "linkTitle" $.Page.LinkTitle "relPermalink" $.Page.RelPermalink }} {{- $backlink := dict "page" $page "links_to" .RelPermalink }} {{- site.Home.Store.Add "backlinks" (slice $backlink) }} {{- end }} {{- end }}