diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html index 0288029..f37614f 100644 --- a/layouts/_default/_markup/render-link.html +++ b/layouts/_default/_markup/render-link.html @@ -1,4 +1,5 @@ {{$trimmed := strings.TrimSuffix ".md" (.Destination | safeURL)}} +{{$trimmed = replace $trimmed "%20" "-"}} {{$external := strings.HasPrefix $trimmed "http" }} {{ if $external }} {{ .Text | safeHTML }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index c30cd4f..9f6443d 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -19,7 +19,7 @@ {{ .TableOfContents }} {{end}} - {{- .Content -}} + {{.Content}} {{partial "footer.html" .}} diff --git a/layouts/index.html b/layouts/index.html index c30cd4f..ce66744 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -24,5 +24,5 @@ {{partial "footer.html" .}} - + diff --git a/layouts/partials/backlinks.html b/layouts/partials/backlinks.html index 2e97820..744f7e3 100644 --- a/layouts/partials/backlinks.html +++ b/layouts/partials/backlinks.html @@ -6,9 +6,12 @@ {{$inbound := index $.Site.Data.linkIndex.index.backlinks $curPage}} {{if $inbound}} {{- range $inbound -}} -
  • - {{index . "source"}} -
  • + {{$src := index . "source"}} + {{$src = replace $src " " "-"}} + +
  • + {{index . "source"}} +
  • {{- end -}} {{else}}
  • diff --git a/layouts/partials/graph.html b/layouts/partials/graph.html index 0e9684d..d529e8d 100644 --- a/layouts/partials/graph.html +++ b/layouts/partials/graph.html @@ -126,7 +126,7 @@ .attr("fill", color) .style("cursor", "pointer") .on("click", (_, d) => { - window.location.href = {{.Site.BaseURL}} + d.id; + window.location.href = {{.Site.BaseURL}} + d.id.replace(" ", "-").replace("%20", "-"); }) .on("mouseover", function (_, d) { d3.selectAll(".node") @@ -184,7 +184,7 @@ const labels = graphNode.append("text") .attr("dx", 12) .attr("dy", ".35em") - .text((d) => d.id) + .text((d) => encodeURI(d.id)) .style("opacity", 0) .style("pointer-events", "none") .call(drag(simulation));