-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eleventy.js
34 lines (29 loc) · 1.16 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
/**
* Copyright 2024 Appliberated (https://appliberated.com). All rights reserved.
* See LICENSE in the project root for license information.
* @author TechAurelian <dev@techaurelian.com> (https://techaurelian.com)
*/
import { addImageShortcode } from "./src/image-shortcode.js";
// /**
// * Validates the provided option by throwing an error if it is not defined.
// *
// * @param {object} options The options object.
// * @param {string} name The name of the option.
// */
// function validateOption(options, name) {
// if (!options[name]) throw new Error(`eleventy-mapped-images requires a ${name} option.`);
// }
export default function (eleventyConfig, options = {}) {
// Validate options
// validateOption(options, 'imageMaps');
if (options.imgShortcode) {
addImageShortcode(eleventyConfig, options.imgShortcode, options.zones);
}
// The options object can contain one or more shortcodes to add in the shortcodes array
// Add the shortcodes to Eleventy
// if (options.shortcodes) {
// for (const shortcode of options.shortcodes) {
// addImageShortcode(eleventyConfig, shortcode.name, shortcode.imdexer, shortcode.baseUrl);
// }
// }
};