Skip to content

Commit 1960f69

Browse files
committed
next attempt at fixing path issue
1 parent 6df133c commit 1960f69

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

docs/metadata_query.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,13 @@ hide:
125125

126126
<script>
127127
let metadata = {};
128+
// Get the base URL of the site (without the current page or subfolder)
129+
const baseURL = window.location.origin + window.location.pathname.replace(/\/[^\/]*\/?$/, '');
128130

129-
fetch(`${window.location.origin}/experiment_metadata/combined_metadata.json`)
131+
// Build the path to your JSON
132+
const json_path = `${baseURL}/experiment_metadata/combined_metadata.json`;
133+
134+
fetch(json_path)
130135
.then(response => {
131136
if (!response.ok) throw new Error('File not found');
132137
return response.json();

0 commit comments

Comments
 (0)