We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 99537c2 commit c0c061cCopy full SHA for c0c061c
lib/assets/javascripts/_modules/search.js
@@ -151,8 +151,9 @@
151
var content = s.processContent(result.content, query)
152
output += '<li class="search-result">'
153
output += '<h3 class="search-result__title">'
154
- var url = result.url.startsWith('/') ? result.url.slice(1) : result.url
155
- output += '<a href="' + pathToSiteRoot + url + '">'
+ var pagePathWithoutLeadingSlash = result.url.startsWith('/') ? result.url.slice(1) : result.url
+ var url = pathToSiteRoot.startsWith('.') ? pathToSiteRoot + pagePathWithoutLeadingSlash : '/' + pagePathWithoutLeadingSlash
156
+ output += '<a href="' + url + '">'
157
output += result.title
158
output += '</a>'
159
output += '</h3>'
0 commit comments