diff --git a/CHANGELOG.md b/CHANGELOG.md index b9c86f84..28f4f74e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] +### Fixed + +- Search not working when `baseURL` does not end with a forward slash ([#224](https://github.com/jpanther/congo/pull/224)) + ## [2.2.2] - 2022-06-16 ### Added diff --git a/assets/js/search.js b/assets/js/search.js index c15de8fe..49b4d8e7 100644 --- a/assets/js/search.js +++ b/assets/js/search.js @@ -107,6 +107,7 @@ function fetchJSON(path, callback) { function buildIndex() { var baseURL = wrapper.getAttribute("data-url"); + baseURL = baseURL.replace(/\/?$/, '/'); fetchJSON(baseURL + "index.json", function (data) { var options = { shouldSort: true,