🔀 Merge pull request #224 from eliaserland:dev

Fixes #223 - Ensure trailing forward slash in `baseURL` for site search
pull/231/head
James Panther 2022-06-22 12:04:32 +10:00 committed by GitHub
commit edd8ab5bcb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
## [Unreleased] ## [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 ## [2.2.2] - 2022-06-16
### Added ### Added

View File

@ -107,6 +107,7 @@ function fetchJSON(path, callback) {
function buildIndex() { function buildIndex() {
var baseURL = wrapper.getAttribute("data-url"); var baseURL = wrapper.getAttribute("data-url");
baseURL = baseURL.replace(/\/?$/, '/');
fetchJSON(baseURL + "index.json", function (data) { fetchJSON(baseURL + "index.json", function (data) {
var options = { var options = {
shouldSort: true, shouldSort: true,