From 5b724e6023770d24323df1b5ae68119b4f9347f2 Mon Sep 17 00:00:00 2001
From: Robert Mihaly <rob@mihalyr.com>
Date: Fri, 30 Dec 2022 11:19:14 +0000
Subject: [PATCH] Set rootURL to the site's baseURL
---
assets/js/variables.js | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/assets/js/variables.js b/assets/js/variables.js
index 3a9636c..1b5fd88 100644
--- a/assets/js/variables.js
+++ b/assets/js/variables.js
@@ -4,7 +4,8 @@
const showId = 'show';
const menu = 'menu';
const active = 'active';
-const rootURL = window.location.protocol + "//" + window.location.host;
+// rootURL must end with '/' for relative URLs to work properly
+const rootURL = '{{ strings.TrimSuffix "/" .Site.BaseURL }}/';
const searchFieldClass = '.search_field';
const searchClass = '.search';
const goBackClass = 'button_back';
--
Gitblit v1.10.0