Skip to content

Commit 1ece545

Browse files
committed
Use whole entry for generating navigation
1 parent b8ea65b commit 1ece545

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

compile-markdown.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,7 @@ for (const entry of db) {
208208
}
209209

210210
// Push file entry to category.
211-
categories[category].files.push({
212-
name: entry.title,
213-
path: file
214-
});
211+
categories[category].files.push(entry);
215212
}
216213

217214
// Generate navigation.
@@ -222,20 +219,19 @@ for (const [_, category] of Object.entries(categories)) {
222219

223220
for (const file of category.files) {
224221
// Current file, highlighted in bold.
225-
if (input == `src/submodules/${repo}/${prefix}${file.path}`) {
222+
if (input === file.path) {
226223
navHtml += /* HTML */ `
227224
<li id="dei-currentpage">
228-
<b>${file.name}</b>
225+
<b>${file.title}</b>
229226
<br>
230227
</li>
231228
`;
232229
}
233230
// Other files.
234231
else {
235-
const path = file.path.substring(0, file.path.length - 3);
236232
navHtml += /* HTML */ `
237233
<li>
238-
<a href="/${repo}/${path}">${file.name}</a>
234+
<a href="${file.href}">${file.title}</a>
239235
<br>
240236
</li>
241237
`;

0 commit comments

Comments
 (0)