Skip to content

Commit

Permalink
directory/index.md creates the directory/ URL.
Browse files Browse the repository at this point in the history
  • Loading branch information
Fil committed Nov 15, 2023
1 parent 1b6b12b commit 905ed8b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ ${parseResult.html}</main>
function renderListItem(p: Page, path: string): string {
return `<li class="observablehq-link${
p.path === path ? " observablehq-link-active" : ""
}"><a href="${escapeDoubleQuoted(relativeUrl(path, p.path.replace(/\/index$/, "") || "/"))}">${escapeData(
}"><a href="${escapeDoubleQuoted(relativeUrl(path, p.path.replace(/\/index$/, "/") || "/"))}">${escapeData(
p.name
)}</a></li>`;
}
Expand Down
2 changes: 1 addition & 1 deletion test/output/build/multi/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<input id="observablehq-sidebar-toggle" type="checkbox">
<nav id="observablehq-sidebar">
<ol>
<li class="observablehq-link"><a href="./subsection">Sub-Section</a></li>
<li class="observablehq-link"><a href="./subsection/">Sub-Section</a></li>
<li class="observablehq-link observablehq-link-active"><a href="./">Multi test</a></li>
</ol>
</nav>
Expand Down
2 changes: 1 addition & 1 deletion test/output/build/multi/subsection/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<input id="observablehq-sidebar-toggle" type="checkbox">
<nav id="observablehq-sidebar">
<ol>
<li class="observablehq-link observablehq-link-active"><a href="../subsection">Sub-Section</a></li>
<li class="observablehq-link observablehq-link-active"><a href="./">Sub-Section</a></li>
<li class="observablehq-link"><a href="../">Multi test</a></li>
</ol>
</nav>
Expand Down

0 comments on commit 905ed8b

Please sign in to comment.