Skip to content

Commit 921c745

Browse files
committed
Do not assume addresses end with .html
1 parent 5c8ff8f commit 921c745

File tree

4 files changed

+6
-60
lines changed

4 files changed

+6
-60
lines changed

assets/js/handlebars/helpers.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,8 @@ Handlebars.registerHelper('isEmptyArray', function (entry, options) {
6464

6565
Handlebars.registerHelper('isLocal', function (nodeId, options) {
6666
const pathSuffix = window.location.pathname.split('/').pop()
67-
const nodePage = nodeId + '.html'
6867

69-
if (nodePage === pathSuffix) {
68+
if (pathSuffix === nodeId + '.html' || pathSuffix === nodeId) {
7069
return options.fn(this)
7170
} else {
7271
return options.inverse(this)

assets/js/search-page.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ const SEARCH_CONTAINER_SELECTOR = '#search'
1515
* Activates only on the `/search.html` page.
1616
*/
1717
export function initialize () {
18-
if (window.location.pathname.endsWith('/search.html')) {
18+
const pathname = window.location.pathname
19+
if (pathname.endsWith('/search.html') || pathname.endsWith('/search')) {
1920
const query = getQueryParamByName('q')
2021
search(query)
2122
}

assets/js/sidebar/sidebar-list.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ function renderSidebarNodeList (nodesByType, type) {
7575
clearCurrentSectionElement(previousSection)
7676
}
7777

78-
if (anchor.matches('.expand') && anchor.pathname === window.location.pathname) {
78+
if (anchor.matches('.expand') &&
79+
(anchor.pathname === window.location.pathname ||
80+
anchor.pathname === window.location.pathname + '.html')) {
7981
openListItem(listItem)
8082
}
8183
})

formatters/html/dist/html-BHYOTRCH.js

-56
This file was deleted.

0 commit comments

Comments
 (0)