Skip to content

Commit

Permalink
Merge pull request #23 from bur3ku/hugo
Browse files Browse the repository at this point in the history
  • Loading branch information
jackyzha0 authored Oct 27, 2021
2 parents 03bb3a3 + 1fc2da4 commit 806d11f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions layouts/_default/_markup/render-link.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{$trimmed := strings.TrimSuffix ".md" (.Destination | safeURL)}}
{{$trimmed = replace $trimmed "%20" "-"}}
{{$external := strings.HasPrefix $trimmed "http" }}
{{ if $external }}
<a href="{{ $trimmed }}" rel="noopener">{{ .Text | safeHTML }}</a>
Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h3>Table of Contents</h3>
{{ .TableOfContents }}
</aside>
{{end}}
{{- .Content -}}
{{.Content}}
</article>
{{partial "footer.html" .}}
</div>
Expand Down
2 changes: 1 addition & 1 deletion layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ <h3>Table of Contents</h3>
{{partial "footer.html" .}}
</div>
</body>

</html>

9 changes: 6 additions & 3 deletions layouts/partials/backlinks.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ <h3>Backlinks</h3>
{{$inbound := index $.Site.Data.linkIndex.index.backlinks $curPage}}
{{if $inbound}}
{{- range $inbound -}}
<li>
<a href="{{index . "source"}}">{{index . "source"}}</a>
</li>
{{$src := index . "source"}}
{{$src = replace $src " " "-"}}

<li>
<a href="{{$src}}">{{index . "source"}}</a>
</li>
{{- end -}}
{{else}}
<li>
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/graph.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ <h3>Interactive Graph</h3>
.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")
Expand Down Expand Up @@ -184,7 +184,7 @@ <h3>Interactive Graph</h3>
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));
Expand Down

0 comments on commit 806d11f

Please sign in to comment.