Skip to content

Commit 4fb932f

Browse files
committed
fix: base path
1 parent 8590ad3 commit 4fb932f

2 files changed

Lines changed: 1 addition & 10 deletions

File tree

app/liturgical-calendar/app.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ const LITS_URL = 'calendar.lits'
2424
const KAL_ENGINE_OK = 0
2525
const KAL_ERR_BUILD_ID_MISMATCH = -22
2626

27-
// Base path résolu depuis <base href> — patché par index.html sur GitHub Pages projet.
28-
// Vaut '/' dans tous les autres environnements.
29-
const BASE_PATH = `/app/liturgical-calendar/`
27+
const BASE_PATH = new URL(document.baseURI).pathname
3028

3129
// ── Lookup tables (miroir de types.rs) ───────────────────────────────────────
3230

app/liturgical-calendar/index.html

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,7 @@
1515
<link rel="mask-icon" href="/favicons/safari-pinned-tab.svg" color="#5bbad5" />
1616
<link rel="stylesheet" href="main.css" media="screen" />
1717
<script>
18-
// 1. Corrige <base href> sur GitHub Pages projet (/repo-name/).
19-
// 2. Restaure le path sauvegardé par 404.html (redirect SPA).
20-
// Synchrone : doit précéder tout module JS.
2118
;(function () {
22-
if (/\.github\.io$/.test(location.hostname)) {
23-
var m = location.pathname.match(/^(\/[^/]+\/)/)
24-
if (m) document.querySelector('base').href = m[1]
25-
}
2619
var redirect = sessionStorage.getItem('spa_redirect')
2720
if (redirect) {
2821
sessionStorage.removeItem('spa_redirect')

0 commit comments

Comments
 (0)