Adds robots.txt

This commit is contained in:
Mouse Reeve 2021-03-29 14:12:15 -07:00
parent 662ddf44b9
commit 4115edad6e
2 changed files with 10 additions and 1 deletions

View file

@ -0,0 +1,5 @@
# See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
User-agent: *
Disallow: /static/js/
Disallow: /static/css/

View file

@ -2,7 +2,7 @@
from django.conf.urls.static import static from django.conf.urls.static import static
from django.contrib import admin from django.contrib import admin
from django.urls import path, re_path from django.urls import path, re_path
from django.views.generic.base import TemplateView
from bookwyrm import settings, views from bookwyrm import settings, views
from bookwyrm.utils import regex from bookwyrm.utils import regex
@ -27,6 +27,10 @@ handler404 = "bookwyrm.views.not_found_page"
handler500 = "bookwyrm.views.server_error_page" handler500 = "bookwyrm.views.server_error_page"
urlpatterns = [ urlpatterns = [
path("admin/", admin.site.urls), path("admin/", admin.site.urls),
path(
"robots.txt",
TemplateView.as_view(template_name="robots.txt", content_type="text/plain"),
),
# federation endpoints # federation endpoints
re_path(r"^inbox/?$", views.Inbox.as_view()), re_path(r"^inbox/?$", views.Inbox.as_view()),
re_path(r"%s/inbox/?$" % local_user_path, views.Inbox.as_view()), re_path(r"%s/inbox/?$" % local_user_path, views.Inbox.as_view()),