• Adds Text-to-Speech functionality to an Eleventy site.

    Parameters

    • eleventyConfig: EleventyConfig
    • config: {
          collectionName?: string;
          rules: {
              audioInnerHTML?: ((...args) => string);
              cssSelectors?: string[];
              hosting: {
                  config: {} & {
                      [k: string]: unknown;
                  };
                  write: ((...args) => Promise<{
                      error?: undefined;
                      value: {
                          href: string;
                          message: string;
                      };
                  } | {
                      error: Error;
                      value?: undefined;
                  }>);
              };
              regex?: RegExp;
              synthesis: {
                  config: {} & {
                      [k: string]: unknown;
                  };
                  extension: string;
                  synthesize: ((...args) => Promise<{
                      error?: undefined;
                      value: Readable;
                  } | {
                      error: Error;
                      value?: undefined;
                  }>);
              };
              xPathExpressions?: string[];
          }[];
          transformName?: string;
      }
      • Optional collectionName?: string

        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).

      • rules: {
            audioInnerHTML?: ((...args) => string);
            cssSelectors?: string[];
            hosting: {
                config: {} & {
                    [k: string]: unknown;
                };
                write: ((...args) => Promise<{
                    error?: undefined;
                    value: {
                        href: string;
                        message: string;
                    };
                } | {
                    error: Error;
                    value?: undefined;
                }>);
            };
            regex?: RegExp;
            synthesis: {
                config: {} & {
                    [k: string]: unknown;
                };
                extension: string;
                synthesize: ((...args) => Promise<{
                    error?: undefined;
                    value: Readable;
                } | {
                    error: Error;
                    value?: undefined;
                }>);
            };
            xPathExpressions?: string[];
        }[]

        Rules that determine which texts to convert into speech.

      • Optional transformName?: string

        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).

    Returns void