Skip to content

Instantly share code, notes, and snippets.

@jaddison
Last active December 10, 2015 20:08
Show Gist options
  • Save jaddison/4485805 to your computer and use it in GitHub Desktop.
Save jaddison/4485805 to your computer and use it in GitHub Desktop.
django-simple-templates base.html example
{% load spurl %}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
{# the `head-gace-js` block is what you would override in your original template to enable a Google Analytics Content Experiment #}
{% block head-gace-js %}{% endblock %}
{# by placing this canonical link in your base.html <head> section, all A/B template pages benefit - no duplicate content penalties #}
<link rel="canonical" href="{% block head-canonical %}{% spurl base=request.get_full_path remove_query_param='ab' %}{% endblock %}">
{# all other <head> section links, scripts, etc... #}
</head>
<body>
{% block content %}{% endblock %}
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment