From 3a9e98145d51a262e7dadd24f261f68349fa7d83 Mon Sep 17 00:00:00 2001
From: weru <fromweru@gmail.com>
Date: Thu, 09 Feb 2023 16:24:50 +0000
Subject: [PATCH] fix baseurl construction #94
---
assets/js/variables.js | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/assets/js/variables.js b/assets/js/variables.js
index ed8e812..ef9fa50 100644
--- a/assets/js/variables.js
+++ b/assets/js/variables.js
@@ -7,7 +7,9 @@
const menu = 'menu';
const active = 'active';
// root_url must end with '/' for relative URLs to work properly
-const root_url = '{{ strings.TrimSuffix "/" .Site.BaseURL }}/';
+let root_url = '{{ strings.TrimSuffix "/" .Site.BaseURL }}/';
+root_url = root_url.startsWith('http') ? root_url : window.location.origin;
+
const search_field_class = '.search_field';
const search_class = '.search';
const go_back_class = 'button_back';
--
Gitblit v1.10.0