Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add SEO docs, set meta description of product pages
Patryk Zawadzki27ef161a128f
diff --git a/docs/index.rst b/docs/index.rstindex 759b605457..3663c63f21 100644--- a/docs/index.rst+++ b/docs/index.rst@@ -13,6 +13,7 @@ Contents:productsstocksettings+ seopaymentsintegrationsdevelopmentdiff --git a/docs/seo.rst b/docs/seo.rstnew file mode 100644index 0000000000..91cbb9c311--- /dev/null+++ b/docs/seo.rst@@ -0,0 +1,38 @@+Search engine optimization (SEO)+================================++Out of the box Saleor will automatically handle certain aspects of how search engines see and index your products.++Sitemaps+--------++A special resource reachable under the ``/sitemap.xml`` URL serves an up to date list of products from your site in an easy to parse Sitemaps XML format understood by all major search engines.++Meta tags+---------++Meta keywords are not used as they are ignored by all major search engines because of the abuse this feature saw in the years since it was introduced.++Meta description will be set to the product's description field. This does not affect the search engine ranking but it affects the snippet of text shown along with the search result.++JSON-LD+-------++All product pages contain semantic descriptions in JSON-LD `Structured Data <https://developers.google.com/search/docs/guides/intro-structured-data>`_ format.++It does not directly affect the search engine ranking but it allows search engines to better understand the data ("this is a product, it's available, it costs $10").++It allows search engines like Google to show product photos, prices, ratings etc. along with their search results.++Google for Retail+-----------------++Saleor provides product feeds compatible with Google Merchant Center.++It's available under the ``/feeds/google/`` URL.++As generating this feed is quite costly, there is a separate management command responsible for generating the necessary files:++.. code-block:: bash++ $ python manage.py update_feedsdiff --git a/templates/product/details.html b/templates/product/details.htmlindex 888006a0d6..c718ee1c78 100644--- a/templates/product/details.html+++ b/templates/product/details.html@@ -10,6 +10,8 @@{% block title %}{{ product }} — {{ block.super }}{% endblock %}+{% block meta_description %}{{ product.description }}{% endblock %}+{% block breadcrumb %}<ul class="breadcrumbs list-unstyled"><li><a href="/">@@ -44,8 +46,8 @@<div class="carousel-inner" role="listbox">{% for image in images %}<div class="carousel-item{% if forloop.first %} active{% endif %}">- <img class="d-block img-fluid"- src="{% get_thumbnail image.image method="crop" size="540x540" %}"+ <img class="d-block img-fluid"+ src="{% get_thumbnail image.image method="crop" size="540x540" %}"srcset="{% get_thumbnail image.image method="crop" size="540x540" %} 1x, {% get_thumbnail image.image method="crop" size="1080x1080" %} 2x" alt=""></div>{% endfor %}@@ -62,8 +64,8 @@{% for image in images %}{% if images|length > 1 %}<li data-target="#carousel-example-generic" data-slide-to="{{ forloop.counter0 }}"{% if forloop.first %} class="active"{% endif %}>- <img src="{% get_thumbnail image.image method="crop" size="60x60" %}"- srcset="{% get_thumbnail image.image method="crop" size="60x60" %} 1x, {% get_thumbnail image.image method="crop" size="120x120" %} 2x"+ <img src="{% get_thumbnail image.image method="crop" size="60x60" %}"+ srcset="{% get_thumbnail image.image method="crop" size="60x60" %} 1x, {% get_thumbnail image.image method="crop" size="120x120" %} 2x"alt=""></li>{% endif %}@@ -71,9 +73,9 @@</ol></div>{% else %}- <img src="{% static 'images/placeholder540x540.png' %}"- srcset="{% static 'images/placeholder540x540.png' %} 1x, {% static 'images/placeholder1080x1080.png' %} 2x"- alt=""+ <img src="{% static 'images/placeholder540x540.png' %}"+ srcset="{% static 'images/placeholder540x540.png' %} 1x, {% static 'images/placeholder1080x1080.png' %} 2x"+ alt=""class="img-fluid">{% endif %}{% endwith %}