Skip to content

Commit

Permalink
robots.txt {{ domain }} added.
Browse files Browse the repository at this point in the history
  • Loading branch information
AliYmn committed Feb 26, 2017
1 parent 95b5f23 commit e919442
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions blog/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from django.shortcuts import get_list_or_404
from django.contrib.syndication.views import Feed
from django.urls import reverse
from django.contrib.sites.models import Site

class HomeListView(ListView):
"""Ana Sayfa"""
Expand Down Expand Up @@ -107,6 +108,11 @@ class RobotsView(TemplateView):
"""robots.txt"""
template_name = 'robots.html'

def get_context_data(self, **kwargs):
context = super(RobotsView, self).get_context_data(**kwargs)
context['domain'] = current_site = Site.objects.get_current().domain
return context



class TagsView(ListView):
Expand Down
4 changes: 2 additions & 2 deletions templates/robots.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
Disallow: /*?ref=*
Disallow: /?ref=*
Disallow: *?replytocom
Sitemap: http://aliyaman.org/sitemap_post.xml
Sitemap: http://aliyaman.org/sitemap_category.xml
Sitemap: http://{{ domain }}/sitemap_post.xml
Sitemap: http://{{ domain }}/sitemap_category.xml

0 comments on commit e919442

Please sign in to comment.