DEV: Add plugin API to add to robots.txt (#17378)

This plugin API can be used to add to robots.txt. The event handler
receives the complete robots information before it is converted into
robots.txt.
This commit is contained in:
Bianca Nenciu
2022-07-12 20:52:55 +03:00
committed by GitHub
parent 2e7e48d982
commit 09f1ef6b05
2 changed files with 22 additions and 0 deletions

View File

@ -84,6 +84,8 @@ class RobotsTxtController < ApplicationController
result[:agents] << { name: 'Googlebot', disallow: deny_paths_googlebot }
end
DiscourseEvent.trigger(:robots_info, result)
result
end
end