@x-govuk/govuk-eleventy-plugin 6.1.0 → 6.2.0
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 +2 -0
- package/layouts/feed.njk +33 -0
- package/package.json +2 -1
package/layouts/base.njk
CHANGED
|
@@ -45,6 +45,8 @@
|
|
|
45
45
|
<link rel="stylesheet" href="{{ stylesheet | canonicalUrl }}">
|
|
46
46
|
{% endfor %}
|
|
47
47
|
|
|
48
|
+
{% if options.feedUrl %}<link rel="alternate" type="application/atom+xml" href="{{ options.feedUrl | canonicalUrl }}" >{% endif %}
|
|
49
|
+
|
|
48
50
|
{% if options.url %}<meta property="og:url" content="{{ page.url | canonicalUrl }}">{% endif %}
|
|
49
51
|
<meta property="og:title" content="{{ title }}">
|
|
50
52
|
{% if description %}<meta property="og:description" name="description" content="{{ description | markdown("inline") | striptags(true) }}">{% endif %}
|
package/layouts/feed.njk
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<feed xmlns="http://www.w3.org/2005/Atom" xml:base="{{ options.url }}">
|
|
3
|
+
<title>{{ options.homeKey }}</title>
|
|
4
|
+
<link href="{{ permalink | absoluteUrl(options.url) }}" rel="self"/>
|
|
5
|
+
<link href="{{ options.url }}"/>
|
|
6
|
+
<updated>{{ collections.post | getNewestCollectionItemDate | dateToRfc3339 }}</updated>
|
|
7
|
+
<id>{{ options.url }}/</id>
|
|
8
|
+
{%- for item in pagination.items %}
|
|
9
|
+
{%- set absolutePostUrl = item.url | absoluteUrl(options.url) %}
|
|
10
|
+
<entry>
|
|
11
|
+
<title>{{ item.data.title }}</title>
|
|
12
|
+
<link href="{{ absolutePostUrl }}"/>
|
|
13
|
+
<updated>{{ item.date | dateToRfc3339 }}</updated>
|
|
14
|
+
<id>{{ absolutePostUrl }}</id>
|
|
15
|
+
{% if item.data.authors %}
|
|
16
|
+
{% for author in item.data.authors %}
|
|
17
|
+
<author>
|
|
18
|
+
<name>{{ author.name }}</name>
|
|
19
|
+
{% if author.url %}<uri>{{ author.url }}</uri>{% endif %}
|
|
20
|
+
</author>
|
|
21
|
+
{% endfor %}
|
|
22
|
+
{% elif item.data.author %}
|
|
23
|
+
<author>
|
|
24
|
+
<name>{{ item.data.author.name }}</name>
|
|
25
|
+
{% if item.data.author.url %}<uri>{{ item.data.author.url }}</uri>{% endif %}
|
|
26
|
+
</author>
|
|
27
|
+
{% endif %}
|
|
28
|
+
<content xml:lang="{{ language or "en" }}" type="html">
|
|
29
|
+
<![CDATA[ {{ item.templateContent | htmlToAbsoluteUrls(absolutePostUrl) }} ]]>
|
|
30
|
+
</content>
|
|
31
|
+
</entry>
|
|
32
|
+
{%- endfor %}
|
|
33
|
+
</feed>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@x-govuk/govuk-eleventy-plugin",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.0",
|
|
4
4
|
"description": "Write documentation using Markdown and publish it using GOV.UK styles",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"govuk",
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@11ty/eleventy": "^2.0.0",
|
|
56
56
|
"@11ty/eleventy-navigation": "^0.3.2",
|
|
57
|
+
"@11ty/eleventy-plugin-rss": "^1.2.0",
|
|
57
58
|
"@rollup/plugin-commonjs": "^25.0.0",
|
|
58
59
|
"@rollup/plugin-node-resolve": "^15.0.0",
|
|
59
60
|
"@x-govuk/govuk-prototype-components": "^3.0.0",
|