xref: /webtrees/resources/views/modules/sitemap/sitemap-index-xml.phtml (revision 10e0649788c8d7d4974d81c048ca2b225df8f22e)
114aabe72SGreg Roach<?php
214aabe72SGreg Roach
3*10e06497SGreg Roachdeclare(strict_types=1);
4*10e06497SGreg Roach
5c5a1ffe6SGreg Roachuse Fisharebest\Webtrees\Family;
614aabe72SGreg Roachuse Fisharebest\Webtrees\Individual;
714aabe72SGreg Roachuse Fisharebest\Webtrees\Media;
814aabe72SGreg Roachuse Fisharebest\Webtrees\Note;
914aabe72SGreg Roachuse Fisharebest\Webtrees\Repository;
10c5a1ffe6SGreg Roachuse Fisharebest\Webtrees\Source;
11c5a1ffe6SGreg Roachuse Fisharebest\Webtrees\Submitter;
120a2e4c5cSGreg Roachuse Illuminate\Support\Collection;
1314aabe72SGreg Roach
1414aabe72SGreg Roach/**
150a2e4c5cSGreg Roach * @var Collection<string,int> $count_families
160a2e4c5cSGreg Roach * @var Collection<string,int> $count_individuals
170a2e4c5cSGreg Roach * @var Collection<string,int> $count_media
180a2e4c5cSGreg Roach * @var Collection<string,int> $count_notes
190a2e4c5cSGreg Roach * @var Collection<string,int> $count_repositories
200a2e4c5cSGreg Roach * @var Collection<string,int> $count_sources
210a2e4c5cSGreg Roach * @var Collection<string,int> $count_submitters
220a2e4c5cSGreg Roach * @var string                 $last_mod
230a2e4c5cSGreg Roach * @var int                    $records_per_volume
2414aabe72SGreg Roach * @var string                 $sitemap_xsl
2514aabe72SGreg Roach */
2614aabe72SGreg Roach
2714aabe72SGreg Roach?>
2814aabe72SGreg Roach<<?php /* Beware short open tags in PHP <8.0 */ ?>?xml version="1.0" encoding="UTF-8"?>
290800f024SGreg Roach<<?php /* Beware short open tags in PHP <8.0 */ ?>?xml-stylesheet type="text/xsl" href="<?= e($sitemap_xsl) ?>"?>
307e1a70f9SGreg Roach<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
3114aabe72SGreg Roach
32c5a1ffe6SGreg Roach    <?php foreach ($count_families as $tree_name => $count) : ?>
33c5a1ffe6SGreg Roach        <?php for ($i = 0; $i <= $count / $records_per_volume; ++$i) : ?>
34c5a1ffe6SGreg Roach        <sitemap>
35c5a1ffe6SGreg Roach            <loc>
36c5a1ffe6SGreg Roach                <?= e(route('sitemap-file', ['tree' => $tree_name, 'type' => Family::RECORD_TYPE, 'page' => $i])) ?>
37c5a1ffe6SGreg Roach            </loc>
38c5a1ffe6SGreg Roach            <lastmod>
39c5a1ffe6SGreg Roach                <?= $last_mod ?>
40c5a1ffe6SGreg Roach            </lastmod>
41c5a1ffe6SGreg Roach        </sitemap>
42c5a1ffe6SGreg Roach        <?php endfor ?>
43c5a1ffe6SGreg Roach    <?php endforeach ?>
44c5a1ffe6SGreg Roach
4514aabe72SGreg Roach    <?php foreach ($count_individuals as $tree_name => $count) : ?>
4614aabe72SGreg Roach        <?php for ($i = 0; $i <= $count / $records_per_volume; ++$i) : ?>
4714aabe72SGreg Roach        <sitemap>
4814aabe72SGreg Roach            <loc>
49c5a1ffe6SGreg Roach                <?= e(route('sitemap-file', ['tree' => $tree_name, 'type' => Individual::RECORD_TYPE, 'page' => $i])) ?>
5014aabe72SGreg Roach            </loc>
5114aabe72SGreg Roach            <lastmod>
5214aabe72SGreg Roach                <?= $last_mod ?>
5314aabe72SGreg Roach            </lastmod>
5414aabe72SGreg Roach        </sitemap>
5514aabe72SGreg Roach        <?php endfor ?>
5614aabe72SGreg Roach    <?php endforeach ?>
5714aabe72SGreg Roach
5814aabe72SGreg Roach    <?php foreach ($count_media as $tree_name => $count) : ?>
5914aabe72SGreg Roach        <?php for ($i = 0; $i <= $count / $records_per_volume; ++$i) : ?>
6014aabe72SGreg Roach        <sitemap>
6114aabe72SGreg Roach            <loc>
62c5a1ffe6SGreg Roach                <?= e(route('sitemap-file', ['tree' => $tree_name, 'type' => Media::RECORD_TYPE, 'page' => $i])) ?>
6314aabe72SGreg Roach            </loc>
6414aabe72SGreg Roach            <lastmod>
6514aabe72SGreg Roach                <?= $last_mod ?>
6614aabe72SGreg Roach            </lastmod>
6714aabe72SGreg Roach        </sitemap>
6814aabe72SGreg Roach        <?php endfor ?>
6914aabe72SGreg Roach    <?php endforeach ?>
7014aabe72SGreg Roach
7114aabe72SGreg Roach    <?php foreach ($count_notes as $tree_name => $count) : ?>
7214aabe72SGreg Roach        <?php for ($i = 0; $i <= $count / $records_per_volume; ++$i) : ?>
7314aabe72SGreg Roach        <sitemap>
7414aabe72SGreg Roach            <loc>
75c5a1ffe6SGreg Roach                <?= e(route('sitemap-file', ['tree' => $tree_name, 'type' => Note::RECORD_TYPE, 'page' => $i])) ?>
7614aabe72SGreg Roach            </loc>
7714aabe72SGreg Roach            <lastmod>
7814aabe72SGreg Roach                <?= $last_mod ?>
7914aabe72SGreg Roach            </lastmod>
8014aabe72SGreg Roach        </sitemap>
8114aabe72SGreg Roach        <?php endfor ?>
8214aabe72SGreg Roach    <?php endforeach ?>
8314aabe72SGreg Roach
8414aabe72SGreg Roach    <?php foreach ($count_repositories as $tree_name => $count) : ?>
8514aabe72SGreg Roach        <?php for ($i = 0; $i <= $count / $records_per_volume; ++$i) : ?>
8614aabe72SGreg Roach        <sitemap>
8714aabe72SGreg Roach            <loc>
88c5a1ffe6SGreg Roach                <?= e(route('sitemap-file', ['tree' => $tree_name, 'type' => Repository::RECORD_TYPE, 'page' => $i])) ?>
8914aabe72SGreg Roach            </loc>
9014aabe72SGreg Roach            <lastmod>
9114aabe72SGreg Roach                <?= $last_mod ?>
9214aabe72SGreg Roach            </lastmod>
9314aabe72SGreg Roach        </sitemap>
9414aabe72SGreg Roach        <?php endfor ?>
9514aabe72SGreg Roach    <?php endforeach ?>
9614aabe72SGreg Roach
9714aabe72SGreg Roach    <?php foreach ($count_sources as $tree_name => $count) : ?>
9814aabe72SGreg Roach        <?php for ($i = 0; $i <= $count / $records_per_volume; ++$i) : ?>
9914aabe72SGreg Roach        <sitemap>
10014aabe72SGreg Roach            <loc>
101c5a1ffe6SGreg Roach                <?= e(route('sitemap-file', ['tree' => $tree_name, 'type' => Source::RECORD_TYPE, 'page' => $i])) ?>
102c5a1ffe6SGreg Roach            </loc>
103c5a1ffe6SGreg Roach            <lastmod>
104c5a1ffe6SGreg Roach                <?= $last_mod ?>
105c5a1ffe6SGreg Roach            </lastmod>
106c5a1ffe6SGreg Roach        </sitemap>
107c5a1ffe6SGreg Roach        <?php endfor ?>
108c5a1ffe6SGreg Roach    <?php endforeach ?>
109c5a1ffe6SGreg Roach
110c5a1ffe6SGreg Roach    <?php foreach ($count_submitters as $tree_name => $count) : ?>
111c5a1ffe6SGreg Roach        <?php for ($i = 0; $i <= $count / $records_per_volume; ++$i) : ?>
112c5a1ffe6SGreg Roach        <sitemap>
113c5a1ffe6SGreg Roach            <loc>
114c5a1ffe6SGreg Roach                <?= e(route('sitemap-file', ['tree' => $tree_name, 'type' => Submitter::RECORD_TYPE, 'page' => $i])) ?>
11514aabe72SGreg Roach            </loc>
11614aabe72SGreg Roach            <lastmod>
11714aabe72SGreg Roach                <?= $last_mod ?>
11814aabe72SGreg Roach            </lastmod>
11914aabe72SGreg Roach        </sitemap>
12014aabe72SGreg Roach        <?php endfor ?>
12114aabe72SGreg Roach    <?php endforeach ?>
12214aabe72SGreg Roach</sitemapindex>
123