Fix examples page and de workshop img
This commit is contained in:
parent
ff45baba2c
commit
93c5eeb99e
2 changed files with 6 additions and 3 deletions
|
|
@ -7,7 +7,7 @@ import { MiniRepl } from '../../../docs/MiniRepl';
|
||||||
|
|
||||||
# Willkommen
|
# Willkommen
|
||||||
|
|
||||||
<img src="/icons/strudel_icon.png" className="w-32 animate-pulse md:float-right ml-8" />
|
<div className="w-32 animate-pulse md:float-right ml-8"></div>
|
||||||
|
|
||||||
Willkommen zum Strudel Workshop!
|
Willkommen zum Strudel Workshop!
|
||||||
Du hast den richtigen Ort gefunden wenn du lernen möchtest wie man mit Code Musik macht.
|
Du hast den richtigen Ort gefunden wenn du lernen möchtest wie man mit Code Musik macht.
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,9 @@ import * as tunes from '../../../src/repl/tunes.mjs';
|
||||||
import HeadCommon from '../../components/HeadCommon.astro';
|
import HeadCommon from '../../components/HeadCommon.astro';
|
||||||
|
|
||||||
import { getMetadata } from '../metadata_parser';
|
import { getMetadata } from '../metadata_parser';
|
||||||
|
|
||||||
|
const { BASE_URL } = import.meta.env;
|
||||||
|
const baseNoTrailing = BASE_URL.endsWith('/') ? BASE_URL.slice(0, -1) : BASE_URL;
|
||||||
---
|
---
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
|
|
@ -12,11 +15,11 @@ import { getMetadata } from '../metadata_parser';
|
||||||
<div class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-2 p-2 select-none">
|
<div class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-2 p-2 select-none">
|
||||||
{
|
{
|
||||||
Object.entries(tunes).map(([name, tune]) => (
|
Object.entries(tunes).map(([name, tune]) => (
|
||||||
<a class="rounded-md bg-slate-900 hover:bg-slate-700 cursor-pointer relative" href={`./#${btoa(tune)}`}>
|
<a class="rounded-md bg-slate-900 hover:bg-slate-700 cursor-pointer relative" href={`${baseNoTrailing}/#${btoa(tune)}`}>
|
||||||
<div class="absolute w-full h-full flex justify-center items-center">
|
<div class="absolute w-full h-full flex justify-center items-center">
|
||||||
<span class="bg-slate-800 p-2 rounded-md text-white">{getMetadata(tune)['title'] || name}</span>
|
<span class="bg-slate-800 p-2 rounded-md text-white">{getMetadata(tune)['title'] || name}</span>
|
||||||
</div>
|
</div>
|
||||||
<img src={`./img/example-${name}.png`} />
|
<img src={`${baseNoTrailing}/img/example-${name}.png`} />
|
||||||
</a>
|
</a>
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue