Renders a robots.txt pointing crawlers to the sitemaps.
SiteMaps.RobotsTxt.render(sitemaps: "https://acme.com/sitemap.xml.gz", extra: ["Disallow: /admin"])
#=> "User-agent: *\nAllow: /\nDisallow: /admin\nSitemap: https://acme.com/sitemap.xml.gz\n"A sitemap may be given as a URL or as a SiteMaps.Config, e.g. SiteMaps.config!(MyApp.Sitemaps, ctx).
Summary
Functions
Renders the robots.txt content.
Options
:sitemaps- one sitemap or a list of them (required):extra- lines added afterAllow: /, e.g.["Disallow: /admin"]
@spec sitemap_directive(String.t() | SiteMaps.Config.t()) :: String.t()
The Sitemap: directive of a sitemap URL or configuration.