1<?php 2 3declare(strict_types=1); 4 5/** 6 * @var array<string> $bad_user_agents 7 * @var string $base_path 8 * @var string $base_url 9 * @var string $sitemap_url 10 * @var iterable<string> $trees 11 */ 12 13?> 14# robots.txt for <?= $base_url ?> 15 16<?php if ($base_path !== '') : ?> 17# CAUTION! This robots.txt needs to be copied to the root folder. 18<?php endif ?> 19 20<?php foreach ($bad_user_agents as $bad_user_agent) : ?> 21User-agent: <?= $bad_user_agent ?> 22 23<?php endforeach ?> 24Disallow: / 25 26User-agent: * 27Disallow: <?= $base_path ?>/admin 28Disallow: <?= $base_path ?>/manager 29Disallow: <?= $base_path ?>/editor 30Disallow: <?= $base_path ?>/account 31<?php foreach ($trees as $tree) : ?> 32Disallow <?= $base_path ?>/tree/<?= $tree ?>/ancestors 33Disallow <?= $base_path ?>/tree/<?= $tree ?>/calendar 34Disallow <?= $base_path ?>/tree/<?= $tree ?>/compact 35Disallow <?= $base_path ?>/tree/<?= $tree ?>/descendants 36Disallow <?= $base_path ?>/tree/<?= $tree ?>/family-book 37Disallow <?= $base_path ?>/tree/<?= $tree ?>/family-list 38Disallow <?= $base_path ?>/tree/<?= $tree ?>/fan-chart 39Disallow <?= $base_path ?>/tree/<?= $tree ?>/hourglass 40Disallow <?= $base_path ?>/tree/<?= $tree ?>/individual-list 41Disallow <?= $base_path ?>/tree/<?= $tree ?>/lifespans 42Disallow <?= $base_path ?>/tree/<?= $tree ?>/pedigree 43Disallow <?= $base_path ?>/tree/<?= $tree ?>/report 44Disallow <?= $base_path ?>/tree/<?= $tree ?>/timeline 45<?php endforeach ?> 46Crawl-delay: 10 47 48<?php if ($sitemap_url !== '') : ?> 49Sitemap: <?= $sitemap_url ?> 50<?php endif ?> 51