-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eleventy.js
35 lines (29 loc) · 1.1 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
/**
* Copyright 2024-2025 Hellogramming (https://www.hellogramming.com/). All rights reserved.
* See LICENSE in the project root for license information.
* @author TechAurelian <[email protected]> (https://techaurelian.com)
*/
// @ts-check
import { addImageShortcode } from "./src/image-shortcode.js";
import { addImageUrlFilter } from "./src/image-filter.js";
/**
* @typedef {Object} ImageShortcodeOptions
* @property {string} imgShortcode The name of the image shortcode.
* @property {string} imgUrlFilter The name of the image URL filter.
* @property {Array} zones The array of image zones.
*/
/**
* Adds the specified image shortcode to Eleventy.
*
* @param {Object} eleventyConfig The Eleventy configuration object.
* @param {ImageShortcodeOptions} options The options for the image shortcode.
*/
export default function (eleventyConfig, options) {
// TODO: Validate options
if (options.imgShortcode) {
addImageShortcode(eleventyConfig, options.imgShortcode, options.zones);
}
if (options.imgUrlFilter) {
addImageUrlFilter(eleventyConfig, options.imgUrlFilter, options.zones);
}
};