@x-govuk/govuk-eleventy-plugin 6.2.4 → 6.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/layouts/base.njk +4 -3
- package/package.json +1 -1
package/layouts/base.njk
CHANGED
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
{% set assetUrl = assetPath | canonicalUrl %}
|
|
4
4
|
{% set themeColor = options.themeColour %}
|
|
5
5
|
|
|
6
|
-
{#
|
|
6
|
+
{# Set the opengraphImageUrl in parent template to either the one
|
|
7
|
+
from the page metadata or else fallback to the generic one from options. #}
|
|
7
8
|
{% set opengraphImage = image if image.opengraphImage else opengraphImage %}
|
|
8
|
-
{% set opengraphImageUrl =
|
|
9
|
+
{% set opengraphImageUrl = (opengraphImage.src | canonicalUrl) if opengraphImage else options.opengraphImageUrl %}
|
|
9
10
|
|
|
10
11
|
{# Pagination #}
|
|
11
12
|
{% set pageNumber = pagination.pageNumber + 1 %}
|
|
@@ -52,7 +53,7 @@
|
|
|
52
53
|
{% if description %}<meta property="og:description" name="description" content="{{ description | markdown("inline") | striptags(true) }}">{% endif %}
|
|
53
54
|
{% if opengraphImage %}<meta name="twitter:card" content="summary_large_image">{% endif %}
|
|
54
55
|
{% if opengraphImage.src %}<meta name="twitter:image" content="{{ opengraphImage.src | canonicalUrl }}">
|
|
55
|
-
|
|
56
|
+
{% endif %}
|
|
56
57
|
{% if opengraphImage.alt %}<meta property="og:image:alt" content="{{ opengraphImage.alt }}">{% endif %}
|
|
57
58
|
{% endblock %}
|
|
58
59
|
|