Merge pull request 'fix path generation' (#8) from fix-link into main
All checks were successful
/ build (push) Successful in 28s
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:
commit
1a28b3f62a
2 changed files with 8 additions and 1 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
import Footer from "../components/Footer.astro"
|
import Footer from "../components/Footer.astro"
|
||||||
import Layout from "../layouts/Layout.astro"
|
import Layout from "../layouts/Layout.astro"
|
||||||
import {Calendar, ChevronDown} from "@lucide/astro"
|
import {Calendar, ChevronDown} from "@lucide/astro"
|
||||||
|
import path from "../utils/path.ts"
|
||||||
---
|
---
|
||||||
|
|
||||||
<Layout>
|
<Layout>
|
||||||
|
|
@ -66,7 +67,7 @@ import {Calendar, ChevronDown} from "@lucide/astro"
|
||||||
Office-Programm, oder die eigene Cloud.<br><br>
|
Office-Programm, oder die eigene Cloud.<br><br>
|
||||||
Wenn ihr euch mit eurer Stadtteil-Initiative, Computer-Stammtisch oder
|
Wenn ihr euch mit eurer Stadtteil-Initiative, Computer-Stammtisch oder
|
||||||
Aktivisty-Gruppe an den DIDAYS beteiligen möchtet, dann schaut
|
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!
|
Wir freuen uns auf die Zusammenarbeit!
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
6
src/utils/path.ts
Normal file
6
src/utils/path.ts
Normal 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("/")
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue