diff options
Diffstat (limited to 'resources')
| -rw-r--r-- | resources/views/modules/sitemap/admin.php | 51 | ||||
| -rw-r--r-- | resources/views/modules/sitemap/sitemap-file.php | 13 | ||||
| -rw-r--r-- | resources/views/modules/sitemap/sitemap-index.php | 68 |
3 files changed, 132 insertions, 0 deletions
diff --git a/resources/views/modules/sitemap/admin.php b/resources/views/modules/sitemap/admin.php new file mode 100644 index 0000000000..985d26cb6a --- /dev/null +++ b/resources/views/modules/sitemap/admin.php @@ -0,0 +1,51 @@ +<?php use Fisharebest\Webtrees\Bootstrap4; ?> +<?php use Fisharebest\Webtrees\I18N; ?> + +<?= view('admin/breadcrumbs', ['links' => [route('admin-control-panel') => I18N::translate('Control panel'), route('admin-modules') => I18N::translate('Modules'), $title]]) ?> + +<h1><?= $title ?></h1> + +<p> + <?= /* I18N: The www.sitemaps.org site is translated into many languages (e.g. http://www.sitemaps.org/fr/) - choose an appropriate URL. */ I18N::translate('Sitemaps are a way for webmasters to tell search engines about the pages on a website that are available for crawling. All major search engines support sitemaps. For more information, see <a href="http://www.sitemaps.org/">www.sitemaps.org</a>.') ?> +</p> + +<p> + <?= /* I18N: Label for a configuration option */ I18N::translate('Which family trees should be included in the sitemaps') ?> +</p> + +<form action="<?= e(route('module', ['module' => 'sitemap', 'action' => 'Admin'])) ?>" method="post"> + <?= csrf_field() ?> + + <?php foreach ($all_trees as $tree): ?> + <?= Bootstrap4::checkbox($tree->getTitle(), false, ['name' => 'sitemap' . $tree->getTreeId(), 'checked' => (bool) $tree->getPreference('include_in_sitemap')]) ?> +<?php endforeach ?> + +<button type="submit" class="btn btn-primary"> + <?= I18N::translate('save') ?> +</button> + +</form> + +<hr> + +<p> + <?= I18N::translate('To tell search engines that sitemaps are available, you should add the following line to your robots.txt file.') ?> +</p> + +<pre>Sitemap: <?= e($sitemap_url) ?></pre> + +<hr> + +<p> + <?= I18N::translate('To tell search engines that sitemaps are available, you can use the following links.') ?> +</p> + +<ul> + <?php foreach ($submit_urls as $search_engine => $url): ?> + <li> + <a href="<?= e($url) ?>"> + <?= e($search_engine) ?> + </a> + </li> + <?php endforeach ?> +</ul> diff --git a/resources/views/modules/sitemap/sitemap-file.php b/resources/views/modules/sitemap/sitemap-file.php new file mode 100644 index 0000000000..d81137909b --- /dev/null +++ b/resources/views/modules/sitemap/sitemap-file.php @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<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"> + <?php foreach ($records as $record): ?> + <url> + <loc><?= e($record->url()) ?></loc> + <?php if ($record->getFirstFact('CHAN') !== null): ?> + <lastmod><?= $record->getFirstFact('CHAN')->getDate()->minimumDate()->Format('%Y-%m-%d') ?></lastmod> + <?php endif ?> + </url> + <?php endforeach ?> +</urlset> + + diff --git a/resources/views/modules/sitemap/sitemap-index.php b/resources/views/modules/sitemap/sitemap-index.php new file mode 100644 index 0000000000..77f3d5e39d --- /dev/null +++ b/resources/views/modules/sitemap/sitemap-index.php @@ -0,0 +1,68 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> + + <?php foreach ($count_individuals as $tree_id => $count): ?> + <?php for ($i = 0; $i <= $count / $records_per_volume; ++$i): ?> + <sitemap> + <loc> + <?= e(route('module', ['module' => 'sitemap', 'action' => 'File', 'file' => $tree_id . '-i-' . $i])) ?> + </loc> + <lastmod> + <?= $last_mod ?> + </lastmod> + </sitemap> + <?php endfor ?> + <?php endforeach ?> + + <?php foreach ($count_media as $tree_id => $count): ?> + <?php for ($i = 0; $i <= $count / $records_per_volume; ++$i): ?> + <sitemap> + <loc> + <?= e(route('module', ['module' => 'sitemap', 'action' => 'File', 'file' => $tree_id . '-m-' . $i])) ?> + </loc> + <lastmod> + <?= $last_mod ?> + </lastmod> + </sitemap> + <?php endfor ?> + <?php endforeach ?> + + <?php foreach ($count_notes as $tree_id => $count): ?> + <?php for ($i = 0; $i <= $count / $records_per_volume; ++$i): ?> + <sitemap> + <loc> + <?= e(route('module', ['module' => 'sitemap', 'action' => 'File', 'file' => $tree_id . '-i-' . $n])) ?> + </loc> + <lastmod> + <?= $last_mod ?> + </lastmod> + </sitemap> + <?php endfor ?> + <?php endforeach ?> + + <?php foreach ($count_repositories as $tree_id => $count): ?> + <?php for ($i = 0; $i <= $count / $records_per_volume; ++$i): ?> + <sitemap> + <loc> + <?= e(route('module', ['module' => 'sitemap', 'action' => 'File', 'file' => $tree_id . '-r-' . $i])) ?> + </loc> + <lastmod> + <?= $last_mod ?> + </lastmod> + </sitemap> + <?php endfor ?> + <?php endforeach ?> + + <?php foreach ($count_sources as $tree_id => $count): ?> + <?php for ($i = 0; $i <= $count / $records_per_volume; ++$i): ?> + <sitemap> + <loc> + <?= e(route('module', ['module' => 'sitemap', 'action' => 'File', 'file' => $tree_id . '-s-' . $i])) ?> + </loc> + <lastmod> + <?= $last_mod ?> + </lastmod> + </sitemap> + <?php endfor ?> + <?php endforeach ?> +</sitemapindex> |
