Skip to content

Commit

Permalink
add pagination to section, fix graph linking
Browse files Browse the repository at this point in the history
  • Loading branch information
jackyzha0 committed Dec 28, 2021
1 parent 1a8cdaa commit efeaf0f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion layouts/_default/section.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ <h1 id="page-title"><a href="{{ .Site.BaseURL }}">{{ .Site.Data.config.page_titl
</header>
<article>
<h1>All {{.Title}}</h1>
{{partial "page-list.html" .Pages.ByLastmod.Reverse }}
{{partial "page-list.html" .Paginator.Pages.ByLastmod.Reverse }}
{{ template "_internal/pagination.html" .}}
</article>
{{partial "contact.html" .}}
</div>
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/graph.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ <h3>Interactive Graph</h3>
.attr("fill", color)
.style("cursor", "pointer")
.on("click", (_, d) => {
window.location.href = {{.Site.BaseURL}} + d.id.replace(" ", "-").replace("%20", "-");
window.location.href = {{.Site.BaseURL}} + decodeURI(d.id).replace(/[\s_]+/g, '-')
})
.on("mouseover", function (_, d) {
d3.selectAll(".node")
Expand Down Expand Up @@ -204,7 +204,7 @@ <h3>Interactive Graph</h3>
const labels = graphNode.append("text")
.attr("dx", 12)
.attr("dy", ".35em")
.text((d) => content[d.id.replace("%20", "-")]?.title || "Untitled")
.text((d) => content[decodeURI(d.id).replace(/[\s_]+/g, '-')]?.title || "Untitled")
.style("opacity", 0)
.style("pointer-events", "none")
.call(drag(simulation));
Expand Down

0 comments on commit efeaf0f

Please sign in to comment.