fix: Gitea homepage tile URLs — strip subdomain to get base domain
Some checks failed
Deploy / build-scan-report (push) Failing after 2m39s
Package Supply Chain / pkg-supply-chain (push) Successful in 1m20s
CI / skinny-install (api) (push) Successful in 1m9s
CI / lint-test (push) Failing after 3m25s
CI / skinny-install (aco) (push) Successful in 1m14s
CI / skinny-install (bcda) (push) Successful in 1m24s
CI / skinny-install (bib) (push) Successful in 1m17s
CI / skinny-install (conf) (push) Successful in 58s
CI / skinny-install (opps) (push) Successful in 1m20s
CI / skinny-install (perf) (push) Successful in 1m13s
CI / skinny-install (bls) (push) Successful in 1m4s
CI / skinny-install (ccw) (push) Successful in 1m12s
CI / skinny-install (cms) (push) Successful in 1m11s
CI / skinny-install (cli) (push) Successful in 1m29s
CI / skinny-install (pfs) (push) Successful in 1m15s
CI / skinny-install (rex) (push) Successful in 1m5s

The JS was using `parts.length > 3` which only stripped the subdomain
for 4+ part hostnames. On gitea.fhirworx.io (3 parts), it kept the
full hostname as base, producing broken URLs like docs.gitea.fhirworx.io.

Fix: use parts.slice(-2) to always extract the last two segments as
the base domain (fhirworx.io).
This commit is contained in:
kert
2026-04-09 22:39:03 -04:00
parent f098c1264c
commit 038be3802d

View File

@@ -291,7 +291,7 @@
<script> <script>
(function() { (function() {
var parts = location.hostname.split('.'); var parts = location.hostname.split('.');
var base = parts.length > 3 ? parts.slice(1).join('.') : location.hostname; var base = parts.length >= 3 ? parts.slice(-2).join('.') : location.hostname;
document.querySelectorAll('.homelab-dashboard [data-subdomain]').forEach(function(el) { document.querySelectorAll('.homelab-dashboard [data-subdomain]').forEach(function(el) {
var sub = el.dataset.subdomain; var sub = el.dataset.subdomain;
var path = el.dataset.path || ''; var path = el.dataset.path || '';