rename parseCarte → parseMap, fix marker icon size, remove testing checklist

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
isUnknown 2026-02-26 15:10:14 +01:00
parent 41fbe71a1f
commit 0c682c78c0
4 changed files with 31 additions and 303 deletions

View file

@ -108,7 +108,7 @@ function parseBlocks($blocksField, $page) {
case 'map':
$mapPage = $block->map()->toPages()->first();
if ($mapPage) {
$blockData['content'] = parseCarte($mapPage);
$blockData['content'] = parseMap($mapPage);
} else {
$blockData['content'] = [
'map' => $block->map()->value()
@ -141,7 +141,7 @@ function parseChapter($chapter) {
}
/**
* Parse un marqueur
* Parse a marker
*/
function parseMarker($marker) {
return [
@ -154,25 +154,25 @@ function parseMarker($marker) {
}
/**
* Parse une carte
* Parse a map
*/
function parseCarte($carte) {
function parseMap($map) {
$markers = [];
foreach ($carte->children()->listed() as $child) {
foreach ($map->children()->listed() as $child) {
if ($child->intendedTemplate()->name() === 'marker') {
$markers[] = parseMarker($child);
}
}
$staticImage = $carte->file('map-static.png');
$staticImage = $map->file('map-static.png');
return [
'id' => $carte->id(),
'uuid' => $carte->uuid()->toString(),
'id' => $map->id(),
'uuid' => $map->uuid()->toString(),
'template' => 'carte',
'title' => $carte->title()->value(),
'slug' => $carte->slug(),
'tags' => $carte->tags()->isNotEmpty() ? $carte->tags()->split() : [],
'title' => $map->title()->value(),
'slug' => $map->slug(),
'tags' => $map->tags()->isNotEmpty() ? $map->tags()->split() : [],
'image' => $staticImage ? $staticImage->url() : null,
'intro' => resolveImagesInHtml($carte->text()->value(), $carte),
'intro' => resolveImagesInHtml($map->text()->value(), $map),
'markers' => $markers
];
}
@ -187,7 +187,7 @@ function parseGeoformat($geoformat) {
if ($template === 'chapter') {
$children[] = parseChapter($child);
} elseif ($template === 'map') {
$children[] = parseCarte($child);
$children[] = parseMap($child);
}
}
@ -228,7 +228,7 @@ foreach ($page->children()->listed() as $child) {
if ($template === 'geoformat') {
$data['children'][] = parseGeoformat($child);
} elseif ($template === 'map') {
$data['children'][] = parseCarte($child);
$data['children'][] = parseMap($child);
}
}