mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-24 21:34:06 -06:00
Fixed backlinks.html + Prettified graph.html
This commit is contained in:
parent
fa3bc3de92
commit
fbc634884b
@ -1,20 +1,16 @@
|
||||
<h3>Backlinks</h3>
|
||||
<ul class="backlinks">
|
||||
{{$url := urls.Parse .Site.BaseURL }}
|
||||
{{$host := strings.TrimRight "/" $url.Path }}
|
||||
{{$curPage := strings.TrimPrefix $host (strings.TrimRight "/" .Page.RelPermalink) }}
|
||||
{{$curPage := strings.TrimRight "/" .Page.RelPermalink }}
|
||||
{{$inbound := index $.Site.Data.linkIndex.index.backlinks $curPage}}
|
||||
{{$contentTable := $.Site.Data.contentIndex}}
|
||||
{{if $inbound}}
|
||||
{{$cleanedInbound := apply (apply $inbound "index" "." "source") "replace" "." " " "-"}}
|
||||
{{- range $cleanedInbound | uniq -}}
|
||||
<li>
|
||||
<a href="{{.}}">{{index (index $contentTable .) "title"}}</a>
|
||||
</li>
|
||||
{{- range $inbound -}}
|
||||
<li>
|
||||
<a href="{{index . "source"}}">{{ replace (index . "source") "/notes/" "" }}</a>
|
||||
</li>
|
||||
{{- end -}}
|
||||
{{else}}
|
||||
<li>
|
||||
No backlinks found
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</ul>
|
||||
@ -201,7 +201,7 @@
|
||||
const labels = graphNode.append("text")
|
||||
.attr("dx", 12)
|
||||
.attr("dy", ".35em")
|
||||
.text((d) => content[decodeURI(d.id).replace(/\s+/g, '-')]?.title || "Untitled")
|
||||
.text((d) => d.id.replace(/(\/notes\/)/g, '').replace(/\s+/g, '-')) //content[decodeURI(d.id).replace(/\s+/g, '-')]?.title || "Untitled")
|
||||
.style("opacity", 0)
|
||||
.style("pointer-events", "none")
|
||||
.call(drag(simulation));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user