fix path generation
All checks were successful
/ build (pull_request) Successful in 39s
/ cleanup-staging (pull_request) Successful in 3s

This commit is contained in:
kritzl 2026-07-11 08:36:41 +02:00
commit 89f19e25f8
Signed by: kritzl
SSH key fingerprint: SHA256:5BmINP9VjZWaUk5Z+2CTut1KFhwLtd0ZynMekKbtViM
2 changed files with 8 additions and 1 deletions

View file

@ -2,6 +2,7 @@
import Footer from "../components/Footer.astro"
import Layout from "../layouts/Layout.astro"
import {Calendar, ChevronDown} from "@lucide/astro"
import path from "../utils/path.ts"
---
<Layout>
@ -66,7 +67,7 @@ import {Calendar, ChevronDown} from "@lucide/astro"
Office-Programm, oder die eigene Cloud.<br><br>
Wenn ihr euch mit eurer Stadtteil-Initiative, Computer-Stammtisch oder
Aktivisty-Gruppe an den DIDAYS beteiligen möchtet, dann schaut
doch <a class="link" href={`${import.meta.env.BASE_URL}/einladung-initiativen`}>in unsere Einladung an Gruppen</a>.
doch <a class="link" href={path(import.meta.env.BASE_URL, 'einladung-initiativen')}>in unsere Einladung an Gruppen</a>.
Wir freuen uns auf die Zusammenarbeit!
</p>
</div>

6
src/utils/path.ts Normal file
View file

@ -0,0 +1,6 @@
export default function path(...components: Array<string>){
return '/' + components
.map(component => component.trim().replace(/(^[\/]*|[\/]*$)/g, ''))
.filter(component => component.length > 0)
.join("/")
}