From e86de2e68242ea67ebe9741fd5d220b87d0912d3 Mon Sep 17 00:00:00 2001 From: Ivan Mamtsev Date: Wed, 25 Dec 2024 20:12:09 +0400 Subject: [PATCH] update robots.txt --- contributors/sitemap.py | 34 +++++++++++++++++----------------- templates/robots.txt | 3 +++ 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/contributors/sitemap.py b/contributors/sitemap.py index 65be457..f8a9130 100644 --- a/contributors/sitemap.py +++ b/contributors/sitemap.py @@ -11,14 +11,14 @@ class StaticViewSitemap(Sitemap): priority = 0.5 - changefreq = 'weekly' + changefreq = "monthly" def items(self): return [ - 'contributors:home', - 'contributors:about', - 'contributors:landing', - 'contributors:achievements' + "contributors:home", + "contributors:about", + "contributors:landing", + "contributors:achievements", ] def location(self, item): @@ -33,46 +33,46 @@ def items(self): return Organization.objects.all() def location(self, item): - return reverse('contributors:organization_details', args=[item.name]) + return reverse("contributors:organization_details", args=[item.name]) class RepositorySitemap(Sitemap): - changefreq = "weekly" + changefreq = "monthly" priority = 0.7 def items(self): return Repository.objects.all() def location(self, item): - return reverse('contributors:repository_details', args=[item.name]) + return reverse("contributors:repository_details", args=[item.name]) class ContributorSitemap(Sitemap): - changefreq = "weekly" + changefreq = "monthly" priority = 0.6 def items(self): return Contributor.objects.all() def location(self, item): - return reverse('contributors:contributor_details', args=[item.login]) + return reverse("contributors:contributor_details", args=[item.login]) class ProjectSitemap(Sitemap): - changefreq = "weekly" + changefreq = "monthly" priority = 0.6 def items(self): return Project.objects.all() def location(self, item): - return reverse('contributors:project_details', args=[item.pk]) + return reverse("contributors:project_details", args=[item.pk]) sitemaps = { - 'static': StaticViewSitemap, - 'organizations': OrganizationSitemap, - 'repositories': RepositorySitemap, - 'contributors': ContributorSitemap, - 'projects': ProjectSitemap, + "static": StaticViewSitemap, + "organizations": OrganizationSitemap, + "repositories": RepositorySitemap, + "contributors": ContributorSitemap, + "projects": ProjectSitemap, } diff --git a/templates/robots.txt b/templates/robots.txt index 36fe2c0..f010db8 100644 --- a/templates/robots.txt +++ b/templates/robots.txt @@ -11,4 +11,7 @@ Disallow: /*labels= Disallow: /admin/ Crawl-delay: 10 +User-agent: Bytespider +Disallow: / + Sitemap: https://hexlet-friends.herokuapp.com/sitemap.xml