From ce25e7a724ab48abaeb04676ae7c13810851e58d Mon Sep 17 00:00:00 2001 From: Nick Sergeant Date: Wed, 20 Jun 2012 11:11:46 -0400 Subject: [PATCH] Sitemap, robots, humans --- templates/base.html | 2 ++ templates/humans.txt | 19 +++++++++++++++++++ templates/robots.txt | 4 ++++ templates/sitemap.xml | 8 ++++++++ urls.py | 6 +++++- views.py | 8 ++++++++ 6 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 templates/humans.txt create mode 100644 templates/sitemap.xml diff --git a/templates/base.html b/templates/base.html index 5eb5da7..c772071 100644 --- a/templates/base.html +++ b/templates/base.html @@ -6,6 +6,8 @@ {% block page-title %}Snipt{% endblock %} + + {% block page-description %} {% endblock %} diff --git a/templates/humans.txt b/templates/humans.txt new file mode 100644 index 0000000..90c5f69 --- /dev/null +++ b/templates/humans.txt @@ -0,0 +1,19 @@ +/* TEAM */ + +Founder and Developer: Nick Sergeant +Contact: nick@snipt.net +Site: http://nicksergeant.com +Twitter: @nicksergeant +Location: Rochester, NY + +Designer: Nick Adams +Contact: nick@nick-adams.com +Site: http://nick-adams.com +Twitter: @nickadamssays +Location: Rochester, NY + +/* SITE */ + +Standards: CSS3, HTML5 +Components: Backbone.js, Twitter Bootstrap, jQuery, Underscore.js +Software: Django diff --git a/templates/robots.txt b/templates/robots.txt index e69de29..a14ea1b 100644 --- a/templates/robots.txt +++ b/templates/robots.txt @@ -0,0 +1,4 @@ +User-agent: * +Disallow: +Disallow: /admin +Sitemap: https://snipt.net/sitemap.xml diff --git a/templates/sitemap.xml b/templates/sitemap.xml new file mode 100644 index 0000000..5a29cf8 --- /dev/null +++ b/templates/sitemap.xml @@ -0,0 +1,8 @@ + + + + + + diff --git a/urls.py b/urls.py index 8e7d147..cff73a8 100644 --- a/urls.py +++ b/urls.py @@ -2,10 +2,10 @@ from django.conf.urls.defaults import include, patterns, url from django.views.generic.simple import direct_to_template from registration.forms import RegistrationFormUniqueEmail from django.http import HttpResponseRedirect +from views import lexers, sitemap from django.contrib import admin from snipts.views import search from tastypie.api import Api -from views import lexers from snipts.api import * import admin as custom_admin @@ -31,6 +31,10 @@ urlpatterns = patterns('', url(r'^404/$', direct_to_template, {'template': '404.html'}), url(r'^500/$', direct_to_template, {'template': '500.html'}), + url(r'^robots.txt$', direct_to_template, {'template': 'robots.txt'}), + url(r'^humans.txt$', direct_to_template, {'template': 'humans.txt'}), + url(r'^sitemap.xml$', sitemap), + url(r'^api/public/lexer/$', lexers), url(r'^api/', include(public_api.urls)), diff --git a/views.py b/views.py index e446c6d..57d1f99 100644 --- a/views.py +++ b/views.py @@ -1,7 +1,15 @@ +from django.shortcuts import render_to_response from annoying.decorators import ajax_request +from django.template import RequestContext from snipts.utils import get_lexers_list +def sitemap(request): + return render_to_response('sitemap.xml', + {}, + context_instance=RequestContext(request), + mimetype='application/xml') + @ajax_request def lexers(request): lexers = get_lexers_list()