1<?php 2 3declare(strict_types=1); 4 5use Fisharebest\Webtrees\GedcomRecord; 6use Fisharebest\Webtrees\Http\RequestHandlers\TreePage; 7use Fisharebest\Webtrees\Tree; 8use Illuminate\Support\Collection; 9 10/** 11 * @var Collection<GedcomRecord> $records 12 * @var string $sitemap_xsl 13 * @var Tree $tree 14 */ 15 16?> 17<<?php /* Beware short open tags in PHP <8.0 */ ?>?xml version="1.0" encoding="UTF-8"?> 18<?xml-stylesheet type="text/xsl" href="<?= e($sitemap_xsl) ?>"?> 19<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"> 20 <?php foreach ($records as $record) : ?> 21 <url> 22 <loc><?= e($record->url()) ?></loc> 23 <?php if ($record->facts(['CHAN'])->isNotEmpty()) : ?> 24 <lastmod><?= $record->facts(['CHAN'])->first()->date()->minimumDate()->Format('%Y-%m-%d') ?></lastmod> 25 <?php endif ?> 26 </url> 27 <?php endforeach ?> 28 29 <?php if ($records->isEmpty()) : ?> 30 <url> 31 <loc><?= e(route(TreePage::class, ['tree' => $tree->name()])) ?></loc> 32 </url> 33 <?php endif ?> 34</urlset> 35 36 37