@jackdbd/eleventy-plugin-text-to-speech
Version:
Eleventy plugin that uses text-to-speech to generate audio assets for your website, then injects audio players in your HTML.
42 lines • 1.43 kB
JavaScript
import { z } from 'zod';
import { collection_name, transform_name } from '@jackdbd/zod-schemas/eleventy';
import { DEFAULT_TRANSFORM_NAME, DEFAULT_COLLECTION_NAME } from '../constants.js';
import { rule } from '../schemas/rule.js';
/**
* Config of this Eleventy plugin.
*
* @hidden
*/
export const config = z
.object({
/**
* Name of the 11ty collection created by this plugin.
*
* @remarks
* If you register this plugin more than once, you will need to use a
* different name every time (otherwise 11ty would throw an Error).
*/
collectionName: collection_name
.default(DEFAULT_COLLECTION_NAME)
.describe('Name of the 11ty collection defined by this plugin'),
/**
* Rules that determine which texts to convert into speech.
*/
rules: z
.array(rule)
.min(1)
.describe('Rules that determine which texts to convert into speech'),
/**
* Name of the 11ty transform created by this plugin.
*
* @remarks
* If you register this plugin more than once, you will need to use a
* different name every time (11ty would NOT throw an Error, but this plugin
* will not work as expected).
*/
transformName: transform_name
.default(DEFAULT_TRANSFORM_NAME)
.describe('Name of the 11ty transform defined by this plugin')
})
.describe(`Plugin config`);
//# sourceMappingURL=plugin.js.map