-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy patheleventy.config.js
72 lines (67 loc) · 2.14 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
import process from 'node:process'
import govukEleventyPlugin from '@x-govuk/govuk-eleventy-plugin'
export default function (eleventyConfig) {
// Plugins
eleventyConfig.addPlugin(govukEleventyPlugin, {
brandColour: '#28a',
fontFamily: 'system-ui, sans-serif',
icons: {
mask: 'https://raw.githubusercontent.com/x-govuk/logo/main/images/x-govuk-mask-icon.svg?raw=true',
shortcut:
'https://raw.githubusercontent.com/x-govuk/logo/main/images/x-govuk-favicon.ico',
touch:
'https://raw.githubusercontent.com/x-govuk/logo/main/images/x-govuk-apple-touch-icon.png'
},
opengraphImageUrl:
'https://x-govuk.github.io/govuk-design-history-docs/assets/opengraph-image.png',
homeKey: 'GOV.UK Design History',
titleSuffix: 'GOV.UK Design History',
parentSite: {
url: 'https://x-govuk.github.io/#projects',
name: 'X-GOVUK projects'
},
url:
process.env.GITHUB_ACTIONS &&
'https://x-govuk.github.io/govuk-design-history/',
header: {
logotype: 'x-govuk',
productName: 'Design History',
search: {
indexPath: '/search.json',
sitemapPath: '/sitemap'
}
},
headingPermalinks: true,
footer: {
copyright: {
text: '© X-GOVUK'
},
contentLicence: {
html: 'Licensed under the <a class="govuk-footer__link" href="https://github.com/x-govuk/govuk-design-history-docs/blob/main/LICENSE.txt">MIT Licence</a>, except where otherwise stated'
}
}
})
// Collections
eleventyConfig.addCollection('homepage', (collection) =>
collection
.getFilteredByGlob([
'docs/introduction.md',
'docs/case-study.md',
'docs/directory.md'
])
.sort((a, b) => (a.data.order || 0) - (b.data.order || 0))
)
// Pass through
eleventyConfig.addPassthroughCopy('./docs/assets')
// Config
return {
dataTemplateEngine: 'njk',
htmlTemplateEngine: 'njk',
markdownTemplateEngine: 'njk',
dir: {
input: 'docs',
layouts: '../node_modules/@x-govuk/govuk-eleventy-plugin/layouts'
},
pathPrefix: process.env.GITHUB_ACTIONS && '/govuk-design-history/'
}
}