summary refs log tree commit diff
path: root/eleventy.config.js
blob: 79bd47a25c0fba554bc114cc48a3296eed3cbbe0 (plain) (blame)
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
filter_local_date = function(date) {
	// yyyy-MM-dd
	return date.getFullYear() + '-'
		+ (date.getMonth() + 1).toString().padStart(2, '0') + '-'
		+ date.getDate().toString().padStart(2, '0')
}

filter_rfc3339_datetime = function(date) {
	// yyyy-MM-dd HH:mm:ssXXX
	date.setSeconds(0, 0)
	return date.toISOString().replace('T', ' ');
}

module.exports = function(eleventyConfig) {
	eleventyConfig.addPassthroughCopy('./css/')

	eleventyConfig.addFilter('local_date', filter_local_date)
	eleventyConfig.addFilter('rfc3339_datetime', filter_rfc3339_datetime)

	return {
		dir: {
			input: 'src',
			includes: '../_includes',
			data: '../_data',
			output: '_site'
		}
	}
}