Jacky Zhao
2022-04-28 3c7ece5405436c85282f156cf387b11d08cc2d87
fix: append trailing slash, fixes #111
3 files modified
6 ■■■■ changed files
assets/js/graph.js 2 ●●● patch | view | raw | blame | history
assets/js/search.js 2 ●●● patch | view | raw | blame | history
layouts/partials/backlinks.html 2 ●●● patch | view | raw | blame | history
assets/js/graph.js
@@ -127,7 +127,7 @@
    .attr("fill", color)
    .style("cursor", "pointer")
    .on("click", (_, d) => {
      window.location.href = baseUrl + '/' + decodeURI(d.id).replace(/\s+/g, '-')
      window.location.href = `${baseUrl}/${decodeURI(d.id).replace(/\s+/g, '-')}/`
    })
    .on("mouseover", function(_, d) {
      d3.selectAll(".node")
assets/js/search.js
@@ -131,7 +131,7 @@
  }
  const redir = (id, term) => {
    window.location.href = BASE_URL + `${id}#:~:text=${encodeURIComponent(term)}`
    window.location.href = `${BASE_URL}${id}#:~:text=${encodeURIComponent(term)}/`
  }
  const formatForDisplay = id => ({
layouts/partials/backlinks.html
@@ -9,7 +9,7 @@
    {{if $inbound}}
    {{$cleanedInbound := apply (apply $inbound "index" "." "source") "replace" "." " " "-"}}
    {{- range $cleanedInbound | uniq -}}
      {{$l := printf "%s%s" $host .}}
      {{$l := printf "%s%s/" $host .}}
      {{with (index $contentTable .)}}
      <li>
          <a href="{{$l}}">{{index (index . "title")}}</a>