generated from x-govuk/govuk-design-history-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eleventy.js
62 lines (54 loc) · 1.94 KB
/
.eleventy.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
module.exports = function (eleventyConfig) {
// Browser Sync
eleventyConfig.setBrowserSyncConfig({
rewriteRules: [{
match: /\/image\/(\d+)(x)?(\d+)?/g,
replace: '/images'
}],
serveStatic: ['public'],
serveStaticOptions: {
extensions: ['html']
}
})
// Template libraries
eleventyConfig.setLibrary('njk', require('./lib/libraries/nunjucks'))
eleventyConfig.setLibrary('md', require('./lib/libraries/markdown'))
// Plugins
eleventyConfig.addPlugin(require('@11ty/eleventy-navigation'))
eleventyConfig.addPlugin(require('@11ty/eleventy-plugin-syntaxhighlight'))
// Filters
eleventyConfig.addFilter('date', require('./lib/filters/date'))
eleventyConfig.addFilter('fixed', require('./lib/filters/fixed'))
eleventyConfig.addFilter('includes', require('./lib/filters/includes'))
eleventyConfig.addFilter('markdown', require('./lib/filters/markdown'))
eleventyConfig.addFilter('pretty', require('./lib/filters/pretty'))
eleventyConfig.addFilter('slug', require('./lib/filters/slug'))
eleventyConfig.addFilter('sort', require('./lib/filters/sort'))
eleventyConfig.addFilter('tokenize', require('./lib/filters/tokenize'))
eleventyConfig.addFilter('totalFromRows', require('./lib/filters/total-from-rows'))
eleventyConfig.addFilter('widont', require('./lib/filters/widont'))
// Transforms
// Collections
// Passthrough
eleventyConfig.addPassthroughCopy('./app/documents')
eleventyConfig.addPassthroughCopy('./app/images')
eleventyConfig.addPassthroughCopy({
'node_modules/govuk-frontend/govuk/assets': 'assets'
})
// Enable data deep merge
eleventyConfig.setDataDeepMerge(true)
// Config
return {
dataTemplateEngine: 'njk',
htmlTemplateEngine: 'njk',
markdownTemplateEngine: 'njk',
dir: {
input: 'app',
output: 'public',
layouts: '_layouts',
includes: '_components'
},
templateFormats: ['njk', 'md'],
passthroughFileCopy: true
}
}