|
1 | 1 | {% extends "base_index.html" %} |
2 | 2 |
|
| 3 | +{% set is_canonical_announcement = article.group and article.group.slug == "canonical-announcements" %} |
| 4 | + |
3 | 5 | {% block title %}{{ article.title.rendered|safe }}{% endblock %} |
4 | 6 |
|
5 | 7 | {% block meta_description %}{{ article.meta_description }}{% endblock %} |
|
11 | 13 | {% block meta_image %}{{ article.image.source_url }}{% endblock %} |
12 | 14 |
|
13 | 15 | {%- block canonical_url -%} |
14 | | - {%- if article.author and article.author.id == 217 -%} |
| 16 | + {%- if is_canonical_announcement -%} |
15 | 17 | https://canonical.com/blog/{{ article.slug }} |
16 | | - {%- elif 2996 in article.tags -%} |
17 | | - https://snapcraft.io/blog/{{ article.slug }} |
18 | | - {%- elif 1304 in article.tags or 3681 in article.tags -%} |
19 | | - https://maas.io/blog/{{ article.slug }} |
20 | 18 | {%- else -%} |
21 | 19 | https://ubuntu.com/blog/{{ article.slug }} |
22 | 20 | {%- endif -%} |
|
27 | 25 | <script type="application/ld+json" nonce="{{ csp_nonce }}"> |
28 | 26 | { |
29 | 27 | "@context": "http://schema.org", |
30 | | - "@id": "https://canonical.com/#article", |
| 28 | + "@id": "{{ request.url }}", |
31 | 29 | "@type": "Article", |
32 | | - "name": "{{ article.title.renderered|safe }}", |
| 30 | + "name": "{{ article.title.rendered | safe }}", |
33 | 31 | "headline": "{{ article.excerpt.raw }}", |
34 | 32 | "author": { |
35 | | - "@type": "Person", |
| 33 | + "@type": "{% if article.author.slug == 'canonical' %}Organization{% else %}Person{% endif %}", |
36 | 34 | "name": "{{ article.author.name }}" |
37 | 35 | }, |
38 | 36 | "datePublished": "{{ article.date_gmt }}", |
39 | 37 | {% if article.image and article.image.source_url %} |
40 | 38 | "image": "{{ article.image.source_url }}", |
41 | 39 | {% endif %} |
42 | | - "url": "{{ request.url }}", |
| 40 | + "url": "{{ self.canonical_url() }}", |
43 | 41 | "publisher": { |
44 | 42 | "@type": "Organization", |
45 | | - "name": "Ubuntu" |
| 43 | + "name": "{% if is_canonical_announcement %}Canonical{% else %}Ubuntu{% endif %}" |
46 | 44 | } |
47 | 45 | } |
48 | 46 | </script> |
|
0 commit comments