-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheleventy.config.js
80 lines (74 loc) · 1.86 KB
/
eleventy.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
const govukEleventyPlugin = require('@x-govuk/govuk-eleventy-plugin')
const { rollup } = require('rollup')
const rollupConfig = require('./rollup.config.js')
module.exports = function(eleventyConfig) {
// Passthrough
eleventyConfig.addPassthroughCopy('./docs/assets')
eleventyConfig.addPassthroughCopy('./docs/humans.txt')
// Build and watch JavaScript
eleventyConfig.addWatchTarget('./docs/javascripts/')
eleventyConfig.on('beforeBuild', async () => {
const bundle = await rollup(rollupConfig)
await bundle.write(rollupConfig.output)
})
// Register the plugin
eleventyConfig.addPlugin(govukEleventyPlugin, {
homeKey: "",
showBreadcrumbs: false,
stylesheets: ['/assets/application.css'],
titleSuffix: 'GOV.UK Publishing Design Guide',
opengraphImageUrl: '/assets/images/opengraph.png',
header: {
productName: "Publishing Design Guide"
},
navigation: {
items: [
{
text: "Components",
href: "/components"
},
{
text: "Patterns",
href: "/patterns"
},
{
text: "Frontend templates",
href: "/frontend-templates"
},
{
text: "Community",
href: "/community"
},
{
text: "About",
href: "/about"
}
]
},
footer: {
meta: {
items: [
{
href: "/accessibility-statement",
text: "Accessibility statement"
},
{
href: "/cookies",
text: "Cookies"
}
]
}
}
})
return {
dataTemplateEngine: 'njk',
htmlTemplateEngine: 'njk',
markdownTemplateEngine: 'njk',
dir: {
// The folder where all your content will live:
input: 'docs',
includes: '../_includes',
layouts: '../_includes/layouts'
}
}
};