xref: /webtrees/resources/views/modules/sitemap/sitemap-file-xml.phtml (revision c5a1ffe6052191bbb2bf5b9dea70553826982f1e)
114aabe72SGreg Roach<?php
214aabe72SGreg Roach
314aabe72SGreg Roachdeclare(strict_types=1);
414aabe72SGreg Roach
514aabe72SGreg Roachuse Fisharebest\Webtrees\GedcomRecord;
614aabe72SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\TreePage;
714aabe72SGreg Roachuse Fisharebest\Webtrees\Tree;
814aabe72SGreg Roachuse Illuminate\Support\Collection;
914aabe72SGreg Roach
1014aabe72SGreg Roach/**
11*c5a1ffe6SGreg Roach * @var float                    $priority
1214aabe72SGreg Roach * @var Collection<GedcomRecord> $records
1314aabe72SGreg Roach * @var string                   $sitemap_xsl
1414aabe72SGreg Roach * @var Tree                     $tree
1514aabe72SGreg Roach */
1614aabe72SGreg Roach
1714aabe72SGreg Roach?>
1814aabe72SGreg Roach<<?php /* Beware short open tags in PHP <8.0 */ ?>?xml version="1.0" encoding="UTF-8"?>
190800f024SGreg Roach<<?php /* Beware short open tags in PHP <8.0 */ ?>?xml-stylesheet type="text/xsl" href="<?= e($sitemap_xsl) ?>"?>
2014aabe72SGreg Roach<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">
21*c5a1ffe6SGreg Roach    <url>
22*c5a1ffe6SGreg Roach        <loc><?= e(route(TreePage::class, ['tree' => $tree->name()])) ?></loc>
23*c5a1ffe6SGreg Roach        <priority>1.0</priority>
24*c5a1ffe6SGreg Roach    </url>
2514aabe72SGreg Roach    <?php foreach ($records as $record) : ?>
2614aabe72SGreg Roach        <url>
2714aabe72SGreg Roach            <loc><?= e($record->url()) ?></loc>
28*c5a1ffe6SGreg Roach            <priority><?= e($priority) ?></priority>
2914aabe72SGreg Roach            <?php if ($record->facts(['CHAN'])->isNotEmpty()) : ?>
3014aabe72SGreg Roach                <lastmod><?= $record->facts(['CHAN'])->first()->date()->minimumDate()->Format('%Y-%m-%d') ?></lastmod>
3114aabe72SGreg Roach            <?php endif ?>
3214aabe72SGreg Roach        </url>
3314aabe72SGreg Roach    <?php endforeach ?>
3414aabe72SGreg Roach</urlset>
3514aabe72SGreg Roach
3614aabe72SGreg Roach
37