Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Add Category meta tags

Pacu2146b5ec6400a
diff --git a/templates/base.html b/templates/base.html
index 78eb4c849e..fbc7384b5e 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -20,6 +20,7 @@
{% block stylesheet %}{% endblock stylesheet %}
{% block meta_tags %}{% endblock meta_tags %}
+ {% block meta_tags %}{% endblock meta_tags %}
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
diff --git a/templates/category/index.html b/templates/category/index.html
index 6d843c8825..df6b34548c 100644
--- a/templates/category/index.html
+++ b/templates/category/index.html
@@ -12,6 +12,26 @@
{% block title %}{{ category }} — {{ block.super }}{% endblock %}
+{% block meta_tags %}
+ <meta name="title" content="{{ category }}">
+ <meta property="og:title" content="{{ category }}">
+ <meta name="og:description" content="{{ category.description }}">
+ <meta property="og:image" content="{% static "images/logo.png" %}" />
+
+ {% with category_url=category.get_absolute_url %}
+ <meta property="og:url" content="{{ category_url }}">
+ <link rel="canonical" href="{{ category_url }}?page={{ products_paginated.number }}">
+
+ {% if products_paginated.has_previous %}
+ <link rel="prev" href="{{ category_url }}?page={{ products_paginated.previous_page_number }}" />
+ {% endif %}
+
+ {% if products_paginated.has_next %}
+ <link rel="next" href="{{ category_url }}?page={{ products_paginated.next_page_number }}" />
+ {% endif %}
+ {% endwith %}
+{% endblock meta_tags %}
+
{% block breadcrumb %}
{{ block.super }}
{% for breadcrumb in breadcrumbs %}