Kirby3 Robots.txt - Manage the robots.txt from the Kirby config file

I am creating posts for my plugins to make it easier to find them using the forum search and not just the docs search.

The plugin is pretty much zero-config. It generates automatic defaults for the starterkit. You do not have to enter them in the config file. But if you would it would look like this.

defaults for starterkit

<?php
return [
    'bnomei.robots-txt.content' => null, // string or callback
    'bnomei.robots-txt.sitemap' => null, // string or callback
    'bnomei.robots-txt.groups' => [ // array or callback
        '*' => [ // user-agent
            'disallow' => [
                '/kirby/',
                '/site/',
            ],
            'allow' => [
                '/media/',
            ]
        ]
    ]
];

But if you need to change these you can either using the arrays as shown above or with a plain string or callback (see readme).

1 Like