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 7ccde80 commit babdeb7Copy full SHA for babdeb7
lib/assets/javascripts/_modules/search.js
@@ -153,8 +153,9 @@
153
var content = s.processContent(result.content, query)
154
output += '<li class="search-result">'
155
output += '<h3 class="search-result__title">'
156
- var url = result.url.startsWith('/') ? result.url.slice(1) : result.url
157
- output += '<a href="' + pathToSiteRoot + url + '">'
+ var pagePathWithoutLeadingSlash = result.url.startsWith('/') ? result.url.slice(1) : result.url
+ var url = pathToSiteRoot.startsWith('.') ? pathToSiteRoot + pagePathWithoutLeadingSlash : '/' + pagePathWithoutLeadingSlash
158
+ output += '<a href="' + url + '">'
159
output += result.title
160
output += '</a>'
161
output += '</h3>'
0 commit comments