xref: /webtrees/resources/views/modules/sitemap/sitemap-file-xml.phtml (revision 7e1a70f919760b36ee05568bafb6f2f13dbaf511)
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/**
11c5a1ffe6SGreg Roach * @var float                        $priority
1236779af1SGreg Roach * @var Collection<int,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) ?>"?>
20*7e1a70f9SGreg 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 https://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
21c5a1ffe6SGreg Roach    <url>
22c5a1ffe6SGreg Roach        <loc><?= e(route(TreePage::class, ['tree' => $tree->name()])) ?></loc>
23c5a1ffe6SGreg Roach        <priority>1.0</priority>
24c5a1ffe6SGreg Roach    </url>
2514aabe72SGreg Roach    <?php foreach ($records as $record) : ?>
2614aabe72SGreg Roach        <url>
2714aabe72SGreg Roach            <loc><?= e($record->url()) ?></loc>
28c5a1ffe6SGreg 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