robotify-netcore
robotify-netcore copied to clipboard
Setup sitemap without appsettings.json
Hi,
How is possible to setup the sitemap link without JSON ?
THanks
Hi,
You can configure you own implementation by creating a class that derives from IRobotifyRobotGroupProvider. Then add this during configuration. The reasons contains an example of this
Hey,
I've this for now, and I don't really see how to setup sitemap link ^^
namespace Librum
{
public class RobotsProvider : IRobotifyRobotGroupProvider
{
public IEnumerable<RobotGroup> Get()
{
yield return new RobotGroup()
{
UserAgent = "*",
Disallow = new[] { "/account", "/saved-articles", "/search" }
};
}
}
}
Hi @clintnetwork - apologies for the super late reply here. There is a documentation issue here are you are able to configure the sitemap url via the .UseRobotify() extension:
app.UseRobotify(c => c
.Enabled(true)
.WithSitemap(new Uri("https://www.example.com/sitemap.xml"))
.DisableFileHeaderComments()
.WithCrawlDelay(delayInSeconds: 10)
);
See https://github.com/stormid/robotify-netcore/blob/master/sample/Robotify.AspNetCore.Sample/Startup.cs#L32