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>
|
<h3>Backlinks</h3>
|
||||||
<ul class="backlinks">
|
<ul class="backlinks">
|
||||||
{{$url := urls.Parse .Site.BaseURL }}
|
{{$curPage := strings.TrimRight "/" .Page.RelPermalink }}
|
||||||
{{$host := strings.TrimRight "/" $url.Path }}
|
|
||||||
{{$curPage := strings.TrimPrefix $host (strings.TrimRight "/" .Page.RelPermalink) }}
|
|
||||||
{{$inbound := index $.Site.Data.linkIndex.index.backlinks $curPage}}
|
{{$inbound := index $.Site.Data.linkIndex.index.backlinks $curPage}}
|
||||||
{{$contentTable := $.Site.Data.contentIndex}}
|
|
||||||
{{if $inbound}}
|
{{if $inbound}}
|
||||||
{{$cleanedInbound := apply (apply $inbound "index" "." "source") "replace" "." " " "-"}}
|
{{- range $inbound -}}
|
||||||
{{- range $cleanedInbound | uniq -}}
|
<li>
|
||||||
<li>
|
<a href="{{index . "source"}}">{{ replace (index . "source") "/notes/" "" }}</a>
|
||||||
<a href="{{.}}">{{index (index $contentTable .) "title"}}</a>
|
</li>
|
||||||
</li>
|
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{else}}
|
{{else}}
|
||||||
<li>
|
<li>
|
||||||
No backlinks found
|
No backlinks found
|
||||||
</li>
|
</li>
|
||||||
{{end}}
|
{{end}}
|
||||||
</ul>
|
</ul>
|
||||||
@ -201,7 +201,7 @@
|
|||||||
const labels = graphNode.append("text")
|
const labels = graphNode.append("text")
|
||||||
.attr("dx", 12)
|
.attr("dx", 12)
|
||||||
.attr("dy", ".35em")
|
.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("opacity", 0)
|
||||||
.style("pointer-events", "none")
|
.style("pointer-events", "none")
|
||||||
.call(drag(simulation));
|
.call(drag(simulation));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user