diff --git a/src/open_inwoner/pdc/views.py b/src/open_inwoner/pdc/views.py index 4c097fa464..82b3fe3277 100644 --- a/src/open_inwoner/pdc/views.py +++ b/src/open_inwoner/pdc/views.py @@ -201,6 +201,7 @@ def crumbs(self): def get_context_data(self, **kwargs): product = self.get_object() context = super().get_context_data(**kwargs) + request = context["view"].request subheadings = extract_subheadings(product.content, tag="h2") @@ -217,6 +218,8 @@ def get_context_data(self, **kwargs): anchors.append(("#contact", _("Contact"))) context["meta_description"] = product.summary + context["meta_image_url"] = request.build_absolute_uri(product.icon.url) + context["meta_page_url"] = request.build_absolute_uri(request.path) context["anchors"] = anchors context["related_products_start"] = 6 if product.links.exists() else 1 context["product_links"] = product.links.order_by("pk") diff --git a/src/open_inwoner/templates/master.html b/src/open_inwoner/templates/master.html index b2f023cf91..bc191f29a0 100644 --- a/src/open_inwoner/templates/master.html +++ b/src/open_inwoner/templates/master.html @@ -10,7 +10,17 @@ {% if meta_description %} + {% endif %} + {% if meta_image_url %} + + + {% endif %} + {% if meta_page_url %} + + {% endif %} + + {% if favicon %} {% endif %}