Skip to content

Commit

Permalink
update robots.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
sgmdlt committed Dec 25, 2024
1 parent 8ec60ba commit e86de2e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
34 changes: 17 additions & 17 deletions contributors/sitemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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,
}
3 changes: 3 additions & 0 deletions templates/robots.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ Disallow: /*labels=
Disallow: /admin/
Crawl-delay: 10

User-agent: Bytespider
Disallow: /

Sitemap: https://hexlet-friends.herokuapp.com/sitemap.xml

0 comments on commit e86de2e

Please sign in to comment.