xref: /webtrees/resources/views/modules/sitemap/sitemap-index-xml.phtml (revision c82761e34f1c58f6aa906b2ff55fa73a937de867)
1<?php
2
3use Fisharebest\Webtrees\Http\RequestHandlers\ModuleAction;
4use Fisharebest\Webtrees\Individual;
5use Fisharebest\Webtrees\Media;
6use Fisharebest\Webtrees\Note;
7use Fisharebest\Webtrees\Source;
8use Fisharebest\Webtrees\Repository;
9
10/**
11 * @var string $sitemap_xsl
12 */
13
14?>
15<<?php /* Beware short open tags in PHP <8.0 */ ?>?xml version="1.0" encoding="UTF-8"?>
16<?xml-stylesheet type="text/xsl" href="<?= e($sitemap_xsl) ?>"?>
17<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
18
19    <?php foreach ($count_individuals as $tree_name => $count) : ?>
20        <?php for ($i = 0; $i <= $count / $records_per_volume; ++$i) : ?>
21    <sitemap>
22        <loc>
23            <?= e(route('sitemap-file', ['tree' => $tree_name, 'records' => Individual::RECORD_TYPE, 'page' => $i])) ?>
24        </loc>
25        <lastmod>
26            <?= $last_mod ?>
27        </lastmod>
28    </sitemap>
29        <?php endfor ?>
30    <?php endforeach ?>
31
32    <?php foreach ($count_media as $tree_name => $count) : ?>
33        <?php for ($i = 0; $i <= $count / $records_per_volume; ++$i) : ?>
34    <sitemap>
35        <loc>
36            <?= e(route('sitemap-file', ['tree' => $tree_name, 'records' => Media::RECORD_TYPE, 'page' => $i])) ?>
37        </loc>
38        <lastmod>
39            <?= $last_mod ?>
40        </lastmod>
41    </sitemap>
42        <?php endfor ?>
43    <?php endforeach ?>
44
45    <?php foreach ($count_notes as $tree_name => $count) : ?>
46        <?php for ($i = 0; $i <= $count / $records_per_volume; ++$i) : ?>
47    <sitemap>
48        <loc>
49            <?= e(route('sitemap-file', ['tree' => $tree_name, 'records' => Note::RECORD_TYPE, 'page' => $i])) ?>
50        </loc>
51        <lastmod>
52            <?= $last_mod ?>
53        </lastmod>
54    </sitemap>
55        <?php endfor ?>
56    <?php endforeach ?>
57
58    <?php foreach ($count_repositories as $tree_name => $count) : ?>
59        <?php for ($i = 0; $i <= $count / $records_per_volume; ++$i) : ?>
60    <sitemap>
61        <loc>
62            <?= e(route('sitemap-file', ['tree' => $tree_name, 'records' => Repository::RECORD_TYPE, 'page' => $i])) ?>
63        </loc>
64        <lastmod>
65            <?= $last_mod ?>
66        </lastmod>
67    </sitemap>
68        <?php endfor ?>
69    <?php endforeach ?>
70
71    <?php foreach ($count_sources as $tree_name => $count) : ?>
72        <?php for ($i = 0; $i <= $count / $records_per_volume; ++$i) : ?>
73    <sitemap>
74        <loc>
75            <?= e(route('sitemap-file', ['tree' => $tree_name, 'records' => SOURCE::RECORD_TYPE, 'page' => $i])) ?>
76        </loc>
77        <lastmod>
78            <?= $last_mod ?>
79        </lastmod>
80    </sitemap>
81        <?php endfor ?>
82    <?php endforeach ?>
83</sitemapindex>
84