Add support for mapcomplete.osm.be/themename and not only mapcomplete.osm.be/themename.html

This commit is contained in:
Pieter Vander Vennet 2020-12-18 12:16:56 +01:00
parent 76b83acf01
commit 201e485238

View file

@ -55,7 +55,10 @@ if (location.hostname === "localhost" || location.hostname === "127.0.0.1") {
const path = window.location.pathname.split("/").slice(-1)[0];
if (path !== "index.html" && path !== "") {
defaultLayout = path.substr(0, path.length - 5);
defaultLayout = path;
if(path.endsWith(".html")){
defaultLayout = path.substr(0, path.length - 5);
}
console.log("Using layout", defaultLayout);
}
defaultLayout = QueryParameters.GetQueryParameter("layout", defaultLayout,"The layout to load into MapComplete").data;