@x-govuk/govuk-eleventy-plugin 8.0.4 → 8.1.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@x-govuk/govuk-eleventy-plugin",
|
|
3
|
-
"version": "8.0
|
|
3
|
+
"version": "8.1.0",
|
|
4
4
|
"description": "Write documentation using Markdown and publish it using GOV.UK styles",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"govuk",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"lint:fix": "npm run lint:prettier:fix && npm run lint:js:fix && npm run lint:scss:fix",
|
|
47
47
|
"test": "node --test",
|
|
48
48
|
"coverage": "node --test --experimental-test-coverage",
|
|
49
|
-
"release": "np"
|
|
49
|
+
"release": "np --no-publish"
|
|
50
50
|
},
|
|
51
51
|
"publishConfig": {
|
|
52
52
|
"access": "public"
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"markdown-it-deflist": "^3.0.0",
|
|
69
69
|
"markdown-it-footnote": "^4.0.0",
|
|
70
70
|
"markdown-it-github-alerts": "^1.0.0",
|
|
71
|
-
"markdown-it-govuk": "^0.
|
|
71
|
+
"markdown-it-govuk": "^0.8.0",
|
|
72
72
|
"markdown-it-image-figures": "^2.0.0",
|
|
73
73
|
"markdown-it-ins": "^4.0.0",
|
|
74
74
|
"markdown-it-mark": "^4.0.0",
|
package/src/data/options.js
CHANGED
|
@@ -21,8 +21,10 @@ const defaults = {
|
|
|
21
21
|
touch: '/assets/rebrand/images/govuk-icon-180.png'
|
|
22
22
|
},
|
|
23
23
|
markdown: {
|
|
24
|
+
calvert: true,
|
|
24
25
|
headingPermalinks: false,
|
|
25
|
-
headingsStartWith: 'xl'
|
|
26
|
+
headingsStartWith: 'xl',
|
|
27
|
+
govspeak: true
|
|
26
28
|
},
|
|
27
29
|
opengraphImageUrl: '/assets/rebrand/images/govuk-opengraph-image.png',
|
|
28
30
|
stylesheets: [],
|
package/src/layouts/sitemap.njk
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
{{ appProseScope(content) if content }}
|
|
13
13
|
|
|
14
|
-
{% for item in collections.sitemap | eleventyNavigation(options.homeKey) %}
|
|
14
|
+
{% for item in collections.sitemap | sortCollection(true) | eleventyNavigation(options.homeKey) %}
|
|
15
15
|
<div class="govuk-!-margin-bottom-4">
|
|
16
16
|
<h2 class="govuk-heading-s govuk-!-margin-bottom-1">
|
|
17
17
|
<a class="govuk-link" href="{{ item.url | canonicalUrl | pretty }}">{{ item.title | smart }}</a>
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
{% endif %}
|
|
22
22
|
{{ collections.sitemap | eleventyNavigation(item.key) | eleventyNavigationToHtml({
|
|
23
23
|
listClass: "app-contents-list govuk-!-margin-left-4"
|
|
24
|
-
}) | safe }}
|
|
24
|
+
}) | smart | safe }}
|
|
25
25
|
</div>
|
|
26
26
|
{% endfor %}
|
|
27
27
|
</div>
|
package/src/markdown-it.js
CHANGED
|
@@ -41,7 +41,8 @@ export function md(markdownOptions = {}) {
|
|
|
41
41
|
const md = new MarkdownIt(opts)
|
|
42
42
|
.use(markdownItGovuk, {
|
|
43
43
|
calvert: true,
|
|
44
|
-
headingsStartWith: markdownOptions.headingsStartWith
|
|
44
|
+
headingsStartWith: markdownOptions.headingsStartWith,
|
|
45
|
+
govspeak: markdownOptions.govspeak
|
|
45
46
|
})
|
|
46
47
|
.use(markdownItAbbr)
|
|
47
48
|
.use(markdownItAnchor, {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import Nunjucks from 'nunjucks'
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Creates a new tags template
|
|
3
5
|
*
|
|
@@ -35,7 +37,11 @@ export class TagTemplate {
|
|
|
35
37
|
this.slugify = options?.slugify || ((string) => string)
|
|
36
38
|
this.permalink = options?.permalink || '/tags/'
|
|
37
39
|
this.caption = options?.title || 'Tags'
|
|
38
|
-
this.title = (data) =>
|
|
40
|
+
this.title = (data) =>
|
|
41
|
+
Nunjucks.renderString(
|
|
42
|
+
options?.tagTitle || 'Posts tagged ‘{{ tag }}’',
|
|
43
|
+
data
|
|
44
|
+
)
|
|
39
45
|
}
|
|
40
46
|
|
|
41
47
|
/**
|