Manage your robots.txt and llms.txt from your Sylius admin pannel
| Sylius Version | PHP Version |
|---|---|
| 2.0.0 | 8.2 - 8.3 |
| 2.1.0 | 8.2 - 8.3 |
ℹ️ For Sylius 1.x, see our 1.x branch and all 1.x releases.
If you want to use our recipes, you can configure your composer.json by running:
composer config --no-plugins --json extra.symfony.endpoint '["https://api.github.com/repos/monsieurbiz/symfony-recipes/contents/index.json?ref=flex/master","flex://defaults"]'composer require monsieurbiz/sylius-robots-txt-pluginThen remove your robots.txt file from your public directory.
rm public/robots.txt
For the installation without flex, follow these additional steps
Change your config/bundles.php file to add this line for the plugin declaration:
<?php
return [
//..
MonsieurBiz\SyliusRobotsTxtPlugin\MonsieurBizSyliusRobotsTxtPlugin::class => ['all' => true],
]; Then create the config file in config/packages/monsieurbiz_sylius_robots_txt_plugin.yaml :
imports:
resource: '@MonsieurBizSyliusRobotsTxtPlugin/config/config.yaml'Finally import the routes in config/routes/monsieurbiz_sylius_robots_txt_plugin.yaml :
monsieurbiz_robots_txt_render:
path: /robots.txt
methods: [ GET ]
defaults:
_controller: MonsieurBiz\SyliusRobotsTxtPlugin\Controller\RenderController
settingName: 'robots_txt_content'
monsieurbiz_llms_txt_render:
path: /llms.txt
methods: [ GET ]
defaults:
_controller: MonsieurBiz\SyliusRobotsTxtPlugin\Controller\RenderController
settingName: 'llms_txt_content'You can open an issue or a Pull Request if you want! 😘
Thank you!
