Merge pull request 'fix path generation' (#8) from fix-link into main
All checks were successful
/ build (push) Successful in 28s

Reviewed-on: #8
Reviewed-by: stb <stb@noreply.git.hamburg.ccc.de>
This commit is contained in:
kritzl 2026-07-11 14:56:55 +02:00
commit 1a28b3f62a
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("/")
}