-
Notifications
You must be signed in to change notification settings - Fork 1
/
eleventy.config.js
85 lines (81 loc) · 2.73 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
81
82
83
84
85
const govukEleventyPlugin = require('@x-govuk/govuk-eleventy-plugin')
const fs = require('fs')
module.exports = function(eleventyConfig) {
eleventyConfig.addPlugin(govukEleventyPlugin, {
icons: {
shortcut: '/assets/data-workspace-favicon.svg'
},
header: {
logotype: {
html: fs.readFileSync('./docs/assets/dit-logo.svg', {encoding: 'utf8'})
},
productName: 'Data Workspace (developer documentation)',
search: {
indexPath: '/search.json',
sitemapPath: '/sitemap'
}
},
footer: {
meta: {
items: [
{
href: '/sitemap/',
text: 'Sitemap'
},
{
href: 'https://github.com/uktrade/data-workspace',
text: 'Data Workspace GitHub repository'
},
{
href: 'https://www.gov.uk/government/organisations/department-for-business-and-trade',
text: 'Created by the Department for Business and Trade (DBT)'
}
]
}
}
})
eleventyConfig.addCollection('homepage', (collection) =>
collection
.getFilteredByGlob([
'docs/development.md',
'docs/deployment.md',
'docs/data-ingestion.md'
])
.sort((a, b) => (a.data.order || 0) - (b.data.order || 0))
)
eleventyConfig.addCollection('deployment', (collection) =>
collection
.getFilteredByGlob(['docs/deployment/*.md'])
.sort((a, b) => (a.data.order || 0) - (b.data.order || 0))
)
eleventyConfig.addCollection('development', (collection) =>
collection
.getFilteredByGlob(['docs/development/*.md'])
.sort((a, b) => (a.data.order || 0) - (b.data.order || 0))
)
eleventyConfig.addCollection('architecture', (collection) =>
collection
.getFilteredByGlob(['docs/architecture/*.md'])
.sort((a, b) => (a.data.order || 0) - (b.data.order || 0))
)
eleventyConfig.addCollection('architecture-decision-record', (collection) =>
collection
.getFilteredByGlob(['docs/architecture-decision-record/*.md'])
.sort((a, b) => (a.data.order || 0) - (b.data.order || 0))
)
eleventyConfig.addPassthroughCopy('./docs/assets')
eleventyConfig.addPassthroughCopy('./docs/CNAME')
eleventyConfig.addPassthroughCopy('./docs/development/assets')
eleventyConfig.addPassthroughCopy({'./node_modules/mermaid/dist/**.mjs': 'assets/mermaid'})
eleventyConfig.addPassthroughCopy({'./node_modules/mermaid/dist/**.js': 'assets/mermaid'})
return {
dataTemplateEngine: 'njk',
htmlTemplateEngine: 'njk',
markdownTemplateEngine: 'njk',
dir: {
// Use layouts from the plugin
input: 'docs',
layouts: '../node_modules/@x-govuk/govuk-eleventy-plugin/layouts'
}
}
};