Skip to content

Commit c371e30

Browse files
committed
Avoid hardcoded paths
1 parent 72c130f commit c371e30

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

layouts/_default/baseof.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<title>{{ .Title }} - {{ .Site.Title }}</title>
7-
<link rel="stylesheet" href="/css/style.css">
7+
<link rel="stylesheet" href="{{ "css/style.css" | relURL }}">
8+
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>📊</text></svg>">
89
</head>
910
<body>
1011
<div id="app">
1112
{{ block "main" . }}{{ end }}
1213
</div>
13-
<script src="/js/trajectory-viewer.js"></script>
14+
<script src="{{ "js/trajectory-viewer.js" | relURL }}"></script>
1415
</body>
1516
</html>

static/js/trajectory-viewer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ class TrajectoryViewer {
147147
const foundInstances = [];
148148

149149
for (const instanceName of instancePatterns) {
150-
const trajPath = `/data/${experimentName}/${instanceName}/${instanceName}.traj.json`;
150+
const trajPath = `data/${experimentName}/${instanceName}/${instanceName}.traj.json`;
151151

152152
try {
153153
const response = await fetch(trajPath, { method: 'HEAD' });
@@ -384,7 +384,7 @@ class TrajectoryViewer {
384384
loadingIndicator.style.display = 'block';
385385

386386
try {
387-
const trajPath = `/data/${this.currentExperiment.name}/${this.currentInstance}/${this.currentInstance}.traj.json`;
387+
const trajPath = `data/${this.currentExperiment.name}/${this.currentInstance}/${this.currentInstance}.traj.json`;
388388
const response = await fetch(trajPath);
389389

390390
if (!response.ok) {
@@ -400,7 +400,7 @@ class TrajectoryViewer {
400400
<div class="error">
401401
<p><strong>Error loading trajectory data:</strong></p>
402402
<p>${error.message}</p>
403-
<p>Path: /data/${this.currentExperiment.name}/${this.currentInstance}/${this.currentInstance}.traj.json</p>
403+
<p>Path: data/${this.currentExperiment.name}/${this.currentInstance}/${this.currentInstance}.traj.json</p>
404404
</div>
405405
`;
406406
} finally {

0 commit comments

Comments
 (0)